Commit 9798cb7e authored by huyuchen's avatar huyuchen

优化修改

parent 6c513b63
......@@ -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.ExcelAttributeConstants;
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 lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -750,4 +751,14 @@ public class TDispatchInfo extends BaseEntity {
@TableField(exist = false)
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
String handlerRemaek;
List<TDispatchInfo> failueList = new ArrayList<>();
for (int i = 0; i < excelVOList.size(); i++) {
StringBuilder socialSucessType = new StringBuilder();
StringBuilder socialFailureType = new StringBuilder();
......@@ -5375,27 +5376,38 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
errorMessageList.add(errorMessage);
}
//办理失败处理
if (socialFailureType.length() > 1) {
if (!CommonConstants.TWO_STRING.equals(dispatch.getStatus())) {
continue;
}
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.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()));
if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
} else {
errorMessage = new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN, excel);
}
errorMessageList.add(errorMessage);
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(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()));
if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(vo);
} else {
errorMessage = new ErrorMessage(vo.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN, vo);
}
errorMessageList.add(errorMessage);
}
}
}
@Override
......
......@@ -1864,10 +1864,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//先删除然后重新生成
boolean isSaveAndUpdate = false;
synchronized (this) {
if (Common.isNotNull(librarySocialList)) {
baseMapper.deleteBatchIds(librarySocialList);
}
if (Common.isNotNull(librarySocialList)) {
baseMapper.deleteBatchIds(librarySocialList);
}
if (Common.isNotNull(libraryFundList)) {
baseMapper.deleteBatchIds(libraryFundList);
......@@ -1908,18 +1906,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
log.error("更新一条预估耗时:" + times + "毫秒");
isSaveAndUpdate = true;
} else {
synchronized (this) {
if (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitSocialSum())) != 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.setCreateName(userName);
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
isSaveAndUpdate = true;
}
if (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitSocialSum())) != CommonConstants.ZERO_INT
|| BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitFundSum())) != CommonConstants.ZERO_INT) {
library.setCreateBy(userId);
library.setCreateName(userName);
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
isSaveAndUpdate = 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