Commit 9b1849bb authored by huyuchen's avatar huyuchen

优化修改

parent be556ac9
......@@ -83,4 +83,12 @@ public class SocialHandleSearchVo extends TDispatchInfo {
@ExcelAttribute(name = "派单项查询")
@Schema(description = "派单项查询" )
private List<String> dispatchItems;
/**
* 菜单id
*/
@TableField(exist = false)
@Schema(description = "mid" )
@ExcelIgnore
private String mId;
}
......@@ -512,7 +512,7 @@ public class TDispatchInfoController {
@Operation(description = "社保批量办理导入")
@SysLog("社保批量办理导入")
@PostMapping("/importSocialHandler")
public R<List<ErrorMessage>> importSocialHandler(@RequestBody MultipartFile file){
public R<List<ErrorMessage>> importSocialHandler(@RequestBody MultipartFile file,@RequestParam String mId){
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
......@@ -528,7 +528,7 @@ public class TDispatchInfoController {
try {
if (Common.isNotNull(requestId)) {
//主动释放锁
return tDispatchInfoService.importSocialHandler(file.getInputStream());
return tDispatchInfoService.importSocialHandler(file.getInputStream(),mId);
} 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);
R<List<ErrorMessage>> importSocialHandler(InputStream inputStream,String mId);
void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo);
......
......@@ -78,21 +78,21 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
/**
* @param socialFundInfo
* @Description: 派单变更预估库
* @Description: 派单减少变更预估库-派减
* @Author: hgw
* @Date: 2022/7/26 19:02
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> updateForecastLibaryByDispatch(TSocialFundInfo socialFundInfo);
R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo, int forecastFlag);
/**
* @param socialFundInfo
* @Description: 派单减少变更预估库-派减
* @Description: 派单变更预估库
* @Author: hgw
* @Date: 2022/7/26 19:02
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo, int forecastFlag);
R<String> updateForecastLibaryByDispatch(TSocialFundInfo socialFundInfo);
/**
* @Description: 户调基-基数变更,同步社保公积金查询、预估库
......
......@@ -3885,7 +3885,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (partSuccess){
forecastLibraryService.updateForecastLibaryByDispatch(sf);
}else {
socialTask.asynchronousDisPatchHandle(sf, 0,null,null,CommonConstants.ONE_INT);
synchronized (this) {
socialTask.asynchronousDisPatchHandle(sf, 0, null, null, CommonConstants.ONE_INT);
}
}
}
}
......@@ -5169,7 +5171,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Transactional(rollbackFor = Exception.class)
@ShardingTransactionType(TransactionType.BASE)
@Override
public R<List<ErrorMessage>> importSocialHandler(InputStream inputStream) {
public R<List<ErrorMessage>> importSocialHandler(InputStream inputStream,String mId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
......@@ -5220,7 +5222,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
socialImportHandle(cachedDataList, errorMessageList,user);
socialImportHandle(cachedDataList, errorMessageList,user,mId);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -5238,7 +5240,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Param
* @return
**/
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user) {
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user,String mId) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -5246,6 +5248,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
SocialImportHandleVo excel;
SocialHandleSearchVo tDispatchInfo = new SocialHandleSearchVo();
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
tDispatchInfo.setMId(mId);
menuUtil.setAuthSql(user, tDispatchInfo);
if (Common.isNotNull(tDispatchInfo.getAuthSql()) && tDispatchInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tDispatchInfo.setAuthSql(tDispatchInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
......@@ -5262,6 +5265,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
ErrorMessage errorMessage;
List<ErrorMessage> messageList;
String handlerRemaek;
for (int i = 0; i < excelVOList.size(); i++) {
StringBuilder socialSucessType = new StringBuilder();
StringBuilder socialFailureType = new StringBuilder();
......@@ -5320,11 +5324,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFailureType.append("6,");
}
try {
if (Common.isNotNull(excel.getReasonType())) {
handlerRemaek = excel.getReasonType() + CommonConstants.COLON_STRING;
} else {
handlerRemaek = "";
}
//办理成功处理
if (socialSucessType.length() > 1) {
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ZERO_STRING, user
, 0, CommonConstants.ONE_STRING, excel.getReasonType() + CommonConstants.COLON_STRING + ServiceUtil.ifNullToEmpty(excel.getRemark()), socialSucessType.substring(0, socialSucessType.length() - 1), excel.getReasonType() + CommonConstants.COLON_STRING + ServiceUtil.ifNullToEmpty(excel.getRemark()));
, 0, CommonConstants.ONE_STRING, ServiceUtil.ifNullToEmpty(excel.getRemark()), socialSucessType.substring(0, socialSucessType.length() - 1), ServiceUtil.ifNullToEmpty(excel.getRemark()));
if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
......@@ -5337,7 +5346,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (socialFailureType.length() > 1) {
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ZERO_STRING, user
, 1, CommonConstants.TWO_STRING, excel.getReasonType() + CommonConstants.COLON_STRING + ServiceUtil.ifNullToEmpty(excel.getRemark()), socialFailureType.substring(0, socialFailureType.length() - 1), excel.getReasonType() + CommonConstants.COLON_STRING + ServiceUtil.ifNullToEmpty(excel.getRemark()));
, 1, CommonConstants.TWO_STRING, handlerRemaek + ServiceUtil.ifNullToEmpty(excel.getRemark()), socialFailureType.substring(0, socialFailureType.length() - 1), handlerRemaek + ServiceUtil.ifNullToEmpty(excel.getRemark()));
if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
......
......@@ -1862,8 +1862,10 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
return R.failed("无需要重新生成的数据(无数据或数据已结算不可重新生成!)");
}
//先删除然后重新生成
if (Common.isNotNull(librarySocialList)) {
baseMapper.deleteBatchIds(librarySocialList);
synchronized (this) {
if (Common.isNotNull(librarySocialList)) {
baseMapper.deleteBatchIds(librarySocialList);
}
}
if (Common.isNotNull(libraryFundList)) {
baseMapper.deleteBatchIds(libraryFundList);
......
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