Commit e605ea8e authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents ebe8b345 33615082
...@@ -66,7 +66,7 @@ public class EmployeeContractVO extends RowIndex implements Serializable { ...@@ -66,7 +66,7 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
*/ */
@NotBlank(message = "签订类型不能为空") @NotBlank(message = "签订类型不能为空")
@Length(max = 20, message = "签订类型不能超过20个字符") @Length(max = 20, message = "签订类型不能超过20个字符")
@ExcelAttribute(name = "签订类型", isNotEmpty = true, errorInfo = "签订情况不能为空", maxLength = 20, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_SITUATION_TYPE) @ExcelAttribute(name = "签订类型", isNotEmpty = true, errorInfo = "签订类型不能为空", maxLength = 20, isDataId = true, dataType = ExcelAttributeConstants.EMPLOYEE_SITUATION_TYPE)
@Schema(description = "签订类型(字典)", name = "situation") @Schema(description = "签订类型(字典)", name = "situation")
private String situation; private String situation;
......
...@@ -51,14 +51,13 @@ public class FddSealInfoController { ...@@ -51,14 +51,13 @@ public class FddSealInfoController {
/** /**
* 分页查询 * 分页查询
* @param page 分页对象
* @param fddSealInfo 法大大印章 * @param fddSealInfo 法大大印章
* @return * @return
*/ */
@Operation(summary = "分页查询", description = "分页查询") @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" ) @GetMapping("/page" )
public R getFddSealInfoPage(Page page, FddSealInfo fddSealInfo) { public R<List<FddSealInfo>> getFddSealInfoPage(FddSealInfo fddSealInfo) {
return R.ok(fddSealInfoService.getFddSealInfoPage(page, fddSealInfo)); return R.ok(fddSealInfoService.getFddSealInfoPage(fddSealInfo));
} }
/** /**
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
package com.yifu.cloud.plus.v1.yifu.archives.mapper; package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.FddSealInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 法大大印章 * 法大大印章
* *
...@@ -38,6 +38,6 @@ public interface FddSealInfoMapper extends BaseMapper<FddSealInfo> { ...@@ -38,6 +38,6 @@ public interface FddSealInfoMapper extends BaseMapper<FddSealInfo> {
* @param fddSealInfo 法大大印章 * @param fddSealInfo 法大大印章
* @return * @return
*/ */
IPage<FddSealInfo> getFddSealInfoPage(Page<FddSealInfo> page, @Param("fddSealInfo") FddSealInfo fddSealInfo); List<FddSealInfo> getFddSealInfoPage(@Param("fddSealInfo") FddSealInfo fddSealInfo);
} }
...@@ -40,7 +40,7 @@ public interface FddSealInfoService extends IService<FddSealInfo> { ...@@ -40,7 +40,7 @@ public interface FddSealInfoService extends IService<FddSealInfo> {
* @param fddSealInfo 法大大印章 * @param fddSealInfo 法大大印章
* @return * @return
*/ */
IPage<FddSealInfo> getFddSealInfoPage(Page<FddSealInfo> page, FddSealInfo fddSealInfo); List<FddSealInfo> getFddSealInfoPage(FddSealInfo fddSealInfo);
/** /**
* 印章授权 * 印章授权
......
...@@ -27,12 +27,11 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractAttachInfoMapper; ...@@ -27,12 +27,11 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractAttachInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil;
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.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.NoUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -42,11 +41,16 @@ import org.apache.ibatis.annotations.Param; ...@@ -42,11 +41,16 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
...@@ -73,6 +77,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -73,6 +77,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
@Autowired @Autowired
private TEmployeeInfoMapper tEmployeeInfoMapper; private TEmployeeInfoMapper tEmployeeInfoMapper;
@Autowired
private TEmployeeProjectMapper tEmployeeProjectMapper;
@Autowired @Autowired
private TEmployeeContractInfoService employeeContractInfoService; private TEmployeeContractInfoService employeeContractInfoService;
...@@ -97,6 +104,10 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -97,6 +104,10 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
@Autowired @Autowired
private TEmployeeLogService tEmployeeLogService; private TEmployeeLogService tEmployeeLogService;
// 缓存信息
@Autowired
private CacheManager cacheManager;
ExecutorService executorService = Executors.newFixedThreadPool(10); ExecutorService executorService = Executors.newFixedThreadPool(10);
public static final String NO_VALID_CONTRACT_FOUND = "未获取到有效在用合同,请确认存在对应姓名、身份证、合同起始时间的合同数据"; public static final String NO_VALID_CONTRACT_FOUND = "未获取到有效在用合同,请确认存在对应姓名、身份证、合同起始时间的合同数据";
...@@ -274,40 +285,57 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -274,40 +285,57 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],tEmployeeProject.getId(),"",employeeInfoCompare,tEmployeeInfo); tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],tEmployeeProject.getId(),"",employeeInfoCompare,tEmployeeInfo);
} else { } else {
//新增人员档案 //新增人员档案
TEmployeeInfo newEmployeeInfo = new TEmployeeInfo();
newEmployeeInfo.setEmpName(fddContractAttachInfo.getEmpName());
newEmployeeInfo.setEmpIdcard(fddContractAttachInfo.getEmpIdcard());
newEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone());
newEmployeeInfo.setEmpNatrue(fddContractTemplate.getType());
newEmployeeInfo.setEmpCode(getCode());
newEmployeeInfo.setFileStatus(CommonConstants.ZERO_INT);
newEmployeeInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
newEmployeeInfo.setStatus(CommonConstants.ZERO_INT);
newEmployeeInfo.setProjectNum(CommonConstants.ONE_INT);
newEmployeeInfo.setFileSource(CommonConstants.dingleDigitStrArray[4]);
Date date = IdCardUtil.getBirthdate(fddContractAttachInfo.getEmpIdcard());
if (null != date) {
//初始化年龄
newEmployeeInfo.setEmpAge(IdCardUtil.IdNOToAge(fddContractAttachInfo.getEmpIdcard()));
newEmployeeInfo.setEmpBirthday(date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
}
newEmployeeInfo.setEmpSex(IdCardUtil.getSex(fddContractAttachInfo.getEmpIdcard()));
tEmployeeInfoMapper.insert(newEmployeeInfo);
//新增项目档案
TEmployeeProject newTEmpProject = new TEmployeeProject();
newTEmpProject.setEmpName(fddContractAttachInfo.getEmpName());
newTEmpProject.setEmpIdcard(fddContractAttachInfo.getEmpIdcard());
newTEmpProject.setEmpPhone(fddContractAttachInfo.getEmpPhone());
newTEmpProject.setDeptId(settleDomain.getId());
newTEmpProject.setDeptNo(settleDomain.getDepartNo());
newTEmpProject.setDeptName(settleDomain.getDepartName());
newTEmpProject.setPost(fddContractAttachInfo.getPost());
newTEmpProject.setUnitId(tCustomerInfo.getId());
newTEmpProject.setUnitName(tCustomerInfo.getCustomerName());
newTEmpProject.setUnitNo(tCustomerInfo.getCustomerCode());
newTEmpProject.setContractType(fddContractTemplate.getType());
newTEmpProject.setDeleteFlag(CommonConstants.STATUS_NORMAL);
newTEmpProject.setStatus(CommonConstants.dingleDigitIntArray[0]);
newTEmpProject.setPost(fddContractAttachInfo.getPost());
newTEmpProject.setEmpNatrue(newEmployeeInfo.getEmpNatrue());
newTEmpProject.setEmpCode(newEmployeeInfo.getEmpCode());
String empNO = getEmpNo(tEmployeeProject.getDeptNo());
newTEmpProject.setEmpNo(empNO);
//新增档案
tEmployeeProjectMapper.insert(newTEmpProject);
//新增合同
TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo();
saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo,tCustomerInfo,newTEmpProject);
//更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1);
} }
//新增项目档案
TEmployeeProject newTEmpProject = new TEmployeeProject();
// newTEmployeeInfo.setEmpName(fddContractAttachInfo.getEmpName());
// newTEmployeeInfo.setEmpIdcard(fddContractAttachInfo.getEmpIdcard());
// newTEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone());
// newTEmployeeInfo.setEmpType(fddContractTemplate.getType());
// newTEmployeeInfo.setSettleDomain(settleDomain.getId());
// newTEmployeeInfo.setPost(fddContractAttachInfo.getPost());
// newTEmployeeInfo.setBelongUnit(tCustomerInfo.getId());
// newTEmployeeInfo.setBelongUnitName(tCustomerInfo.getCustomerName());
// newTEmployeeInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
// newTEmployeeInfo.setWorkFlag(CommonConstants.ZERO_STRING);
// newTEmployeeInfo.setLockFlag(CommonConstants.ONE_STRING);
// newTEmployeeInfo.setWorkingStatusSub(CommonConstants.ZERO_STRING);
// newTEmployeeInfo.setContractFileStatus(CommonConstants.ZERO_STRING);
// Date date = IdCardUtil.getBirthdate(fddContractAttachInfo.getEmpIdcard());
//
// newTEmployeeInfo.setEmpNo(str);
//
// if (null != date) {
// //初始化年龄
// newTEmployeeInfo.setEmpAge(IdCardUtil.IdNOToAge(fddContractAttachInfo.getEmpIdcard()));
// newTEmployeeInfo.setEmpBirthday(date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
// }
// newTEmployeeInfo.setEmpSex(IdCardUtil.getSex(fddContractAttachInfo.getEmpIdcard()));
// //新增档案
// tEmployeeInfoMapper.insert(newTEmployeeInfo);
//新增合同
TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo();
saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo,tCustomerInfo,newTEmpProject);
//更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1);
} }
} }
}catch (Exception e) { }catch (Exception e) {
...@@ -571,4 +599,34 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -571,4 +599,34 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
return str; return str;
} }
//获取员工主码
private synchronized String getCode() {
String nowDay = DateUtil.getThisDay();
Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_EMP_CODE);
Object nowNumObj = cache.get(nowDay);
int nowNums = 1;
if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1;
}
cache.put(nowDay, nowNums);
return "ZM" + nowDay + this.getFiveNum(String.valueOf(nowNums));
}
/**
* @param nowNums 数字
* @Description: 获取五位字符型数字
* @Author: hgw
* @Date: 2022/6/21 17:35
* @return: 五位字符型数字
**/
private String getFiveNum(String nowNums) {
if (nowNums.length() >= 5) {
return nowNums.substring(0, 5);
}
String[] zeroArr = {"0", "00", "000", "0000"};
int num = 4 - nowNums.length();
return zeroArr[num] + nowNums;
}
} }
...@@ -68,7 +68,7 @@ public class FddSealInfoServiceImpl extends ServiceImpl<FddSealInfoMapper, FddSe ...@@ -68,7 +68,7 @@ public class FddSealInfoServiceImpl extends ServiceImpl<FddSealInfoMapper, FddSe
private final FddReqLogService reqLogService; private final FddReqLogService reqLogService;
@Override @Override
public IPage<FddSealInfo> getFddSealInfoPage(Page<FddSealInfo> page, FddSealInfo fddSealInfo) { public List<FddSealInfo> getFddSealInfoPage(FddSealInfo fddSealInfo) {
long count = this.count(Wrappers.<FddSealInfo>query().lambda().eq(FddSealInfo::getStatus,CommonConstants.TWO_STRING)); long count = this.count(Wrappers.<FddSealInfo>query().lambda().eq(FddSealInfo::getStatus,CommonConstants.TWO_STRING));
if (count == CommonConstants.ZERO_INT) { if (count == CommonConstants.ZERO_INT) {
//初始化印章 //初始化印章
...@@ -120,7 +120,7 @@ public class FddSealInfoServiceImpl extends ServiceImpl<FddSealInfoMapper, FddSe ...@@ -120,7 +120,7 @@ public class FddSealInfoServiceImpl extends ServiceImpl<FddSealInfoMapper, FddSe
} }
} }
} }
return baseMapper.getFddSealInfoPage(page, fddSealInfo); return baseMapper.getFddSealInfoPage(fddSealInfo);
} }
@Override @Override
......
...@@ -83,9 +83,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -83,9 +83,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
private final TCustomerInfoMapper tCustomerInfoMapper; private final TCustomerInfoMapper tCustomerInfoMapper;
// 缓存信息
private final CacheManager cacheManager;
@Override @Override
public R addCheck(TEmployeeProject tEmployeeProject) { public R addCheck(TEmployeeProject tEmployeeProject) {
...@@ -590,42 +587,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -590,42 +587,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
proInsList.add(insTEmployeePro); proInsList.add(insTEmployeePro);
} }
/**
* @param
* @Description: 获取员工主码
* @Author: hgw
* @Date: 2022/6/22 17:52
* @return: java.lang.String
**/
private synchronized String getCode() {
String nowDay = DateUtil.getThisDay();
Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_EMP_CODE);
Object nowNumObj = cache.get(nowDay);
int nowNums = 1;
if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1;
}
cache.put(nowDay, nowNums);
return "ZM" + nowDay + this.getFiveNum(String.valueOf(nowNums));
}
/**
* @param nowNums 数字
* @Description: 获取五位字符型数字
* @Author: hgw
* @Date: 2022/6/21 17:35
* @return: 五位字符型数字
**/
private String getFiveNum(String nowNums) {
if (nowNums.length() >= 5) {
return nowNums.substring(0, 5);
}
String[] zeroArr = {"0", "00", "000", "0000"};
int num = 4 - nowNums.length();
return zeroArr[num] + nowNums;
}
@Override @Override
public R<List<ErrorMessage>> batchRemoveByIds(String ids) { public R<List<ErrorMessage>> batchRemoveByIds(String ids) {
List<ErrorMessage> errorList = new ArrayList<ErrorMessage>(); List<ErrorMessage> errorList = new ArrayList<ErrorMessage>();
......
...@@ -658,10 +658,18 @@ ...@@ -658,10 +658,18 @@
<update id="updateEmpIdById" parameterType="java.util.List"> <update id="updateEmpIdById" parameterType="java.util.List">
update t_employee_project update t_employee_project
SET EMP_ID = #{i.id} <trim prefix="set" suffixOverrides=",">
<trim prefix="EMP_ID =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.id!=null">
when EMP_IDCARD=#{i.empIdcard} then #{i.id}
</if>
</foreach>
</trim>
</trim>
where where
<foreach collection="list" separator="or" item="i" index="index" > <foreach collection="list" separator="or" item="i" index="index" >
EMP_IDCARD=#{i.empIdcard} AND DEPT_NO =#{i.deptNo} EMP_IDCARD=#{i.empIdcard}
</foreach> </foreach>
</update> </update>
......
...@@ -255,7 +255,7 @@ public interface ErrorCodes { ...@@ -255,7 +255,7 @@ public interface ErrorCodes {
// 该人员未在档,请核实 // 该人员未在档,请核实
String ARCHIVES_IMPORT_EMP_NOT_EXISTS = "archives.import.emp.not.exists"; String ARCHIVES_IMPORT_EMP_NOT_EXISTS = "archives.import.emp.not.exists";
// 存在已减档的档案,禁止导入 // 存在已减档的档案,禁止导入
String ARCHIVES_IMPORT_EMP_ERROR_STATUS_EXISTS = "archives.import.emp.error.status..exists"; String ARCHIVES_IMPORT_EMP_ERROR_STATUS_EXISTS = "archives.import.emp.error.status.exists";
// 身份证必填 // 身份证必填
String ARCHIVES_IMPORT_EMP_IDCARD_MUST = "archives.import.emp.idCard.must"; String ARCHIVES_IMPORT_EMP_IDCARD_MUST = "archives.import.emp.idCard.must";
String ARCHIVES_IMPORT_EMP_EMPNAME_MUST = "archives.import.emp.empName.must"; String ARCHIVES_IMPORT_EMP_EMPNAME_MUST = "archives.import.emp.empName.must";
......
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