DESKTOP-0GD05B0\Administrator 2 роки тому
батько
коміт
4d22c4a90a

+ 10 - 8
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/YizhuLuRuController.java

@@ -8,6 +8,7 @@ import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.datamodify.SelectV2;
 import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.inpatient.patient.Overview;
 import thyyxxk.webserver.entity.inpatient.patient.Patient;
@@ -88,6 +89,12 @@ public class YizhuLuRuController {
         return server.getFrequency();
     }
 
+    @GetMapping("/getSupplyType")
+    @PassToken
+    public ResultVo<List<SelectV2>> getSupplyType() {
+        return server.getSupplyType();
+    }
+
     @GetMapping("/huoQuFeiYongXinXi")
     public ResultVo<Map<String, Object>> huoQuFeiYongXinXi(@RequestParam("queryCode") String queryCode) {
         if (queryCode == null) {
@@ -135,12 +142,6 @@ public class YizhuLuRuController {
         return server.huoQuGeiYaoFangShi(code);
     }
 
-    @GetMapping("/getCostFreeDosing")
-    @PassToken
-    public ResultVo<List<GetDropdownBox>> getCostFreeDosing(String code) {
-        return server.getCostFreeDosing(code);
-    }
-
     @GetMapping("/huoQuZhiXinKeShi")
     public ResultVo<List<GetDropdownBox>> huoQuZhiXinKeShi(String code) {
         return server.huoQuZhiXinKeShi(code);
@@ -229,8 +230,9 @@ public class YizhuLuRuController {
     }
 
     @GetMapping("/copyTheDoctorSOrder")
-    public ResultVo<String> copyTheDoctorSOrder(@RequestParam("orderNo") BigDecimal orderNo) {
-        return server.copyTheDoctorSOrder(orderNo);
+    public ResultVo<String> copyTheDoctorSOrder(@RequestParam("orderNo") BigDecimal orderNo,
+                                                @RequestParam("deptCode") String deptCode) {
+        return server.copyTheDoctorSOrder(orderNo, deptCode);
     }
 
 }

+ 10 - 11
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.datamodify.SelectV2;
 import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.inpatient.patient.Overview;
@@ -126,8 +127,8 @@ public interface YiZhuLuRuDao {
             "    drug_quan_name       = (select name " +
             "                            from yp_zd_unit with (NOLOCK) " +
             "                            where code = mini_unit), " +
-            "                           supply_code, " +
-            "    supply_code_name     = (select supply_name " +
+            "                           rtrim(supply_code) supply_code, " +
+            "    supply_code_name     = (select rtrim(supply_name) " +
             "                            from yz_supply_type with (NOLOCK) " +
             "                            where yz_supply_type.supply_code = a.supply_code), " +
             "                           a.inpatient_no, " +
@@ -821,6 +822,13 @@ public interface YiZhuLuRuDao {
             "from yz_order_frequency")
     List<GetDropdownBox> selectFrequency();
 
+    @Select("select rtrim(supply_code) code, " +
+            "       rtrim(supply_name) name, " +
+            "       py_code, " +
+            "       d_code as          w_code " +
+            "from yz_supply_type with (NOLOCK)")
+    List<SelectV2> selectSupplyType();
+
 
     @Select("select rtrim(supply_code) code, rtrim(supply_name) name " +
             "from yz_supply_type with (NOLOCK) " +
@@ -828,15 +836,6 @@ public interface YiZhuLuRuDao {
     List<GetDropdownBox> huoQuGeiYaoFangShi(String code);
 
 
-    @Select("select rtrim(supply_code) code, rtrim(supply_name) name " +
-            "from (select b.charge_code, a.* " +
-            "      from yz_supply_type a " +
-            "               left join yz_supply_charge b on a.supply_code = b.supply_code) aa " +
-            "where charge_code is null " +
-            "  and (py_code like #{code} or d_code like #{code} or supply_name like #{code} or supply_code like #{code})")
-    List<GetDropdownBox> getCostFreeDosing(String code);
-
-
     @Select("SELECT a.code code, " +
             "       a.name name " +
             "FROM zd_unit_code a with (NOLOCK), " +

+ 49 - 0
src/main/java/thyyxxk/webserver/entity/datamodify/SelectV2.java

@@ -0,0 +1,49 @@
+package thyyxxk.webserver.entity.datamodify;
+
+import lombok.Data;
+import thyyxxk.webserver.utils.StringUtil;
+
+@Data
+public class SelectV2 {
+
+    private String code;
+    private String name;
+    private String pyCode;
+    private String wCode;
+
+    public String getCode() {
+        if (StringUtil.isBlank(code)) {
+            return code;
+        }
+        return code.trim();
+    }
+
+    public String getName() {
+        if (StringUtil.isBlank(name)) {
+            return name;
+        }
+        return name.trim();
+    }
+
+    public String getPyCode() {
+        if (StringUtil.isBlank(pyCode)) {
+            return pyCode;
+        }
+        return pyCode.trim();
+    }
+
+    public String getWCode() {
+        if (StringUtil.isBlank(wCode)) {
+            return wCode;
+        }
+        return wCode.trim();
+    }
+
+    public String getValue() {
+        return getCode();
+    }
+
+    public String getLabel() {
+        return getName();
+    }
+}

+ 2 - 0
src/main/java/thyyxxk/webserver/service/LoginService.java

@@ -1,6 +1,7 @@
 package thyyxxk.webserver.service;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -64,6 +65,7 @@ public class LoginService {
         return ResultVoUtil.success(tempUserInfo);
     }
 
+    @DS("his")
     public ResultVo<Map<String, Object>> fetchVueMenus() {
         List<Integer> roles = dao.getUserRoles(TokenUtil.getTokenUserId());
         if (null == roles || roles.isEmpty()) {

+ 28 - 7
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -4,6 +4,7 @@ import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -23,6 +24,7 @@ import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.RoleCode;
 import thyyxxk.webserver.entity.casefrontsheet.SheetOverview;
 import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
+import thyyxxk.webserver.entity.datamodify.SelectV2;
 import thyyxxk.webserver.entity.datamodify.YzActOrder;
 import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;
 import thyyxxk.webserver.entity.dictionary.CodeName;
@@ -794,16 +796,30 @@ public class YiZhuLuRuServer {
     }
 
 
+    /**
+     * 获取医嘱频率
+     *
+     * @return 返回频率
+     */
     public ResultVo<List<GetDropdownBox>> getFrequency() {
         return ResultVoUtil.success(dao.selectFrequency());
     }
 
     /**
-     * 获取频率
+     * @return 给药方式
+     */
+    public ResultVo<List<SelectV2>> getSupplyType() {
+        return ResultVoUtil.success(dao.selectSupplyType());
+    }
+
+
+    /**
+     * 获取频率 准备不要了
      *
      * @param code 五笔,拼音,中文,编码
      * @return 返回对应的数据
      */
+    @Deprecated
     public ResultVo<List<GetDropdownBox>> huoQuZhuYuanPinLv(String code) {
         return ResultVoUtil.success(dao.huoQuZhuYuanPinLv("%" + code.toUpperCase() + "%"));
     }
@@ -814,14 +830,11 @@ public class YiZhuLuRuServer {
      * @param code 五笔,拼音,中文,编码
      * @return 返回对应的数据
      */
+    @Deprecated
     public ResultVo<List<GetDropdownBox>> huoQuGeiYaoFangShi(String code) {
         return ResultVoUtil.success(dao.huoQuGeiYaoFangShi(StringUtil.isContainChinese(code)));
     }
 
-    public ResultVo<List<GetDropdownBox>> getCostFreeDosing(String code) {
-        return ResultVoUtil.success(dao.getCostFreeDosing(StringUtil.isContainChinese(code)));
-    }
-
     /**
      * 获取执行科室
      *
@@ -1550,7 +1563,7 @@ public class YiZhuLuRuServer {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
     }
 
-    public ResultVo<String> copyTheDoctorSOrder(BigDecimal orderNo) {
+    public ResultVo<String> copyTheDoctorSOrder(BigDecimal orderNo, String deptCode) {
         QueryWrapper<?> qw = new QueryWrapper<>();
         qw.eq("a.act_order_no", orderNo);
         List<XinZhenYzActOrder> yiZhuList = dao.selectOrderNo(qw);
@@ -1565,10 +1578,12 @@ public class YiZhuLuRuServer {
         revertToTheDefaultState(fatherOrder, us, null);
 
         List<XinZhenYzActOrder> addOrderList = new ArrayList<>();
+        setCopyExecUnit(fatherOrder, deptCode);
         addOrderList.add(fatherOrder);
 
         if (ListUtil.notBlank(childOrderList)) {
             childOrderList.forEach(item -> {
+                setCopyExecUnit(item, deptCode);
                 revertToTheDefaultState(item, us, fatherOrder.getActOrderNo());
                 addOrderList.add(item);
             });
@@ -1576,7 +1591,13 @@ public class YiZhuLuRuServer {
 
         XinZhenYiZhu patInfo = dao.queryPatientInfo(fatherOrder.getInpatientNo(), fatherOrder.getAdmissTimes());
         getThis().insertATemplate(addOrderList, patInfo);
-        return ResultVoUtil.success();
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "复制成功。");
+    }
+
+    private void setCopyExecUnit(XinZhenYzActOrder v, String dept) {
+        if (StringUtil.notBlank(dept)) {
+            v.setExecUnit(dept);
+        }
     }
 
     @Transactional(rollbackFor = Exception.class)