|
@@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
+import thyyxxk.webserver.dao.his.dictionary.EmployeeMiDao;
|
|
|
import thyyxxk.webserver.dao.his.dictionary.PersonnelDictDao;
|
|
|
import thyyxxk.webserver.dao.his.dictionary.ZdEducationCodeDao;
|
|
|
import thyyxxk.webserver.dao.his.dictionary.ZdEmpInmarkDao;
|
|
@@ -13,6 +14,8 @@ import thyyxxk.webserver.dao.his.dictionary.ZdIfcadreDao;
|
|
|
import thyyxxk.webserver.dao.his.dictionary.ZdUnitClassDao;
|
|
|
import thyyxxk.webserver.dao.his.dictionary.ZdUnitCodeDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.dictionary.EmployeeMi;
|
|
|
+import thyyxxk.webserver.entity.dictionary.EmployeeMiVo;
|
|
|
import thyyxxk.webserver.entity.dictionary.ZdEducationCode;
|
|
|
import thyyxxk.webserver.entity.dictionary.ZdEmpInmark;
|
|
|
import thyyxxk.webserver.entity.dictionary.ZdEmpPosition;
|
|
@@ -60,10 +63,13 @@ public class PersonnelDictService {
|
|
|
|
|
|
private final ZdEmpInmarkDao empInmarkDao;
|
|
|
|
|
|
+ private final EmployeeMiDao employeeMiDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
public PersonnelDictService(PersonnelDictDao dao, ZdUnitCodeDao deptDao, RedisLikeService redis,
|
|
|
ZdUnitClassDao deptClassDao, ZdEmpPositionDao empPositionDao, ZdEmpTitleDao empTitleDao,
|
|
|
- ZdEducationCodeDao educationCodeDao, ZdIfcadreDao ifcadreDao, ZdEmpInmarkDao empInmarkDao) {
|
|
|
+ ZdEducationCodeDao educationCodeDao, ZdIfcadreDao ifcadreDao, ZdEmpInmarkDao empInmarkDao,
|
|
|
+ EmployeeMiDao employeeMiDao) {
|
|
|
this.dao = dao;
|
|
|
this.deptDao = deptDao;
|
|
|
this.redis = redis;
|
|
@@ -73,6 +79,7 @@ public class PersonnelDictService {
|
|
|
this.educationCodeDao = educationCodeDao;
|
|
|
this.ifcadreDao = ifcadreDao;
|
|
|
this.empInmarkDao = empInmarkDao;
|
|
|
+ this.employeeMiDao = employeeMiDao;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -660,4 +667,82 @@ public class PersonnelDictService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Description 根据text查询职工信息
|
|
|
+ * @Author hsh
|
|
|
+ * @param text 关键字
|
|
|
+ * @return EmployeeMiVo 职工信息
|
|
|
+ * @Date 2023/12/25 10:51
|
|
|
+ */
|
|
|
+ public ResultVo<List<EmployeeMiVo>> selectEmployeeMi(String text){
|
|
|
+ return ResultVoUtil.success(employeeMiDao.selectEmployeeMiAll(text));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 根据code查询职工信息
|
|
|
+ * @Author hsh
|
|
|
+ * @param code 职工编码
|
|
|
+ * @return EmployeeMi 职工信息
|
|
|
+ * @Date 2023/12/26 10:39
|
|
|
+ */
|
|
|
+ public ResultVo<EmployeeMi> selectEmployeeMiByCode(String code){
|
|
|
+ return ResultVoUtil.success(employeeMiDao.selectEmployeeMiByCode(code));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 根据code删除职工信息
|
|
|
+ * @Author hsh
|
|
|
+ * @param code 职工编码
|
|
|
+ * @return map
|
|
|
+ * @Date 2023/12/26 10:54
|
|
|
+ */
|
|
|
+ public ResultVo<Map<String, Object>> delEmployeeMiByCode(String code){
|
|
|
+ if (StringUtil.isBlank(code)) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有职工编码,请检查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ try{
|
|
|
+ int num = employeeMiDao.deleteEmployeeMiByCode(code);
|
|
|
+ if(num == 0){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "删除职工字典失败!");
|
|
|
+ }
|
|
|
+ resultMap.put("cg", "删除职工字典成功!");
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ } catch(Exception e){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "删除职工字典失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 根据code更新员工信息停用状态
|
|
|
+ * @Author hsh
|
|
|
+ * @param code 员工编码
|
|
|
+ * @return map
|
|
|
+ * @Date 2023/12/26 14:46
|
|
|
+ */
|
|
|
+ public ResultVo<Map<String, Object>> updateEmployeeMiDelFlagByCode(String code, String delFlag){
|
|
|
+ if(StringUtil.isBlank(code)) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有职工编码,请检查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ EmployeeMi emp = employeeMiDao.selectEmployeeMiByCode(code);
|
|
|
+ if(null == emp){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, code + "的职工字典信息不存在,请检查!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ try{
|
|
|
+ int num = employeeMiDao.updateEmployeeMiDelFlagByCode(code, delFlag);
|
|
|
+ if(num == 0){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新职工字典停用或启用失败!");
|
|
|
+ }
|
|
|
+ resultMap.put("cg", "更新职工字典停用或启用成功!");
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ } catch(Exception e){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新职工字典停用或启用失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|