Commit 36e5fa75 authored by hongguangwu's avatar hongguangwu

MVP1.6.4-优化社保士兵, isAutoFlag

parent f2d9bdad
......@@ -558,7 +558,7 @@ public class TDispatchInfoController {
try {
if (Common.isNotNull(requestId)) {
//主动释放锁
return tDispatchInfoService.addApplyHandle(idList,typeSub,handleStatus,handleRemark,socialType,remark,user);
return tDispatchInfoService.addApplyHandle(idList,typeSub,handleStatus,handleRemark,socialType,remark,user, false);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
......@@ -593,7 +593,7 @@ public class TDispatchInfoController {
try {
if (Common.isNotNull(requestId)) {
//主动释放锁
return tDispatchInfoService.importSocialHandler(file.getInputStream(),mId);
return tDispatchInfoService.importSocialHandler(file.getInputStream(),mId, false);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
......@@ -754,7 +754,7 @@ public class TDispatchInfoController {
tDispatchInfo.setAuthSql(tDispatchInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
tDispatchInfo.setCreateBy(user.getId());
return tDispatchInfoService.fundImportHandle(file.getInputStream(),tDispatchInfo);
return tDispatchInfoService.fundImportHandle(file.getInputStream(),tDispatchInfo, false);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
......
......@@ -53,7 +53,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<ErrorMessage>> importDiy(InputStream inputStream, String orderId);
R<List<ErrorMessage>> importSocialHandler(InputStream inputStream,String mId);
R<List<ErrorMessage>> importSocialHandler(InputStream inputStream,String mId, boolean isAutoHandle);
void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo);
......@@ -81,7 +81,8 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<ErrorMessage>> addApplyAudit(List<String> ids, String auditStatus, String auditRemark, String remark);
R<List<ErrorMessage>> addApplyHandle(List<String> ids, String typeSub, String handleStatus, String handleRemark, String socialType, String remark, YifuUser user);
// isAutoFlag:是否社保士兵的自动办理,true :是
R<List<ErrorMessage>> addApplyHandle(List<String> ids, String typeSub, String handleStatus, String handleRemark, String socialType, String remark, YifuUser user, boolean isAutoHandle);
/**
* @Description: 社保士兵导出
......@@ -130,7 +131,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
**/
R<List<ErrorMessage>> dispatchAdd(TDispatchImportVo importVo);
R<List<ErrorMessage>> fundImportHandle(InputStream inputStream,TDispatchInfo tDispatchInfo);
R<List<ErrorMessage>> fundImportHandle(InputStream inputStream,TDispatchInfo tDispatchInfo, boolean isAutoFlag);
R<Boolean> updateExportSocialFlagById(String id,String status);
......
......@@ -3766,11 +3766,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return R.failed("数据异常,派单审核失败!");
}
}
// isAutoFlag:是否社保士兵的自动办理,true :是
@Transactional(rollbackFor = Exception.class)
@ShardingTransactionType(TransactionType.BASE)
@Override
public R<List<ErrorMessage>> addApplyHandle(List<String> ids, String typeSub, String handleStatus,
String handleRemark, String socialType, String remark, YifuUser userAuto) {
public R<List<ErrorMessage>> addApplyHandle(List<String> ids, String typeSub, String handleStatus
, String handleRemark, String socialType, String remark, YifuUser userAuto, boolean isAutoHandle) {
YifuUser user = SecurityUtils.getUser();
if (userAuto != null) {
user = userAuto;
......@@ -3802,7 +3804,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(requestId)) {
try {
List<ErrorMessage> errorInfo = addBatchApplyHandle(null,null,ids, typeSub, user, flag, handleStatus,
Common.isNullToString(handleRemark), socialType, remark);
Common.isNullToString(handleRemark), socialType, remark, isAutoHandle);
if (errorInfo == null || errorInfo.isEmpty()) {
return R.ok(null, "办理成功!");
} else {
......@@ -3849,7 +3851,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Transactional(rollbackFor = Exception.class)
public List<ErrorMessage> addBatchApplyHandle(ConcurrentHashMap<String, String> socialMap,ConcurrentHashMap<String, String> fundMap,
List<String> idsList, String typeSub, YifuUser user
, int flag, String handleStatus, String handleRemark, String socialType, String remark) {
, int flag, String handleStatus, String handleRemark, String socialType, String remark, boolean isAutoHandle) {
List<ErrorMessage> errorList = new ArrayList<>();
if (!Common.isNotNull(idsList)) {
errorList.add(new ErrorMessage(-1, CommonConstants.PARAM_IS_NOT_ERROR));
......@@ -3954,7 +3956,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialInfo.setHandleUserName(user.getNickname());
// 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf);
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf, isAutoHandle);
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
......@@ -4048,7 +4050,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
if (Common.isNotNull(socialInfo) && Common.isNotNull(socialInfo.getId())) {
// 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf);
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf, isAutoHandle);
socialInfo.setReduceHandleUser(user.getId());
socialInfo.setReduceHandleTime(now);
//社保派减办理成功才变更社保的办理状态
......@@ -4493,11 +4495,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @return: void
**/
private void setSocialHandleStatus(String handleStatus, String socialType, int flag, TSocialInfo socialInfo
, TDispatchInfo dis, TSocialFundInfo sf) {
, TDispatchInfo dis, TSocialFundInfo sf, boolean isAutoHandle) {
// 办理成功 处理社保相关数据 (直接排除五险)
updateSocialByHandle(flag, socialInfo, dis, sf);
// 批量办理,或者办理选择对应的类型,修改对应的办理状态 (派增派减都改)
this.setSocialSixStatus(handleStatus, socialType, socialInfo,sf, dis);
this.setSocialSixStatus(handleStatus, socialType, socialInfo,sf, dis, isAutoHandle);
boolean handing = CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus());
// HandleStatus办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减 4办理中 5部分办理失败
// 派减,审核不通过,社保状态不变更
......@@ -4843,12 +4845,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @return: void
**/
private void setSocialSixStatus(String handleStatus, String socialType, TSocialInfo socialInfo,
TSocialFundInfo sf,
TDispatchInfo dis) {
TSocialFundInfo sf, TDispatchInfo dis, boolean isAutoHandle) {
if (Common.isNotNull(socialType)){
//派增处理
if (CommonConstants.ZERO_STRING.equals(dis.getType())){
if (CommonConstants.ONE_STRING.equals(dis.getAutoFlag()) || CommonConstants.FIVE_STRING.equals(socialInfo.getYgsHandleStatus())) {
if (isAutoHandle || CommonConstants.ONE_STRING.equals(dis.getAutoFlag()) || CommonConstants.FIVE_STRING.equals(socialInfo.getYgsHandleStatus())) {
if (socialType.contains(CommonConstants.ONE_STRING)
&& Common.isNotNull(socialInfo.getPensionHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle())
......@@ -4881,7 +4882,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
if (CommonConstants.ONE_STRING.equals(dis.getAutoFlag()) || CommonConstants.FIVE_STRING.equals(socialInfo.getYsdHandleStatus())) {
if (isAutoHandle || CommonConstants.ONE_STRING.equals(dis.getAutoFlag()) || CommonConstants.FIVE_STRING.equals(socialInfo.getYsdHandleStatus())) {
if (socialType.contains(CommonConstants.TWO_STRING)
&& Common.isNotNull(socialInfo.getMedicalHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle())
......@@ -4949,7 +4950,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
handleStatusTemp = CommonConstants.FOUR_STRING;
}
boolean flag = CommonConstants.THREE_STRING.equals(handleStatusTemp);
if (CommonConstants.ONE_STRING.equals(dis.getAutoFlag()) || CommonConstants.FIVE_STRING.equals(socialInfo.getYgsHandleStatus())) {
if (isAutoHandle || CommonConstants.ONE_STRING.equals(dis.getAutoFlag()) || CommonConstants.FIVE_STRING.equals(socialInfo.getYgsHandleStatus())) {
if (socialType.contains(CommonConstants.ONE_STRING)) {
if (CommonConstants.FIVE_STRING.equals(sf.getPensionHandle())) {
if (CommonConstants.FIVE_STRING.equals(socialInfo.getPensionHandle())) {
......@@ -5002,7 +5003,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}*/
}
}
if (CommonConstants.ONE_STRING.equals(dis.getAutoFlag()) || CommonConstants.FIVE_STRING.equals(socialInfo.getYsdHandleStatus())) {
if (isAutoHandle || CommonConstants.ONE_STRING.equals(dis.getAutoFlag()) || CommonConstants.FIVE_STRING.equals(socialInfo.getYsdHandleStatus())) {
if (socialType.contains(CommonConstants.TWO_STRING)) {
if (CommonConstants.FIVE_STRING.equals(sf.getMedicalHandle())) {
if (CommonConstants.FIVE_STRING.equals(socialInfo.getMedicalHandle())) {
......@@ -5855,7 +5856,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Transactional(rollbackFor = Exception.class)
@ShardingTransactionType(TransactionType.BASE)
@Override
public R<List<ErrorMessage>> fundImportHandle(InputStream inputStream,TDispatchInfo tDispatchInfo) {
public R<List<ErrorMessage>> fundImportHandle(InputStream inputStream,TDispatchInfo tDispatchInfo, boolean isAutoFlag) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
......@@ -5907,7 +5908,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
fundImportHandle(cachedDataList, errorMessageList,user,tDispatchInfo,map);
fundImportHandle(cachedDataList, errorMessageList,user,tDispatchInfo,map, isAutoFlag);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -5926,7 +5927,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @return
**/
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList,
YifuUser user,TDispatchInfo dispatchInfo,ConcurrentHashMap<String, String> map) {
YifuUser user,TDispatchInfo dispatchInfo,ConcurrentHashMap<String, String> map, boolean isAutoFlag) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -5995,7 +5996,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(null,null,Collections.singletonList(dispatch.getId()), CommonConstants.ONE_STRING, user
, flag, handleStatus, (Common.isEmpty(excel.getReasonType())?"":excel.getReasonType()+CommonConstants.COLON_STRING)
+excel.getRemark(), null, excel.getReasonType());
+excel.getRemark(), null, excel.getReasonType(), isAutoFlag);
if (Common.isNotNull(messageList)){
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
......@@ -6020,7 +6021,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Transactional(rollbackFor = Exception.class)
@ShardingTransactionType(TransactionType.BASE)
@Override
public R<List<ErrorMessage>> importSocialHandler(InputStream inputStream,String mId) {
public R<List<ErrorMessage>> importSocialHandler(InputStream inputStream,String mId, boolean isAutoHandle) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
......@@ -6072,7 +6073,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
socialImportHandle(cachedDataList, errorMessageList,user,mId,idcardMap);
socialImportHandle(cachedDataList, errorMessageList,user,mId,idcardMap, isAutoHandle);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -6091,7 +6092,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @return
**/
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList,
YifuUser user,String mId,ConcurrentHashMap<String, String> map) {
YifuUser user,String mId,ConcurrentHashMap<String, String> map, boolean isAutoHandle) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -6199,7 +6200,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(socialMap,fundMap,Collections.singletonList(dispatch.getId()), CommonConstants.ZERO_STRING, user
, 0, CommonConstants.ONE_STRING, ServiceUtil.ifNullToEmpty(excel.getRemark()), socialSucessType.substring(0, socialSucessType.length() - 1), ServiceUtil.ifNullToEmpty(excel.getRemark()));
, 0, CommonConstants.ONE_STRING, ServiceUtil.ifNullToEmpty(excel.getRemark()), socialSucessType.substring(0, socialSucessType.length() - 1), ServiceUtil.ifNullToEmpty(excel.getRemark()), isAutoHandle);
if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
......@@ -6230,7 +6231,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
vo = dispatchInfo.getExcel();
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(socialMap,fundMap,Collections.singletonList(dispatchInfo.getId()), CommonConstants.ZERO_STRING, user
, 1, CommonConstants.TWO_STRING, dispatchInfo.getHandlerRemaek() + ServiceUtil.ifNullToEmpty(vo.getRemark()), dispatchInfo.getSocialFailureType().substring(0, dispatchInfo.getSocialFailureType().length() - 1), dispatchInfo.getHandlerRemaek() + ServiceUtil.ifNullToEmpty(vo.getRemark()));
, 1, CommonConstants.TWO_STRING, dispatchInfo.getHandlerRemaek() + ServiceUtil.ifNullToEmpty(vo.getRemark()), dispatchInfo.getSocialFailureType().substring(0, dispatchInfo.getSocialFailureType().length() - 1), dispatchInfo.getHandlerRemaek() + ServiceUtil.ifNullToEmpty(vo.getRemark()), isAutoHandle);
if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(vo);
......
......@@ -599,7 +599,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
**/
public R<List<ErrorMessage>> doSocialAndDispatch(List<String> idList, String typeSub, String handleStatus
, String handleRemark, String socialType, String remark, YifuUser user) {
return tDispatchInfoService.addApplyHandle(idList, typeSub, handleStatus, handleRemark, socialType, remark, user);
return tDispatchInfoService.addApplyHandle(idList, typeSub, handleStatus, handleRemark, socialType, remark, user, true);
}
/**
......
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