浏览代码

职工字典查询

hsh 1 年之前
父节点
当前提交
9e927a59e1

+ 22 - 0
src/main/java/thyyxxk/webserver/controller/dictionary/PersonnelDictController.java

@@ -9,6 +9,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 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;
@@ -163,4 +165,24 @@ public class PersonnelDictController {
         return service.delEmpInmarkByCode(code);
     }
 
+    @GetMapping("/selectEmployeeMi")
+    public ResultVo<List<EmployeeMiVo>> selectEmployeeMi(@RequestParam("text") String text){
+        return service.selectEmployeeMi(text);
+    }
+
+    @GetMapping("/selectEmployeeMiByCode")
+    public ResultVo<EmployeeMi> selectEmployeeMiByCode(@RequestParam("code") String code){
+        return service.selectEmployeeMiByCode(code);
+    }
+
+    @GetMapping("/delEmployeeMiByCode")
+    public ResultVo<Map<String, Object>> delEmployeeMiByCode(@RequestParam("code") String code){
+        return service.delEmployeeMiByCode(code);
+    }
+
+    @GetMapping("/updateEmployeeMiDelFlagByCode")
+    public ResultVo<Map<String, Object>> updateEmployeeMiDelFlagByCode(@RequestParam("code") String code, @RequestParam("delFlag") String delFlag){
+        return service.updateEmployeeMiDelFlagByCode(code, delFlag);
+    }
+
 }

+ 74 - 0
src/main/java/thyyxxk/webserver/dao/his/dictionary/EmployeeMiDao.java

@@ -0,0 +1,74 @@
+package thyyxxk.webserver.dao.his.dictionary;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import thyyxxk.webserver.entity.dictionary.EmployeeMi;
+import thyyxxk.webserver.entity.dictionary.EmployeeMiVo;
+
+import java.util.List;
+
+@Mapper
+public interface EmployeeMiDao extends BaseMapper<EmployeeMi> {
+
+    @Select("  select mi.code,   " +
+            "         mi.dept_code, rtrim(unit.name) as dept_name,   " +
+            "         rtrim(mi.name) as name,   " +
+            "         mi.emp_po_code, rtrim(po.name) as emp_po_name,  " +
+            "         mi.py_code,   " +
+            "         mi.d_code,   " +
+            "         mi.emp_tit_code, rtrim(tit.name) as emp_tit_name,  " +
+            "         mi.mark, rtrim(mark.name) as mark_name,  " +
+            "         mi.dept_code_2,   " +
+            "         mi.prof_type,   " +
+            "         mi.ifcadre, rtrim(ifcadre.name) as ifcadre_name,  " +
+            "         mi.limited,   " +
+            "         mi.order_yn,   " +
+            "         mi.del_flag,  " +
+            "         mi.n_code, " +
+            "         '0' as new_flag,  " +
+            "         mi.code_rs,  " +
+            "         mi.ysjb, rtrim(ysjb.name) as ysjb_name, " +
+            "         mi.gh_charge_type, rtrim(hb.name) as gh_charge_name, " +
+            "         mi.rs_pr_sj,  " +
+            "         mi.doctor_xz_yp,  " +
+            "         mi.login_flag, " +
+            "         isnull(mi.del_flag,'0') as del_flag_b, " +
+            "         mi.social_no,  " +
+            "         mi.phone_no,  " +
+            "         mi.yb_code  " +
+            "    from a_employee_mi as mi  " +
+            "    left join zd_unit_code as unit " +
+            "      on mi.dept_code = unit.code and isnull(unit.del_flag, '') <> '1' " +
+            "    left join zd_emp_position as po  " +
+            "      on mi.emp_po_code = po.code " +
+            "    left join zd_emp_title as tit  " +
+            "      on mi.emp_tit_code = tit.code " +
+            "    left join zd_emp_inmark as mark  " +
+            "      on mi.mark = mark.code " +
+            "    left join zd_ifcadre as ifcadre  " +
+            "      on mi.ifcadre = ifcadre.code " +
+            "    left join ysh_zd_ysjb as ysjb " +
+            "      on mi.ysjb = ysjb.code " +
+            "    left join mzy_zd_charge_type as hb " +
+            "      on mi.gh_charge_type = hb.code " +
+            "   where isnull(mi.py_code,'') like ('%' + upper(#{text}) + '%')  " +
+            "      or isnull(mi.d_code,'') like ('%' + upper(#{text}) + '%')  " +
+            "      or (isnull(mi.code,'') like '%${text}%' or isnull(mi.n_code,'') like '${text}%') " +
+            "      or isnull(mi.name,'') like '%${text}%' " +
+            "   order by mi.code ")
+    List<EmployeeMiVo> selectEmployeeMiAll(@Param("text") String text);
+
+    @Select(" select mi.* from a_employee_mi mi where mi.code = #{code} ")
+    EmployeeMi selectEmployeeMiByCode(@Param("code") String code);
+
+    @Delete(" delete from a_employee_mi where code = #{code} ")
+    int deleteEmployeeMiByCode(@Param("code") String code);
+
+    @Update(" update a_employee_mi set del_flag = #{delFlag} where code = #{code} ")
+    int updateEmployeeMiDelFlagByCode(@Param("code") String code, @Param("delFlag") String delFlag);
+
+}

+ 127 - 0
src/main/java/thyyxxk/webserver/entity/dictionary/EmployeeMi.java

@@ -0,0 +1,127 @@
+package thyyxxk.webserver.entity.dictionary;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName EmployeeMi
+ * @Author hsh
+ * @Date 2023/12/22 15:34
+ * @Version 1.0
+ * @Description 员工表
+ **/
+@Data
+@TableName(value = "a_employee_mi")
+public class EmployeeMi implements Serializable {
+    private static final long serialVersionUID = -1L;
+
+    private String code;
+    private String deptCode;
+    private String name;
+    private String empPoCode;
+    private String pyCode;
+    private String empTitCode;
+    private String dCode;
+    private String paymentCode;
+    private String mark;
+    @TableField(value = "dept_code_2")
+    private String deptCode2;
+    private String profType;
+    private String ifcadre;
+    private String workType;
+    private String limited;
+    private String orderYn;
+    private String delFlag;
+    private String nCode;
+    private String deptYp;
+    private String codeRs;
+    private String ysjb;
+    private String sexCode;
+    private Date birthDate;
+    private String marryStatus;
+    private String jhsyFlag;
+    private String nationCode;
+    private String countryCode;
+    private String ryDate;
+    private String ryDw;
+    private String zwCode;
+    private String zcCode;
+    private String zwDate;
+    private String zcDate;
+    private String birthPlace;
+    private String jtcs;
+    private String grcf;
+    private String zzxl;
+    private String zzxlDate;
+    private String zzxlXx;
+    private String zzmm;
+    private String zzmmDate;
+    private String dnzw;
+    private String grsf;
+    private String ryyy;
+    private String jtdz;
+    private String arxm;
+    private String ardw;
+    private String jtdh;
+    private String lxdh;
+    private String sfzh;
+    private String zcTj;
+    private String zcTjDate;
+    @TableField(value = "zw_code_2")
+    private String zwCode2;
+    @TableField(value = "zw_date_2")
+    private String zwDate2;
+    private String ghFlag;
+    private String ghDate;
+    private String bzFlag;
+    private String sysId;
+    private String dnzwDate;
+    private String hkPlace;
+    private String joinTime;
+    private String rsly;
+    private String breakTime;
+    private String addsalaryClass;
+    private String retireTime;
+    private String retireAddress;
+    private String ifReturn;
+    private String returnKs;
+    private String returnGroup;
+    private String rsKscode;
+    private String rsYgxz;
+    private String rsName;
+    private String rsGzjb;
+    private String rsGzfl;
+    private String rsGzzh;
+    private String rsHxxl;
+    private String rsSjly;
+    private String rsShsj;
+    private String rsLysj;
+    private String rsWorkFlag;
+    private String rsDelFlag;
+    private String rsWorkClass;
+    private String rsPileHoliday;
+    private String orderFlag;
+    private String rsEduDegree;
+    private String rsPrZc;
+    private Date rsPrSj;
+    private Date deathDate;
+    private String ghChargeType;
+    private String doctorXzYp;
+    private String loginFlag;
+    private String wxHomepageFlag;
+    private String portrait;
+    private String introduction;
+    private String specialty;
+    private String wxHomepageOrder;
+    private String showManageFlag;
+    private String portraitBackup;
+    private String socialNo;
+    private String phoneNo;
+    private String ybCode;
+    private String antitumorLevel;
+
+}

+ 65 - 0
src/main/java/thyyxxk/webserver/entity/dictionary/EmployeeMiVo.java

@@ -0,0 +1,65 @@
+package thyyxxk.webserver.entity.dictionary;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
+/**
+ * @ClassName EmployeeMiVo
+ * @Author hsh
+ * @Date 2023/12/25 9:26
+ * @Version 1.0
+ * @Description 职工的vo
+ **/
+@Data
+public class EmployeeMiVo {
+
+    private String code;
+    // 科室编码
+    private String deptCode;
+    private String deptName;
+    private String name;
+    // 职务编码
+    private String empPoCode;
+    private String empPoName;
+    private String pyCode;
+    private String dCode;
+    // 技术职称编码
+    private String empTitCode;
+    private String empTitName;
+    // 在院标志编码
+    private String mark;
+    private String markName;
+    @TableField(value = "dept_code_2")
+    private String deptCode2;
+    private String profType;
+    // 干工标志编码
+    private String ifcadre;
+    private String ifcadreName;
+    private String limited;
+    // 医生处方权(1: 普通处方权; 2: 毒麻药处方权)
+    private String orderYn;
+    // 删除标志
+    private String delFlag;
+    private String nCode;
+    private String newFlag;
+    private String deptYp;
+    // 人事职工编码(工号)
+    private String codeRs;
+    // 病历(医生)级别
+    private String ysjb;
+    private String ysjbName;
+    // 挂号级别
+    private String ghChargeType;
+    private String ghChargeName;
+    private String rsPrSj;
+    // 限制药品级别(0: 非限制使用药品; 1: 限制使用药品; 2: 特殊使用药品)
+    private String doctorXzYp;
+    // 病区允许就诊(1: 允许; 2: 不允许)
+    private String loginFlag;
+    // 停用
+    private String delFlagB;
+    private String socialNo;
+    private String phoneNo;
+    private String ybCode;
+
+}

+ 86 - 1
src/main/java/thyyxxk/webserver/service/dictionary/PersonnelDictService.java

@@ -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, "更新职工字典停用或启用失败!");
+        }
+
+    }
+
 }