Browse Source

增加中药药单状态更新日志,上下限预计可用天数按60天计算,住院发药超出库存提示

WANGJIALIANG 2 years ago
parent
commit
e9dc7a4429

+ 6 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpInDetlMapper.java

@@ -249,6 +249,9 @@ public interface YpInDetlMapper {
             "<when test='inType != null'>" +
             "  and in_type in (${inType})" +
             "</when>" +
+            "<when test='chargeCode != null'>" +
+            "  and charge_code=#{chargeCode}" +
+            "</when>" +
             "<when test='inDocuNo != null'>" +
             "  and in_docu_no=#{inDocuNo}" +
             "</when>" +
@@ -286,6 +289,9 @@ public interface YpInDetlMapper {
             "<when test='inType != null'>" +
             "  and in_type in (${inType})" +
             "</when>" +
+            "<when test='chargeCode != null'>" +
+            "  and charge_code=#{chargeCode}" +
+            "</when>" +
             "<when test='inDocuNo != null'>" +
             "  and in_docu_no=#{inDocuNo}" +
             "</when>" +

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfDrugApplyServiceImpl.java

@@ -63,7 +63,7 @@ public class YfDrugApplyServiceImpl implements YfDrugApplyService {
             ypBaseBoundVo.setThirtyDayDosage(ypBaseBoundSum.getThirtyDayDosage());
             ypBaseBoundVo.setSixtyDayDosage(ypBaseBoundSum.getSixtyDayDosage());
             ypBaseBoundVo.setFourteenDayDosage(ypBaseBoundSum.getFourteenDayDosage());
-            ypBaseBoundVo.setAvailableDay(ypBaseBoundVo.getSevenDayDosage()==0?0:(int)Math.floor(ypBaseBoundVo.getStockAmount()/ypBaseBoundVo.getSevenDayDosage()));
+            ypBaseBoundVo.setAvailableDay(ypBaseBoundVo.getFourteenDayDosage()==0?0:(int)Math.floor(ypBaseBoundVo.getStockAmount()/ypBaseBoundVo.getFourteenDayDosage()));
         });
         return ypBaseBoundVos;
     }

+ 5 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfWardPrescriptionServiceImpl.java

@@ -600,6 +600,11 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
             actpatient.setTableName(tableName);
             zyActpatientMapper.updateZyActpatientZy(actpatient);
         }
+        if (yzActOrderCyMapper.updateChargeStatus(now, userCode, "4", pageNo) == 0) {
+            throw new MzException("确认发药失败,更新药单状态异常"+pageNo);
+        }else{
+            log.info("确认药单成功{}", pageNo);
+        }
         for (int i = 0; i < yzActOrderCyDetails.size(); i++) {
             YzActOrderCyDetail yzActOrderCyDetail = yzActOrderCyDetails.get(i);
             YpZyPatient ypZyPatient = new YpZyPatient();
@@ -641,7 +646,6 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
             ypZyPatient.setDoctorName(yzActOrderCy.getDoctorCode());
             ypZyPatient.setZySerialNo(zyDetailCharges.get(0).getZySerialNo());
             ypZyPatientMapper.insertYpZyPatient(ypZyPatient);
-            yzActOrderCyMapper.updateChargeStatus(now, userCode, "4", pageNo);
             if(yzActOrderCy.getSourceFlag() == 1 && isTy == 0){
                 ZyDetailCharge zyDetailChargeNew = new ZyDetailCharge();
                 zyDetailChargeNew.setInpatientNo(yzActOrderCy.getInpatientNo()).setAdmissTimes(yzActOrderCy.getAdmissTimes());

+ 26 - 8
src/main/resources/static/js/yf/drug_apply.js

@@ -665,7 +665,7 @@ function getYpBaseYfBound() {
             }, {
                 field: 'name',
                 title: '药品名称',
-                align: "center",
+                align: "left",
                 valign: 'middle'
             },
             {
@@ -689,37 +689,55 @@ function getYpBaseYfBound() {
                 field: 'stockAmount',
                 title: '药房库存',
                 align: "center",
-                valign: 'middle'
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return keepTwoDecimal(value);
+                }
             }, {
                 field: 'stockAmountYk',
                 title: '药库库存',
                 align: "center",
-                valign: 'middle'
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return keepTwoDecimal(value);
+                }
             }, {
                 field: 'manufactoryName',
                 title: '制药厂',
-                align: "center",
+                align: "left",
                 valign: 'middle'
             }, {
                 field: 'sevenDayDosage',
                 title: '7天用量',
                 align: "center",
-                valign: 'middle'
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return keepTwoDecimal(value);
+                }
             }, {
                 field: 'fourteenDayDosage',
                 title: '14天用量',
                 align: "center",
-                valign: 'middle'
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return keepTwoDecimal(value);
+                }
             }, {
                 field: 'thirtyDayDosage',
                 title: '30天用量',
                 align: "center",
-                valign: 'middle'
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return keepTwoDecimal(value);
+                }
             }, {
                 field: 'sixtyDayDosage',
                 title: '60天用量',
                 align: "center",
-                valign: 'middle'
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return keepTwoDecimal(value);
+                }
             }, {
                 field: 'availableDay',
                 title: '预计可用天数',

+ 4 - 1
src/main/resources/static/js/yf/ward_prescription.js

@@ -697,7 +697,10 @@ function initSummarizingTable() {
                     return rowObject.amount
                 }
             },
-            {name: 'stockAmount', index: 'stockAmount', align: 'center', width: 30},
+            {name: 'stockAmount', index: 'stockAmount', align: 'center', width: 30,
+                formatter: function (cellvalue, options, rowObject) {
+                    return cellvalue<rowObject.amount?('<span style="color: red">'+cellvalue+'</span>'):cellvalue
+                }},
             {name: 'retprice', index: 'retprice', align: 'center', width: 30},
             {
                 name: 'totalMoney', index: 'totalMoney', align: 'center', width: 30,