Commit eb0c5001 authored by fangxinjiang's avatar fangxinjiang

批量新增导入

parent b2f7b4c9
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; 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;
...@@ -27,6 +28,7 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -27,6 +28,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
/** /**
...@@ -217,4 +219,10 @@ public class TEmpContractAlert extends BaseEntity { ...@@ -217,4 +219,10 @@ public class TEmpContractAlert extends BaseEntity {
@Schema(description ="合同ID") @Schema(description ="合同ID")
@ExcelIgnore @ExcelIgnore
private String contractId; private String contractId;
/**
* 合同截止日期
*/
@TableField(exist = false)
private Date auditTime;
} }
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
/**
* @Author fxj
* @Date 2022/7/21
* @Description
* @Version 1.0
*/
@Data
public class SetInfoVo implements Serializable {
private Map<String, ProjectSetInfoVo> ProjectSetInfoVoMap;
}
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpFamilyService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpFamilyService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchCheckVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchCheckVo;
...@@ -30,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; ...@@ -30,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
......
...@@ -22,10 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -22,10 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain; import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService; import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchCheckVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchEmpVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
...@@ -179,7 +176,7 @@ public class TSettleDomainController { ...@@ -179,7 +176,7 @@ public class TSettleDomainController {
@SysLog("通过结算主体编码获取结算主体及客户信息") @SysLog("通过结算主体编码获取结算主体及客户信息")
@Inner @Inner
@PostMapping("/getSetInfoByCodes") @PostMapping("/getSetInfoByCodes")
public Map<String, ProjectSetInfoVo> getSetInfoByCodes(@RequestBody(required = true) List<String> codes) { public SetInfoVo getSetInfoByCodes(@RequestBody(required = true) List<String> codes) {
return tSettleDomainService.getSetInfoByCodes(codes); return tSettleDomainService.getSetInfoByCodes(codes);
} }
} }
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain; import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
...@@ -45,7 +46,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> { ...@@ -45,7 +46,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
List<String> getSettleDomainIdsByUserId(String id); List<String> getSettleDomainIdsByUserId(String id);
Map<String, ProjectSetInfoVo> getSetInfoByCodes(List<String> codes); SetInfoVo getSetInfoByCodes(List<String> codes);
/** /**
* 通过id获取结算主体及单位部分信息 * 通过id获取结算主体及单位部分信息
......
...@@ -36,10 +36,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; ...@@ -36,10 +36,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -200,6 +197,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -200,6 +197,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (Common.isNotNull(entity.getHandleStatus())){ if (Common.isNotNull(entity.getHandleStatus())){
wrapper.eq(TEmpContractAlert::getHandleStatus,entity.getHandleStatus()); wrapper.eq(TEmpContractAlert::getHandleStatus,entity.getHandleStatus());
} }
if (Common.isNotNull(entity.getDaysDue())){
wrapper.eq(TEmpContractAlert::getDaysDue,entity.getDaysDue());
}
return wrapper; return wrapper;
} }
/** /**
...@@ -230,7 +230,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -230,7 +230,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)); .eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
Map<String,TEmpContractAlert> alertMap = new HashMap<>(); Map<String,TEmpContractAlert> alertMap = new HashMap<>();
if (Common.isNotNull(alertList)){ if (Common.isNotNull(alertList)){
Date nowDate = new Date(); Date nowDate = DateUtil.dateIncreaseByDay(new Date(),CommonConstants.ONE_INT);
for (TEmployeeContractInfo contract:alertList){ for (TEmployeeContractInfo contract:alertList){
extracted(nowDate, contract,alertMap); extracted(nowDate, contract,alertMap);
} }
...@@ -269,7 +269,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -269,7 +269,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (Common.isNotNull(alert) if (Common.isNotNull(alert)
&& Common.isNotNull(alert.getContractEnd()) && Common.isNotNull(alert.getContractEnd())
&& Common.isNotNull(contract.getContractEnd()) && Common.isNotNull(contract.getContractEnd())
&& alert.getContractEnd().after(contract.getContractEnd())){ && alert.getAuditTime().after(contract.getContractEnd())){
return; return;
} }
alert = new TEmpContractAlert(); alert = new TEmpContractAlert();
...@@ -283,6 +283,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -283,6 +283,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setEmpIdcard(contract.getEmpIdcard()); alert.setEmpIdcard(contract.getEmpIdcard());
alert.setContractStart(contract.getContractStart()); alert.setContractStart(contract.getContractStart());
alert.setContractEnd(contract.getContractEnd()); alert.setContractEnd(contract.getContractEnd());
alert.setAuditTime(LocalDateTimeUtils.convertLDTToDate(contract.getAuditTimeLast()));
if (Common.isNotNull(contract.getFileProvince())){ if (Common.isNotNull(contract.getFileProvince())){
alert.setFileProvince(Integer.toString(contract.getFileProvince())); alert.setFileProvince(Integer.toString(contract.getFileProvince()));
} }
...@@ -298,9 +299,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -298,9 +299,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (Common.isNotNull(alert.getContractEnd())){ if (Common.isNotNull(alert.getContractEnd())){
if (Common.isNotNull(contract.getContractEnd()) && contract.getContractEnd().before(nowDate)){ if (Common.isNotNull(contract.getContractEnd()) && contract.getContractEnd().before(nowDate)){
alert.setDueFlag(CommonConstants.ONE_STRING); alert.setDueFlag(CommonConstants.ONE_STRING);
alert.setDaysOver(DateUtil.daysBetween(nowDate,alert.getContractEnd())); alert.setDaysOver(DateUtil.daysBetween(alert.getContractEnd(),nowDate));
}else { }else {
alert.setDaysDue(DateUtil.daysBetween(alert.getContractEnd(), nowDate)); alert.setDaysDue(DateUtil.daysBetween( nowDate,alert.getContractEnd()));
alert.setDueFlag(CommonConstants.ZERO_STRING); alert.setDueFlag(CommonConstants.ZERO_STRING);
} }
alert.setFirstAlertTime(DateUtil.dateIncreaseByMonth(alert.getContractEnd(),CommonConstants.THREE_INT_NEGATE)); alert.setFirstAlertTime(DateUtil.dateIncreaseByMonth(alert.getContractEnd(),CommonConstants.THREE_INT_NEGATE));
......
...@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCutsomerDataPermissonMapper; ...@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCutsomerDataPermissonMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TSettleDomainMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TSettleDomainMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService; import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
...@@ -104,11 +105,12 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -104,11 +105,12 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
} }
@Override @Override
public Map<String, ProjectSetInfoVo> getSetInfoByCodes(List<String> codes) { public SetInfoVo getSetInfoByCodes(List<String> codes) {
List<ProjectSetInfoVo> voList = baseMapper.getSetInfoByCodes(codes); List<ProjectSetInfoVo> voList = baseMapper.getSetInfoByCodes(codes);
SetInfoVo setMap = new SetInfoVo();
if (Common.isNotNull(voList)){ if (Common.isNotNull(voList)){
return voList.stream().collect(Collectors.toMap(k->k.getDepartNo(),k->k)); setMap.setProjectSetInfoVoMap(voList.stream().collect(Collectors.toMap(k->k.getDepartNo(),k->k)));
} }
return null; return setMap;
} }
} }
...@@ -308,6 +308,17 @@ public class Common { ...@@ -308,6 +308,17 @@ public class Common {
return null; return null;
} }
public static Integer isNotNullToInt(String value) {
if (Common.isNotNull(value)){
try {
return Integer.valueOf(value);
}catch (Exception e){
return null;
}
}
return null;
}
/** /**
* 默认"null" * 默认"null"
* @param obj * @param obj
...@@ -377,4 +388,15 @@ public class Common { ...@@ -377,4 +388,15 @@ public class Common {
} }
return money; return money;
} }
public static void clear(Collection map){
if (Common.isNotNull(map)){
map.clear();
}
}
public static void clear(Map map){
if (Common.isNotNull(map)){
map.clear();
}
}
} }
...@@ -135,6 +135,12 @@ emp.dispatch.social.and.fund.not.empty=\u65B0\u589E\u5F02\u5E38\uFF1A\u5FC5\u987 ...@@ -135,6 +135,12 @@ emp.dispatch.social.and.fund.not.empty=\u65B0\u589E\u5F02\u5E38\uFF1A\u5FC5\u987
emp.dispatch.project.not.found=\u65B0\u589E\u5F02\u5E38\uFF1A\u672A\u627E\u5230\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u4FE1\u606F emp.dispatch.project.not.found=\u65B0\u589E\u5F02\u5E38\uFF1A\u672A\u627E\u5230\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u4FE1\u606F
emp.dispatch.add.emp.error=\u65B0\u589E\u5F02\u5E38\uFF1A\u6D3E\u5355\u65B0\u589E\u6863\u6848\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5
emp.dispatch.add.contract.error=\u65B0\u589E\u5F02\u5E38\uFF1A\u6D3E\u5355\u65B0\u589E\u5408\u540C\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5
emp.dispatch.add.project.error=\u65B0\u589E\u5F02\u5E38\uFF1A\u6D3E\u5355\u65B0\u589E\u9879\u76EE\u6863\u6848\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5
......
...@@ -3,9 +3,9 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util; ...@@ -3,9 +3,9 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchAddVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchCheckVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchCheckVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDispatchAddVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDispatchAddVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
...@@ -64,8 +64,8 @@ public class ArchivesDaprUtil { ...@@ -64,8 +64,8 @@ public class ArchivesDaprUtil {
* @Param * @Param
* @return * @return
**/ **/
public R<Map> getSetInfoByCodes(List<String> codes){ public R<SetInfoVo> getSetInfoByCodes(List<String> codes){
R<Map> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSetInfoByCodes",JSON.toJSONString(codes), Map.class, SecurityConstants.FROM_IN); R<SetInfoVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSetInfoByCodes",JSON.toJSONString(codes), SetInfoVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("获取档案派单信息失败!"); return R.failed("获取档案派单信息失败!");
} }
......
...@@ -32,7 +32,7 @@ public class UpmsDaprUtils { ...@@ -32,7 +32,7 @@ public class UpmsDaprUtils {
* @return * @return
**/ **/
public static R<List<SysArea>> getAreaListR() { public static R<List<SysArea>> getAreaListR() {
R<List<SysArea>> areaListR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(),"/area/inner/getSysAreaList","", SysArea.class, SecurityConstants.FROM_IN); R<List<SysArea>> areaListR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(),"/area/inner/getSysAreaList","", List.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(areaListR)){ if (Common.isEmpty(areaListR)){
return R.failed("获取所有区域数据失败!"); return R.failed("获取所有区域数据失败!");
} }
......
...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
...@@ -75,13 +77,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -75,13 +77,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isNotEmpty(insuranceList.getRecords())){ if (CollectionUtils.isNotEmpty(insuranceList.getRecords())){
//根据项目编码获取项目名称 //根据项目编码获取项目名称
List<String> collect = insuranceList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList()); List<String> collect = insuranceList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) { if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuranceListVO record : insuranceList.getRecords()) { for (InsuranceListVO record : insuranceList.getRecords()) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
} }
} }
} }
...@@ -103,13 +105,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -103,13 +105,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isNotEmpty(insuranceList)){ if (CollectionUtils.isNotEmpty(insuranceList)){
//根据项目编码获取项目名称 //根据项目编码获取项目名称
List<String> collect = insuranceList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList()); List<String> collect = insuranceList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) { if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuranceListVO record : insuranceList) { for (InsuranceListVO record : insuranceList) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
} }
} }
} }
...@@ -431,13 +433,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -431,13 +433,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> detailList = new ArrayList<>(); List<TInsuranceDetail> detailList = new ArrayList<>();
//根据项目编码获取项目名称 //根据项目编码获取项目名称
List<String> collect = insuranceExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList()); List<String> collect = insuranceExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) { if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuranceExportListVO record : insuranceExportList) { for (InsuranceExportListVO record : insuranceExportList) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
} }
TInsuranceDetail detail = new TInsuranceDetail(); TInsuranceDetail detail = new TInsuranceDetail();
detail.setId(record.getId()); detail.setId(record.getId());
...@@ -670,22 +672,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -670,22 +672,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
//根据项目编码查询项目是否存在 //根据项目编码查询项目是否存在
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo())); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS) { if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS) {
Map data = setInfoByCodes.getData(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){ if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
JSONObject jsonObject = (JSONObject) data.get(param.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(param.getDeptNo());
if (null == jsonObject){ if (null == jsonObject){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
//结算类型,根据项目编码获取,并冗余到明细记录中 //结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = jsonObject.getString("insuranceSettleType"); String settleType = jsonObject.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){ if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE); param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param); listResult.add(param);
...@@ -884,22 +886,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -884,22 +886,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
//根据项目编码查询项目是否存在 //根据项目编码查询项目是否存在
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo())); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS) { if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS) {
Map data = setInfoByCodes.getData(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){ if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
JSONObject jsonObject = (JSONObject) data.get(param.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(param.getDeptNo());
if (null == jsonObject){ if (null == jsonObject){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
//结算类型,根据项目编码获取,并冗余到明细记录中 //结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = jsonObject.getString("insuranceSettleType"); String settleType = jsonObject.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){ if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE); param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param); listResult.add(param);
......
...@@ -89,21 +89,21 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -89,21 +89,21 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "身份证省" ,isArea = true) @ExcelAttribute(name = "身份证省" ,isArea = true)
@Schema(description = "身份证省" ) @Schema(description = "身份证省" )
@ExcelProperty("身份证省" ) @ExcelProperty("身份证省" )
private Integer idCardProvince; private String idCardProvince;
/** /**
* 身份证市 * 身份证市
*/ */
@ExcelAttribute(name = "身份证市" ,isArea = true,parentField = "idCardProvince") @ExcelAttribute(name = "身份证市" ,isArea = true,parentField = "idCardProvince")
@Schema(description = "身份证市" ) @Schema(description = "身份证市" )
@ExcelProperty("身份证市" ) @ExcelProperty("身份证市" )
private Integer idCardCity; private String idCardCity;
/** /**
* 身份证县 * 身份证县
*/ */
@ExcelAttribute(name = "身份证县",isArea = true,parentField = "idCardCity") @ExcelAttribute(name = "身份证县",isArea = true,parentField = "idCardCity")
@Schema(description = "身份证县" ) @Schema(description = "身份证县" )
@ExcelProperty("身份证县" ) @ExcelProperty("身份证县" )
private Integer idCardTown; private String idCardTown;
/** /**
* 身份证所在地 * 身份证所在地
...@@ -111,7 +111,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -111,7 +111,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "身份证所在地") @ExcelAttribute(name = "身份证所在地")
@Schema(description = "身份证所在地" ) @Schema(description = "身份证所在地" )
@ExcelProperty("身份证所在地" ) @ExcelProperty("身份证所在地" )
private Integer idCardAddress; private String idCardAddress;
/** /**
* 档案-省 * 档案-省
...@@ -119,21 +119,21 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -119,21 +119,21 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "档案-省" ,isArea = true) @ExcelAttribute(name = "档案-省" ,isArea = true)
@Schema(description = "档案-省" ) @Schema(description = "档案-省" )
@ExcelProperty("档案-省" ) @ExcelProperty("档案-省" )
private Integer fileProvince; private String fileProvince;
/** /**
* 档案-市 * 档案-市
*/ */
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince", isNotEmpty = true) @ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince", isNotEmpty = true)
@Schema(description = "档案-市" ) @Schema(description = "档案-市" )
@ExcelProperty("档案-市" ) @ExcelProperty("档案-市" )
private Integer fileCity; private String fileCity;
/** /**
* 档案-县 * 档案-县
*/ */
@ExcelAttribute(name = "档案-县" ,isArea = true,parentField = "fileCity", isNotEmpty = true) @ExcelAttribute(name = "档案-县" ,isArea = true,parentField = "fileCity", isNotEmpty = true)
@Schema(description = "档案-县" ) @Schema(description = "档案-县" )
@ExcelProperty("档案-县" ) @ExcelProperty("档案-县" )
private Integer fileTown; private String fileTown;
/** /**
* 就职班组 * 就职班组
...@@ -147,10 +147,10 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -147,10 +147,10 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/** /**
* 就职岗位 * 就职岗位
*/ */
@Length(max = 30, message = "就职岗位 不能超过30 个字符" ) @Length(max = 30, message = "岗位 不能超过30 个字符" )
@ExcelAttribute(name = "就职岗位", maxLength = 30, isNotEmpty = true) @ExcelAttribute(name = "岗位", maxLength = 30, isNotEmpty = true)
@Schema(description = "就职岗位" ) @Schema(description = "岗位" )
@ExcelProperty("就职岗位" ) @ExcelProperty("岗位" )
private String post; private String post;
/** /**
...@@ -165,8 +165,8 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -165,8 +165,8 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/** /**
* 工时制:1标准工时 2 综合工时 3不定时工时制 * 工时制:1标准工时 2 综合工时 3不定时工时制
*/ */
@Length(max = 1, message = "工时制 不能超过1 个字符" ) @Length(max = 1, message = "工时制 不能超过50 个字符" )
@ExcelAttribute(name = "工时制", maxLength = 1, isDataId = true,dataType = ExcelAttributeConstants.WORKING_HOURS, isNotEmpty = true) @ExcelAttribute(name = "工时制", maxLength = 50, isDataId = true,dataType = ExcelAttributeConstants.WORKING_HOURS, isNotEmpty = true)
@Schema(description = "工时制:1标准工时 2 综合工时 3不定时工时制" ) @Schema(description = "工时制:1标准工时 2 综合工时 3不定时工时制" )
@ExcelProperty("工时制" ) @ExcelProperty("工时制" )
private String workingHours; private String workingHours;
...@@ -232,7 +232,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -232,7 +232,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/** /**
* 合同期限 * 合同期限
*/ */
@ExcelAttribute(name = "合同期限", isInteger = true ) @ExcelAttribute(name = "合同期限")
@Schema(description = "合同期限" ) @Schema(description = "合同期限" )
@ExcelProperty("合同期限" ) @ExcelProperty("合同期限" )
private String contractTerm; private String contractTerm;
...@@ -310,7 +310,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -310,7 +310,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
* 缴纳类型(0最低缴纳、1自定义缴纳、2最高缴纳) * 缴纳类型(0最低缴纳、1自定义缴纳、2最高缴纳)
*/ */
@Length(max = 1, message = "缴纳类型 不能超过1 个字符" ) @Length(max = 1, message = "缴纳类型 不能超过1 个字符" )
@ExcelAttribute(name = "缴纳类型", maxLength = 1, isDataId = true, readConverterExp = "0=最低缴纳,1=自定义缴纳,2=最高缴纳") @ExcelAttribute(name = "缴纳类型", isDataId = true, readConverterExp = "0=最低缴纳,1=自定义缴纳,2=最高缴纳")
@Schema(description = "缴纳类型:(0最低缴纳、1自定义缴纳、2最高缴纳)" ) @Schema(description = "缴纳类型:(0最低缴纳、1自定义缴纳、2最高缴纳)" )
@ExcelProperty("缴纳类型" ) @ExcelProperty("缴纳类型" )
private String paymentType; private String paymentType;
......
...@@ -138,7 +138,7 @@ public class TDispatchInfoController { ...@@ -138,7 +138,7 @@ public class TDispatchInfoController {
@Operation(description = "批量新增派单信息记录表 hasPermission('demo_tdispatchinfo-batch-import')") @Operation(description = "批量新增派单信息记录表 hasPermission('demo_tdispatchinfo-batch-import')")
@SysLog("批量新增派单信息记录表") @SysLog("批量新增派单信息记录表")
@PostMapping("/importListAdd") @PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-batch-import')") //@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file){ public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file){
return tDispatchInfoService.importDiy(file.getInputStream()); return tDispatchInfoService.importDiy(file.getInputStream());
} }
......
...@@ -56,7 +56,6 @@ import java.io.InputStream; ...@@ -56,7 +56,6 @@ import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 派单信息记录表 * 派单信息记录表
...@@ -258,9 +257,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -258,9 +257,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private void importTDispatchInfo(List<TDispatchImportVo> excelVOList, private void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList, List<ErrorMessage> errorMessageList,
YifuUser user) { YifuUser user) {
if (Common.isEmpty(excelVOList)){ if (!Common.isNotNull(excelVOList)){
return; return;
} }
Map<String,String> excelVOTemp = new HashMap<>();
// 个性化校验逻辑 // 个性化校验逻辑
List<String> idcards = new ArrayList<>(); List<String> idcards = new ArrayList<>();
List<String> codes = new ArrayList<>(); List<String> codes = new ArrayList<>();
...@@ -305,26 +305,30 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -305,26 +305,30 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excel = excelVOList.get(i); excel = excelVOList.get(i);
fundSet = fundHoldMap.get(excel.getProvidentHousehold()); fundSet = fundHoldMap.get(excel.getProvidentHousehold());
socialSet = socialHoldMap.get(excel.getSocialHousehold()); socialSet = socialHoldMap.get(excel.getSocialHousehold());
socialFund = socialFundMap.get(excel.getEmpIdcard());; socialFund = getSocialFund(socialFundMap,excel);
setInfoVo = projectVoMap.get(excel.getSettleDomainCode()); setInfoVo = getSetInfoVo(projectVoMap,excel);
// 数据合法情况 // 数据合法情况
if (validImport(errorMessageList, excel, dispatchMap,setInfoVo)) { if (validImport(errorMessageList, excel, dispatchMap,setInfoVo)) {
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
continue; continue;
} }
if (Common.isNotNull(excel.getSocialHousehold())){ if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isEmpty(socialSet)){ if (Common.isEmpty(socialSet)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST)));
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
continue; continue;
} }
} }
if (Common.isNotNull(excel.getProvidentHousehold())){ if (Common.isNotNull(excel.getProvidentHousehold())){
if (Common.isEmpty(fundSet)){ if (Common.isEmpty(fundSet)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_HOLD_NOT_EXIST))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_HOLD_NOT_EXIST)));
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
continue; continue;
} }
} }
// 是否可以派单: 派单状态、兼职工伤处理 // 是否可以派单: 派单状态、兼职工伤处理
if (validDdispatchStatus(errorMessageList, socialFundMap, excel)) { if (validDdispatchStatus(errorMessageList, socialFundMap, excel)) {
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
continue; continue;
} }
if (Common.isNotNull(empVoMap)) { if (Common.isNotNull(empVoMap)) {
...@@ -336,6 +340,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -336,6 +340,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
initSocialAddInfo(socialsMap, empVo, socialSet, excel); initSocialAddInfo(socialsMap, empVo, socialSet, excel);
// 新增公积金 // 新增公积金
if (initFundAddInfo(errorMessageList, fundsMap, empVo, fundSet, excel)){ if (initFundAddInfo(errorMessageList, fundsMap, empVo, fundSet, excel)){
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
continue; continue;
} }
// 新增派单信息 // 新增派单信息
...@@ -348,23 +353,31 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -348,23 +353,31 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
addVo.setProjectsMap(projectsMap); addVo.setProjectsMap(projectsMap);
R<EmpDispatchAddVo> res = archivesDaprUtil.addDispatchInfo(addVo); R<EmpDispatchAddVo> res = archivesDaprUtil.addDispatchInfo(addVo);
// 开始插入各种数据了 // 开始插入各种数据了
insertAllInfo(excelVOList, errorMessageList, empVoMap, res,socialsMap,fundsMap,socialFundAddMap,dispatchMap); insertAllInfo(excelVOList, errorMessageList, empVoMap, res,socialsMap,fundsMap,socialFundAddMap,dispatchMap,excelVOTemp);
// 清理map list 等数据 // 清理map list 等数据
excelVOList.clear(); Common.clear(excelVOList);
empAddsMap.clear(); Common.clear(empAddsMap);
contractsMap.clear(); Common.clear(contractsMap);
projectsMap.clear(); Common.clear(projectsMap);
empVoMap.clear(); Common.clear(empVoMap);
idcards.clear(); Common.clear(idcards);
codes.clear(); Common.clear(codes);
socialholds.clear(); Common.clear(socialholds);
fundholds.clear(); Common.clear(fundholds);
socialsMap.clear(); Common.clear(socialsMap);
fundsMap.clear(); Common.clear(fundsMap);
dispatchMap.clear(); Common.clear(dispatchMap);
socialFundAddMap.clear(); Common.clear(socialFundAddMap);
socialHoldMap.clear(); Common.clear(socialHoldMap);
fundHoldMap.clear(); Common.clear(fundHoldMap);
Common.clear(excelVOTemp);
}
private ProjectSetInfoVo getSetInfoVo(Map<String, ProjectSetInfoVo> projectVoMap, TDispatchImportVo excel) {
return Common.isEmpty(projectVoMap)?null:projectVoMap.get(excel.getSettleDomainCode());
}
private TSocialFundInfo getSocialFund(Map<String, TSocialFundInfo> socialFundMap, TDispatchImportVo excel) {
return Common.isEmpty(socialFundMap)?null:socialFundMap.get(excel.getEmpIdcard());
} }
private void insertAllInfo(List<TDispatchImportVo> excelVOList, private void insertAllInfo(List<TDispatchImportVo> excelVOList,
...@@ -374,7 +387,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -374,7 +387,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Map<String, TSocialInfo> socialsMap, Map<String, TSocialInfo> socialsMap,
Map<String, TProvidentFund> fundsMap, Map<String, TProvidentFund> fundsMap,
Map<String, TSocialFundInfo> socialFundAddMap, Map<String, TSocialFundInfo> socialFundAddMap,
Map<String, TDispatchInfo> dispatchMap) { Map<String, TDispatchInfo> dispatchMap,
Map<String,String> excelVOTemp) {
Map<String, EmpAddDispatchVo> empAddsMap = null; Map<String, EmpAddDispatchVo> empAddsMap = null;
Map<String, EmpContractDispatchVo> contractsMap = null; Map<String, EmpContractDispatchVo> contractsMap = null;
Map<String, EmpProjectDispatchVo> projectsMap = null; Map<String, EmpProjectDispatchVo> projectsMap = null;
...@@ -394,7 +408,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -394,7 +408,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i); excel = excelVOList.get(i);
empVo = empVoMap.get(excel.getEmpIdcard()); if (Common.isNotNull(excelVOTemp) && Common.isNotNull(excelVOTemp.get(excel.getEmpIdcard()))){
continue;
}
empVo = getEmpVoMap(empVoMap,excel);
// 验证档案是否插入成功 如果MAP 无数据直接不处理 // 验证档案是否插入成功 如果MAP 无数据直接不处理
if (Common.isEmpty(empVo) && Common.isNotNull(empAddsMap)){ if (Common.isEmpty(empVo) && Common.isNotNull(empAddsMap)){
emp = empAddsMap.get(excel.getEmpIdcard()); emp = empAddsMap.get(excel.getEmpIdcard());
...@@ -455,6 +472,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -455,6 +472,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
private DispatchEmpVo getEmpVoMap(Map<String, DispatchEmpVo> empVoMap, TDispatchImportVo excel) {
return Common.isNotNull(empVoMap)?empVoMap.get(excel.getEmpIdcard()):null;
}
private void insertSocial(EmpAddDispatchVo emp, TSocialInfo social) { private void insertSocial(EmpAddDispatchVo emp, TSocialInfo social) {
if (Common.isNotNull(emp) && Common.isNotNull(social)){ if (Common.isNotNull(emp) && Common.isNotNull(social)){
social.setEmpNo(emp.getEmpCode()); social.setEmpNo(emp.getEmpCode());
...@@ -656,9 +677,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -656,9 +677,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
private Map<String, ProjectSetInfoVo> getProjectVoMap(List<String> codes) { private Map<String, ProjectSetInfoVo> getProjectVoMap(List<String> codes) {
R<Map> res = archivesDaprUtil.getSetInfoByCodes(codes); R<SetInfoVo> res = archivesDaprUtil.getSetInfoByCodes(codes);
if (Common.isNotNull(res) && Common.isNotNull(res.getData())){ if (Common.isNotNull(res) && Common.isNotNull(res.getData())){
return res.getData(); return res.getData().getProjectSetInfoVoMap();
} }
return new HashMap<>(); return new HashMap<>();
} }
...@@ -974,14 +995,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -974,14 +995,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
.le(SysBaseSetInfo::getApplyEndDate, now) .le(SysBaseSetInfo::getApplyEndDate, now)
.eq(SysBaseSetInfo::getDeleteFlag, CommonConstants.ZERO_STRING)); .eq(SysBaseSetInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isNotNull(socialBases)) { if (Common.isNotNull(socialBases)) {
socialHoldMap = socialBases.stream().collect(Collectors.toMap(k -> k.getDepartName(), k -> k)); for (SysBaseSetInfo set:socialBases){
socialHoldMap.put(set.getDepartName(),set);
}
} }
socialBases.clear(); socialBases.clear();
} }
if (Common.isNotNull(fundHolds)) { if (Common.isNotNull(fundHolds)) {
List<SysBaseSetInfo> fundBases = baseSetMapper.getFundBaseSet(fundHolds); List<SysBaseSetInfo> fundBases = baseSetMapper.getFundBaseSet(fundHolds);
if (Common.isNotNull(fundBases)) { if (Common.isNotNull(fundBases)) {
fundHoldMap = fundBases.stream().collect(Collectors.toMap(k -> k.getDepartName(), k -> k)); for (SysBaseSetInfo set:fundBases){
fundHoldMap.put(set.getDepartName(),set);
}
} }
fundBases.clear(); fundBases.clear();
} }
...@@ -1041,14 +1066,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1041,14 +1066,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
emp.setContractStatus(CommonConstants.ZERO_INT); emp.setContractStatus(CommonConstants.ZERO_INT);
emp.setDeleteFlag(CommonConstants.ZERO_STRING); emp.setDeleteFlag(CommonConstants.ZERO_STRING);
emp.setFileSource(CommonConstants.ONE_STRING); emp.setFileSource(CommonConstants.ONE_STRING);
emp.setFileProvince(excel.getFileProvince()); emp.setFileProvince(Common.isNotNullToInt(excel.getFileProvince()));
emp.setFileCity(excel.getFileCity()); emp.setFileCity(Common.isNotNullToInt(excel.getFileCity()));
emp.setFileTown(excel.getFileTown()); emp.setFileTown(Common.isNotNullToInt(excel.getFileTown()));
emp.setFileStatus(CommonConstants.ZERO_INT); emp.setFileStatus(CommonConstants.ZERO_INT);
emp.setStatus(CommonConstants.ZERO_INT); emp.setStatus(CommonConstants.ZERO_INT);
emp.setIdProvince(excel.getIdCardProvince()); emp.setIdProvince(Common.isNotNullToInt(excel.getIdCardProvince()));
emp.setIdCity(excel.getIdCardCity()); emp.setIdCity(Common.isNotNullToInt(excel.getIdCardCity()));
emp.setIdTown(excel.getIdCardTown()); emp.setIdTown(Common.isNotNullToInt(excel.getIdCardTown()));
emp.setProjectNum(CommonConstants.ONE_INT); emp.setProjectNum(CommonConstants.ONE_INT);
emp.setDeptNo(excel.getSettleDomainCode()); emp.setDeptNo(excel.getSettleDomainCode());
emp.setPost(excel.getPost()); emp.setPost(excel.getPost());
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
<collection property="fundProList" ofType="com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion" <collection property="fundProList" ofType="com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion"
select="com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper.selectByPrimaryId" column="id"> select="com.yifu.cloud.plus.v1.yifu.social.mapper.SysPayProportionMapper.selectByPrimaryId" column="id">
</collection> </collection>
</resultMap> </resultMap>
<sql id="base_column_list"> <sql id="base_column_list">
...@@ -328,7 +328,6 @@ ...@@ -328,7 +328,6 @@
</sql> </sql>
<!--sysBaseSetInfo简单分页查询--> <!--sysBaseSetInfo简单分页查询-->
<select id="getSysBaseSetInfoPage" resultMap="sysBaseSetInfoMap"> <select id="getSysBaseSetInfoPage" resultMap="sysBaseSetInfoMap">
SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM sys_base_set_info a FROM sys_base_set_info a
<where> <where>
...@@ -349,7 +348,6 @@ ...@@ -349,7 +348,6 @@
<!--获取对应户名称的公积金基数信息--> <!--获取对应户名称的公积金基数信息-->
<select id="getFundBaseSet" resultMap="sysBaseSetInfoMap"> <select id="getFundBaseSet" resultMap="sysBaseSetInfoMap">
select
<include refid="base_column_list"/> <include refid="base_column_list"/>
FROM sys_base_set_info a FROM sys_base_set_info a
<where> <where>
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
<result property="personalMedicalCardinal" column="PERSONAL_MEDICAL_CARDINAL"/> <result property="personalMedicalCardinal" column="PERSONAL_MEDICAL_CARDINAL"/>
<result property="personalBigailmentCardinal" column="PERSONAL_BIGAILMENT_CARDINAL"/> <result property="personalBigailmentCardinal" column="PERSONAL_BIGAILMENT_CARDINAL"/>
<result property="personalUnemploymentCardinal" column="PERSONAL_UNEMPLOYMENT_CARDINAL"/> <result property="personalUnemploymentCardinal" column="PERSONAL_UNEMPLOYMENT_CARDINAL"/>
<result property="personalWorkInjuryCardinal" column="PERSONAL_WORK_INJURY_CARDINAL"/>
<result property="unitPensionPer" column="UNIT_PENSION_PER"/> <result property="unitPensionPer" column="UNIT_PENSION_PER"/>
<result property="unitMedicalPer" column="UNIT_MEDICAL_PER"/> <result property="unitMedicalPer" column="UNIT_MEDICAL_PER"/>
<result property="unitUnemploymentPer" column="UNIT_UNEMPLOYMENT_PER"/> <result property="unitUnemploymentPer" column="UNIT_UNEMPLOYMENT_PER"/>
...@@ -204,7 +203,6 @@ ...@@ -204,7 +203,6 @@
a.PERSONAL_MEDICAL_CARDINAL, a.PERSONAL_MEDICAL_CARDINAL,
a.PERSONAL_BIGAILMENT_CARDINAL, a.PERSONAL_BIGAILMENT_CARDINAL,
a.PERSONAL_UNEMPLOYMENT_CARDINAL, a.PERSONAL_UNEMPLOYMENT_CARDINAL,
a.PERSONAL_WORK_INJURY_CARDINAL,
a.UNIT_PENSION_PER, a.UNIT_PENSION_PER,
a.UNIT_MEDICAL_PER, a.UNIT_MEDICAL_PER,
a.UNIT_UNEMPLOYMENT_PER, a.UNIT_UNEMPLOYMENT_PER,
...@@ -409,9 +407,6 @@ ...@@ -409,9 +407,6 @@
<if test="tSocialFundInfo.personalUnemploymentCardinal != null"> <if test="tSocialFundInfo.personalUnemploymentCardinal != null">
AND a.PERSONAL_UNEMPLOYMENT_CARDINAL = #{tSocialFundInfo.personalUnemploymentCardinal} AND a.PERSONAL_UNEMPLOYMENT_CARDINAL = #{tSocialFundInfo.personalUnemploymentCardinal}
</if> </if>
<if test="tSocialFundInfo.personalWorkInjuryCardinal != null">
AND a.PERSONAL_WORK_INJURY_CARDINAL = #{tSocialFundInfo.personalWorkInjuryCardinal}
</if>
<if test="tSocialFundInfo.unitPensionPer != null"> <if test="tSocialFundInfo.unitPensionPer != null">
AND a.UNIT_PENSION_PER = #{tSocialFundInfo.unitPensionPer} AND a.UNIT_PENSION_PER = #{tSocialFundInfo.unitPensionPer}
</if> </if>
......
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