|
|
@ -53,10 +53,14 @@ import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.flowable.LoanBePadsinc |
|
|
|
import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.flowable.SubmitLoanBePadsincereDto; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanbepadsincereveh.LoanBePadsincereVehDetailsVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanbepadsincereveh.LoanBePadsincereVehDto; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfile.LoanFile; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfile.LoanFileEnum; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentschedule.LoanRepaymentScheduleDetailsVo; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanbepadsincereveh.LoanBePadsincereVehService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymentplandetails.LoanRepaymentPlanDetailsService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymentschedule.LoanRepaymentScheduleService; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.utils.DateUtils; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFeign; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowVo; |
|
|
@ -114,6 +118,8 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
@Autowired |
|
|
|
private LoanRepaymentPlanDetailsService loanRepaymentPlanDetailsService; |
|
|
|
@Autowired |
|
|
|
private LoanFileService loanFileService; |
|
|
|
@Autowired |
|
|
|
private FlowableFeign flowableFeign; |
|
|
|
@Autowired |
|
|
|
private MessageFeign messageFeign; |
|
|
@ -122,7 +128,7 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
@Autowired |
|
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
|
@Autowired |
|
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
|
|
|
|
public PagerVo<LoanBePadsincereApplyVo> listPageVo(PagerQuery<LoanBePadsincereApplyQuery> pq) { |
|
|
|
LoanBePadsincereApplyQuery query = pq.getParams(); |
|
|
@ -189,12 +195,24 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
List<LoanBePadsincereVehDto> loanBePadsincereVehDtoList = dto.getLoanBePadsincereVehDtoList(); |
|
|
|
List<LoanBePadsincereFile> fileUrlList = dto.getFileUrlList(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
String sid = this.insertByDto(dto); |
|
|
|
for (LoanBePadsincereVehDto loanBePadsincereVehDto : loanBePadsincereVehDtoList) { |
|
|
|
loanBePadsincereVehDto.setMainSid(sid); |
|
|
|
loanBePadsincereVehService.saveOrUpdateDto(loanBePadsincereVehDto); |
|
|
|
} |
|
|
|
for (LoanBePadsincereFile loanBePadsincereFile : fileUrlList) { |
|
|
|
LoanFile loanFile = new LoanFile(); |
|
|
|
loanFile.setLinkSid(sid); |
|
|
|
loanFile.setAttachType(LoanFileEnum.BEPADSINCERE.getAttachType()); |
|
|
|
String filePath = loanBePadsincereFile.getUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
loanFile.setFilePath(filePath); |
|
|
|
loanFileService.save(loanFile); |
|
|
|
} |
|
|
|
return rb.success().setData(sid); |
|
|
|
} |
|
|
|
this.updateByDto(dto); |
|
|
@ -290,8 +308,8 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(importReturn.getCheckInfo2())) { |
|
|
|
return rb.success().setData(resultList2).setMsg(importReturn.getCheckInfo2()); |
|
|
|
if (StringUtils.isNotBlank(importReturn.getCheckInfo())) { |
|
|
|
return rb.setMsg(importReturn.getCheckInfo()); |
|
|
|
} else { |
|
|
|
return rb.success().setData(resultList2).setMsg("成功导入数据,请点击确定按钮"); |
|
|
|
} |
|
|
@ -300,9 +318,7 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
private ReturnExcelInfo getSheetVal(Sheet sheet, int[] resultCell) { |
|
|
|
ReturnExcelInfo importReturn = new ReturnExcelInfo(); |
|
|
|
List<BePadsincereExcelInfo> importVoList = new ArrayList<>(); |
|
|
|
int[] resultIndex = new int[resultCell.length]; |
|
|
|
Set<String> checkWord = new HashSet<>(); |
|
|
|
Set<String> checkWord2 = new HashSet<>(); |
|
|
|
for (int r = 1; r <= sheet.getLastRowNum(); r++) { |
|
|
|
Row row = sheet.getRow(r); |
|
|
|
if (row == null) { |
|
|
@ -317,6 +333,7 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
NullPointerException nullPointerException = new NullPointerException(); |
|
|
|
} |
|
|
|
String temp = getCellVal(row.getCell(i)).toString().trim(); |
|
|
|
temp = temp.replace(".0", ""); |
|
|
|
for (int j = 0; j < resultCell.length; j++) { |
|
|
|
if (i == resultCell[j]) { |
|
|
|
switch (i) { |
|
|
@ -388,31 +405,38 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
} |
|
|
|
importVoList.add(importVo); |
|
|
|
} |
|
|
|
StringBuffer sbBankCNo = new StringBuffer(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if (!importVoList.isEmpty()) { |
|
|
|
for (BePadsincereExcelInfo excelInfo : importVoList) { |
|
|
|
if (StringUtils.isBlank(excelInfo.getBankContractNo())) { |
|
|
|
checkWord.add("资方合同编号不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getPeriod())) { |
|
|
|
checkWord.add("期数不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getBePrincipal())) { |
|
|
|
checkWord.add("逾期本金不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getBeDefInter())) { |
|
|
|
checkWord.add("逾期罚息不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getBankCollectionAcc())) { |
|
|
|
checkWord.add("资方收款账户不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getBankCollectionNum())) { |
|
|
|
checkWord.add("资方收款账号不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
List<LoanRepaymentScheduleDetailsVo> loanRepaymentScheduleDetailsVos = loanRepaymentScheduleService.selectByBankContractNo(excelInfo.getBankContractNo()); |
|
|
|
if (loanRepaymentScheduleDetailsVos == null || loanRepaymentScheduleDetailsVos.size() == 0) { |
|
|
|
checkWord.add("资方合同号" + excelInfo.getBankContractNo() + "在还款计划表中不存在"); |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getBankContractNo())) { |
|
|
|
checkWord.add("资方合同号" + excelInfo.getBankContractNo() + "在还款计划表中不存在"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -432,20 +456,6 @@ public class LoanBePadsincereApplyService extends MybatisBaseService<LoanBePadsi |
|
|
|
return importReturn; |
|
|
|
} |
|
|
|
importReturn.setInfos(importVoList); |
|
|
|
StringBuffer sbcheck2 = new StringBuffer(); |
|
|
|
if (!checkWord2.isEmpty()) { |
|
|
|
for (String s : checkWord2) { |
|
|
|
if (StringUtils.isBlank(s)) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
sbcheck2.append(s).append(","); |
|
|
|
} |
|
|
|
} |
|
|
|
if (sbcheck2.length() > 0) { |
|
|
|
sbcheck2.delete(sbcheck2.length() - 1, sbcheck2.length()); |
|
|
|
importReturn.setCheckInfo2("已存在" + sbcheck2.toString() + "的记录,是否继续导入"); |
|
|
|
return importReturn; |
|
|
|
} |
|
|
|
return importReturn; |
|
|
|
} |
|
|
|
|
|
|
|