Commit f740cb35 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.5.4' into MVP1.5.4

parents d1b9172b e0aaea28
......@@ -296,7 +296,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
// 初始化
tEmployeeContractInfo.setUpdateBy(user.getId());
tEmployeeContractInfo.setUpdateTime(LocalDateTime.now());
if (CommonConstants.TWO_STRING.equals(tEmployeeContractInfo.getContractType())
|| CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getContractType())) {
tEmployeeContractInfo.setContractEnd(null);
}
//是否归档:否
tEmployeeContractInfo.setIsFile(CommonConstants.ONE_STRING);
//是否在用:否
......@@ -1148,7 +1151,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
errorInfo.append("该员工已存在相同起始日期的合同,禁止重复添加!");
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该员工已存在相同起始日期的合同,禁止重复添加!"));
return;
}
}
......@@ -1165,8 +1169,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfo != null) {
errorInfo.append("该员工已存在相同起始和截止日期的合同,禁止重复添加");
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该员工已存在相同起始和截止日期的合同,禁止重复添加"));
return;
}
}
......
......@@ -155,4 +155,8 @@ public class ExcelAttributeConstants {
public static final String HOUSEHOLD = "household";
// 派单办理失败类型
public static final String DISPATCH_HANDLE_REASON = "dispatch-audit-add-reason";
// 社保办理失败类型
public static final String SOCIAL_DISPATCH_HANDLE_REASON = "social-conduct-add-reason";
// 公积金办理失败类型
public static final String FUND_DISPATCH_HANDLE_REASON = "fund-conduct-add-reason";
}
......@@ -567,4 +567,8 @@ public interface ErrorCodes {
* 社保办理:无办理权限或无可需要办理的社保数据
*/
String SOCIAL_IMPORT_HANDLE_NOT_EXITS = "social.import.handle.not.exits";
/**
* 社保办理:该数据已处理,请勿重复操作
*/
String SOCIAL_IMPORT_SAME_INFO = "social.import.same.info";
}
......@@ -221,6 +221,7 @@ fund_import_handle_reason_not_empty=\u516C\u79EF\u91D1\u529E\u7406\uFF1A\u529E\u
social_import_handle_reason_not_empty=\u793E\u4FDD\u529E\u7406\uFF1A\u4EFB\u4E00\u9669\u79CD\u529E\u7406\u5931\u8D25\uFF0C\u5931\u8D25\u7C7B\u578B\u5FC5\u586B
social_import_handle_not_empty=\u793E\u4FDD\u529E\u7406\u5931\u8D25\uFF0C\u5FC5\u987B\u529E\u7406\u5176\u4E2D\u4E00\u4E2A\u9669\u79CD
social.import.handle.not.exits=\u65E0\u529E\u7406\u6743\u9650\u6216\u65E0\u53EF\u9700\u8981\u529E\u7406\u7684\u793E\u4FDD\u6570\u636E
social.import.same.info=\u8BE5\u6570\u636E\u5DF2\u5904\u7406\uFF0C\u8BF7\u52FF\u91CD\u590D\u64CD\u4F5C
......
......@@ -16,21 +16,14 @@
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
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.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 派单信息记录表
......@@ -72,7 +65,7 @@ public class FundImportHandleVo extends RowIndex implements Serializable {
/**
* 失败类型
*/
@ExcelAttribute(name = "失败类型",isDataId = true,isConvert = false,dataType = ExcelAttributeConstants.DISPATCH_HANDLE_REASON)
@ExcelAttribute(name = "失败类型",isDataId = true,isConvert = false,dataType = ExcelAttributeConstants.FUND_DISPATCH_HANDLE_REASON)
@Schema(description = "失败类型" )
@ExcelProperty("失败类型" )
private String reasonType;
......
......@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
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.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -108,7 +109,7 @@ public class SocialImportHandleVo extends RowIndex implements Serializable {
/**
* 失败类型
*/
@ExcelAttribute(name = "失败类型")
@ExcelAttribute(name = "失败类型",isDataId = true,isConvert = false,dataType = ExcelAttributeConstants.SOCIAL_DISPATCH_HANDLE_REASON)
@Schema(description = "失败类型" )
@ExcelProperty("失败类型" )
private String reasonType;
......
......@@ -69,7 +69,8 @@ public interface TForecastLibraryMapper extends BaseMapper<TForecastLibrary> {
int updateForecastFundStatusByIdList(@Param("idList")List<String> idList, @Param("status") String status);
int deleteForecastSocial(@Param("idCard") String idCard, @Param("socialPayMonth") String socialPayMonth, @Param("socialCreateMonth") String socialCreateMonth);
int deleteForecastSocial(@Param("idCard") String idCard, @Param("socialPayMonth") String socialPayMonth, @Param("socialCreateMonth") String socialCreateMonth
, @Param("fundPayMonth") String fundPayMonth, @Param("fundCreateMonth") String fundCreateMonth);
void updateForSocialAndFound(@Param("infoVo") UpdateSocialFoundVo infoVo);
......
......@@ -78,6 +78,7 @@ import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
......@@ -5029,6 +5030,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<FundImportHandleVo> util1 = new ExcelUtil<>(FundImportHandleVo.class);
ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
......@@ -5073,7 +5075,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
fundImportHandle(cachedDataList, errorMessageList,user,tDispatchInfo);
fundImportHandle(cachedDataList, errorMessageList,user,tDispatchInfo,map);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -5091,7 +5093,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Param
* @return
**/
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user,TDispatchInfo dispatchInfo) {
public void fundImportHandle(List<FundImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList,
YifuUser user,TDispatchInfo dispatchInfo,ConcurrentHashMap<String, String> map) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -5127,6 +5130,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(CommonConstants.PARAM_INFO_ERROR),excel));
continue;
}
//表内数据重复 员工身份证
if (null == map.get(excel.getEmpIdcard())) {
map.put(excel.getEmpIdcard(),excel.getRowIndex().toString());
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_SAME_INFO) , excel));
continue;
}
// 办理失败,原因必填
if (CommonConstants.ONE_STRING.equals(excel.getHandleStatus()) && Common.isEmpty(excel.getReasonType())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.FUND_IMPORT_HANDLE_REASON_NOT_EMPY),excel));
......@@ -5185,6 +5195,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<SocialImportHandleVo> util1 = new ExcelUtil<>(SocialImportHandleVo.class);
ConcurrentHashMap<String, String> idcardMap = new ConcurrentHashMap<>();
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
......@@ -5229,7 +5240,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
socialImportHandle(cachedDataList, errorMessageList,user,mId);
socialImportHandle(cachedDataList, errorMessageList,user,mId,idcardMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
......@@ -5247,7 +5258,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Param
* @return
**/
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user,String mId) {
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList,
YifuUser user,String mId,ConcurrentHashMap<String, String> map) {
if (!Common.isNotNull(excelVOList)) {
return;
}
......@@ -5273,10 +5285,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
List<ErrorMessage> messageList;
String handlerRemaek;
for (int i = 0; i < excelVOList.size(); i++) {
StringBuilder socialSucessType = new StringBuilder();
StringBuilder socialFailureType = new StringBuilder();
excel = excelVOList.get(i);
//表内数据重复 员工身份证
if (null == map.get(excel.getEmpIdcard())) {
map.put(excel.getEmpIdcard(),excel.getRowIndex().toString());
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_SAME_INFO) , excel));
continue;
}
//身份证加任一险种必填
if (Common.isEmpty(excel.getDbHandleStatus()) && Common.isEmpty(excel.getGsHandleStatus())
&& Common.isEmpty(excel.getSjHandleStatus()) && Common.isEmpty(excel.getSyHandleStatus())
......
......@@ -1868,10 +1868,10 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (Common.isNotNull(librarySocialList)) {
baseMapper.deleteBatchIds(librarySocialList);
}
}
if (Common.isNotNull(libraryFundList)) {
baseMapper.deleteBatchIds(libraryFundList);
}
}
// 新基数,老比例,存放Map
HashMap<String, TForecastLibrary> socialHistoryMap = new HashMap<>();
HashMap<String, TForecastLibrary> fundHistoryMap = new HashMap<>();
......@@ -1912,7 +1912,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
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());
baseMapper.deleteForecastSocial(library.getEmpIdcard(),library.getSocialPayMonth(),library.getSocialCreateMonth()
,library.getProvidentPayMonth(),library.getProvidentCreateMonth());
library.setCreateBy(userId);
library.setCreateName(userName);
library.setCreateTime(LocalDateTime.now());
......
......@@ -679,7 +679,8 @@
</update>
<delete id="deleteForecastSocial">
delete from t_forecast_library where SOCIAL_PAY_MONTH = #{socialPayMonth} and SOCIAL_CREATE_MONTH = #{socialCreateMonth}
delete from t_forecast_library where (SOCIAL_PAY_MONTH = #{socialPayMonth} and SOCIAL_CREATE_MONTH = #{socialCreateMonth})
or (PROVIDENT_PAY_MONTH = #{fundPayMonth} and PROVIDENT_CREATE_MONTH = #{fundCreateMonth})
and EMP_IDCARD = #{idCard} and DATA_PUSH = 0
</delete>
......
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