Commit 5eddc07f authored by fangxinjiang's avatar fangxinjiang

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

parents 6c659338 47fef00f
......@@ -51,7 +51,8 @@ public class TElecEmployeeInfo extends BaseEntity {
* 员工姓名
*/
@Schema(description ="员工姓名")
@TableField(exist = false)
@NotNull(message = "员工姓名不能为空")
@Size(max = 20, message = "员工姓名不可超过20位")
private String empName;
/**
......@@ -98,22 +99,17 @@ public class TElecEmployeeInfo extends BaseEntity {
@Size(max = 2, message = "身资料类型不可超过2位")
private String dataType;
/**
* 附件
*/
@Schema(description ="附件")
private String attaInfo;
/**
* 附件id
*/
@Schema(description ="附件id")
private String fileId;
/**
* 是否删除 0否/1是
*/
@Schema(description ="是否删除 0否/1是")
private String deleteFlag;
/**
* @Author fxj
* @Description 附件ID
* @Date 14:53 2022/6/21
**/
@TableField(exist = false)
private String attaIds;
}
......@@ -79,6 +79,7 @@ public class TEmpChangeInfoVO implements Serializable {
* 划转起始月
*/
@ExcelProperty(value ="划转起始月")
@ExcelAttribute(name = "划转起始月",maxLength = 6,isInteger = true)
private String changeStartMonth;
}
......@@ -9,6 +9,22 @@ public class EmployeeConstants {
public static final String REMARL_LENGTH = "备注长度超过200";
public static final String POST_LENGTH = "就职岗位长度超过20";
public static final String DEPT_NO_LENGTH = "项目编码长度超过20";
public static final String VALIDITY_START = "身份证开始日期必填!";
public static final String VALIDITY_END = "身份证截止日期必填!";
public static final String EMP_NATIONAL = "民族必填!";
public static final String ID_PROVINCE = "户籍所在地必填!";
public static final String FILE_PROVINCE = "档案所在地必填!";
public static final String EMP_REGIS_TYPE = "户口性质必填!";
public static final String IS_COLLEGE = "是否大专及以上必填!";
public static final String CONTACT_ADDRESS = "通信地址必填!";
public static final String EMP_NATRUE_ZERO = "派遣";
public static final String EMP_NATRUE_ONE = "外包";
public static final String HIGN_EDUCATION = "最高学历必填";
public static final String SCHOOL = "学校必填";
public static final String MAJOR = "专业必填";
public static final String ADMISSION_DATE = "入学时间必填";
public static final String GRADUTION_DATE = "毕业时间必填";
/**
* 无数据可更新
**/
......
......@@ -80,7 +80,7 @@ public class TElecEmployeeInfoController {
@PostMapping
@PreAuthorize("@pms.hasPermission('archives_telecemployeeinfo_add')" )
public R save(@Valid @RequestBody TElecEmployeeInfo tElecEmployeeInfo) {
return R.ok(tElecEmployeeInfoService.save(tElecEmployeeInfo));
return tElecEmployeeInfoService.saveElecInfo(tElecEmployeeInfo);
}
/**
......
......@@ -52,4 +52,6 @@ public interface TElecEmployeeInfoService extends IService<TElecEmployeeInfo> {
*/
R getEmpInfoByCard(String idCard);
R saveElecInfo(TElecEmployeeInfo tElecEmployeeInfo);
}
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TElecEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.FileUploadService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService;
......@@ -67,6 +68,8 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
private final DaprUpmsProperties daprUpmsProperties;
private final TAttaInfoMapper attaInfoMapper;
@Override
public boolean save(TElecEmployeeInfo entity) {
return super.save(entity);
......@@ -114,13 +117,25 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
@Override
public R getEmpInfoByCard(String idCard) {
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard,idCard)));
.eq(TEmployeeInfo::getEmpIdcard,idCard)).eq(TEmployeeInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
if (Common.isNotNull(tEmployeeInfo)) {
return R.ok(tEmployeeInfo);
}
return R.failed("未找到身份证号对应的档案信息");
}
@Override
public R saveElecInfo(TElecEmployeeInfo tElecEmployeeInfo) {
baseMapper.insert(tElecEmployeeInfo);
//更新附件信息
List<String> ids;
if (Common.isNotNull(tElecEmployeeInfo.getAttaIds())){
ids = Common.initStrToList(tElecEmployeeInfo.getAttaIds(),CommonConstants.COMMA_STRING);
attaInfoMapper.updateDomainId(tElecEmployeeInfo.getId(),ids);
}
return R.ok();
}
/**
* zip解压
* @param srcFile zip源文件
......
......@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO;
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.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
......@@ -115,14 +116,13 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMsg = new HashSet<>();
TEmpChangeInfoVO excel = excelVOList.get(i);
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH) + 1;
if (excel.getUnsettleDeal().equals(CommonConstants.IS_CHANGE)) {
if (Common.isEmpty(excel.getChangeStartMonth())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHANGE_START_MONTH_EXIT, excel.getNewSettleCode()));
} else if (Integer.parseInt(excel.getChangeStartMonth()) > month ) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHANGE_LESS_MONTH_EXIT, excel.getNewSettleCode()));
errorMsg.add("第" + (i + 2) + "行划转起始月不能为空");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行划转起始月不能为空"));
} else if (Integer.parseInt(excel.getChangeStartMonth()) > Integer.parseInt(DateUtil.getThisMonth())) {
errorMsg.add("第" + (i + 2) + "行划转起始月要小于等于当前月");
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行划转起始月要小于等于当前月"));
}
}
......
......@@ -630,8 +630,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private void checkEmployeeVOR(long lineNum, EmployeeVO employeeInfo, Map<Long, ErrorMessage> errorMsgMap, Set<String> errorMsg) {
if (Common.isEmpty(employeeInfo.getEmpIdcard())) {
errorMsg.add("员工身份证必填!");
errorMsgMap.put(lineNum, new ErrorMessage("员工身份证必填!"));
errorMsg.add("身份证号必填!");
errorMsgMap.put(lineNum, new ErrorMessage("身份证号必填!"));
}
if (Common.isEmpty(employeeInfo.getDeptNo())) {
errorMsg.add("项目编码必填!");
......@@ -645,12 +645,73 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
errorMsgMap.put(lineNum, new ErrorMessage("员工姓名必填!"));
}
if (Common.isEmpty(employeeInfo.getEmpPhone())) {
errorMsg.add("手机号必填!");
errorMsgMap.put(lineNum, new ErrorMessage("手机号必填!"));
errorMsg.add("手机号必填!");
errorMsgMap.put(lineNum, new ErrorMessage("手机号必填!"));
}
if (Common.isEmpty(employeeInfo.getEmpNatrue())) {
errorMsg.add("员工类型必填!");
errorMsgMap.put(lineNum, new ErrorMessage("员工类型必填!"));
} else if (EmployeeConstants.EMP_NATRUE_ZERO.equals(employeeInfo.getEmpNatrue())
|| EmployeeConstants.EMP_NATRUE_ONE.equals(employeeInfo.getEmpNatrue())) {
// 2.员工类型为外包和派遣,额外必填项有:身份证开始日期、身份证截止日期、民族、户籍所在(省市县)、户口性质、档案所在地(省市县)、是否大专及以上、通信地址
if (Common.isEmpty(employeeInfo.getValidityStart())) {
errorMsg.add(EmployeeConstants.VALIDITY_START);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.VALIDITY_START));
}
if (Common.isEmpty(employeeInfo.getValidityEnd())) {
errorMsg.add(EmployeeConstants.VALIDITY_END);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.VALIDITY_END));
}
if (Common.isEmpty(employeeInfo.getEmpNational())) {
errorMsg.add(EmployeeConstants.EMP_NATIONAL);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.EMP_NATIONAL));
}
if (Common.isEmpty(employeeInfo.getIdProvince())) {
errorMsg.add(EmployeeConstants.ID_PROVINCE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.ID_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getEmpRegisType())) {
errorMsg.add(EmployeeConstants.EMP_REGIS_TYPE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.EMP_REGIS_TYPE));
}
if (Common.isEmpty(employeeInfo.getFileProvince())) {
errorMsg.add(EmployeeConstants.FILE_PROVINCE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.FILE_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getContactAddress())) {
errorMsg.add(EmployeeConstants.CONTACT_ADDRESS);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.CONTACT_ADDRESS));
}
if (Common.isEmpty(employeeInfo.getIsCollege())) {
errorMsg.add(EmployeeConstants.IS_COLLEGE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.IS_COLLEGE));
} else if (CommonConstants.IS_TRUE.equals(employeeInfo.getIsCollege())) {
// 3.员工类型为外包和派遣,并且是否大专及以上为是,再增加必填项:最高学历、学校、专业、入学时间、毕业时间
if (Common.isEmpty(employeeInfo.getHignEducation())) {
errorMsg.add(EmployeeConstants.HIGN_EDUCATION);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.HIGN_EDUCATION));
}
if (Common.isEmpty(employeeInfo.getSchool())) {
errorMsg.add(EmployeeConstants.SCHOOL);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.SCHOOL));
}
if (Common.isEmpty(employeeInfo.getMajor())) {
errorMsg.add(EmployeeConstants.MAJOR);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.MAJOR));
}
if (Common.isEmpty(employeeInfo.getAdmissionDate())) {
errorMsg.add(EmployeeConstants.ADMISSION_DATE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.ADMISSION_DATE));
}
if (Common.isEmpty(employeeInfo.getGradutionDate())) {
errorMsg.add(EmployeeConstants.GRADUTION_DATE);
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.GRADUTION_DATE));
}
}
}
if (Common.isEmpty(employeeInfo.getPost())) {
errorMsg.add("就职岗位必填!");
errorMsgMap.put(lineNum, new ErrorMessage("就职岗位必填!"));
}
}
......@@ -1154,10 +1215,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 获取身份证、手机号列表,批量查询档案
List<String> idCardList = new ArrayList<>();
List<String> phoneList = new ArrayList<>();
EmployeeVO employeeVO;
long lineNum;
for (int i = 0; i < excelVOList.size(); i++) {
lineNum = i + 2L;
employeeVO = excelVOList.get(i);
// 判断空值
this.judgeNull(errorMsgMap, employeeVO, lineNum);
// 判空
if (Common.isEmpty(excelVOList.get(i).getEmpIdcard())) {
errorMsgMap.put((i + 2L), new ErrorMessage("员工身份证必填"));
errorMsgMap.put(lineNum, new ErrorMessage("员工身份证必填"));
} else {
idCardList.add(excelVOList.get(i).getEmpIdcard());
}
......@@ -1493,6 +1560,60 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return R.ok();
}
/**
* @Description: 批量更新的判断
* @Author: hgw
* @Date: 2022/7/6 15:10
* @return: void
**/
private void judgeNull(Map<Long, ErrorMessage> errorMsgMap, EmployeeVO employeeInfo, long lineNum) {
if (Common.isNotNull(employeeInfo.getEmpNatrue())
&& (EmployeeConstants.EMP_NATRUE_ZERO.equals(employeeInfo.getEmpNatrue())
|| EmployeeConstants.EMP_NATRUE_ONE.equals(employeeInfo.getEmpNatrue()))) {
// 2.员工类型为外包和派遣,额外必填项有:身份证开始日期、身份证截止日期、民族、户籍所在(省市县)、户口性质、档案所在地(省市县)、是否大专及以上、通信地址
if (Common.isEmpty(employeeInfo.getValidityStart())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.VALIDITY_START));
}
if (Common.isEmpty(employeeInfo.getValidityEnd())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.VALIDITY_END));
}
if (Common.isEmpty(employeeInfo.getEmpNational())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.EMP_NATIONAL));
}
if (Common.isEmpty(employeeInfo.getIdProvince())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.ID_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getEmpRegisType())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.EMP_REGIS_TYPE));
}
if (Common.isEmpty(employeeInfo.getFileProvince())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.FILE_PROVINCE));
}
if (Common.isEmpty(employeeInfo.getContactAddress())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.CONTACT_ADDRESS));
}
if (Common.isNotNull(employeeInfo.getIsCollege())
&& CommonConstants.IS_TRUE.equals(employeeInfo.getIsCollege())) {
// 3.员工类型为外包和派遣,并且是否大专及以上为是,再增加必填项:最高学历、学校、专业、入学时间、毕业时间
if (Common.isEmpty(employeeInfo.getHignEducation())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.HIGN_EDUCATION));
}
if (Common.isEmpty(employeeInfo.getSchool())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.SCHOOL));
}
if (Common.isEmpty(employeeInfo.getMajor())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.MAJOR));
}
if (Common.isEmpty(employeeInfo.getAdmissionDate())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.ADMISSION_DATE));
}
if (Common.isEmpty(employeeInfo.getGradutionDate())) {
errorMsgMap.put(lineNum, new ErrorMessage(EmployeeConstants.GRADUTION_DATE));
}
}
}
}
// 更新学历-房
private void saveOrUpdateEducation(List<TEmployeeInfo> saveList) {
TEmpEducation education;
......
......@@ -273,7 +273,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (tEmployeeProject.getIsLeaveEmployee() == CommonConstants.dingleDigitIntArray[1]) {
if (Common.isNotNull(list)) {
return R.failed("存在草稿/已审核的状态的项目,不允许同步减档");
return R.failed("该人员存在其他进行中的项目,禁止同步减档!");
}
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
code = CommonConstants.ONE_STRING;
......
......@@ -32,8 +32,6 @@
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="dataType" column="DATA_TYPE"/>
<result property="attaInfo" column="ATTA_INFO"/>
<result property="fileId" column="FILE_ID"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
......@@ -44,15 +42,13 @@
<sql id="Base_Column_List">
a.ID,
b.EMP_NAME,
a.EMP_NAME,
a.EMP_IDCARD,
b.EMP_NO,
b.UNIT_NAME,
b.DEPT_NO,
b.DEPT_NAME,
a.DATA_TYPE,
a.ATTA_INFO,
a.FILE_ID,
a.DELETE_FLAG,
a.UPDATE_BY,
a.CREATE_BY,
......@@ -67,7 +63,7 @@
AND a.ID = #{tElecEmployeeInfo.id}
</if>
<if test="tElecEmployeeInfo.empName != null and tElecEmployeeInfo.empName.trim() != ''">
AND b.EMP_NAME = #{tElecEmployeeInfo.empName}
AND a.EMP_NAME = #{tElecEmployeeInfo.empName}
</if>
<if test="tElecEmployeeInfo.empIdcard != null and tElecEmployeeInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tElecEmployeeInfo.empIdcard}
......@@ -84,12 +80,6 @@
<if test="tElecEmployeeInfo.dataType != null and tElecEmployeeInfo.dataType.trim() != ''">
AND a.DATA_TYPE = #{tElecEmployeeInfo.dataType}
</if>
<if test="tElecEmployeeInfo.attaInfo != null and tElecEmployeeInfo.attaInfo.trim() != ''">
AND a.ATTA_INFO = #{tElecEmployeeInfo.attaInfo}
</if>
<if test="tElecEmployeeInfo.fileId != null and tElecEmployeeInfo.fileId.trim() != ''">
AND a.FILE_ID = #{tElecEmployeeInfo.fileId}
</if>
<if test="tElecEmployeeInfo.createBy != null and tElecEmployeeInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tElecEmployeeInfo.createBy}
</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment