Commit bddf0a5d authored by liuzicheng's avatar liuzicheng

优化

parent 3f1eca86
package com.jqtx.windows.command;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.jqtx.windows.common.exception.BizException;
import com.jqtx.windows.common.factory.AbstractCommand;
......@@ -9,9 +8,9 @@ import com.jqtx.windows.component.LoanComponent;
import com.jqtx.windows.component.model.LoanModel;
import com.jqtx.windows.infrastructure.enums.ExceptionCodeEnum;
import com.jqtx.windows.web.response.JsonResult;
import com.jqtx.windows.web.response.LoanDetailResponse;
import com.jqtx.windows.web.response.LoanSubmitResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -32,12 +31,22 @@ public class LoanStatusCommand extends AbstractCommand {
String request = RuntimeContextHolder.currentRuntimeContext().getRequestBody();
LoanSubmitResponse loanSubmitResponse = JSON.parseObject(request, LoanSubmitResponse.class);
LoanModel byLoanNo = loanComponent.getByLoanNo(loanSubmitResponse.getLoanNo());
LoanDetailResponse response = new LoanDetailResponse();
response.setOrderNo(loanSubmitResponse.getOrderNo());
response.setStatus(0);
response.setRemark("提现审核中");
if (Objects.isNull(byLoanNo)) {
throw new BizException(ExceptionCodeEnum.BIZ_CREDIT_NOT_FOUND_ERROR);
}
if (StringUtils.isEmpty(byLoanNo.getLoanCreditResult())) {
throw new BizException(ExceptionCodeEnum.RESULT_NOT_FOUND_ERROR);
if("PASS".equals(byLoanNo.getLoanCreditResult())){
response.setStatus(1);
response.setRemark("提现通过");
}
if("REFUSED".equals(byLoanNo.getLoanCreditResult())){
response.setStatus(2);
response.setRemark("提现拒绝,去别家看看");
}
return JsonResult.success(byLoanNo.getLoanCreditResult());
return JsonResult.success(response);
}
}
package com.jqtx.windows.web.response;
import lombok.Data;
@Data
public class LoanDetailResponse {
private String orderNo;
private Integer status;
private String remark;
}
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