Commit fff55881 authored by fangxinjiang's avatar fangxinjiang

自动化办理调整 2024-04-17

parent 41896d80
......@@ -264,13 +264,26 @@ public class TAutoPaymentDetailServiceImpl extends ServiceImpl<TAutoPaymentDetai
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return judgeAllMessage(errorMessageList);
}
/**
* @Author fxj
* @Description 判断所有返回数据,是否全部为正确的
* @Date 18:01 2023/10/18
* @Param
* @return
**/
private R<List<ErrorMessage>> judgeAllMessage(List<ErrorMessage> errorMessageList) {
if (!errorMessageList.isEmpty() && errorMessageList.stream().noneMatch(e-> e.getColor().equals(CommonConstants.RED))) {
return R.ok();
}
return R.ok(errorMessageList);
}
private void importTAutoPaymentDetail(List<TAutoPaymentDetailVo> excelVOList, List<ErrorMessage> errorMessageList,String parentId) {
// 执行数据插入操作 组装
TAutoPaymentDetailVo excel;
TAutoPaymentDetail detail;
List<TAutoPaymentDetail> details;
List<TAutoPaymentDetail> updateList;
TAutoPaymentInfo paymentInfo = paymentInfoMapper.selectById(parentId);
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
......@@ -283,24 +296,31 @@ public class TAutoPaymentDetailServiceImpl extends ServiceImpl<TAutoPaymentDetai
continue;
}
// 数据合法情况
if (!CommonConstants.ZERO_STRING.equals(excel.getRepeatHandleFlag())){
if (!CommonConstants.ZERO_STRING.equals(excel.getRepeatHandleFlag()) && !CommonConstants.ONE_STRING.equals(excel.getRepeatHandleFlag())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "'是否重新办理'填写不正确!",excel));
continue;
}
detail = baseMapper.selectOne(Wrappers.<TAutoPaymentDetail>query().lambda()
details = baseMapper.selectList(Wrappers.<TAutoPaymentDetail>query().lambda()
.eq(TAutoPaymentDetail::getParentId,parentId)
.eq(TAutoPaymentDetail::getEmpName,excel.getEmpName())
.eq(TAutoPaymentDetail::getCertNum,excel.getCertNum())
.eq(TAutoPaymentDetail::getSocialSecurityAccount,excel.getSocialSecurityAccount())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(detail)){
.eq(TAutoPaymentDetail::getSocialSecurityAccount,excel.getSocialSecurityAccount()));
if (Common.isEmpty(details)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "对应姓名+证件号码+社保户的数据不存在!",excel));
continue;
}
detail.setRepeatHandleFlag("0");
// 插入
baseMapper.updateById(detail);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS,excel));
if (Common.isNotNull(details)){
updateList = new ArrayList<>();
for (TAutoPaymentDetail detail:details){
detail.setRepeatHandleFlag("0");
updateList.add(detail);
}
if (Common.isNotNull(updateList)){
// 插入
this.updateBatchById(updateList);
}
}
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS,CommonConstants.GREEN));
}
}
......
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