Parcourir la source

发药窗口叫号优化

hsh il y a 2 ans
Parent
commit
21d4955f9d

+ 14 - 4
src/main/java/cn/hnthyy/thmz/controller/mz/YpfydlController.java

@@ -30,7 +30,7 @@ public class YpfydlController {
      */
     @UserLoginToken
     @RequestMapping(value = "/getToMedicine", method = {RequestMethod.GET})
-    public Map<String, Object> getToMedicine(@RequestParam("groupNo") String groupNo) {
+    public Map<String, Object> getToMedicine(@RequestParam("groupNo") String groupNo, @RequestParam("winNo") String winNo) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
             if (StringUtils.isBlank(groupNo)) {
@@ -38,6 +38,11 @@ public class YpfydlController {
                 resultMap.put("message", "查询未发药药品失败,未选择药房");
                 return resultMap;
             }
+            if (StringUtils.isBlank(winNo)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "查询未发药药品失败,未选择发药窗口");
+                return resultMap;
+            }
             Date now = new Date();
             Date begin = DateUtil.getFirstSecond(now);
             Date end = DateUtil.getLastSecond(now);
@@ -46,7 +51,7 @@ public class YpfydlController {
             List<String> pastList = new ArrayList();
             //待取药集合
             List<String> currentList = new ArrayList();
-            List<Map<String, Object>> all = mzYpFydlService.queryToMedicine(groupNo, begin, end);
+            List<Map<String, Object>> all = mzYpFydlService.queryToMedicine(groupNo, begin, end, winNo);
             if (all != null && all.size() > 0) {
                 for (Map<String, Object> map : all) {
                     Date priceTime = (Date) map.get("price_time");
@@ -87,7 +92,7 @@ public class YpfydlController {
      * @return
      */
     @RequestMapping(value = "/getToMedicineUser", method = {RequestMethod.GET})
-    public Map<String, Object> getToMedicineUser(@RequestParam("groupNo") String groupNo) {
+    public Map<String, Object> getToMedicineUser(@RequestParam("groupNo") String groupNo, @RequestParam("winNo") String winNo) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
             if (StringUtils.isBlank(groupNo)) {
@@ -95,10 +100,15 @@ public class YpfydlController {
                 resultMap.put("message", "查询未发药药品失败,未选择药房");
                 return resultMap;
             }
+            if (StringUtils.isBlank(winNo)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "查询未发药药品失败,未选择发药窗口");
+                return resultMap;
+            }
             Date now = new Date();
             Date begin = DateUtil.getFirstSecond(now);
             Date end = DateUtil.getLastSecond(now);
-            List<Map<String, Object>> currentList = mzYpFydlService.queryToMedicine(groupNo, begin, end);
+            List<Map<String, Object>> currentList = mzYpFydlService.queryToMedicine(groupNo, begin, end, winNo);
             resultMap.put("code", 0);
             resultMap.put("message", "查询未发药药品成功");
             resultMap.put("currentList", currentList);

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzYpFydlMapper.java

@@ -74,7 +74,7 @@ public interface MzYpFydlMapper {
             "( mz_charge_detail.charge_item_code = yp_zd_dict.code ) AND" +
             "( mz_charge_detail.serial = yp_zd_dict.serial ) AND" +
             "( isnull(yp_zd_dict.class_code,'') <> '210100') AND" +
-            "         (mz_charge_detail.windows_no_yf  like (case '71' when '81' then '%' else '04' end) )  AND" +
+            "         (mz_charge_detail.windows_no_yf  like (case '71' when '81' then '%' else #{winNo} end) )  AND" +
             "         ( mz_charge_detail.pay_mark='0' and mz_charge_detail.serial_no > 0) and" +
             "         (isnull(mz_charge_detail.confirm_flag,'0') in('0','2','5') OR mz_charge_detail.print_flag_yj='1')  and" +
             "         (isnull(mz_charge_detail.confirm_zs,'') <> '1' and " +
@@ -82,7 +82,7 @@ public interface MzYpFydlMapper {
             " not EXISTS(select * from mz_receipt_serial i WITH(NOLOCK) where mz_charge_detail.patient_id = i.patient_id and " +
             "                                                   mz_charge_detail.times = i.times and" +
             "                                                   mz_charge_detail.real_no = -i.receipt_sn  )")
-    List<Map<String, Object>> selectToMedicine(@Param(value = "groupNo") String groupNo,@Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+    List<Map<String, Object>> selectToMedicine(@Param(value = "groupNo") String groupNo,@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param(value = "winNo") String winNo);
 
 
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/his/mz/MzYpFydlService.java

@@ -22,6 +22,6 @@ public interface MzYpFydlService {
      * @param endDate 结束时间
      * @return
      */
-    List<Map<String, Object>> queryToMedicine(String groupNo,Date beginDate, Date endDate);
+    List<Map<String, Object>> queryToMedicine(String groupNo,Date beginDate, Date endDate, String winNo);
 
 }

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzYpFydlServiceImpl.java

@@ -21,7 +21,7 @@ public class MzYpFydlServiceImpl implements MzYpFydlService {
     }
 
     @Override
-    public List<Map<String, Object>> queryToMedicine(String groupNo,Date beginDate, Date endDate) {
-        return mzYpFydlMapper.selectToMedicine(groupNo,beginDate,endDate);
+    public List<Map<String, Object>> queryToMedicine(String groupNo,Date beginDate, Date endDate, String winNo) {
+        return mzYpFydlMapper.selectToMedicine(groupNo,beginDate,endDate,winNo);
     }
 }

+ 1 - 1
src/main/resources/static/js/mz/pharmacy-cell-number.js

@@ -186,7 +186,7 @@ function getTableDate() {
     $.ajax({
         type: "GET",
         contentType: "application/json;charset=UTF-8",
-        url: "/thmz/getToMedicineUser?groupNo=" + groupNo,
+        url: "/thmz/getToMedicineUser?groupNo=" + groupNo + "&winNo=" + $("#winNo").val(),
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         dataType: 'json',
         success: function (result) {

+ 1 - 1
src/main/resources/static/js/mz/to-medicine.js

@@ -201,7 +201,7 @@ function getTableDate() {
     $.ajax({
         type: "GET",
         contentType: "application/json;charset=UTF-8",
-        url: "/thmz/getToMedicine?groupNo=" + groupNo,
+        url: "/thmz/getToMedicine?groupNo=" + groupNo + "&winNo=" + $("#winNo").val(),
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         dataType: 'json',
         success: function (result) {