Commit 4b6809f4 authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents 051a980d f848382a
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
......@@ -145,8 +148,6 @@ public class DispatchEmpVo implements Serializable {
/**
* 合同类型
*/
@NotBlank(message = "合同类型不能为空")
@Length(max = 32, message = "合同类型不能超过32个字符")
@ExcelAttribute(name = "合同类型", maxLength = 32, needExport = true)
@Schema(description = "合同类型", name = "contractName")
private String contractName;
......@@ -156,15 +157,12 @@ public class DispatchEmpVo implements Serializable {
* 1 固定期限
* 2 无固定期限
*/
@NotBlank(message = "签订期限不能为空")
@Length(max = 32, message = "签订期限不能超过32个字符")
@ExcelAttribute(name = "签订期限", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_CONTRACT_TYPE, needExport = true)
@Schema(description = "签订期限", name = "contractType")
private String contractType;
/**
* 合同起始时间
*/
@NotBlank(message = "合同起始时间不能为空")
@ExcelAttribute(name = "合同起始时间", needExport = true)
@Schema(description = "合同起始时间", name = "contractStart")
private Date contractStart;
......@@ -177,7 +175,6 @@ public class DispatchEmpVo implements Serializable {
/**
* 合同年限
*/
@NotBlank(message = "合同年限不能为空")
@ExcelAttribute(name = "合同年限", errorInfo = "合同年限不能为空")
@Schema(description = "合同年限", name = "contractTerm")
private String contractTerm;
......@@ -192,8 +189,6 @@ public class DispatchEmpVo implements Serializable {
/**
* 业务细分
*/
@NotBlank(message = "业务细分不能为空")
@Length(max = 32, message = "业务细分不能超过32个字符")
@ExcelAttribute(name = "业务细分", maxLength = 32, needExport = true)
@Schema(description = "业务细分(存lable)", name = "contractName")
private String contractSubName;
......@@ -203,4 +198,5 @@ public class DispatchEmpVo implements Serializable {
*/
@Schema(description ="项目状态(0正常;1已减项)")
private Integer projectStatus;
}
......@@ -200,4 +200,19 @@ public class EmpContractDispatchVo implements Serializable {
@ExcelAttribute(name = "项目", errorInfo = "项目不能为空", isOrgan = true, maxLength = 32)
@Schema(description = "项目", name = "settleDomain")
private String settleDomain;
/**
* 项目名称
*/
@Length(max = 128, message = "项目名称不能超过128个字符")
@ExcelAttribute(name = "项目名称", maxLength = 128)
@Schema(description = "项目名称", name = "subjectDepart")
private String subjectDepart;
/**
* 客户名称
*/
@Length(max = 128, message = "客户名称不能超过128个字符")
@ExcelAttribute(name = "客户名称", maxLength = 128)
@Schema(description = "客户名称", name = "subjectUnit")
private String subjectUnit;
}
......@@ -73,6 +73,12 @@ public class EmpProjectDispatchVo implements Serializable {
@ExcelAttribute(name = "项目编码",isNotEmpty = true, errorInfo = "项目编码不能为空",maxLength = 20)
private String deptNo;
/**
* 项目名称
*/
@Schema(description ="项目名称")
private String deptName;
/**
* 合同类型(字典值)
*/
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author fxj
* @Date 2022/8/1
* @Description
* @Version 1.0
*/
@Data
public class UpdateEmpVo implements Serializable {
// 员工身份认证
String empIdCard;
// 项目编码
String projectNo;
// 合同开始时间
String contractName;
}
......@@ -23,10 +23,7 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDataAuth;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchCheckVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.DispatchEmpVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpDispatchAddVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorMessageVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
......@@ -466,5 +463,14 @@ public class TEmployeeInfoController {
public EmpDispatchAddVo addDispatchInfo(@RequestBody(required = true) EmpDispatchAddVo addVo) {
return tEmployeeInfoService.addDispatchInfo(addVo);
}
/**
* @Description: 派单审核通过 更新档案 合同 项目档案审核状态
* @Author: fxj
* @Date: 2022/08/01 18:52
**/
@Operation(summary = "通过EMP_ID查询人员档案变更日志", description = "通过EMP_ID查询人员档案变更日志")
@GetMapping("/inner/updateEmpInfo")
public Boolean updateEmpInfo(@RequestBody UpdateEmpVo vo) {
return tEmployeeInfoService.updateEmpInfo(vo);
}
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.UpdateEmpVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
......@@ -143,5 +144,4 @@ public class TEmployeeLogController {
return R.ok(tEmployeeLogService.list(Wrappers.<TEmployeeLog>query().eq("PROJECT_ID", projectId)
.eq("TYPE", CommonConstants.ONE_INT).orderByDesc(CommonConstants.CREATE_TIME)));
}
}
......@@ -95,6 +95,8 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
**/
R<List<ErrorMessage>> updateContract(TEmployeeContractInfo tEmployeeContractInfo);
String getCode(boolean isNew);
/**
* @param tEmployeeContractInfo
* @Description: 审核
......
......@@ -184,4 +184,6 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
Map<String,DispatchEmpVo> getDispatchEmpVo(DispatchCheckVo checkVo);
EmpDispatchAddVo addDispatchInfo(EmpDispatchAddVo addVo);
Boolean updateEmpInfo(UpdateEmpVo vo);
}
......@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeContractConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractUpdateVO;
......@@ -75,7 +76,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private static final String EMPINFO_IS_NOT_EXITS_BYID = "未找到人员档案与项目档案!";
private final TEmployeeInfoService tEmployeeInfoService;
private final TEmployeeInfoMapper tEmployeeInfoMapper;
private final TEmployeeProjectService tEmployeeProjectService;
private final TSettleDomainService tSettleDomainService;
private final TCustomerInfoService tCustomerInfoService;
......@@ -127,7 +128,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private R<List<ErrorMessage>> setBaseInfo(TEmployeeContractInfo tEmployeeContractInfo, TEmployeeProject tEmployeeProject) {
// 获取人员档案
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(tEmployeeContractInfo.getEmpId());
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeContractInfo.getEmpId());
// 获取项目
if (tEmployeeProject == null) {
tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
......@@ -234,7 +235,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
* @Date: 2022/6/22 17:52
* @return: java.lang.String
**/
private synchronized String getCode(boolean isNew) {
@Override
public synchronized String getCode(boolean isNew) {
String nowDay = DateUtil.getThisDay();
int nowNums;
String empCode = null;
......@@ -398,7 +400,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private void updateEmployeeContractStatus(String empId) {
//查看未作废合同数
TEmployeeInfo employeeInfo = tEmployeeInfoService.getById(empId);
TEmployeeInfo employeeInfo = tEmployeeInfoMapper.selectById(empId);
if (employeeInfo != null) {
employeeInfo.setContractStatus(CommonConstants.ONE_INT);
}
......@@ -436,10 +438,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProjectService.updateById(tEmployeeProject);
}
// 更新档案、项目合同状态为(1在用)
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(contractInfo.getEmpId());
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(contractInfo.getEmpId());
if (tEmployeeInfo != null) {
tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
tEmployeeInfoService.updateById(tEmployeeInfo);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
} else {
//先停用项目内的其他的员工合同————不要这个逻辑了
......@@ -475,7 +477,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
// 更新档案、项目合同状态为(0无合同 1在用 2不在用)
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(contractInfo.getEmpId());
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(contractInfo.getEmpId());
if (tEmployeeInfo != null) {
// 判断人员有无审核通过的其他合同
TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
......@@ -488,7 +490,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} else {
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
}
tEmployeeInfoService.updateById(tEmployeeInfo);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
}
}
......
......@@ -84,7 +84,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private final TEmpEducationService tEmpEducationService;
private final TSettleDomainService tSettleDomainService;
private final TEmployeeContractInfoMapper contractMapper;
private final TEmployeeContractInfoService contractServicer;
@Override
public IPage<TEmployeeInfo> getPage(Page<TEmployeeInfo> page, TEmployeeInfo employeeInfo, String sql) {
......@@ -2083,6 +2085,54 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return addVo;
}
/**
* @Author fxj
* @Description 派单审核通过 同步人员档案 项目档案 合同状态信息
* @Date 19:30 2022/8/1
* @Param
* @return
**/
@Override
public Boolean updateEmpInfo(UpdateEmpVo vo) {
if (Common.isEmpty(vo)){
if (Common.isEmpty(vo.getEmpIdCard())){
TEmployeeInfo employeeInfo = baseMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeInfo::getEmpIdcard,vo.getEmpIdCard())
.eq(TEmployeeInfo::getStatus,CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(employeeInfo)){
employeeInfo.setStatus(CommonConstants.ONE_INT);
baseMapper.updateById(employeeInfo);
}
if (Common.isNotNull(vo.getContractName())){
TEmployeeContractInfo c = contractServicer.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getEmpIdcard,vo.getEmpIdCard())
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_INT)
.eq(TEmployeeContractInfo::getContractName,vo.getContractName())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(c)){
c.setAuditStatus(CommonConstants.TWO_INT);
contractServicer.updateById(c);
}
}
if (Common.isNotNull(vo.getProjectNo())){
TEmployeeProject p = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.ONE_STRING)
.eq(TEmployeeProject::getEmpIdcard,vo.getEmpIdCard())
.eq(TEmployeeProject::getDeptNo,vo.getProjectNo())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(p)){
tEmployeeProjectService.updateById(p);
}
}
}
}
return true;
}
private void saveContract(Map<String, EmpProjectDispatchVo> projectsMap,
Map<String, EmpContractDispatchVo> contractsMap,
Map<String, EmpAddDispatchVo> empAddsMap) {
......@@ -2112,7 +2162,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
contract.setFileTown(emp.getFileTown());
}
}
contractMapper.insert(contract);
contract.setApplyNo(contractServicer.getCode(false));
contractServicer.save(contract);
contractAdd.setId(contract.getId());
contractAdd.setEmpNo(contract.getEmpNo());
contractsMap.put(contractAdd.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + contractAdd.getDeptNo(), contractAdd);
......@@ -2129,6 +2180,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(empAddsMap)) {
EmpAddDispatchVo empAdd;
TEmployeeInfo employeeInfo;
Date date;
for (Map.Entry<String, EmpAddDispatchVo> entry : empAddsMap.entrySet()) {
empAdd = entry.getValue();
try {
......@@ -2137,6 +2189,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
BeanUtil.copyProperties(empAdd, employeeInfo);
employeeInfo.setEmpCode(getCode());
employeeInfo.setStatus(CommonConstants.ZERO_INT);
date = IdCardUtil.getBirthdate(employeeInfo.getEmpIdcard());
if (Common.isNotNull(date)) {
//初始化年龄
employeeInfo.setEmpAge(IdCardUtil.IdNOToAge(employeeInfo.getEmpIdcard()));
employeeInfo.setEmpBirthday(date);
}
employeeInfo.setEmpSex(IdCardUtil.getSex(employeeInfo.getEmpIdcard()));
baseMapper.insert(employeeInfo);
empAdd.setId(employeeInfo.getId());
empAdd.setEmpCode(employeeInfo.getEmpCode());
......
......@@ -669,7 +669,7 @@
<select id="getDispatchEmpVo" resultMap="dispatchEmpVoMap">
select
a.ID,a.EMP_CODE,a.EMP_NATRUE,a.EMP_NAME,
a.ID,a.EMP_CODE,a.EMP_NAME,
a.EMP_IDCARD,a.EMP_NATIONAL,a.EMP_PHONE,a.ID_PROVINCE,a.ID_CITY,
a.ID_TOWN,a.EMP_REGIS_TYPE,a.FILE_PROVINCE,a.FILE_CITY,a.FILE_TOWN,a.HIGN_EDUCATION,a.FILE_STATUS,
......@@ -677,9 +677,9 @@
b.CONTRACT_START,b.CONTRACT_END,b.CONTRACT_TERM,b.CONTRACT_SUB_NAME,b.CONTRACT_ID,
c.UNIT_NAME,
c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST,c.EMP_NO,c.PROJECT_STATUS
c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST,c.EMP_NO,c.PROJECT_STATUS,c.EMP_NATRUE
from (
select e.ID,e.EMP_CODE,e.EMP_NATRUE,e.EMP_NAME,e.EMP_IDCARD,e.EMP_NATIONAL,e.EMP_PHONE,e.ID_PROVINCE,e.ID_CITY,
select e.ID,e.EMP_CODE,e.EMP_NAME,e.EMP_IDCARD,e.EMP_NATIONAL,e.EMP_PHONE,e.ID_PROVINCE,e.ID_CITY,
e.ID_TOWN,e.EMP_REGIS_TYPE,e.FILE_PROVINCE,e.FILE_CITY,e.FILE_TOWN,e.HIGN_EDUCATION,e.FILE_STATUS
from t_employee_info e
where 1=1
......@@ -693,7 +693,7 @@
</if>
) a
left join (
select p.UNIT_NAME,p.UNIT_NO,p.DEPT_ID,p.DEPT_NAME,p.DEPT_NO,p.POST,p.EMP_ID,p.EMP_NO,P.PROJECT_STATUS
select p.UNIT_NAME,p.UNIT_NO,p.DEPT_ID,p.DEPT_NAME,p.DEPT_NO,p.POST,p.EMP_ID,p.EMP_NO,P.PROJECT_STATUS,p.EMP_NATRUE
from t_employee_project p
where 1=1
<if test="checkVo != null">
......
......@@ -91,6 +91,12 @@ public interface CacheConstants {
**/
String EVERYDAY_EMP_CONTRACT_CODE = "everyday_emp_contract_code";
/**
* @Description: 派单申请编码
* @Author: fxj
**/
String EVERYDAY_DISPATCH_CODE = "everyday_dispatch_code";
/**
* 区域数据--标签
*/
......
package com.yifu.cloud.plus.v1.yifu.common.core.util;
import lombok.extern.slf4j.Slf4j;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.util.regex.Pattern.compile;
/**
* 身份证处理
* @Author fxj
* @Date 2019-11-15
* @return
**/
@Slf4j
public class IdCardUtil {
public static int IdNOToAge(String IdNO){
int leh = IdNO.length();
Date dates;
SimpleDateFormat df = new SimpleDateFormat("yyyy");
String year=df.format(new Date());
dates = getBirthdate(IdNO);
int u=Integer.parseInt(year)-Integer.parseInt(df.format(dates));
return u;
}
/**
* 提取身份证中的出生日期,身份证非法则返回空
* @param idNum
* @return
*/
public static Date getBirthdate(String idNum){
Pattern idNumPattern = null;
Matcher idNumMatcher = null;
Date date = null;
//定义判别用户身份证号的正则表达式(要么是15位,要么是18位,最后一位可以为字母)
idNumPattern = compile("(\\d{14}[0-9a-zA-Z])|(\\d{17}[0-9a-zA-Z])");
//通过Pattern获得Matcher
idNumMatcher = idNumPattern.matcher(idNum);
//判断用户输入是否为身份证号
if(idNumMatcher.matches()){
Pattern birthDatePattern =null;
Matcher birthDateMather = null;
String year = null;
if(idNum.length()==18){
//如果是,定义正则表达式提取出身份证中的出生日期
birthDatePattern= compile("\\d{6}(\\d{4})(\\d{2})(\\d{2}).*");//身份证上的前6位以及出生年月日
//通过Pattern获得Matcher
birthDateMather= birthDatePattern.matcher(idNum);
}else if(idNum.length()==15){
//如果是,定义正则表达式提取出身份证中的出生日期
birthDatePattern= compile("\\d{6}(\\d{2})(\\d{2})(\\d{2}).*");//身份证上的前6位以及出生年月日
//通过Pattern获得Matcher
birthDateMather= birthDatePattern.matcher(idNum);
}
//通过Matcher获得用户的出生年月日
if(birthDateMather.find()){
if(idNum.length()==18){
year = birthDateMather.group(1);
}else if(idNum.length()==15){
year = "19"+birthDateMather.group(1);
}
String month = birthDateMather.group(2);
String datetemp = birthDateMather.group(3);
String dateStr =year+"-"+month+"-"+datetemp;
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd" );
Date shijian = null;
try {
shijian =sdf.parse(dateStr);
String temp = sdf.format(shijian);
if(dateStr.equals(temp)){
//输出用户的出生年月日
date = shijian;
}
} catch (ParseException e) {
//数据有误
}
}
}
return date;
}
/**
* 获取身份证的性别
* @Author fxj
* @Date 2019-12-25
* @param idNum
* @return
**/
public static String getSex(String idNum){
Pattern idNumPattern = null;
Matcher idNumMatcher = null;
Date date = null;
//定义判别用户身份证号的正则表达式(要么是15位,要么是18位,最后一位可以为字母)
idNumPattern = compile("(\\d{14}[0-9a-zA-Z])|(\\d{17}[0-9a-zA-Z])");
//通过Pattern获得Matcher
idNumMatcher = idNumPattern.matcher(idNum);
//判断用户输入是否为身份证号
String sex = null;
if(idNumMatcher.matches()) {
if (idNum.length() == 18) {
if (Integer.parseInt(idNum.substring(16).substring(0, 1)) % 2 == 0) {// 判断性别
sex = "2";
} else {
sex = "1";
}
} else if (idNum.length() == 15) {
if (Integer.parseInt(idNum.substring(14, 15)) % 2 == 0) {
sex = "2";
} else {
sex = "1";
}
}
}
return sex;
}
}
......@@ -183,3 +183,4 @@ emp.dispatch.settleDomain.stop=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5BF9\u5E94\u9879
......@@ -6,6 +6,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
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.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.R;
......@@ -14,6 +15,7 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -162,4 +164,27 @@ public class ArchivesDaprUtil {
}
return res;
}
/**
* @Author fxj
* @Description 派单审核通过 同步人员档案 项目档案 合同状态信息
* @Date 19:30 2022/8/1
* @Param
* @return
**/
public R<Boolean> updateEmpInfo(String empIdCard, String projectNo, String contractName){
if (Common.isEmpty(empIdCard) || Common.isEmpty(projectNo) || Common.isEmpty(contractName)){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
UpdateEmpVo vo = new UpdateEmpVo();
vo.setEmpIdCard(empIdCard);
vo.setProjectNo(projectNo);
vo.setContractName(contractName);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId()
,"/temployeeinfo/inner/updateEmpInfo" , JSON.toJSONString(vo), UpdateEmpVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("更新人员档案、项目档案、合同状态信息失败!");
}
return res;
}
}
......@@ -3,10 +3,12 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
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.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.R;
......@@ -46,4 +48,35 @@ public class CheckDaprUtil {
return res;
}
public R<Boolean> checkIdCardAndMobile(String empName, String idCard, String mobile){
if (Common.isNotNull(empName) && Common.isNotNull(idCard)){
TCheckIdCard tCheckIdCard = new TCheckIdCard();
tCheckIdCard.setIdCard(idCard);
tCheckIdCard.setName(empName);
R<TCheckIdCard> res = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(),daprCheckProperties.getAppId(),"/tcheckidcard/inner/checkIdCardSingle",JSON.toJSONString(tCheckIdCard), TCheckIdCard.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res) || Common.isEmpty(res.getData())){
return R.failed("校验身份证信息失败!");
}
TCheckIdCard checkIdCard = res.getData();
if (Common.isEmpty(checkIdCard.getIsTrue()) || CommonConstants.ZERO_INT == checkIdCard.getIsTrue().intValue()){
return R.failed(checkIdCard.getReason());
}
}
if (Common.isNotNull(mobile)){
TCheckMobile checkMobile = new TCheckMobile();
checkMobile.setMobile(mobile);
R<TCheckMobile> res = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(),daprCheckProperties.getAppId(),"/tcheckmobile/inner/checkOneMobile",JSON.toJSONString(checkMobile), TCheckMobile.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res) || Common.isEmpty(res.getData())){
return R.failed("校验手机号码信息失败!");
}
TCheckMobile cm = res.getData();
if (Common.isEmpty(cm.getStatus()) || !CommonConstants.ONE_STRING.equals(cm.getStatus())){
return R.failed(cm.getMessage());
}
}
return R.ok();
}
}
......@@ -569,9 +569,9 @@ public class InsurancesConstants {
*/
public static final String REFUND_EXPORT_FAILED = "减员办理失败";
/**
* 员工投保信息不存在
* 员工投保记录不存在
*/
public static final String USER_DATA_IS_NOT_EXIST = "员工投保信息不存在";
public static final String USER_DATA_IS_NOT_EXIST = "员工投保记录不存在";
/**
* 存在多条在保记录
......@@ -619,6 +619,20 @@ public class InsurancesConstants {
*/
public static final String DELETE_INSURANCE_TYPE_STANDARD = "删除购买标准";
/**
* 购买标准不能超过9999999.99
*/
public static final String INSURANCE_TYPE_STANDARD_MAX_ERROR = "购买标准不能超过9999999.99";
/**
* 医疗额度不能超过9999999.99
*/
public static final String MEDICAL_QUOTA_MAX_ERROR = "医疗额度不能超过9999999.99";
/**
* 身故和残疾不能超过9999999.99
*/
public static final String DIE_DISABLE_QUOTA_MAX_ERROR = "身故和残疾不能超过9999999.99";
/**
* 导入减员数据
......
......@@ -168,6 +168,15 @@ public class ValidityUtil {
if(!money.matches(ValidityConstants.POSITIVE_INTEGER_PATTERN_TWO_FLOAT)){
return Boolean.FALSE ;
}
return Boolean.TRUE;
}
/**
* 判断金额是否大于9999999.99
* @param money 金额
* @return boolean
*/
public static boolean validateMoneyMax(final String money) {
BigDecimal bigDecimalMoney= new BigDecimal(money);
boolean max = bigDecimalMoney.compareTo(CommonConstants.MONEY_MAX) >0;
if(max){
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author zhaji
* @description TODO
* @date 2022-08-01 18:11:59
*/
@Data
public class InsuranceListByIdCardVo extends TInsuranceDetail {
/**
* 购买月数
*/
@Schema(description = "购买月数")
private Long buyMonth;
}
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
......@@ -442,9 +443,8 @@ public class TInsuranceDetailController {
* @return
*/
@Operation(summary = "根据身份证查询所有的商险列表", description = "根据身份证查询所有的商险列表")
@PostMapping("/getInsuranceListByIdCard")
public R<IPage<TInsuranceDetail>> getInsuranceListByIdCard(Page<TInsuranceDetail> page,
@RequestParam String idCard) {
@GetMapping("/getInsuranceListByIdCard")
public R<IPage<InsuranceListByIdCardVo>> getInsuranceListByIdCard(Page page, String idCard) {
return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard));
}
}
......@@ -176,5 +176,5 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @date 2022-08-01
* @return
*/
IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
}
......@@ -301,6 +301,6 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param
* @return {@link R}
*/
IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard);
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -2500,7 +2499,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
List<TInsuranceRefund> refundList = new ArrayList<>();
List<TInsuranceOperate> operateList = new ArrayList<>();
for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) {
TInsuranceRefund refund = new TInsuranceRefund();
RefundErrorVo refundErrorVo = new RefundErrorVo();
......@@ -2907,7 +2905,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName).eq(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.THREE_INT)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
......@@ -2919,6 +2917,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
TInsuranceDetail one = getOne(queryWrapper);
//员工投保记录不存在
if (Common.isEmpty(one)){
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param);
......@@ -2926,11 +2925,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//当前保单信息的不是已投保状态不能导入
Integer buyHandleStatus = one.getBuyHandleStatus();
//商险待投保,无法减员
if (CommonConstants.ONE_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_ONE_ERROR);
errorList.add(param);
continue;
}
//商险投保中,无法减员
if (CommonConstants.TWO_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_TWO_ERROR);
errorList.add(param);
......@@ -3159,7 +3160,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) )
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper);
......@@ -3376,7 +3378,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
List<TInsuranceDetail> list = list(queryWrapper);
......@@ -3561,8 +3564,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
@Override
public IPage<TInsuranceDetail> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard) {
return baseMapper.getInsuranceListByIdCard(page, idCard);
public IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard) {
IPage<InsuranceListByIdCardVo> insuranceListByIdCard = baseMapper.getInsuranceListByIdCard(page, idCard);
List<InsuranceListByIdCardVo> records = insuranceListByIdCard.getRecords();
if (CollectionUtils.isNotEmpty(records)){
for (InsuranceListByIdCardVo record : records) {
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
}
insuranceListByIdCard.setRecords(records);
}
return insuranceListByIdCard;
}
}
......@@ -125,12 +125,21 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
if (!ValidityUtil.validateMoney(buyStandard)){
return R.failed("购买标准格式不正确");
}
if (!ValidityUtil.validateMoneyMax(buyStandard)){
return R.failed(InsurancesConstants.INSURANCE_TYPE_STANDARD_MAX_ERROR);
}
if (!ValidityUtil.validateMoney(medicalQuota)){
return R.failed("医疗额度格式不正确");
}
if (!ValidityUtil.validateMoneyMax(medicalQuota)){
return R.failed(InsurancesConstants.MEDICAL_QUOTA_MAX_ERROR);
}
if (!ValidityUtil.validateMoney(dieDisableQuota)){
return R.failed("身故或残疾额度格式不正确");
}
if (!ValidityUtil.validateMoneyMax(dieDisableQuota)){
return R.failed(InsurancesConstants.DIE_DISABLE_QUOTA_MAX_ERROR);
}
LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeStandard::getInsuranceTypeId,insuranceTypeStandard.getInsuranceTypeId())
.eq(TInsuranceTypeStandard::getBuyStandard,insuranceTypeStandard.getBuyStandard())
......
......@@ -763,13 +763,14 @@
</update>
<!--getInsuranceListByIdCard-->
<select id="getInsuranceListByIdCard" resultMap="BaseResultMap">
<select id="getInsuranceListByIdCard" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListByIdCardVo">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurance_detail
<where>
1=1
AND EMP_IDCARD_NO = #{idCard}
AND IS_EFFECT = 0
</where>
ORDER BY CREATE_TIME desc
</select>
......
......@@ -34,6 +34,14 @@ public class DispatchConstants {
public static final String DISPATCH_SOCIAL_REDUCE = "社保派减";
public static final String SOCIAL_RECORD_ROSTER_EXPORT = "社保花名册导出";
public static final String SOCIAL_RECORD_EXPORT = "公积金变更清册导出";
public static final String DISPATCH_PENSION = "养老、";
public static final String DISPATCH_MEDICAL = "医疗、";
public static final String DISPATCH_BIRTH = "生育、";
public static final String DISPATCH_INJURY = "工伤、";
public static final String DISPATCH_UNEMP = "失业、";
public static final String DISPATCH_BIGMAILMENT= "大病、";
public static final String DISPATCH_FUND= "公积金、";
/**
......
......@@ -566,4 +566,13 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("身份证所在地" )
private String idCardAddress;
/**
* 申请编码
*/
@ExcelAttribute(name = "申请编码")
@Schema(description = "申请编码" )
@ExcelProperty("申请编码" )
private String applyNo;
}
......@@ -62,7 +62,7 @@ public class TProvidentFund extends BaseEntity {
/**
* 公积金户名称
*/
@ExcelAttribute(name = "公积金户名称", maxLength = 32)
@ExcelAttribute(name = "公积金户名称", maxLength = 50)
@Schema(description = "公积金户名称" )
@ExcelProperty("公积金户名称" )
private String providentHouseholdName;
......@@ -247,6 +247,7 @@ public class TProvidentFund extends BaseEntity {
@Schema(description = "单边小数点 ,如:四舍五入、见角进元等" )
@ExcelProperty("单边小数点 ,如:四舍五入、见角进元等" )
private String fundPayPoint;
/**
* 流程实例ID
*/
......@@ -338,6 +339,15 @@ public class TProvidentFund extends BaseEntity {
@Schema(description = "补缴是否采用最新基数0是1否" )
@ExcelProperty("补缴是否采用最新基数0是1否" )
private String insuranceIsLatestCardinality;
/**
* 补缴政策
*/
@Length(max = 255, message = "补缴政策不能超过255个字符" )
@ExcelAttribute(name = "补缴政策", maxLength = 255)
@Schema(description = "补缴政策" )
@ExcelProperty("补缴政策" )
private String payPolicy;
/**
* 是否含当月 0:是,1:否
*/
......
......@@ -61,7 +61,7 @@ public class TSocialInfo extends BaseEntity {
/**
* 社保户名称
*/
@ExcelAttribute(name = "社保户名称", maxLength = 32)
@ExcelAttribute(name = "社保户名称", maxLength = 50)
@Schema(description = "社保户名称" )
@ExcelProperty("社保户名称" )
private String socialHouseholdName;
......@@ -568,6 +568,15 @@ public class TSocialInfo extends BaseEntity {
@Schema(description = "补缴是否采用最新基数0是1否" )
@ExcelProperty("补缴是否采用最新基数0是1否" )
private String insuranceIsLatestCardinality;
/**
* 补缴政策
*/
@Length(max = 255, message = "补缴政策不能超过255个字符" )
@ExcelAttribute(name = "补缴政策", maxLength = 255)
@Schema(description = "补缴政策" )
@ExcelProperty("补缴政策" )
private String payPolicy;
/**
* 派减办理人
*/
......
......@@ -71,19 +71,19 @@ public class FundHandleExportVo implements Serializable {
/**
* 公积金缴纳地-省
*/
@ExcelAttribute(name = "公积金缴纳地-省", maxLength = 32, isDataId = true, isArea = true, parentField = "",needExport = true)
@ExcelAttribute(name = "公积金缴纳地-省", maxLength = 32, isArea = true, needExport = true)
@ExcelProperty("公积金缴纳地-省" )
private String fundProvince;
/**
* 公积金缴纳地-市
*/
@ExcelAttribute(name = "公积金缴纳地-市", maxLength = 32, isDataId = true, isArea = true, parentField = "fundProvince",needExport = true)
@ExcelAttribute(name = "公积金缴纳地-市", maxLength = 32, isArea = true, parentField = "fundProvince",needExport = true)
@ExcelProperty("公积金缴纳地-市" )
private String fundCity;
/**
* 公积金缴纳地-县
*/
@ExcelAttribute(name = "公积金缴纳地-县", maxLength = 32, isDataId = true, isArea = true, parentField = "fundCity",needExport = true)
@ExcelAttribute(name = "公积金缴纳地-县", maxLength = 32, isArea = true, parentField = "fundCity",needExport = true)
@ExcelProperty("公积金缴纳地-县" )
private String fundTown;
/**
......@@ -131,7 +131,7 @@ public class FundHandleExportVo implements Serializable {
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户", errorInfo = "公积金户不能为空", maxLength = 32,needExport = true)
@ExcelAttribute(name = "公积金户", errorInfo = "公积金户不能为空", maxLength = 50,needExport = true)
@ExcelProperty("公积金户" )
private String providentHouseholdName;
/**
......
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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.util.DateUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @Author fxj
......@@ -178,14 +172,14 @@ public class SocialHandleExportVo implements Serializable {
@ExcelAttribute(name = "合同起始时间", errorInfo = "合同起始时间不能为空",dateFormat = DateUtil.ISO_DATE_FORMAT,needExport = true)
@Schema(description = "合同起始时间")
@ExcelProperty("合同起始时间" )
private LocalDate contractStart;
private Date contractStart;
/**
* 合同到期时间
*/
@ExcelAttribute(name = "合同到期时间",needExport = true,dateFormat = DateUtil.ISO_DATE_FORMAT)
@Schema(description = "合同到期时间")
@ExcelProperty("合同到期时间" )
private LocalDate contractEnd;
private Date contractEnd;
/**
* 创建人姓名
*/
......@@ -208,7 +202,7 @@ public class SocialHandleExportVo implements Serializable {
@ExcelAttribute(name = "缴纳类型",isDataId = true,readConverterExp = "0=最低缴纳,1=自定义,2=最高缴纳",needExport = true)
@Schema(description = "缴纳类型(0最低缴纳、1自定义、2最高缴纳)")
@ExcelProperty("缴纳类型" )
private Integer paymentType;
private String paymentType;
/**
* 社保户
*/
......@@ -222,28 +216,28 @@ public class SocialHandleExportVo implements Serializable {
@ExcelAttribute(name = "社保缴纳地-省", maxLength = 32, isDataId = true, isArea = true, parentField = "",needExport = true)
@Schema(description = "社保缴纳地-省")
@ExcelProperty("社保缴纳地-省" )
private Integer socialProvince;
private String socialProvince;
/**
* 缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市", maxLength = 32, isDataId = true, isArea = true, parentField = "socialProvince",needExport = true)
@Schema(description = "社保缴纳地-市")
@ExcelProperty("社保缴纳地-市" )
private Integer socialCity;
private String socialCity;
/**
* 缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县", maxLength = 32, isDataId = true, isArea = true, parentField = "socialCity",needExport = true)
@Schema(description = "社保缴纳地-县")
@ExcelProperty("社保缴纳地-县" )
private Integer socialTown;
private String socialTown;
/**
* 养老起缴日期
*/
@ExcelAttribute(name = "养老起缴日期", needExport = true)
@Schema(description="养老起缴日期")
@ExcelProperty("养老起缴日期" )
private LocalDateTime pensionStart;;
private Date pensionStart;;
/**
* 养老基数
......@@ -259,7 +253,7 @@ public class SocialHandleExportVo implements Serializable {
@ExcelAttribute(name = "医疗起缴日期", needExport = true)
@Schema(description="医疗起缴日期")
@ExcelProperty("医疗起缴日期" )
private LocalDateTime medicalStart;
private Date medicalStart;
/**
* 医疗基数
*/
......@@ -273,7 +267,7 @@ public class SocialHandleExportVo implements Serializable {
@ExcelAttribute(name = "失业起缴日期", needExport = true)
@Schema(description="失业起缴日期")
@ExcelProperty("失业起缴日期" )
private LocalDateTime unemployStart;
private Date unemployStart;
/**
* 失业基数
*/
......@@ -287,7 +281,7 @@ public class SocialHandleExportVo implements Serializable {
@ExcelAttribute(name = "工伤起缴日期", needExport = true)
@Schema(description="工伤起缴日期")
@ExcelProperty("工伤起缴日期" )
private LocalDateTime workInjuryStart;
private Date workInjuryStart;
/**
* 工伤基数
*/
......@@ -301,7 +295,7 @@ public class SocialHandleExportVo implements Serializable {
@ExcelAttribute(name = "生育起缴日期", needExport = true)
@Schema(description="生育起缴日期")
@ExcelProperty("生育起缴日期" )
private LocalDateTime birthStart;
private Date birthStart;
/**
* 生育基数
*/
......@@ -315,7 +309,7 @@ public class SocialHandleExportVo implements Serializable {
@ExcelAttribute(name = "大病起缴日期", needExport = true)
@Schema(description="大病起缴日期")
@ExcelProperty("大病起缴日期" )
private LocalDateTime bigailmentStart;
private Date bigailmentStart;
/**
* 大病缴纳基数
*/
......
......@@ -257,8 +257,8 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 社保户
*/
@Length(max = 32, message = "社保户 不能超过32个字符" )
@ExcelAttribute(name = "社保户", maxLength = 32)
@Length(max = 50, message = "社保户 不能超过50个字符" )
@ExcelAttribute(name = "社保户", maxLength = 50)
@Schema(description = "社保户" )
@ExcelProperty("社保户" )
private String socialHousehold;
......@@ -362,8 +362,8 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 公积金户
*/
@Length(max = 32, message = "公积金户 不能超过32 个字符" )
@ExcelAttribute(name = "公积金户", maxLength = 32)
@Length(max = 50, message = "公积金户 不能超过50 个字符" )
@ExcelAttribute(name = "公积金户", maxLength = 50)
@Schema(description = "公积金户" )
@ExcelProperty("公积金户" )
private String providentHousehold;
......
......@@ -93,12 +93,12 @@ public class TDispatchInfoExportVo {
@ExcelProperty("派单项")
private String dispatchItem;
@ExcelAttribute(name = "社保户", maxLength = 32)
@ExcelAttribute(name = "社保户", maxLength = 50)
@Schema(description = "社保户")
@ExcelProperty("社保户")
private String socialHouseholdName;
@ExcelAttribute(name = "公积金户", maxLength = 32)
@ExcelAttribute(name = "公积金户", maxLength = 50)
@Schema(description = "公积金户")
@ExcelProperty("公积金户")
private String providentHouseholdName;
......
......@@ -39,7 +39,7 @@ public class TDispatchInfoPageVo extends TDispatchInfo {
/**
* 社保户名称
*/
@ExcelAttribute(name = "社保户名称", maxLength = 32)
@ExcelAttribute(name = "社保户名称", maxLength = 50)
@Schema(description = "社保户名称" )
@ExcelProperty("社保户名称" )
private String socialHouseholdName;
......@@ -47,7 +47,7 @@ public class TDispatchInfoPageVo extends TDispatchInfo {
/**
* 公积金户名称
*/
@ExcelAttribute(name = "公积金户名称", maxLength = 32)
@ExcelAttribute(name = "公积金户名称", maxLength = 50)
@Schema(description = "公积金户名称" )
@ExcelProperty("公积金户名称" )
private String providentHouseholdName;
......
......@@ -70,7 +70,7 @@ public class TDispatchInfoSearchVo extends TDispatchInfo {
/**
* 社保户名称
*/
@ExcelAttribute(name = "社保户名称", maxLength = 32)
@ExcelAttribute(name = "社保户名称", maxLength = 50)
@Schema(description = "社保户名称" )
@ExcelProperty("社保户名称" )
private String socialHouseholdName;
......@@ -78,7 +78,7 @@ public class TDispatchInfoSearchVo extends TDispatchInfo {
/**
* 公积金户名称
*/
@ExcelAttribute(name = "公积金户名称", maxLength = 32)
@ExcelAttribute(name = "公积金户名称", maxLength = 50)
@Schema(description = "公积金户名称" )
@ExcelProperty("公积金户名称" )
private String providentHouseholdName;
......
......@@ -288,8 +288,8 @@ public class TDispatchInfoController {
//@PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_addApplyHandle')")
public R<List<ErrorMessage>> addApplyHandle(@RequestParam(name = "ids", required = true) String ids,
@RequestParam(name = "typeSub", required = true) String typeSub,
@RequestParam(name = "auditStatus", required = true) String handleStatus,
@RequestParam(name = "auditRemark", required = false) String handleRemark,
@RequestParam(name = "handleStatus", required = true) String handleStatus,
@RequestParam(name = "handleRemark", required = false) String handleRemark,
@RequestParam(name = "socialType", required = false) String socialType) {
return tDispatchInfoService.addApplyHandle(ids,typeSub,handleStatus,handleRemark,socialType);
}
......@@ -304,7 +304,7 @@ public class TDispatchInfoController {
@PostMapping("/doexportSocialRecordRoster")
@Operation(description = "导出社保花名册 hasPermission('wxhr:tdispatchinfo_doexportSocialRecordRoster')")
@SysLog("导出社保花名册信息")
@PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_doexportSocialRecordRoster')")
//@PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_doexportSocialRecordRoster')")
public void doexportSocialRecordRoster(HttpServletResponse response, HttpServletRequest request,
@RequestParam(name = "idStr", required = false) String idStr,
@RequestBody String[] exportFields, SocialHandleSearchVo searchVo) {
......
......@@ -53,6 +53,7 @@ public class TPaymentInfoController {
/**
* 简单分页查询
*
* @param page 分页对象
* @param tPaymentInfo 缴费库
* @return
......@@ -60,61 +61,65 @@ public class TPaymentInfoController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TPaymentInfo>> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
return new R<>(tPaymentInfoService.getTPaymentInfoPage(page,tPaymentInfo));
return new R<>(tPaymentInfoService.getTPaymentInfoPage(page, tPaymentInfo));
}
/**
* 通过id查询缴费库
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R<TPaymentInfo> getById(@PathVariable("id" ) String id) {
@GetMapping("/{id}")
public R<TPaymentInfo> getById(@PathVariable("id") String id) {
return R.ok(tPaymentInfoService.getById(id));
}
/**
* 修改缴费库
*
* @param tPaymentInfo 缴费库
* @return R
*/
@Operation(summary = "修改缴费库", description = "修改缴费库:hasPermission('social_tpaymentinfo_edit')")
@SysLog("修改缴费库" )
@SysLog("修改缴费库")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_edit')" )
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_edit')")
public R<Boolean> updateById(@RequestBody TPaymentInfo tPaymentInfo) {
return R.ok(tPaymentInfoService.updateById(tPaymentInfo));
}
/**
* 通过id删除缴费库
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除缴费库", description = "通过id删除缴费库:hasPermission('social_tpaymentinfo_del')")
@SysLog("通过id删除缴费库" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')" )
@SysLog("通过id删除缴费库")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')")
public R removeById(@PathVariable String id) {
return tPaymentInfoService.removeInFoById(id);
}
/**
* 通过ids删除一条记录
*
* @param ids
* @return R
*/
@Operation(summary = "通过ids删除缴费库", description = "通过ids删除缴费库:hasPermission('social_tpaymentinfo_del')")
@Operation(summary = "通过ids删除缴费库", description = "通过ids删除缴费库")
@SysLog("删除缴费库")
@DeleteMapping("/removeBatchByIds")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_del')")
public R<Boolean> removeBatchByIds(String ids) {
return tPaymentInfoService.removeAllInfoById(ids);
}
/**
* 通过id查询单条记录(包含明细)
*
* @param id
* @return R
*/
......@@ -126,6 +131,7 @@ public class TPaymentInfoController {
/**
* 省市社保 批量导入
*
* @author huyc
* @date 2022-07-22
**/
......@@ -134,12 +140,13 @@ public class TPaymentInfoController {
@SysLog("批量新增缴费库")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_batchImport')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, @RequestParam String random){
return tPaymentInfoService.importSocialDiy(file.getInputStream(),random);
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file, @RequestParam String random) {
return tPaymentInfoService.importSocialDiy(file.getInputStream(), random);
}
/**
* 导入省市社保-合肥三险
*
* @author huyc
* @date 2022-07-22
**/
......@@ -148,12 +155,13 @@ public class TPaymentInfoController {
@SysLog("批量新增缴费库-合肥三险")
@PostMapping("/importListSocialHeFei")
public R<List<ErrorMessage>> importListSocialHeFei(@RequestBody MultipartFile file, @RequestParam String random,
@RequestParam(value = "type") String type){
return tPaymentInfoService.importSocialHeFeiDiy(file.getInputStream(),random,type);
@RequestParam(value = "type") String type) {
return tPaymentInfoService.importSocialHeFeiDiy(file.getInputStream(), random, type);
}
/**
* 导入公积金
*
* @author huyc
* @date 2022-07-27
**/
......@@ -162,12 +170,13 @@ public class TPaymentInfoController {
@SysLog("导入公积金")
@PostMapping("/batchImportPaymentFundInfo")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_batchImport')")
public R<List<ErrorMessage>> importListFund(@RequestBody MultipartFile file){
public R<List<ErrorMessage>> importListFund(@RequestBody MultipartFile file) {
return tPaymentInfoService.batchImportPaymentFundInfo(file.getInputStream());
}
/**
* 缴费库 批量导出
*
* @author huyc
* @date 2022-07-22
**/
......@@ -175,7 +184,28 @@ public class TPaymentInfoController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
public void export(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
tPaymentInfoService.listExport(response,searchVo);
tPaymentInfoService.listExport(response, searchVo);
}
/**
* 根据条件批量删除
*
* @param empIdCard 员工身份证
* @param socialHouseId 社保户
* @param fundHouseId 公积金户
* @param socialCreateMonth 生成月份
* @param socialPayMonth 缴纳月份
* @return R
*/
@Operation(description = "根据条件批量删除")
@SysLog("根据条件批量删除")
@PostMapping("/removeBatchByIdsAndType")
public R removeBatchByIdsAndType(@RequestParam(name = "empIdCard", required = false) String empIdCard,
@RequestParam(name = "socialHouseId", required = false) String socialHouseId,
@RequestParam(name = "fundHouseId", required = false) String fundHouseId,
@RequestParam(name = "socialCreateMonth", required = false) String socialCreateMonth,
@RequestParam(name = "socialPayMonth", required = false) String socialPayMonth) {
return tPaymentInfoService.removeBatchByInfo(empIdCard, socialHouseId,
fundHouseId, socialCreateMonth, socialPayMonth);
}
}
......@@ -134,4 +134,5 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
@Param("settleDomainIds")List<String> settleDomainIds,
@Param("idsStr") List<String> idsStr,
@Param("sql") String sql);
String getMaxDispatchCode();
}
......@@ -83,7 +83,7 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo);
/**
* @Description: 基数变更,同步社保公积金查询、预估库 TODO-加定时器
* @Description: 基数变更,同步社保公积金查询、预估库
* @Author: hgw
* @Date: 2022/7/26 19:09
* @return: void
......
......@@ -99,4 +99,18 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
**/
R getAllInfoById(String id);
/**
* 根据条件批量删除
* @Author huyc
* @Date 2022-07-29
* @param empIdCard 员工身份证
* @param socialHouseId 社保户
* @param fundHouseId 公积金户
* @param socialCreateMonth 生成月份
* @param socialPayMonth 缴纳月份
* @return
**/
R removeBatchByInfo(String empIdCard, String socialHouseId, String fundHouseId,
String socialCreateMonth, String socialPayMonth);
}
......@@ -31,27 +31,33 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
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.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CheckDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.constants.DispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -87,6 +93,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private final TAuditInfoMapper auditInfoMapper;
@Autowired
private CacheManager cacheManager;
@Autowired
private final CheckDaprUtil checkDaprUtil;
private final TForecastLibraryService forecastLibraryService;
/**
* 派单信息记录表简单分页查询
*
......@@ -363,7 +377,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
// 新增派单信息
initDispatchAddInfo(user, dispatchMap, empVo, socialSet, fundSet, excel);
initDispatchAddInfo(user, dispatchMap, empVo, socialSet, fundSet, excel,socialFund);
// 变更社保公积金查询
initSocialFundAddInfo(socialFundAddMap, empVo, socialSet, fundSet, setInfoVo, socialFund, excel);
}
......@@ -417,7 +431,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
EmpAddDispatchVo emp = null;
TSocialInfo social = null;
TProvidentFund fund = null;
TSocialFundInfo socialFund;
TSocialFundInfo socialFund = null;
TDispatchInfo dispatch = null;
if (Common.isNotNull(res) && Common.isNotNull(res.getData())){
empAddsMap = res.getData().getEmpAddsMap();
......@@ -491,6 +505,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
initSocialFundAndInsert(emp, social, fund, socialFund,project);
}
// 生成预付数据
if (Common.isNotNull(socialFund) && Common.isNotNull(socialFund.getId())){
forecastLibraryService.updateForecastLibaryByDispatch(socialFund);
}
}catch (Exception e){
log.error("派单新增异常:", e);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "派单新增异常:"+e.getMessage()));
......@@ -527,7 +545,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private void insertDispatch(EmpAddDispatchVo emp, TDispatchInfo dispatch) {
if (Common.isNotNull(dispatch)){
if (Common.isNotNull(emp)){
dispatch.setEmpNo(emp.getEmpCode());
dispatch.setEmpId(emp.getId());
dispatch.setSettleDomainCode(emp.getDeptNo());
dispatch.setSettleDomain(emp.getDeptId());
......@@ -648,7 +665,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalProvidentPer(fund.getPersonalProvidentPer());
socialFund.setProvidentStart(fund.getProvidentStart());
socialFund.setFundPayPoint(fund.getFundPayPoint());
socialFund.setPayPolicy(fund.getFundPayPoint());
socialFund.setTrustRemarkFund(fund.getTrustRemark());
socialFund.setCanOverpayFund(fund.getCanOverpay());
socialFund.setOverpayNumberFund(fund.getOverpayNumber());
......@@ -736,6 +752,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setLowerLimitFund(fundSet.getLowerLimit());
socialFund.setUpperLimitFund(fundSet.getUpperLimit());
socialFund.setPayPolicyFund(fundSet.getPayPolicy());
socialFund.setFundPayPoint(Common.isNotNullToStr(fundSet.getFundPayPoint()));
socialFund.setLatestCardinalityFund(fundSet.getInsuranceIsLatestCardinality());
}
}
......@@ -751,15 +768,59 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
return new HashMap<>();
}
/**
* @param
* @Description: 获取 申请编码
* @Author: fxj
* @Date: 2022-08-01 15:01
* @return: java.lang.String
**/
private synchronized String getApplyCode() {
String nowDay = DateUtil.getThisDay();
Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_DISPATCH_CODE);
Object nowNumObj = cache.get(nowDay);
int nowNums = 1;
if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1;
} else {
String code = null;
try {
code = baseMapper.getMaxDispatchCode();
nowNums = Integer.parseInt(code) + 1;
} catch (NumberFormatException e) {
log.error("获取申请编码当日最大编码时出错:" + code);
nowNums = 1;
}
}
cache.put(nowDay, nowNums);
return "PD" + nowDay + this.getFourNum(String.valueOf(nowNums));
}
/**
* @param nowNums 数字
* @Description: 获取四位字符型数字
* @Author: fxj
**/
private String getFourNum(String nowNums) {
if (nowNums.length() >= 4) {
return nowNums.substring(0, 4);
}
String[] zeroArr = {"0", "00", "000"};
int num = 3 - nowNums.length();
return zeroArr[num] + nowNums;
}
private void initDispatchAddInfo(YifuUser user,
Map<String, TDispatchInfo> dispatchMap,
DispatchEmpVo empVo,
SysBaseSetInfo socialSet,
SysBaseSetInfo fundSet,
TDispatchImportVo excel) {
TDispatchImportVo excel,
TSocialFundInfo socialFund) {
TDispatchInfo dispatch;
dispatch = new TDispatchInfo();
// 初始化派单项
initAddHandleItem(excel, socialFund,dispatch);
dispatch.setOrganName(user.getDeptName());
dispatch.setCreateBy(user.getId());
dispatch.setCreateTime(LocalDateTime.now());
......@@ -804,7 +865,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setContractTerm(excel.getContractTerm());
dispatch.setContractType(excel.getContractType());
dispatch.setWorkingHours(excel.getWorkingHours());
// 派单项信息封装 TODO
// 封装客户信息
if (Common.isNotNull(empVo)){
......@@ -830,9 +890,78 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
// 生成申请编码
dispatch.setApplyNo(getApplyCode());
dispatchMap.put(excel.getEmpIdcard(),dispatch);
}
private void initAddHandleItem(TDispatchImportVo excel, TSocialFundInfo socialFund, TDispatchInfo dispatch) {
StringBuffer temp = new StringBuffer();
if (Common.isEmpty(socialFund)){
if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isNotNull(excel.getPensionStart())){
temp.append(DispatchConstants.DISPATCH_PENSION);
}
if (Common.isNotNull(excel.getMedicalStart())){
temp.append(DispatchConstants.DISPATCH_MEDICAL);
}
if (Common.isNotNull(excel.getBirthStart())){
temp.append(DispatchConstants.DISPATCH_BIRTH);
}
if (Common.isNotNull(excel.getWorkInjuryStart())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
if (Common.isNotNull(excel.getUnemployStart())){
temp.append(DispatchConstants.DISPATCH_UNEMP);
}
if (Common.isNotNull(excel.getBigailmentStart())){
temp.append(DispatchConstants.DISPATCH_BIGMAILMENT);
}
}
if (Common.isNotNull(excel.getProvidentHousehold())){
temp.append(DispatchConstants.DISPATCH_FUND);
}
}
if (Common.isNotNull(socialFund)){
if (Common.isNotNull(excel.getSocialHousehold())){
// 办理失败或已派减 视为可派增
if (CommonConstants.TWO_STRING.equals(socialFund.getPensionHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getPensionHandle())){
temp.append(DispatchConstants.DISPATCH_PENSION);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getMedicalHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getMedicalHandle())){
temp.append(DispatchConstants.DISPATCH_MEDICAL);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getWorkInjuryHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getWorkInjuryHandle())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getBirthHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBirthHandle())){
temp.append(DispatchConstants.DISPATCH_BIRTH);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getUnemployHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getUnemployHandle())){
temp.append(DispatchConstants.DISPATCH_UNEMP);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getBigailmentHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBigailmentHandle())){
temp.append(DispatchConstants.DISPATCH_BIGMAILMENT);
}
}
//公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败9 审核不通过)、派减(5待审核 6待办理 7 办理成功 8 办理失败 )
if (Common.isNotNull(excel.getProvidentHousehold())
&& (CommonConstants.FOUR_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.NINE_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.EIGHT_STRING.equals(socialFund.getFundStatus())
)){
temp.append(DispatchConstants.DISPATCH_FUND);
}
}
dispatch.setDispatchItem(temp.toString());
}
private boolean initFundAddInfo(List<ErrorMessage> errorMessageList,
Map<String, TProvidentFund> funds,
DispatchEmpVo empVo, SysBaseSetInfo fundSet,
......@@ -868,6 +997,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fund.setCanOverpay(fundSet.getCanOverpay());
fund.setOverpayNumber(fundSet.getOverpayNumber());
fund.setFundBaseSetId(fundSet.getId());
fund.setPayPolicy(fundSet.getPayPolicy());
if (Common.isNotNull(fundSet.getProvince())){
fund.setFundProvince(Integer.toString(fundSet.getProvince()));
}
......@@ -1009,6 +1139,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
social.setIsIllness(socialSet.getIsIllness());
social.setOverpayNumber(socialSet.getOverpayNumber());
social.setValueType(socialSet.getValueType());
social.setPayPolicy(socialSet.getPayPolicy());
// 比例初始化
social.setPersonalPensionPer(socialSet.getPersonalPersionPro());
social.setPersonalMedicalPer(socialSet.getPersonalMedicalPro());
......@@ -1204,6 +1335,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
contract.setSettleDomain(setInfoVo.getId());
contract.setDeptNo(setInfoVo.getDepartNo());
contract.setCustomerId(setInfoVo.getCustomerId());
contract.setSubjectUnit(setInfoVo.getCustomerName());
contract.setSubjectDepart(setInfoVo.getDepartName());
if (Common.isNotNull(empVo)) {
contract.setEmpId(empVo.getId());
contract.setEmpNo(empVo.getEmpNo());
......@@ -1240,6 +1373,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
project.setEmpNo(empVo.getEmpNo());
}
if (Common.isNotNull(setInfoVo)){
project.setDeptName(setInfoVo.getDepartName());
project.setBusinessPrimaryType(setInfoVo.getBusinessPrimaryType());
project.setBusinessSecondType(setInfoVo.getBusinessSecondType());
project.setBusinessThirdType(setInfoVo.getBusinessThirdType());
......@@ -1402,6 +1536,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isEmpty(excel.getContractName()) && validContractInfo(errorMessageList,excel,empVo)){
return true;
}
// 如果没有人员档案和项目档案的时候校验身份证和手机号码
R<Boolean> checkRes = checkDaprUtil.checkIdCardAndMobile(excel.getEmpName(),excel.getEmpIdcard(),excel.getEmpMobile());
if (Common.isEmpty(checkRes) || checkRes.getCode() != CommonConstants.SUCCESS){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), checkRes.getMsg()));
return true;
}
}
/*项目档案有可用状态的合同:
不对合同做判断,取值:项目档案的合同;
......@@ -1639,7 +1779,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
private boolean validSocialStartDate(List<ErrorMessage> errorMessageList, TDispatchImportVo excel, SysBaseSetInfo socialSet) {
if (Common.isNotNull(socialSet) && CommonConstants.ONE_STRING.equals(excel.getPaymentType())){
if (ServiceUtil.checkDispatchDate(LocalDateTimeUtils.convertDateToLDT(excel.getPensionStart()),
socialSet.getCanOverpay(), socialSet.getOverpayNumber(), socialSet.getHaveThisMonth())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
......@@ -1670,7 +1809,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_START_IS_ERROR)));
return true;
}
}
return false;
}
......@@ -1832,6 +1970,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setDeleteFlag(CommonConstants.ZERO_STRING);
dispatch.setReduceReason(excel.getReasonType());
dispatch.setTrustRemark(excel.getTrustRemark());
StringBuffer temp = new StringBuffer();
if (Common.isNotNull(excel.getSocialReduceDate())){
dispatch.setSocialHandleStatus(CommonConstants.ZERO_STRING);
dispatch.setSocialId(socialFund.getSocialId());
......@@ -1843,6 +1982,25 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setSocialReduceDate(excel.getSocialReduceDate());
socialFund.setSocialReduceStatus(CommonConstants.ZERO_STRING);
socialFund.setSocialStatus(CommonConstants.SIX_STRING);
// 养老办理状态:0待办理1办理成功2办理失败3已派减
if (CommonConstants.ONE_STRING.equals(socialFund.getPensionHandle())){
temp.append(DispatchConstants.DISPATCH_PENSION);
}
if (CommonConstants.ONE_STRING.equals(socialFund.getMedicalHandle())){
temp.append(DispatchConstants.DISPATCH_MEDICAL);
}
if (CommonConstants.ONE_STRING.equals(socialFund.getWorkInjuryHandle())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
if (CommonConstants.ONE_STRING.equals(socialFund.getBirthHandle())){
temp.append(DispatchConstants.DISPATCH_BIRTH);
}
if (CommonConstants.ONE_STRING.equals(socialFund.getUnemployHandle())){
temp.append(DispatchConstants.DISPATCH_UNEMP);
}
if (CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())){
temp.append(DispatchConstants.DISPATCH_BIGMAILMENT);
}
}
if (Common.isNotNull(excel.getFundReduceDate())){
dispatch.setFundHandleStatus(CommonConstants.ZERO_STRING);
......@@ -1854,7 +2012,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setFundReduceDate(excel.getFundReduceDate());
socialFund.setFundStatus(CommonConstants.FIVE_STRING);
socialFund.setFundReduceStatus(CommonConstants.ZERO_STRING);
// 公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败9 审核不通过)、派减(5待审核 6待办理 7 办理成功 8 办理失败 )
if (CommonConstants.THREE_STRING.equals(socialFund.getFundStatus())){
temp.append(DispatchConstants.DISPATCH_FUND);
}
}
dispatch.setDispatchItem(temp.toString());
dispatch.setBelongUnitName(socialFund.getUnitName());
dispatch.setBelongUnit(socialFund.getUnitId());
if (Common.isNotNull(empVo)){
......@@ -2055,14 +2218,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 待办理
sf.setSocialAddStatus(CommonConstants.ONE_STRING);
sf.setSocialStatus(CommonConstants.ONE_STRING);
// 要更新 人员档案 项目档案 合同的状态信息
archivesDaprUtil.updateEmpInfo(dis.getEmpIdcard(),dis.getSettleDomainCode(),dis.getContractName());
//派增审核不通过 需要处理预估数据
} else if (CommonConstants.ONE_INT == flag.intValue()) {
socialInfo.setDeleteFlag(CommonConstants.ONE_STRING);
// 作废更新:社保状态、同步预估数据 审核不通过直接作废 TODO 预估数据
// 作废更新:社保状态、同步预估数据 审核不通过直接作废
socialInfo.setAuditStatus(CommonConstants.TWO_STRING);
socialInfo.setDeleteFlag(CommonConstants.ONE_STRING);
sf.setSocialAddStatus(CommonConstants.FIVE_STRING);
sf.setSocialStatus(CommonConstants.TEN_STRING);
// 更新预估数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf);
}
socialInfo.setAuditTime(now);
socialInfo.setAuditUser(user.getId());
......@@ -2107,11 +2274,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setFundStatus(CommonConstants.ONE_STRING);
// 审核不通过
} else if (CommonConstants.ONE_INT == flag.intValue()) {
// 作废更新:公积金状态、同步档案的公积金状态、同步预估数据 TODO
// 作废更新:公积金状态、同步档案的公积金状态、同步预估数据
providentFund.setAuditStatus(CommonConstants.TWO_STRING);
providentFund.setDeleteFlag(CommonConstants.ONE_STRING);
sf.setFundAddStatus(CommonConstants.FOUR_STRING);
sf.setFundStatus(CommonConstants.NINE_STRING);
// 更新预估数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf);
}
providentFund.setAuditTime(now);
providentFund.setAuditUser(user.getId());
......@@ -2124,7 +2293,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setFundStatus(CommonConstants.EIGHT_STRING);
// 审核不通过
} else if (CommonConstants.ONE_INT == flag.intValue()) {
// 作废更新:公积金状态、同步档案的公积金状态、同步预估数据 TODO
// 作废更新:公积金状态、同步档案的公积金状态
sf.setFundReduceStatus(CommonConstants.ONE_STRING_NEGATE);
sf.setFundStatus(CommonConstants.THREE_STRING);
}
......@@ -2283,7 +2452,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TSocialInfo socialInfo = null;
TProvidentFund providentFund = null;
TAuditInfo auditInfo = null;
StringBuilder socialTypeRemark = null;
StringBuilder socialTypeRemark = new StringBuilder();
TSocialFundInfo sf = null;
Date now = new Date();
StringBuffer temp = new StringBuffer();
......@@ -2304,7 +2473,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isEmpty(socialTypeRemark.toString())
&& CommonConstants.ZERO_STRING.equals(typeSub)
&& CommonConstants.ZERO_STRING.equals(dis.getType())
&& Common.isNotNull(socialType)) {
&& Common.isEmpty(socialType)) {
continue;
}
socialInfo = socialMapper.selectById(dis.getSocialId());
......@@ -2330,7 +2499,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf);
// 派增办理,全部失败,清空社保状态
if (CommonConstants.TWO_STRING.equals(socialInfo.getHandleStatus())) {
// 同步预估库数据 TODO
// 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf);
}
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
......@@ -2349,7 +2519,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
initAuditInfo(auditInfo, ( temp + handleRemark), handleStatus, user, temp.toString());
}
dis.setSocialHandleStatus(socialInfo.getHandleStatus());
auditInfo.setSocialId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保派增派单数据:" + dis.getEmpName()));
......@@ -2373,7 +2542,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[1]);
sf.setFundAddStatus(CommonConstants.THREE_STRING);
sf.setFundStatus(CommonConstants.FOUR_STRING);
// 同步预估库数据 TODO
// 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf);
}
fundMapper.updateById(providentFund);
dis.setFundHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
......@@ -2406,7 +2576,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
sf.setSocialReduceStatus(CommonConstants.TWO_STRING);
sf.setSocialStatus(CommonConstants.EIGHT_STRING);
// 同步预估库数据 TODO
// 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf);
}
if (CommonConstants.ONE_INT == flag) {
//派减办理不通过
......@@ -2455,7 +2626,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
sf.setFundReduceStatus(CommonConstants.TWO_STRING);
sf.setFundStatus(CommonConstants.SEVEN_STRING);
// 派减办理成功后,同步预估库数据清理 TODO
// 派减办理成功后,同步预估库数据清理
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf);
}
if (CommonConstants.ONE_INT == flag) {
//派减办理不通过
......@@ -2480,40 +2652,43 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
}
}
//更新派单状态
if (Common.isNotNull(auditInfo)) {
//派增判断
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
if (Common.isNotNull(socialInfo) && Common.isNotNull(providentFund)
&& (CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.ZERO_STRING.equals(providentFund.getHandleStatus())
)) {
} else {
if ((Common.isEmpty(dis.getSocialHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())))
&& (Common.isEmpty(dis.getSocialHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus()) || CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())))) {
//办理成功 更新为办理完结 2020-05-26 办理失败 更新为办理完结 2020-05-26
if ((CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus()))
&& ((CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus())))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getSocialHandleStatus())
&& ((CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus())))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if ((CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus()))
&& Common.isEmpty(dis.getFundHandleStatus())) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
//派减判断
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
if (null != socialInfo && null != providentFund && (
((CommonConstants.ONE_STRING.equals(socialInfo.getHandleStatus()) || CommonConstants.FIVE_STRING.equals(socialInfo.getHandleStatus())) && CommonConstants.ONE_STRING.equals(socialInfo.getReduceCan()))
|| (CommonConstants.ONE_STRING.equals(providentFund.getHandleStatus()) && CommonConstants.ONE_STRING.equals(providentFund.getReduceCan()))
)) {
//同时有社保和公积金的只要有一条没办理就不改派单状态
} else {
if (CommonConstants.ZERO_INT == flag || CommonConstants.ONE_INT == flag) {
if ( !((Common.isNotNull(socialInfo)
&& CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus()))
|| (Common.isEmpty(providentFund)
&& CommonConstants.ZERO_STRING.equals(providentFund.getHandleStatus())))
) {
//办理成功或失败 更新为办理完结 2020-05-26
dis.setStatus(CommonConstants.FOUR_STRING);
}
}
}
if (CommonConstants.ZERO_INT == flag) {
auditInfo.setAuditStatus(CommonConstants.SIX_STRING);
} else if (CommonConstants.ONE_INT == flag) {
......@@ -2528,8 +2703,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} else {
errorList.add(new ErrorMessage(-1, "派单数据错误!"));
}
}
}
} catch(Exception e){
log.error("派单办理异常:", e);
......@@ -2633,37 +2806,37 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 有对应办理项且 对应项为待办理或者空时更新 下同
if (socialType.indexOf(CommonConstants.ONE_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getPensionHandle()))){
|| CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle()))){
socialInfo.setPensionHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setPensionHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.TEN_STRING) > CommonConstants.ZERO_INT
if (socialType.indexOf(CommonConstants.TWO_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getMedicalHandle()))){
|| CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle()))){
socialInfo.setMedicalHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setMedicalHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.THREE_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getUnemployHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getUnemployHandle()))){
|| CommonConstants.ZERO_STRING.equals(socialInfo.getUnemployHandle()))){
socialInfo.setUnemployHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setUnemployHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.FOUR_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getWorkInjuryHandle()))){
|| CommonConstants.ZERO_STRING.equals(socialInfo.getWorkInjuryHandle()))){
socialInfo.setWorkInjuryHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setWorkInjuryHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.FIVE_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getBirthHandle()))){
|| CommonConstants.ZERO_STRING.equals(socialInfo.getBirthHandle()))){
socialInfo.setBirthHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setBirthHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.SIX_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getBigailmentHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getBigailmentHandle()))){
|| CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle()))){
socialInfo.setBigailmentHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setBigailmentHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
......@@ -2791,7 +2964,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, SocialHandleExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
......@@ -2806,7 +2979,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build();
WriteSheet writeSheet = EasyExcel.writerSheet(DispatchConstants.SOCIAL_RECORD_ROSTER_EXPORT+index).build();
excelWriter.write(list,writeSheet);
index++;
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
......@@ -2817,7 +2990,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
excelWriter.finish();
}else {
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build();
WriteSheet writeSheet = EasyExcel.writerSheet(DispatchConstants.SOCIAL_RECORD_ROSTER_EXPORT+index).build();
excelWriter.write(list,writeSheet);
excelWriter.finish();
}
......@@ -2903,7 +3076,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, FundHandleExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
......
......@@ -1436,6 +1436,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
for (TSocialFundInfo socialFundInfo : socialFundInfoMap.values()) {
this.updateForecastLibaryCore(socialFundInfo, null);
socialFundInfoMapper.updateById(socialFundInfo);
}
}
}
......
......@@ -17,16 +17,20 @@ package com.yifu.cloud.plus.v1.yifu.social.service.impl;/*
import cn.hutool.core.collection.CollUtil;
import com.alibaba.excel.read.listener.ReadListener;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
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.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept;
import com.yifu.cloud.plus.v1.yifu.social.concurrent.threadpool.YFSocialImportThreadPoolExecutor;
import com.yifu.cloud.plus.v1.yifu.social.constants.PaymentConstants;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
......@@ -46,7 +50,6 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -106,6 +109,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
private final int partSize = 30;
@Autowired
private ArchivesDaprUtil archivesDaprUtil;
/**
* 缴费库简单分页查询
*
......@@ -236,6 +242,47 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return R.ok(vo, "查询成功!");
}
@Override
public R removeBatchByInfo(String empIdCard, String socialHouseId, String fundHouseId,
String socialCreateMonth, String socialPayMonth) {
YifuUser user = SecurityUtils.getUser();
LambdaQueryWrapper<TPaymentInfo> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(empIdCard)) {
wrapper.eq(TPaymentInfo::getEmpIdcard, empIdCard);
}
if (Common.isNotNull(socialHouseId)) {
wrapper.eq(TPaymentInfo::getSocialHousehold, socialHouseId);
}
if (Common.isNotNull(fundHouseId)) {
wrapper.eq(TPaymentInfo::getProvidentHousehold, fundHouseId);
}
if (Common.isNotNull(socialCreateMonth)) {
wrapper.eq(TPaymentInfo::getSocialCreateMonth, socialCreateMonth);
}
if (Common.isNotNull(socialPayMonth)) {
wrapper.eq(TPaymentInfo::getSocialPayMonth, socialPayMonth);
}
List<TPaymentInfo> list = baseMapper.selectList(wrapper);
List<String> idList = new ArrayList<>();
if (Common.isNotNull(list)) {
for (TPaymentInfo paymentInfo : list) {
if ((!user.getId().equals(paymentInfo.getCreateBy()) ||
CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus()))
&& !CommonConstants.ONE_STRING.equals(user.getId())) {
return R.failed("存在不符合条件的数据(已推送至结算平台或非本人创建),禁止删除!");
} else {
idList.add(paymentInfo.getId());
}
}
} else {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
baseMapper.deleteBatchIds(idList);
return R.ok();
}
@Override
public R<List<ErrorMessage>> importSocialDiy(InputStream inputStream, String random) {
YifuUser user = SecurityUtils.getUser();
......@@ -668,6 +715,24 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray;
String checkRes;
Map<String,String> cusMap = new HashMap<>();
Map<String,String> itemMap = new HashMap<>();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
if(CollectionUtils.isNotEmpty(settleDomainR)){
for (TSettleDomainSelectVo tSettleDomainSelectVo : settleDomainR) {
cusMap.put(tSettleDomainSelectVo.getCustomerId(), tSettleDomainSelectVo.getCustomerName());
itemMap.put(tSettleDomainSelectVo.getId(), tSettleDomainSelectVo.getDepartName());
}
}
for (TPaymentInfoVo infoVo : list) {
atomicLine.incrementAndGet();
++i;
......@@ -925,8 +990,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setEmpIdcard(socialInfo.getEmpIdcard());
paymentInfo.setEmpName(socialInfo.getEmpName());
paymentInfo.setEmpNo(socialInfo.getEmpNo());
paymentInfo.setSettleDomainId(socialInfo.getSettleDomain());
paymentInfo.setUnitId(socialInfo.getBelongUnit());
if (Common.isNotNull(itemMap) && Common.isNotNull(cusMap)) {
paymentInfo.setSettleDomainId(itemMap.get(socialInfo.getSettleDomain()));
paymentInfo.setUnitId(cusMap.get(socialInfo.getBelongUnit()));
}
paymentInfo.setInauguralTeam(socialInfo.getInauguralTeam());
paymentInfo.setTelecomNumber(socialInfo.getTelecomNumber());
......@@ -935,7 +1002,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialCity(socialInfo.getSocialCity());
paymentInfo.setSocialTown(socialInfo.getSocialTown());
paymentInfo.setSocialHousehold(socialInfo.getSocialHousehold());
paymentInfo.setSocialHousehold(socialInfo.getSocialHouseholdName());
paymentInfo.setSocialPayMonth(infoVo.getSocialPayMonth());
// 同时设置公积金缴纳日期方便导入处理
paymentInfo.setProvidentPayMonth(infoVo.getSocialPayMonth());
......@@ -1031,6 +1099,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.SUCCESS_MSG_PREFIX + "保存成功!", i, random));
}
itemMap.clear();
cusMap.clear();
} else {
return null;
}
......@@ -1347,8 +1417,24 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
String[] areaArray = null;
List<TPaymentInfo> paymentInfoListTemp = null;
BigDecimal cTemp;
Map<String,String> cusMap = new HashMap<>();
Map<String,String> itemMap = new HashMap<>();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
if(CollectionUtils.isNotEmpty(settleDomainR)){
for (TSettleDomainSelectVo tSettleDomainSelectVo : settleDomainR) {
cusMap.put(tSettleDomainSelectVo.getCustomerId(), tSettleDomainSelectVo.getCustomerName());
itemMap.put(tSettleDomainSelectVo.getId(), tSettleDomainSelectVo.getDepartName());
}
}
for (TPaymentInfoVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
......@@ -1473,8 +1559,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setEmpIdcard(fund.getEmpIdcard());
paymentInfo.setEmpName(fund.getEmpName());
paymentInfo.setEmpNo(fund.getEmpNo());
paymentInfo.setSettleDomainId(fund.getSettleDomain());
paymentInfo.setUnitId(fund.getBelongUnit());
if (Common.isNotNull(itemMap) && Common.isNotNull(cusMap)) {
paymentInfo.setSettleDomainId(itemMap.get(fund.getSettleDomain()));
paymentInfo.setUnitId(cusMap.get(fund.getBelongUnit()));
}
paymentInfo.setInauguralTeam(fund.getInauguralTeam());
paymentInfo.setTelecomNumber(fund.getTelecomNumber());
}
......@@ -1484,7 +1572,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setFundProvince(fund.getFundProvince());
paymentInfo.setFundCity(fund.getFundCity());
paymentInfo.setFundTown(fund.getFundTown());
paymentInfo.setProvidentHousehold(fund.getProvidentHousehold());
paymentInfo.setProvidentHousehold(fund.getProvidentHouseholdName());
if (null != paymentInfo.getFundProvince()) {
temp = areaMap.get(paymentInfo.getFundProvince());
if (Common.isNotNull(temp)) {
......@@ -1546,6 +1634,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
itemMap.clear();
cusMap.clear();
} else {
errorMessageList.add(new ErrorMessage(-1, "无数据可导入!"));
}
......@@ -1874,6 +1964,24 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String[] areaArray;
String checkRes;
Map<String,String> cusMap = new HashMap<>();
Map<String,String> itemMap = new HashMap<>();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
if(CollectionUtils.isNotEmpty(settleDomainR)){
for (TSettleDomainSelectVo tSettleDomainSelectVo : settleDomainR) {
cusMap.put(tSettleDomainSelectVo.getCustomerId(), tSettleDomainSelectVo.getCustomerName());
itemMap.put(tSettleDomainSelectVo.getId(), tSettleDomainSelectVo.getDepartName());
}
}
for (TPaymentHeFeiVo infoVo : list) {
atomicLine.incrementAndGet();
++i;
......@@ -2068,8 +2176,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setEmpIdcard(socialInfo.getEmpIdcard());
payExists.setEmpName(socialInfo.getEmpName());
payExists.setEmpNo(socialInfo.getEmpNo());
payExists.setSettleDomainId(socialInfo.getSettleDomain());
payExists.setUnitId(socialInfo.getBelongUnit());
if (Common.isNotNull(itemMap) && Common.isNotNull(cusMap)) {
payExists.setSettleDomainId(itemMap.get(socialInfo.getSettleDomain()));
payExists.setUnitId(cusMap.get(socialInfo.getBelongUnit()));
}
payExists.setInauguralTeam(socialInfo.getInauguralTeam());
payExists.setTelecomNumber(socialInfo.getTelecomNumber());
}
......@@ -2077,7 +2187,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setSocialCity(socialInfo.getSocialCity());
payExists.setSocialTown(socialInfo.getSocialTown());
payExists.setSocialHousehold(socialInfo.getSocialHousehold());
payExists.setSocialHousehold(socialInfo.getSocialHouseholdName());
payExists.setSocialPayMonth(infoVo.getSocialPayMonth());
// 同时设置公积金缴纳日期方便导入处理
payExists.setProvidentPayMonth(infoVo.getSocialPayMonth());
......@@ -2187,6 +2297,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
logList.add(new TPaymentInfoImportLog(null, infoVo.getEmpName(), infoVo.getEmpIdcard()
, CommonConstants.SUCCESS_MSG_PREFIX + "保存成功!", i, random));
}
itemMap.clear();
cusMap.clear();
} else {
return null;
}
......
......@@ -177,6 +177,7 @@ public class ServiceUtil {
}else if (CommonConstants.ONE_STRING.equals(canOverpay)){
temp = socialStartDate;
}
boolean falg= isaBoolean(temp, now);
return (null != temp && (temp.getYear() < now.getYear() || isaBoolean(temp, now)));
}
private static boolean isaBoolean(LocalDateTime temp, LocalDateTime now) {
......
......@@ -93,6 +93,7 @@
<result property="idCardCity" column="ID_CARD_CITY"/>
<result property="idCardTown" column="ID_CARD_TOWN"/>
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
<result property="applyNo" column="APPLY_NO"/>
</resultMap>
<resultMap id="dispatchPageMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPageVo" extends="tDispatchInfoMap">
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
......@@ -203,7 +204,8 @@
a.ID_CARD_PROVINCE,
a.ID_CARD_CITY,
a.ID_CARD_TOWN,
a.ID_CARD_ADDRESS
a.ID_CARD_ADDRESS,
a.APPLY_NO
</sql>
<sql id="tDispatchInfo_where">
<if test="tDispatchInfo != null">
......@@ -537,7 +539,7 @@
a.CONTRACT_TERM,
a.CONTRACT_START,
a.CONTRACT_END,
a.CREASTE_USER_NAME,
a.CREATE_NAME,
b.RECORD_BASE,
b.PAYMENT_TYPE,
b.SOCIAL_HOUSEHOLD_NAME,
......@@ -825,4 +827,9 @@
order by a.CREATE_TIME desc
</where>
</sql>
<!-- 获取当日最大的编码 -->
<select id="getMaxDispatchCode" resultType="java.lang.String">
SELECT ifnull(max(right(e.APPLY_NO,4)),0) APPLY_NO FROM t_dispatch_info e where e.DELETE_FLAG = 0 and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d')
</select>
</mapper>
......@@ -73,6 +73,7 @@
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="payPolicy" column="PAY_POLICY"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -123,7 +124,8 @@
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME
a.UPDATE_TIME,
a.PAY_POLICY
</sql>
<sql id="tProvidentFund_where">
<if test="tProvidentFund != null">
......
......@@ -120,6 +120,7 @@
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="payPolicy" column="PAY_POLICY"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -219,7 +220,8 @@
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME
a.UPDATE_TIME,
a.PAY_POLICY
</sql>
<sql id="tSocialInfo_where">
<if test="tSocialInfo != null">
......
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