Commit 9798cb7e authored by huyuchen's avatar huyuchen

优化修改

parent 6c513b63
...@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.annotation.TableName; ...@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialImportHandleVo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
...@@ -750,4 +751,14 @@ public class TDispatchInfo extends BaseEntity { ...@@ -750,4 +751,14 @@ public class TDispatchInfo extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String noCreateUser; private String noCreateUser;
@TableField(exist = false)
private SocialImportHandleVo excel;
@TableField(exist = false)
private String handlerRemaek;
@TableField(exist = false)
private String socialFailureType;
} }
...@@ -5288,6 +5288,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5288,6 +5288,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
String handlerRemaek; String handlerRemaek;
List<TDispatchInfo> failueList = new ArrayList<>();
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
StringBuilder socialSucessType = new StringBuilder(); StringBuilder socialSucessType = new StringBuilder();
StringBuilder socialFailureType = new StringBuilder(); StringBuilder socialFailureType = new StringBuilder();
...@@ -5375,26 +5376,37 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5375,26 +5376,37 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
errorMessageList.add(errorMessage); errorMessageList.add(errorMessage);
} }
//办理失败处理 //办理失败处理
if (socialFailureType.length() > 1) { if (socialFailureType.length() > 1) {
if (!CommonConstants.TWO_STRING.equals(dispatch.getStatus())) { if (!CommonConstants.TWO_STRING.equals(dispatch.getStatus())) {
continue; continue;
} }
dispatch.setHandlerRemaek(handlerRemaek);
dispatch.setSocialFailureType(socialFailureType.toString());
dispatch.setExcel(excel);
failueList.add(dispatch);
}
} catch (Exception e) {
log.error("批量导入办理异常:", e);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_FAILED, excel));
}
}
if (!Common.isEmpty(failueList)) {
SocialImportHandleVo vo;
for (TDispatchInfo dispatchInfo : failueList) {
vo = dispatchInfo.getExcel();
// 执行数据插入操作 组装 // 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ZERO_STRING, user messageList = addBatchApplyHandle(Collections.singletonList(dispatchInfo.getId()), CommonConstants.ZERO_STRING, user
, 1, CommonConstants.TWO_STRING, handlerRemaek + ServiceUtil.ifNullToEmpty(excel.getRemark()), socialFailureType.substring(0, socialFailureType.length() - 1), handlerRemaek + ServiceUtil.ifNullToEmpty(excel.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()));
if (Common.isNotNull(messageList)) { if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT); errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel); errorMessage.setData(vo);
} else { } else {
errorMessage = new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN, excel); errorMessage = new ErrorMessage(vo.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN, vo);
} }
errorMessageList.add(errorMessage); errorMessageList.add(errorMessage);
} }
} catch (Exception e) {
log.error("批量导入办理异常:", e);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_FAILED, excel));
}
} }
} }
......
...@@ -1864,11 +1864,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1864,11 +1864,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//先删除然后重新生成 //先删除然后重新生成
boolean isSaveAndUpdate = false; boolean isSaveAndUpdate = false;
synchronized (this) {
if (Common.isNotNull(librarySocialList)) { if (Common.isNotNull(librarySocialList)) {
baseMapper.deleteBatchIds(librarySocialList); baseMapper.deleteBatchIds(librarySocialList);
} }
}
if (Common.isNotNull(libraryFundList)) { if (Common.isNotNull(libraryFundList)) {
baseMapper.deleteBatchIds(libraryFundList); baseMapper.deleteBatchIds(libraryFundList);
} }
...@@ -1908,12 +1906,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1908,12 +1906,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
log.error("更新一条预估耗时:" + times + "毫秒"); log.error("更新一条预估耗时:" + times + "毫秒");
isSaveAndUpdate = true; isSaveAndUpdate = true;
} else { } else {
synchronized (this) {
if (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitSocialSum())) != CommonConstants.ZERO_INT if (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitSocialSum())) != CommonConstants.ZERO_INT
|| BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitFundSum())) != CommonConstants.ZERO_INT) { || BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitFundSum())) != CommonConstants.ZERO_INT) {
//判断是否有重复数据有则删除
baseMapper.deleteForecastSocial(library.getEmpIdcard(),library.getSocialPayMonth(),library.getSocialCreateMonth()
,library.getProvidentPayMonth(),library.getProvidentCreateMonth());
library.setCreateBy(userId); library.setCreateBy(userId);
library.setCreateName(userName); library.setCreateName(userName);
library.setCreateTime(LocalDateTime.now()); library.setCreateTime(LocalDateTime.now());
...@@ -1922,7 +1916,6 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1922,7 +1916,6 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
} }
} }
}
saveLibraryMap.clear(); saveLibraryMap.clear();
if (Common.isNotNull(socialFundInfo.getSocialId()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus()) if (Common.isNotNull(socialFundInfo.getSocialId()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) { || CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
......
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