Commit ab911575 authored by BlackJokerCJ's avatar BlackJokerCJ

xiyi

parent 0470d425
...@@ -7,19 +7,26 @@ import com.jqtx.windows.common.factory.AbstractCommand; ...@@ -7,19 +7,26 @@ import com.jqtx.windows.common.factory.AbstractCommand;
import com.jqtx.windows.common.factory.RuntimeContextHolder; import com.jqtx.windows.common.factory.RuntimeContextHolder;
import com.jqtx.windows.common.utils.ValidateUtil; import com.jqtx.windows.common.utils.ValidateUtil;
import com.jqtx.windows.component.CreditResultComponent; import com.jqtx.windows.component.CreditResultComponent;
import com.jqtx.windows.component.LoanComponent;
import com.jqtx.windows.component.model.CreditResultModel; import com.jqtx.windows.component.model.CreditResultModel;
import com.jqtx.windows.component.model.LoanModel;
import com.jqtx.windows.web.request.SyncCreditResultRequest; import com.jqtx.windows.web.request.SyncCreditResultRequest;
import com.jqtx.windows.web.response.JsonResult; import com.jqtx.windows.web.response.JsonResult;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
@Service @Service
@Slf4j @Slf4j
public class SyncCreditCommand extends AbstractCommand { public class SyncCreditCommand extends AbstractCommand {
@Autowired @Autowired
private CreditResultComponent creditResultComponent; private CreditResultComponent creditResultComponent;
@Autowired
private LoanComponent loanComponent;
@Override @Override
public JsonResult execute() { public JsonResult execute() {
...@@ -31,6 +38,16 @@ public class SyncCreditCommand extends AbstractCommand { ...@@ -31,6 +38,16 @@ public class SyncCreditCommand extends AbstractCommand {
CreditResultModel creditResultModel = BeanUtil.toBean(syncCreditResultRequest, CreditResultModel.class); CreditResultModel creditResultModel = BeanUtil.toBean(syncCreditResultRequest, CreditResultModel.class);
creditResultModel.setCreditStatus(syncCreditResultRequest.getStatus()); creditResultModel.setCreditStatus(syncCreditResultRequest.getStatus());
creditResultComponent.insert(creditResultModel); creditResultComponent.insert(creditResultModel);
if (StringUtils.isNotEmpty(creditResultModel.getLoanNo())) {
boolean pass=syncCreditResultRequest.getStatus().equals("1");
LoanModel loanModel = new LoanModel();
loanModel.setLoanNo(creditResultModel.getLoanNo());
loanModel.setLoanStatus(pass?"AUDITED":"CANCELED");
loanModel.setGmtModified(LocalDateTime.now());
loanComponent.updateByLoanNo(loanModel);
}
} catch (Exception e) { } catch (Exception e) {
log.error("同步授信结果授信编号:{},报错:{}", syncCreditResultRequest.getOrderNo(), e.getMessage(), e); log.error("同步授信结果授信编号:{},报错:{}", syncCreditResultRequest.getOrderNo(), e.getMessage(), e);
throw new BizException("同步授信结果错误"); throw new BizException("同步授信结果错误");
......
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