Commit bdf116c8 authored by hongguangwu's avatar hongguangwu

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

parents dc76bdc3 514b0ad2
......@@ -91,18 +91,23 @@ public class EmployeeProjectVO implements Serializable {
/**
* 合同类型(字典值)
*/
@NotNull(message = "合同类型不能为空")
@ExcelProperty(value ="合同类型")
@ExcelAttribute(name = "合同类型",isNotEmpty = true, errorInfo = "项目编码不能为空",maxLength = 2)
private String contractType;
/**
* 工时制
*/
@NotNull(message = "工时制不能为空")
@ExcelProperty(value ="工时制")
@ExcelAttribute(name = "工时制",isNotEmpty = true, errorInfo = "工时制不能为空",maxLength = 1)
private String workingHours;
/**
* 就职岗位
*/
@NotNull(message = "就职岗位不能为空")
@ExcelProperty(value ="就职岗位")
@ExcelAttribute(name = "就职岗位",isNotEmpty = true, errorInfo = "就职岗位不能为空",maxLength = 20)
private String post;
......@@ -111,6 +116,7 @@ public class EmployeeProjectVO implements Serializable {
* 入职日期
*/
@ExcelProperty(value ="入职日期")
@NotNull(message = "入职日期不能为空")
@Past
private LocalDate enjoinDate;
......@@ -118,6 +124,7 @@ public class EmployeeProjectVO implements Serializable {
* 试用期(单位月)
*/
@ExcelProperty(value ="试用期")
@NotNull(message = "试用期不能为空")
private String tryPeriod;
}
......@@ -51,8 +51,6 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
void updateExcelEmployeeInfo(@Param("list") List<TEmployeeInfo> list);
int insertExcelEmployeeInfo(@Param("list") List<TEmployeeInfo> list);
/**
* 获得导出的人员档案列表
* hgw 2022-6-24 10:09:44
......
......@@ -152,6 +152,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setEmpId(tEmployeeInfo.getId());
tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]);
this.save(tEmployeeProject);
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
return R.ok();
}
return R.failed("未在人员档案中查到身份信息");
......@@ -289,7 +291,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage));
}
List<TEmployeeInfo> insertList = new ArrayList();
List<TEmployeeInfo> updateList = new ArrayList();
List<TEmployeeProject> proInsList = new ArrayList();
List<TEmployeeProject> proupdateList = new ArrayList();
......@@ -330,37 +331,17 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//不存在复档或复项的情况
//档案无(在档人员、离职库皆无),项目无
if (Common.isEmpty(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)) {
// 校验身份证实名
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(excel.getEmpName());
checkIdCard.setIdCard(excel.getEmpIdcard());
List<TCheckIdCard> checkList = new ArrayList<>();
checkList.add(checkIdCard);
R<List<TCheckIdCard>> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckidcard/inner/checkIdCard", checkList, TCheckIdCard.class, SecurityConstants.FROM_IN);
Boolean isSave = false;
if (checkListR != null && checkListR.getData() != null) {
for (TCheckIdCard check : checkListR.getData()) {
if (check.getIsTrue() == CommonConstants.ZERO_INT) {
errorMsg.add(check.getReason());
isSave = true;
break;
}
}
}
if (!isSave) {
insertExcelPost(excel, insertList);
insertExcelPro(excel, proInsList);
}
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_EMP_ERROR));
//档案有(在档人员),项目无
} else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)
&& CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) {
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(excel, updateList, tEmployeeInfo,CommonConstants.ONE_INT);
insertExcelPro(excel, proInsList);
//档案有(在档人员),项目有(草稿/已审核);
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[0] == tEmployeeProject.getProjectStatus()) {
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(excel, updateList, tEmployeeInfo,CommonConstants.ZERO_INT);
updateExcelPro(excel, proupdateList, tEmployeeProject);
}
......@@ -369,17 +350,17 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(离职库),项目(已减档)
if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(excel, updateList, tEmployeeInfo,CommonConstants.ZERO_INT);
updateExcelPro(excel, proupdateList, tEmployeeProject);
//档案有(离职库),项目无;
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject) ) {
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(excel, updateList, tEmployeeInfo,CommonConstants.ONE_INT);
insertExcelPro(excel, proInsList);
//档案有(在档人员),项目(已减档)
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
updateExcelPost(excel, updateList, tEmployeeInfo);
updateExcelPost(excel, updateList, tEmployeeInfo,CommonConstants.ZERO_INT);
updateExcelPro(excel, proupdateList, tEmployeeProject);
}
//不允许复档复项
......@@ -404,9 +385,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
try {
if (insertList.size() > CommonConstants.dingleDigitIntArray[0]) {
tEmployeeInfoMapper.insertExcelEmployeeInfo(insertList);
}
if (updateList.size() > CommonConstants.dingleDigitIntArray[0]) {
tEmployeeInfoMapper.updateExcelEmployeeInfo(updateList);
}
......@@ -721,10 +699,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
* 更新人员档案
*/
private void updateExcelPost(EmployeeProjectVO excel,List<TEmployeeInfo> updateList,TEmployeeInfo tEmployeeInfo) {
private void updateExcelPost(EmployeeProjectVO excel,List<TEmployeeInfo> updateList,TEmployeeInfo tEmployeeInfo,int num) {
BeanUtil.copyProperties(excel, tEmployeeInfo);
YifuUser user = SecurityUtils.getUser();
tEmployeeInfo.setUpdateBy(user.getId());
if (num == CommonConstants.ONE_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT);
}
updateList.add(tEmployeeInfo);
// 记录变更日志
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
......
......@@ -485,6 +485,11 @@
when ID=#{i.id} then 0
</foreach>
</trim>
<trim prefix="PROJECT_NUM =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then #{i.projectNum}
</foreach>
</trim>
<trim prefix="UPDATE_TIME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then now()
......@@ -504,27 +509,6 @@
</foreach>
</update>
<insert id="insertExcelEmployeeInfo" parameterType="java.util.List">
insert into t_employee_info
(ID,EMP_NATRUE,EMP_NAME,EMP_IDCARD,STATUS,FILE_STATUS,EMP_CODE,DELETE_FLAG,CREATE_BY,CREATE_NAME,CREATE_TIME)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
REPLACE(UUID(),"-",""),
#{item.empNatrue,jdbcType=VARCHAR},
#{item.empName,jdbcType=VARCHAR},
#{item.empIdcard,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR},
0,
#{item.empCode,jdbcType=VARCHAR},
#{item.deleteFlag,jdbcType=VARCHAR},
#{item.createBy,jdbcType=VARCHAR},
#{item.createName,jdbcType=VARCHAR},
now()
)
</foreach>
</insert>
<!--tEmployeeInfo人员档案导出查询-->
<select id="getTEmployeeExportList" resultMap="tEmployeeExportMap">
select
......
......@@ -50,6 +50,11 @@ public interface CommonConstants {
*/
Long DEPT_TREE_ROOT_ID = 0L;
/**
* 1L
*/
Long LONG_1 = 1L;
/**
* 菜单
*/
......@@ -257,4 +262,14 @@ public interface CommonConstants {
String ID = "ID";
String PARAM_IS_NOT_ERROR = "传参异常,请检查参数";
int EXCEL_EXPORT_LIMIT = 60000;
/**
* 成功颜色
*/
String GREEN = "green";
/**
* 失败颜色
*/
String RED = "red";
}
......@@ -213,6 +213,10 @@ public interface ErrorCodes {
* 存在已减档的档案,禁止导入
*/
String CHECKS_REDUCE_EMP_ERROR = "checks.reduce.emp.error";
/**
* 该人员暂无档案信息,请先至“在档人员”处建档
*/
String CHECKS_EXIT_EMPPROJECT_ERROR = "checks.exit.empproject.error";
/**
* 存在已减项的项目,禁止导入
*/
......
......@@ -58,6 +58,8 @@ checks.emp.project.error=\u5B58\u5728\u5DF2\u51CF\u6863\u7684\u6863\u6848\u548C\
checks.reduce.emp.error=\u5B58\u5728\u5DF2\u51CF\u6863\u7684\u6863\u6848\uFF0C\u7981\u6B62\u5BFC\u5165
checks.reduce.project.error=\u5B58\u5728\u5DF2\u51CF\u9879\u7684\u9879\u76EE\uFF0C\u7981\u6B62\u5BFC\u5165
checks.exit.empproject.error=\u8BE5\u4EBA\u5458\u6682\u65E0\u6863\u6848\u4FE1\u606F\uFF0C\u8BF7\u5148\u81F3\u201C\u5728\u6863\u4EBA\u5458\u201D\u5904\u5EFA\u6863
checks.emp.exit.error=\u4EBA\u5458\u4E0D\u5728\u8BE5\u9879\u76EE\uFF0C\u65E0\u6CD5\u66F4\u65B0
checks.project.delete.error=\u9879\u76EE\u6863\u6848\u72B6\u6001\u4E3A\u5DF2\u5BA1\u6838\uFF0C\u7981\u6B62\u5220\u9664
......
......@@ -323,4 +323,17 @@ public class DictController {
return sysDictItemService.getDictToValue();
}
/**
* @Description: 根据type和value获取字典值
* @Author: huyc
* @Date: 2022/7/1
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Inner
@PostMapping("/inner/getLableFronValue")
public R<String> getLableFronValue(@RequestParam String value,@RequestParam String type) {
return sysDictItemService.getLableFronValue(value,type);
}
}
......@@ -84,4 +84,6 @@ public interface SysDictItemService extends IService<SysDictItem> {
void clearDictItemCache();
R<Boolean> saveDiy(SysDictItem sysDictItem);
R<String> getLableFronValue(String value,String type);
}
......@@ -123,6 +123,16 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
return R.ok();
}
@Override
public R<String> getLableFronValue(String value, String type) {
SysDictItem sysDictItem = baseMapper.selectOne(Wrappers.<SysDictItem>query().lambda()
.eq(SysDictItem::getType,type).eq(SysDictItem::getValue,value)
.eq(SysDictItem::getDelFlag,CommonConstants.ZERO_STRING));
if (Common.isNotNull(sysDictItem)) {
return R.ok(sysDictItem.getLabel());
}
return R.ok(CommonConstants.EMPTY_STRING);
}
private void updateDictItem(String type, Map<String,Object> resultMap){
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
......
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