瀏覽代碼

门诊给药方式维护

lighter 1 月之前
父節點
當前提交
b7120b2b21

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>13.5.3</version>
+    <version>13.5.6</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 60 - 5
src/main/java/thyyxxk/webserver/controller/orderZdMaintain/OrderZdMaintainController.java

@@ -4,7 +4,6 @@ import cn.hutool.core.util.StrUtil;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.RequiredArgsConstructor;
-import org.aspectj.apache.bcel.classfile.Code;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.aop.interfaces.NeedMenu;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
@@ -36,7 +35,6 @@ public class OrderZdMaintainController {
     private final ExtraCache extraCache;
     private final PublicServer publicServer;
 
-
     @GetMapping("/getChangeItemType")
     @NeedMenu(MenuEnum.orderZdMaintain)
     public ResultVo<List<CodeName>> getChangeItemType() {
@@ -143,7 +141,6 @@ public class OrderZdMaintainController {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
     }
 
-
     @AllArgsConstructor
     @Data
     public static class TempCodeName {
@@ -153,10 +150,12 @@ public class OrderZdMaintainController {
 
     @GetMapping("/getSupplyClass")
     @NeedMenu(MenuEnum.orderZdMaintain)
-    public ResultVo<List<TempCodeName>> getSupplyClass() {
+    public ResultVo<List<TempCodeName>> getSupplyClass(@RequestParam("desc") String desc) {
         List<TempCodeName> codeNames = new ArrayList<>();
         for (SupplyClass value : SupplyClass.values()) {
-            codeNames.add(new TempCodeName(value.getCode(), value.getName()));
+            if (value.getDesc().equals("all") || value.getDesc().equals(desc)) {
+                codeNames.add(new TempCodeName(value.getCode(), value.getName()));
+            }
         }
         return ResultVoUtil.success(codeNames);
     }
@@ -167,6 +166,12 @@ public class OrderZdMaintainController {
         return ResultVoUtil.success(dao.selectAllSupplyType());
     }
 
+    @GetMapping("/selectAllMzSupplyType")
+    @NeedMenu(MenuEnum.orderZdMaintain)
+    public ResultVo<List<MzZdSupplyType>> selectAllMzSupplyType() {
+        return ResultVoUtil.success(dao.selectAllMzSupplyType());
+    }
+
     @PostMapping("/insertSupplyType")
     @NeedMenu(MenuEnum.orderZdMaintain)
     public ResultVo<String> insertSupplyType(@RequestBody YzSupplyTypeDTO param) {
@@ -175,6 +180,14 @@ public class OrderZdMaintainController {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
     }
 
+    @PostMapping("/insertMzSupplyType")
+    @NeedMenu(MenuEnum.orderZdMaintain)
+    public ResultVo<String> insertMzSupplyType(@RequestBody MzZdSupplyType param) {
+        param.setSupplyCode(publicServer.getMzSupplyNo());
+        dao.insertMzSupplyType(param);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
+    }
+
     @PostMapping("/updateSupplyType")
     @NeedMenu(MenuEnum.orderZdMaintain)
     public ResultVo<String> updateSupplyType(@RequestBody YzSupplyTypeDTO param) {
@@ -182,6 +195,13 @@ public class OrderZdMaintainController {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
     }
 
+    @PostMapping("/updateMzSupplyType")
+    @NeedMenu(MenuEnum.orderZdMaintain)
+    public ResultVo<String> updateMzSupplyType(@RequestBody MzZdSupplyType param) {
+        dao.updateMzSupplyType(param);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
+    }
+
     @GetMapping("/deleteSupplyType")
     @NeedMenu(MenuEnum.orderZdMaintain)
     public ResultVo<String> deleteSupplyType(@RequestParam("code") String code,
@@ -190,6 +210,14 @@ public class OrderZdMaintainController {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
     }
 
+    @GetMapping("/deleteMzSupplyType")
+    @NeedMenu(MenuEnum.orderZdMaintain)
+    public ResultVo<String> deleteMzSupplyType(@RequestParam("code") String code,
+                                             @RequestParam("delFlag") String delFlag) {
+        dao.delMzSupplyType(code, delFlag);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
+    }
+
     @Data
     public static class SupplyCharge {
         private String supplyCode;
@@ -204,6 +232,12 @@ public class OrderZdMaintainController {
         return ResultVoUtil.success(dao.getSupplyCharges(code));
     }
 
+    @GetMapping("/getMzSupplyCharges")
+    @NeedMenu(MenuEnum.orderZdMaintain)
+    public ResultVo<List<SupplyCharge>> getMzSupplyCharges(@RequestParam("code") String code) {
+        return ResultVoUtil.success(dao.getMzSupplyCharges(code));
+    }
+
     @GetMapping("/delSupplyCharge")
     @NeedMenu(MenuEnum.orderZdMaintain)
     public ResultVo<String> delSupplyCharge(@RequestParam("code") String code,
@@ -212,6 +246,14 @@ public class OrderZdMaintainController {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
     }
 
+    @GetMapping("/delMzSupplyCharge")
+    @NeedMenu(MenuEnum.orderZdMaintain)
+    public ResultVo<String> delMzSupplyCharge(@RequestParam("code") String code,
+                                            @RequestParam("chargeCode") String chargeCode) {
+        dao.delMzSupplyCharge(code, chargeCode);
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
+    }
+
     @Data
     public static class SaveSupplyCharge {
         private String supplyCode;
@@ -232,4 +274,17 @@ public class OrderZdMaintainController {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
     }
 
+    @PostMapping("/saveMzSupplyCharge")
+    public ResultVo<String> saveMzSupplyCharge(@RequestBody SaveSupplyCharge param) {
+        if (ListUtil.isBlank(param.getList())) {
+            return ResultVoUtil.fail(ExceptionEnum.SUCCESS);
+        }
+        dao.delMzSupplyChargeByCode(param.getSupplyCode());
+        ListUtil.batchList(param.getList(), OrderZdMaintainDao.class, (m, i) -> {
+            if (StrUtil.isNotBlank(i.getChargeCode())) {
+                m.insertMzSupplyCharge(param.getSupplyCode(), i.getChargeCode(), i.getChargeAmount());
+            }
+        });
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_EL_NOTIFICATION);
+    }
 }

+ 3 - 0
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -56,6 +56,9 @@ public interface PublicDao {
     @Select("select supply_code from yz_sequence")
     int getSupply();
 
+    @Select("select max(supply_code) from mz_zd_supply_type")
+    int getMzSupply();
+
     @Update("update yz_sequence set supply_code = #{newSupply} where supply_code = #{oldSupply} ")
     int updateSupply(int oldSupply,int newSupply);
 

+ 45 - 0
src/main/java/thyyxxk/webserver/dao/his/orderZdMaintain/OrderZdMaintainDao.java

@@ -238,6 +238,18 @@ public interface OrderZdMaintainDao {
             "FROM yz_supply_type a order by supply_code ")
     List<YzSupplyTypeDTO> selectAllSupplyType();
 
+    @Select("SELECT                \n" +
+            "rtrim(supply_name) as supply_name,\n" +
+            "rtrim(supply_code) as supply_code,\n" +
+            "rtrim(supply_occ)  as supply_occ,\n" +
+            "del_flag,sort_code,class_code,\n" +
+            "rtrim(print_name) AS print_name,\n" +
+            "rtrim(py_code) AS py_code,\n" +
+            "rtrim(d_code) AS  d_code,\n" +
+            "child_code,try_flag,\n" +
+            "childName = (select rtrim(c.supply_name) from mz_zd_supply_type c where c.supply_code = a.child_code)\n" +
+            "FROM mz_zd_supply_type a order by supply_code ")
+    List<MzZdSupplyType> selectAllMzSupplyType();
 
     @Insert("insert into yz_supply_type (supply_code, supply_name, del_flag, class, print_name, py_code,\n" +
             "                            d_code, supply_child, self_buy, ps_flag, pring_flag)\n" +
@@ -245,6 +257,12 @@ public interface OrderZdMaintainDao {
             "        #{psFlag}, #{pringFlag})")
     void insertSupplyType(YzSupplyTypeDTO yzSupplyTypeDTO);
 
+    @Insert("insert into mz_zd_supply_type (supply_code, supply_name, del_flag, class_code, " +
+            "print_name, py_code,d_code, child_code, try_flag) values " +
+            "(#{supplyCode}, #{supplyName}, '0', #{classCode}, #{printName}, #{pyCode}, " +
+            "#{dCode}, #{childCode}, #{tryFlag})")
+    void insertMzSupplyType(MzZdSupplyType mzZdSupplyType);
+
     @Update("UPDATE yz_supply_type \n" +
             "    SET \n" +
             "        supply_name = #{supplyName},\n" +
@@ -261,24 +279,51 @@ public interface OrderZdMaintainDao {
             "        supply_code = #{supplyCode}")
     void updateSupplyType(YzSupplyTypeDTO yzSupplyTypeDTO);
 
+    @Update("UPDATE mz_zd_supply_type SET \n" +
+            "supply_name = #{supplyName},\n" +
+            "del_flag = #{delFlag},\n" +
+            "class_code = #{classCode},\n" +
+            "print_name = #{printName},\n" +
+            "py_code = #{pyCode},\n" +
+            "d_code = #{dCode},\n" +
+            "child_code = #{childCode},\n" +
+            "try_flag = #{tryFlag}\n" +
+            "WHERE supply_code = #{supplyCode}")
+    void updateMzSupplyType(MzZdSupplyType mzZdSupplyType);
 
     @Update("update yz_supply_type set del_flag = #{delFlag} where supply_code = #{code} ")
     void delSupplyType(String code, String delFlag);
 
+    @Update("update mz_zd_supply_type set del_flag = #{delFlag} where supply_code = #{code} ")
+    void delMzSupplyType(String code, String delFlag);
 
     @Select("select charge_code, charge_amount, " +
             "charge_name = (select rtrim(name) from zd_charge_item where charge_code = code)\n" +
             "from yz_supply_charge where supply_code = #{code}")
     List<OrderZdMaintainController.SupplyCharge> getSupplyCharges(String code);
 
+    @Select("select charge_code, amount as chargeAmount,\n" +
+            "charge_name = (select rtrim(name) from zd_charge_item where charge_code = code)\n" +
+            "from mz_zd_supply_charge where supply_code = #{code}")
+    List<OrderZdMaintainController.SupplyCharge> getMzSupplyCharges(String code);
+
     @Delete("delete yz_supply_charge where supply_code = #{code} and charge_code = #{chargeCode}")
     void delSupplyCharge(String code, String chargeCode);
 
+    @Delete("delete from mz_zd_supply_charge where supply_code = #{code} and charge_code = #{chargeCode}")
+    void delMzSupplyCharge(String code, String chargeCode);
+
     @Insert("insert into yz_supply_charge(supply_code, charge_code, charge_amount)" +
             " values (#{code},#{chargeCode},#{chargeAmount})")
     void insertSupplyCharge(String code, String chargeCode, BigDecimal chargeAmount);
 
+    @Insert("insert into mz_zd_supply_charge(supply_code, charge_code, amount)" +
+            " values (#{code},#{chargeCode},#{chargeAmount})")
+    void insertMzSupplyCharge(String code, String chargeCode, BigDecimal chargeAmount);
+
     @Delete("delete yz_supply_charge where supply_code = #{code}")
     void delSupplyChargeByCode(String code);
 
+    @Delete("delete from mz_zd_supply_charge where supply_code = #{code}")
+    void delMzSupplyChargeByCode(String code);
 }

+ 98 - 0
src/main/java/thyyxxk/webserver/entity/orderZdMaintain/dto/MzZdSupplyType.java

@@ -0,0 +1,98 @@
+package thyyxxk.webserver.entity.orderZdMaintain.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import thyyxxk.webserver.entity.orderZdMaintain.enums.SupplyClass;
+
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName(value = "mz_zd_supply_type")
+public class MzZdSupplyType {
+    /**
+     * supplyCode
+     */
+    @TableField(value = "supply_code")
+    private String supplyCode;
+
+    /**
+     * supplyName
+     */
+    @TableField(value = "supply_name")
+    private String supplyName;
+
+    /**
+     * supplyOcc
+     */
+    @TableField(value = "supply_occ")
+    private String supplyOcc;
+
+    /**
+     * delFlag
+     */
+    @TableField(value = "del_flag")
+    private String delFlag;
+
+    /**
+     * sortCode
+     */
+    @TableField(value = "sort_code")
+    private Integer sortCode;
+
+    /**
+     * class
+     */
+    @TableField(value = "class_code")
+    private Integer classCode;
+
+    /**
+     * printName
+     */
+    @TableField(value = "print_name")
+    private String printName;
+
+    /**
+     * pyCode
+     */
+    @TableField(value = "py_code")
+    private String pyCode;
+
+    /**
+     * dCode
+     */
+    @TableField(value = "d_code")
+    private String dCode;
+
+    @TableField(value = "child_code")
+    private String childCode;
+
+    /**
+     * tryFlag
+     */
+    @TableField(value = "try_flag")
+    private String tryFlag;
+
+    @TableField(exist = false)
+    private String childName;
+
+
+    public static LambdaQueryWrapper<YzSupplyTypeDTO> lambdaQueryWrapper() {
+        return new LambdaQueryWrapper<>();
+    }
+
+    public static QueryWrapper<YzSupplyTypeDTO> queryWrapper() {
+        return new QueryWrapper<>();
+    }
+
+    public String getClassName() {
+        return SupplyClass.getNameByCode(this.classCode, "zy");
+    }
+
+}

+ 1 - 1
src/main/java/thyyxxk/webserver/entity/orderZdMaintain/dto/YzSupplyTypeDTO.java

@@ -122,7 +122,7 @@ public class YzSupplyTypeDTO implements Serializable {
     }
 
     public String getClasssName() {
-        return SupplyClass.getNameByCode(this.classs);
+        return SupplyClass.getNameByCode(this.classs, "mz");
     }
 
 }

+ 15 - 13
src/main/java/thyyxxk/webserver/entity/orderZdMaintain/enums/SupplyClass.java

@@ -9,23 +9,25 @@ import lombok.NoArgsConstructor;
 @NoArgsConstructor
 public enum SupplyClass {
 
-    口服(1, "口服"),
-    输液(2, "输液"),
-    出院带药(3, "出院带药"),
-    领药临时(4, "领药(临时)"),
-    退药(5, "退药"),
-    外用(6, "外用"),
-    注射(7, "注射"),
-    药物治疗(8, "药物治疗"),
-    其他(9, "其他");
+    口服(1, "口服", "all"),
+    输液(2, "输液", "all"),
+    出院带药(3, "出院带药", "all"),
+    领药临时(4, "领药(临时)", "all"),
+    退药(5, "退药", "all"),
+    外用(6, "外用", "zy"),
+    领药非临时(6, "领药(非临时)", "mz"),
+    注射(7, "注射", "all"),
+    药物治疗(8, "药物治疗", "all"),
+    其他(9, "其他", "all");
 
     private Integer code;
     private String name;
+    private String desc;
 
-    public static String getNameByCode(Integer code) {
-        for (SupplyClass supplyClass : SupplyClass.values()) {
-            if (supplyClass.getCode().equals(code)) {
-                return supplyClass.getName();
+    public static String getNameByCode(Integer code, String oppositeDesc) {
+        for (SupplyClass spc : SupplyClass.values()) {
+            if (spc.getCode().equals(code) && !spc.getDesc().equals(oppositeDesc)) {
+                return spc.getName();
             }
         }
         return "";

+ 6 - 0
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -198,6 +198,12 @@ public class PublicServer {
         return formatNumberWithLeadingZeros(newSupply, 3);
     }
 
+    public String getMzSupplyNo() {
+        int supply = dao.getMzSupply();
+        int newSupply = supply + 1;
+        return formatNumberWithLeadingZeros(newSupply, 3);
+    }
+
     /**
      * 将数字格式化为指定长度的字符串,不足位数在前面补0.
      *