Browse Source

药房药品入库自动平虚库,处方限制天数设置优化

WANGJIALIANG 3 years ago
parent
commit
0afa74e4d3

+ 3 - 2
src/main/java/cn/hnthyy/thmz/controller/yf/YfSpecialMarkController.java

@@ -112,9 +112,10 @@ public class YfSpecialMarkController {
                 resultMap.put("message", "更新药房特殊标志维护信息失败,药房编码为空");
                 return resultMap;
             }
-            if (ypBaseYfVo.getPrescriptionLimitDays() != null) {
-                ypZdDictService.modifyYpZdDictPrescriptionLimitDays(ypBaseYfVo.getPrescriptionLimitDays(),ypBaseYfVo.getChargeCode());
+            if(null == ypBaseYfVo.getPrescriptionLimitDays() || ypBaseYfVo.getPrescriptionLimitDays() == 0){
+                ypBaseYfVo.setPrescriptionLimitDays(null);
             }
+            ypZdDictService.modifyYpZdDictPrescriptionLimitDays(ypBaseYfVo.getPrescriptionLimitDays(),ypBaseYfVo.getChargeCode());
             YpBaseYf ypBaseYf = new YpBaseYf();
             BeanUtils.copyProperties(ypBaseYfVo,ypBaseYf);
             int i = ypBaseYfService.modifyYpBaseYf(ypBaseYf);

+ 1 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpBaseYfServiceImpl.java

@@ -134,6 +134,7 @@ public class YpBaseYfServiceImpl implements YpBaseYfService {
                         ,ypOutDetlVo.getGroupNoOut(),amount, stockValue) == 0){
                     throw new MzException("药品编码"+ypOutDetlVo.getChargeCode()+"入库出错");
                 }
+                ypBaseYfMapper.updateResetVirtual(ypOutDetlVo.getChargeCode(), serial, ypOutDetlVo.getGroupNoOut());
             }
             //新增药房药品入库记录
             SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");

+ 9 - 1
src/main/resources/static/js/yf/yf_special_mark.js

@@ -79,8 +79,16 @@ function initTable() {
             root: "data", repeatitems: false
         },
         beforeSubmitCell:function(rowid, cellname, value, iRow, iCol){
-            let record = jQuery("#tb_table").getRowData(rowid);
+            let record = $("#tb_table").getRowData(rowid);
             let temp = eval('(' + '{ "'+cellname+'": "'+value+'"}' + ')');
+            if(cellname === 'prescriptionLimitDays' && value == 0){
+                if (!confirm("确定放开当前药品的处方天数限制吗?")) {
+                    return;
+                }
+            }
+            if(cellname !== 'prescriptionLimitDays'){
+                temp.prescriptionLimitDays = record.prescriptionLimitDays;
+            }
             temp.chargeCode = record.chargeCode;
             temp.serial = record.serial;
             temp.groupNo = pharmacyGroupNo;