Commit 77d8172f authored by 张庆's avatar 张庆

新增挡板规则

parent 107413cc
...@@ -3,6 +3,7 @@ package com.jqtx.windows.command; ...@@ -3,6 +3,7 @@ package com.jqtx.windows.command;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.jqtx.windows.common.config.BaseConfig;
import com.jqtx.windows.common.config.SpringContextConfig; import com.jqtx.windows.common.config.SpringContextConfig;
import com.jqtx.windows.common.exception.BizException; import com.jqtx.windows.common.exception.BizException;
import com.jqtx.windows.common.factory.AbstractCommand; import com.jqtx.windows.common.factory.AbstractCommand;
...@@ -22,6 +23,8 @@ import org.springframework.stereotype.Service; ...@@ -22,6 +23,8 @@ import org.springframework.stereotype.Service;
public class GetCreditCommand extends AbstractCommand { public class GetCreditCommand extends AbstractCommand {
@Autowired @Autowired
private CreditComponent creditComponent; private CreditComponent creditComponent;
@Autowired
private BaseConfig baseConfig;
public JsonResult execute() { public JsonResult execute() {
String requestBody = RuntimeContextHolder.currentRuntimeContext().getRequestBody(); String requestBody = RuntimeContextHolder.currentRuntimeContext().getRequestBody();
...@@ -45,28 +48,28 @@ public class GetCreditCommand extends AbstractCommand { ...@@ -45,28 +48,28 @@ public class GetCreditCommand extends AbstractCommand {
response.setOrderNo(credit.getOrderNo()); response.setOrderNo(credit.getOrderNo());
response.setUpdateTime(LocalDateTimeUtil.formatNormal(credit.getGmtModified())); response.setUpdateTime(LocalDateTimeUtil.formatNormal(credit.getGmtModified()));
//偶数TODO //偶数TODO
// if (!SpringContextConfig.getActiveProfile().equals("prod")) { if (baseConfig.getUseBaffle().equals("use")) {
// response.setStatus("1");
// response.setApprovalAmount("10000.00");
//// String substring = credit.getOrderNo().substring(credit.getOrderNo().length() - 1, credit.getOrderNo().length());
//// if (Integer.valueOf(substring) % 2 == 0) {
//// response.setStatus("1");
//// response.setApprovalAmount("10000.00");
//// } else {
//// response.setStatus("2");
//// //response.setApprovalAmount("10000.00");
//// response.setRemark("挡板拒绝");
//// }
// } else {
if (CreditResultStatusEnum.PASS.name().equals(credit.getCreditResult())) {
response.setStatus("1"); response.setStatus("1");
response.setApprovalAmount(credit.getCreditAmt()); response.setApprovalAmount("10000.00");
} // String substring = credit.getOrderNo().substring(credit.getOrderNo().length() - 1, credit.getOrderNo().length());
if (CreditResultStatusEnum.REFUSED.name().equals(credit.getCreditResult())) { // if (Integer.valueOf(substring) % 2 == 0) {
response.setStatus("2"); // response.setStatus("1");
// response.setApprovalAmount("10000.00");
// } else {
// response.setStatus("2");
// //response.setApprovalAmount("10000.00");
// response.setRemark("挡板拒绝");
// }
} else {
if (CreditResultStatusEnum.PASS.name().equals(credit.getCreditResult())) {
response.setStatus("1");
response.setApprovalAmount(credit.getCreditAmt());
}
if (CreditResultStatusEnum.REFUSED.name().equals(credit.getCreditResult())) {
response.setStatus("2");
}
response.setRemark(credit.getMemo());
} }
response.setRemark(credit.getMemo());
//}
return response; return response;
} }
} }
package com.jqtx.windows.command; package com.jqtx.windows.command;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.jqtx.windows.common.config.BaseConfig;
import com.jqtx.windows.common.config.SpringContextConfig; import com.jqtx.windows.common.config.SpringContextConfig;
import com.jqtx.windows.common.exception.BizException; import com.jqtx.windows.common.exception.BizException;
import com.jqtx.windows.common.factory.AbstractCommand; import com.jqtx.windows.common.factory.AbstractCommand;
...@@ -26,6 +27,8 @@ public class LoanStatusCommand extends AbstractCommand { ...@@ -26,6 +27,8 @@ public class LoanStatusCommand extends AbstractCommand {
@Autowired @Autowired
private LoanComponent loanComponent; private LoanComponent loanComponent;
@Autowired
private BaseConfig baseConfig;
@Override @Override
public JsonResult execute() { public JsonResult execute() {
...@@ -40,27 +43,27 @@ public class LoanStatusCommand extends AbstractCommand { ...@@ -40,27 +43,27 @@ public class LoanStatusCommand extends AbstractCommand {
if (Objects.isNull(loanModel)) { if (Objects.isNull(loanModel)) {
throw new BizException(ExceptionCodeEnum.BIZ_CREDIT_NOT_FOUND_ERROR); throw new BizException(ExceptionCodeEnum.BIZ_CREDIT_NOT_FOUND_ERROR);
} }
// if (!SpringContextConfig.getActiveProfile().equals("prod")) { if (baseConfig.getUseBaffle().equals("use")) {
// response.setStatus(1);
// response.setRemark("挡板:提现通过");
//// String substring = loanModel.getOrderNo().substring(loanModel.getOrderNo().length() - 1, loanModel.getOrderNo().length());
//// if (Integer.valueOf(substring) % 2 == 0) {
//// response.setStatus(1);
//// response.setRemark("挡板:提现通过");
//// } else {
//// response.setStatus(2);
//// response.setRemark("挡板:提现拒绝,去别家看看");
//// }
// } else {
if ("PASS".equals(loanModel.getLoanCreditResult())) {
response.setStatus(1); response.setStatus(1);
response.setRemark("提现通过"); response.setRemark("挡板:提现通过");
} // String substring = loanModel.getOrderNo().substring(loanModel.getOrderNo().length() - 1, loanModel.getOrderNo().length());
if ("REFUSED".equals(loanModel.getLoanCreditResult())) { // if (Integer.valueOf(substring) % 2 == 0) {
response.setStatus(2); // response.setStatus(1);
response.setRemark("提现拒绝,去别家看看"); // response.setRemark("挡板:提现通过");
// } else {
// response.setStatus(2);
// response.setRemark("挡板:提现拒绝,去别家看看");
// }
} else {
if ("PASS".equals(loanModel.getLoanCreditResult())) {
response.setStatus(1);
response.setRemark("提现通过");
}
if ("REFUSED".equals(loanModel.getLoanCreditResult())) {
response.setStatus(2);
response.setRemark("提现拒绝,去别家看看");
}
} }
//}
return JsonResult.success(response); return JsonResult.success(response);
} }
} }
package com.jqtx.windows.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "baseconfig")
public class BaseConfig {
private String useBaffle;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment