Commit 8a692712 authored by huyuchen's avatar huyuchen

预派单 参数校验修改

parent 283420fd
......@@ -369,7 +369,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
errorMessageList = handleFileAddress(1, preInfo, areaMap, areaIdMap, importVo, errorMessageList);
}
// 档案地市没问题 开始派单处理
if (Common.isEmpty(errorMessageList)) {
if (errorMessageList.size() == CommonConstants.ZERO_INT) {
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
}
// 处理派增结果
......@@ -456,8 +456,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
.eq(TPreDispatchInfo::getDispatchFlag, CommonConstants.ZERO_STRING)
.eq(TPreDispatchInfo::getPreStatus, CommonConstants.ZERO_STRING));
}
if (Common.isEmpty(preList)) {
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
if (!Common.isNotNull(preList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
// 找出所有需要派减的社保或公积金数据 主要用于派减是获取项目相关数据
HashMap<String, TSocialInfo> socialMap = new HashMap<>();
......@@ -501,7 +501,10 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
resetMessageList(pre, errorMessageList, errorMsgList, i + 1);
}
}
return R.ok(errorMsgList);
if (Common.isNotNull(errorMsgList)) {
return R.failed(errorMsgList);
}
return R.ok();
}
@Override
......@@ -2094,27 +2097,24 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
* @Date 2022-07-18
**/
private R<Boolean> handleDispatchAddRes(TPreDispatchInfo preInfo, List<ErrorMessage> errorMessageList) {
if (Common.isEmpty(errorMessageList)) {
return R.failed(preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
PreDispatchConstants.PREDISPATCH_EXCEPTION);
}
ErrorMessage errorMessage = errorMessageList.get(CommonConstants.ZERO_INT);
if (null != errorMessage) {
if (errorMessage.getMessage().indexOf(PreDispatchConstants.DISPATCH_ADD_SUCCESS) >= CommonConstants.ZERO_INT) {
preInfo.setPreStatus(CommonConstants.TWO_STRING);
preInfo.setExceptionContent(CommonConstants.EMPTY_STRING);
baseMapper.updatePreStatusById(preInfo);
return R.ok(null, preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
PreDispatchConstants.DISPATCH_ADD_SUCCESS);
} else {
preInfo.setPreStatus(CommonConstants.ONE_STRING);
preInfo.setExceptionContent(errorMessage.getMessage());
baseMapper.updatePreStatusById(preInfo);
return R.failed(preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
errorMessage.getMessage());
if (errorMessageList.size() > CommonConstants.ZERO_INT) {
ErrorMessage errorMessage = errorMessageList.get(CommonConstants.ZERO_INT);
if (null != errorMessage) {
if (errorMessage.getMessage().indexOf(PreDispatchConstants.DISPATCH_ADD_SUCCESS) >= CommonConstants.ZERO_INT) {
preInfo.setPreStatus(CommonConstants.TWO_STRING);
preInfo.setExceptionContent(CommonConstants.EMPTY_STRING);
baseMapper.updatePreStatusById(preInfo);
return R.ok(null, preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
PreDispatchConstants.DISPATCH_ADD_SUCCESS);
} else {
preInfo.setPreStatus(CommonConstants.ONE_STRING);
preInfo.setExceptionContent(errorMessage.getMessage());
baseMapper.updatePreStatusById(preInfo);
return R.failed(preInfo.getEmpIdcard() +
CommonConstants.COLON_STRING +
errorMessage.getMessage());
}
}
}
return null;
......@@ -2371,7 +2371,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
errorMessageList = handleFileAddress(i, pre, areaMap, areaIdMap, importVo, errorMessageList);
}
// 档案地市没问题 开始派单处理
if (Common.isEmpty(errorMessageList)){
if (!Common.isNotNull(errorMessageList)){
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
}
// 处理派增结果
......
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