瀏覽代碼

科室字典维护代码开发

hurugang 6 年之前
父節點
當前提交
ed78a0d935

+ 57 - 0
src/main/java/cn/hnthyy/thmz/entity/his/ZdUnitCode.java

@@ -0,0 +1,57 @@
+package cn.hnthyy.thmz.entity.his;
+
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * 科室字典
+ */
+@Data
+public class ZdUnitCode {
+    //原科室编码 修改的时候需要用
+    private String originalCode;
+    //科室编码
+    private String code;
+    //科室名称
+    private String name;
+    //科室分类编码
+    private Integer classCode;
+    //科室拼音码
+    private String pyCode;
+    //科室五笔码
+    private String dCode;
+    //门诊科室标记
+    private Integer mzFlag;
+    //停用标记
+    private Integer delFlag;
+    //院内码
+    private Integer nCode;
+    //医技标志
+    private Integer yjFlag;
+    //门诊人次统计标志
+    private Integer mzrcFlag;
+    //父科室编号
+    private String parentCode;
+    //收取挂号费标志
+    private Integer ghChargeFlag;
+    //科室地点
+    private String officePos;
+    //给药方式执行科室
+    private Integer supplyFlag;
+    //新农合编码
+    private String xnhDeptCode;
+    //新农合名称
+    private String xnhDeptName;
+    //门诊挂号就诊标志
+    private Integer ghjzFlag;
+    //微信门诊分类标志
+    private String mzClass;
+    //排序码
+    private String sortCode;
+    //操作人id
+    private String opId;
+    //操作日期
+    private Date opDate;
+    //科室分类名称
+    private String classValue;
+}

+ 35 - 0
src/main/java/cn/hnthyy/thmz/enums/YesNoEnum.java

@@ -0,0 +1,35 @@
+package cn.hnthyy.thmz.enums;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * yes or no enum
+ */
+public enum YesNoEnum {
+    YES(1,"是"),
+    NO(0,"否");
+
+    public Integer code;
+    public String name;
+
+    YesNoEnum(Integer code, String name){
+        this.code=code;
+        this.name=name;
+    }
+
+    /**
+     * 根据编码查询对应的类型
+     * @param code
+     * @return
+     */
+    public static YesNoEnum getYesNoByCode(String code){
+        List<YesNoEnum> yesNoEnums= Arrays.asList(values());
+        for (YesNoEnum yesNoEnum:yesNoEnums){
+            if(yesNoEnum.code.equals(code)){
+                return yesNoEnum;
+            }
+        }
+        return null;
+    }
+}

+ 224 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/ZdUnitCodeMapper.java

@@ -0,0 +1,224 @@
+package cn.hnthyy.thmz.mapper.his;
+
+import cn.hnthyy.thmz.entity.his.ZdUnitCode;
+import cn.hnthyy.thmz.vo.PageViewVO;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+public interface ZdUnitCodeMapper {
+    /**
+     * 分页查询科室字典列表
+     *
+     * @param zdUnitCode 科室查询条件
+     * @param pageViewVO 分页数据
+     * @return
+     */
+    @Select({"<script>",
+            "SELECT top ${pageSize} code,name,class_code,py_code,d_code,mz_flag,del_flag,n_code,yj_flag,mzrc_flag,parent_code,gh_charge_flag,office_pos,",
+            "supply_flag,xnh_dept_code,xnh_dept_name,ghjz_flag,mz_class,sort_code,op_id,op_date FROM (SELECT ROW_NUMBER() OVER (ORDER BY zd_unit_code_page.${orderByCase} desc) ",
+            "AS RowNumber,* from dbo.zd_unit_code zd_unit_code_page where del_flag=0 ",
+            "<when test='code!=null'>",
+            " and code =#{code,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='name!=null'>",
+            " and name like#{name,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='classCode!=null'>",
+            " and class_code =#{classCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='pyCode!=null'>",
+            " and py_code =#{pyCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='dCode!=null'>",
+            " and d_code =#{dCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='mzFlag!=null'>",
+            " and mz_flag =#{mzFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='nCode!=null'>",
+            " and n_code =#{nCode,jdbcType=VARCHAR}",
+            "</when>",
+            "</when>",
+            "<when test='yjFlag!=null'>",
+            " and yj_flag =#{yjFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='ghChargeFlag!=null'>",
+            " and gh_charge_flag =#{ghChargeFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='ghjzFlag!=null'>",
+            " and ghjz_flag =#{ghjzFlag,jdbcType=CHAR}",
+            "</when>",
+            ") as A WHERE RowNumber >#{pageSize}*#{pageIndex} order by RowNumber asc",
+            "</script>"})
+    List<ZdUnitCode> selectZdUnitCodeWithPage(ZdUnitCode zdUnitCode, PageViewVO pageViewVO);
+
+
+    /**
+     * 统计科室字典总数
+     *
+     * @param zdUnitCode 科室查询条件
+     * @return
+     */
+    @Select({"<script>",
+            "SELECT count(1) from dbo.zd_unit_code where del_flag=0 ",
+            "<when test='code!=null'>",
+            " and code =#{code,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='name!=null'>",
+            " and name like#{name,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='classCode!=null'>",
+            " and class_code =#{classCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='pyCode!=null'>",
+            " and py_code =#{pyCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='dCode!=null'>",
+            " and d_code =#{dCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='mzFlag!=null'>",
+            " and mz_flag =#{mzFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='nCode!=null'>",
+            " and n_code =#{nCode,jdbcType=VARCHAR}",
+            "</when>",
+            "</when>",
+            "<when test='yjFlag!=null'>",
+            " and yj_flag =#{yjFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='ghChargeFlag!=null'>",
+            " and gh_charge_flag =#{ghChargeFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='ghjzFlag!=null'>",
+            " and ghjz_flag =#{ghjzFlag,jdbcType=CHAR}",
+            "</when>",
+            "</script>"})
+    int countZdUnitCode(ZdUnitCode zdUnitCode);
+
+
+    /**
+     * 检查修改或者新增数据是否重复 部门编码 部门名称 新农合编码 新农合名称
+     *
+     * @param zdUnitCode 科室查询条件
+     * @return
+     */
+    @Select({"<script>",
+            "SELECT count(1) from dbo.zd_unit_code where 1=1 ",
+            "<when test='code!=null'>",
+            " and code =#{code,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='name!=null'>",
+            " and name =#{name,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='xnhDeptCode!=null'>",
+            " and xnh_dept_code =#{xnhDeptCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='xnhDeptName!=null'>",
+            " and xnh_dept_name =#{xnhDeptName,jdbcType=VARCHAR}",
+            "</when>",
+            "</script>"})
+    int checkZdUnitCode(ZdUnitCode zdUnitCode);
+
+    /**
+     * 新增科室字典
+     *
+     * @param zdUnitCode
+     * @return
+     */
+    @Insert("INSERT INTO dbo.zd_unit_code(code,name,class_code,py_code,d_code,mz_flag,del_flag,n_code,yj_flag,mzrc_flag,parent_code," +
+            "gh_charge_flag,office_pos,supply_flag,xnh_dept_code,xnh_dept_name,ghjz_flag,mz_class,sort_code,op_id,op_date )VALUES(#{code,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR}" +
+            ",#{classCode,jdbcType=VARCHAR},#{pyCode,jdbcType=VARCHAR},#{dCode,jdbcType=VARCHAR},#{mzFlag,jdbcType=CHAR},#{delFlag,jdbcType=CHAR},#{nCode,jdbcType=VARCHAR},#{yjFlag,jdbcType=CHAR}" +
+            ",#{mzrcFlag,jdbcType=CHAR},#{parentCode,jdbcType=CHAR},#{ghChargeFlag,jdbcType=CHAR},#{officePos,jdbcType=VARCHAR},#{supplyFlag,jdbcType=CHAR},#{xnhDeptCode,jdbcType=VARCHAR}" +
+            ",#{xnhDeptName,jdbcType=VARCHAR},#{ghjzFlag,jdbcType=CHAR},#{mzClass,jdbcType=VARCHAR},#{sortCode,jdbcType=VARCHAR},#{opId,jdbcType=VARCHAR},#{opDate,jdbcType=DATETIME}) ")
+    int insertZdUnitCode(ZdUnitCode zdUnitCode);
+
+    /**
+     * 修改科室字典
+     *
+     * @param zdUnitCode
+     * @return
+     */
+    @Update({"<script>",
+            "update dbo.zd_unit_code",
+            "<trim prefix='set' prefixOverrides=',' suffix=' where code = #{originalCode} '>",
+            "<when test='code!=null'>",
+            "code =#{code,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='name!=null'>",
+            ",name =#{name,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='classCode!=null'>",
+            ",class_code =#{classCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='pyCode!=null'>",
+            ",py_code =#{pyCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='dCode!=null'>",
+            ",d_code =#{dCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='mzFlag!=null'>",
+            ",mz_flag =#{mzFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='delFlag!=null'>",
+            ",del_flag =#{delFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='nCode!=null'>",
+            ",n_code =#{nCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='yjFlag!=null'>",
+            ",yj_flag =#{yjFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='mzrcFlag!=null'>",
+            ",mzrc_flag =#{mzrcFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='parentCode!=null'>",
+            ",parent_code =#{parentCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='ghChargeFlag!=null'>",
+            ",gh_charge_flag =#{ghChargeFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='officePos!=null'>",
+            ",office_pos =#{officePos,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='supplyFlag!=null'>",
+            ",supply_flag =#{supplyFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='xnhDeptCode!=null'>",
+            ",xnh_dept_code =#{xnhDeptCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='xnhDeptName!=null'>",
+            ",xnh_dept_name =#{xnhDeptName,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='ghjzFlag!=null'>",
+            ",ghjz_flag =#{ghjzFlag,jdbcType=CHAR}",
+            "</when>",
+            "<when test='mzClass!=null'>",
+            ",mz_class =#{mzClass,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='sortCode!=null'>",
+            ",sort_code =#{sortCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='opId!=null'>",
+            ",op_id =#{opId,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='opDate!=null'>",
+            ",op_date =#{opDate,jdbcType=DATETIME}",
+            "</when>",
+            "</trim>",
+            "</script>"})
+    int updateZdUnitCode(ZdUnitCode zdUnitCode);
+
+    /**
+     * 根据科室编码查询科室信息
+     *
+     * @param code 科室编码
+     * @return
+     */
+    @Select("select code,name,class_code,py_code,d_code,mz_flag,del_flag,n_code,yj_flag,mzrc_flag,parent_code,gh_charge_flag,office_pos,supply_flag,xnh_dept_code," +
+            "xnh_dept_name,ghjz_flag,mz_class,sort_code,op_id,op_date from dbo.zd_unit_code where code=#{code,jdbcType=VARCHAR}")
+    ZdUnitCode selectByCode(@Param("code") String code);
+}

+ 58 - 0
src/main/java/cn/hnthyy/thmz/service/his/ZdUnitCodeService.java

@@ -0,0 +1,58 @@
+package cn.hnthyy.thmz.service.his;
+
+import cn.hnthyy.thmz.entity.his.ZdUnitCode;
+import cn.hnthyy.thmz.vo.PageViewVO;
+import java.util.List;
+
+public interface ZdUnitCodeService {
+    /**
+     * 分页查询科室字典列表
+     *
+     * @param zdUnitCode 科室查询条件
+     * @param pageViewVO 分页数据
+     * @return
+     */
+    List<ZdUnitCode> queryZdUnitCodeWithPage(ZdUnitCode zdUnitCode, PageViewVO pageViewVO);
+
+
+    /**
+     * 统计科室字典总数
+     *
+     * @param zdUnitCode 科室查询条件
+     * @return
+     */
+    int countZdUnitCode(ZdUnitCode zdUnitCode);
+
+
+    /**
+     * 检查修改或者新增数据是否重复 部门编码 部门名称 新农合编码 新农合名称
+     *
+     * @param zdUnitCode 科室查询条件
+     * @return
+     */
+    int checkZdUnitCode(ZdUnitCode zdUnitCode);
+
+    /**
+     * 新增科室字典
+     *
+     * @param zdUnitCode
+     * @return
+     */
+    int saveZdUnitCode(ZdUnitCode zdUnitCode);
+
+    /**
+     * 修改科室字典
+     *
+     * @param zdUnitCode
+     * @return
+     */
+    int modifyZdUnitCode(ZdUnitCode zdUnitCode);
+
+    /**
+     * 根据科室编码查询科室信息
+     *
+     * @param code 科室编码
+     * @return
+     */
+    ZdUnitCode queryByCode(String code);
+}

+ 45 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/ZdUnitCodeServiceImpl.java

@@ -0,0 +1,45 @@
+package cn.hnthyy.thmz.service.impl.his;
+
+import cn.hnthyy.thmz.entity.his.ZdUnitCode;
+import cn.hnthyy.thmz.mapper.his.ZdUnitCodeMapper;
+import cn.hnthyy.thmz.service.his.ZdUnitCodeService;
+import cn.hnthyy.thmz.vo.PageViewVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+@Service
+public class ZdUnitCodeServiceImpl implements ZdUnitCodeService {
+    @SuppressWarnings("all")
+    @Autowired
+    private ZdUnitCodeMapper zdUnitCodeMapper;
+    @Override
+    public List<ZdUnitCode> queryZdUnitCodeWithPage(ZdUnitCode zdUnitCode, PageViewVO pageViewVO) {
+        return zdUnitCodeMapper.selectZdUnitCodeWithPage(zdUnitCode,pageViewVO);
+    }
+
+    @Override
+    public int countZdUnitCode(ZdUnitCode zdUnitCode) {
+        return zdUnitCodeMapper.countZdUnitCode(zdUnitCode);
+    }
+
+    @Override
+    public int checkZdUnitCode(ZdUnitCode zdUnitCode) {
+        return zdUnitCodeMapper.checkZdUnitCode(zdUnitCode);
+    }
+
+    @Override
+    public int saveZdUnitCode(ZdUnitCode zdUnitCode) {
+        return zdUnitCodeMapper.insertZdUnitCode(zdUnitCode);
+    }
+
+    @Override
+    public int modifyZdUnitCode(ZdUnitCode zdUnitCode) {
+        return zdUnitCodeMapper.updateZdUnitCode(zdUnitCode);
+    }
+
+    @Override
+    public ZdUnitCode queryByCode(String code) {
+        return zdUnitCodeMapper.selectByCode(code);
+    }
+}

+ 40 - 0
src/main/java/cn/hnthyy/thmz/vo/PageViewVO.java

@@ -0,0 +1,40 @@
+package cn.hnthyy.thmz.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 分页对象
+ */
+@Data
+public class PageViewVO {
+    //默认页
+    private   Integer pageIndex=0;
+    //默认页面展示数
+    private  Integer pageSize=10;
+    //总记录数
+    private List data;
+    //总页数
+    private Integer totalPages;
+    //总记录数
+    private Integer total;
+
+    public PageViewVO() {
+
+    }
+
+    public PageViewVO(Integer pageIndex, Integer pageSize) {
+        if(pageIndex!=null && pageIndex>0){
+            this.pageIndex=pageIndex;
+        }
+        if(pageSize!=null && pageSize>0){
+            this.pageSize=pageSize;
+        }
+    }
+
+    public void setTotal(int total) {
+        this.total = total;
+        totalPages= (total+pageSize-1)/pageSize;
+    }
+}

+ 3 - 1
src/main/resources/static/js/menu.js

@@ -195,7 +195,9 @@ function imgFun (url, imgs) {
     xhr.send();
 }
 
-
+/**
+ * 打开上传图片操纵框
+ */
 function profileImage() {
     $("#mydropzone").css("display","block");
     $("#profileImageTitleInfo").removeClass('hide').addClass('in');

+ 23 - 35
src/main/resources/templates/menu.html

@@ -52,9 +52,9 @@
                 <!-- sidebar menu -->
                 <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                     <div class="menu_section">
-                        <h3>General</h3>
+                        <h3>门诊业务</h3>
                         <ul class="nav side-menu">
-                            <li><a><i class="fa fa-home"></i> Home <span class="fa fa-chevron-down"></span></a>
+                            <li><a><i class="fa fa-home"></i> 首页 <span class="fa fa-chevron-down"></span></a>
                                 <ul class="nav child_menu">
                                     <li><a href="index.html">Dashboard</a></li>
                                     <li><a href="index2.html">Dashboard2</a></li>
@@ -110,7 +110,7 @@
                         </ul>
                     </div>
                     <div class="menu_section">
-                        <h3>Live On</h3>
+                        <h3>系统管理</h3>
                         <ul class="nav side-menu">
                             <li><a><i class="fa fa-bug"></i> Additional Pages <span
                                     class="fa fa-chevron-down"></span></a>
@@ -210,54 +210,42 @@
                             <ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
                                 <li>
                                     <a>
-                                        <span class="image"><img id="headImage1" src=""
-                                                                 alt="Profile Image"/></span>
+                                        <span class="image"><img id="headImage1" src="" alt="Profile Image"/></span>
                                         <span>
-                          <span>John Smith</span>
-                          <span class="time">3 mins ago</span>
-                        </span>
-                                        <span class="message">
-                          Film festivals used to be do-or-die moments for movie makers. They were where...
-                        </span>
+                                          <span>John Smith</span>
+                                          <span class="time">3 mins ago</span>
+                                        </span>
+                                        <span class="message">Film festivals used to be do-or-die moments for movie makers. They were where...</span>
                                     </a>
                                 </li>
                                 <li>
                                     <a>
-                                        <span class="image"><img id="headImage2" src=""
-                                                                 alt="Profile Image"/></span>
+                                        <span class="image"><img id="headImage2" src="" alt="Profile Image"/></span>
                                         <span>
-                          <span>John Smith</span>
-                          <span class="time">3 mins ago</span>
-                        </span>
-                                        <span class="message">
-                          Film festivals used to be do-or-die moments for movie makers. They were where...
-                        </span>
+                                          <span>John Smith</span>
+                                          <span class="time">3 mins ago</span>
+                                        </span>
+                                        <span class="message">Film festivals used to be do-or-die moments for movie makers. They were where...</span>
                                     </a>
                                 </li>
                                 <li>
                                     <a>
-                                        <span class="image"><img id="headImage3" src=""
-                                                                 alt="Profile Image"/></span>
+                                        <span class="image"><img id="headImage3" src="" alt="Profile Image"/></span>
                                         <span>
-                          <span>John Smith</span>
-                          <span class="time">3 mins ago</span>
-                        </span>
-                                        <span class="message">
-                          Film festivals used to be do-or-die moments for movie makers. They were where...
-                        </span>
+                                          <span>John Smith</span>
+                                          <span class="time">3 mins ago</span>
+                                        </span>
+                                        <span class="message">Film festivals used to be do-or-die moments for movie makers. They were where...</span>
                                     </a>
                                 </li>
                                 <li>
                                     <a>
-                                        <span class="image"><img id="headImage4" src=""
-                                                                 alt="Profile Image"/></span>
+                                        <span class="image"><img id="headImage4" src="" alt="Profile Image"/></span>
                                         <span>
-                          <span>John Smith</span>
-                          <span class="time">3 mins ago</span>
-                        </span>
-                                        <span class="message">
-                          Film festivals used to be do-or-die moments for movie makers. They were where...
-                        </span>
+                                          <span>John Smith</span>
+                                          <span class="time">3 mins ago</span>
+                                        </span>
+                                        <span class="message">Film festivals used to be do-or-die moments for movie makers. They were where...</span>
                                     </a>
                                 </li>
                                 <li>