Browse Source

Merge branch 'dev-1.1.4' of https://172.16.32.165/hurugang/thmz_system into dev-1.1.4

hurugang 2 years ago
parent
commit
fc0cbcf09b

+ 7 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpBaseMapper.java

@@ -85,7 +85,7 @@ public interface YpBaseMapper {
             "  c.group_no=#{ypBase.groupNo} and" +
             "  c.drug_id is not null" +
             "  <when test='ypBase.delFlag!=null'>" +
-            "   and isnull(c.drug_flag,0)=#{ypBase.delFlag}" +
+            "   and isnull(c.del_flag,0)=#{ypBase.delFlag}" +
             "  </when>" +
             " and c.charge_code=b.charge_code)cc order by del_flag" +
             "</script>")
@@ -157,6 +157,12 @@ public interface YpBaseMapper {
             "<when test='miniStockAmount!=null'>",
             ",mini_stock_amount =#{miniStockAmount}",
             "</when>",
+            "<when test='packRetprice!=null'>",
+            ",pack_retprice =#{packRetprice,jdbcType=DECIMAL}",
+            "</when>",
+            "<when test='retprice!=null'>",
+            ",retprice =#{retprice,jdbcType=DECIMAL}",
+            "</when>",
             "</trim>" +
             "<where>" +
             "charge_code = #{chargeCode}" +

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpOutDetlYfMapper.java

@@ -181,7 +181,7 @@ public interface YpOutDetlYfMapper {
             "SELECT distinct a.out_date,a.out_type,a.dept_code,a.draw_no,a.drawer,a.keeper,a.confirm_id," +
             "a.confirm_date,confirm_flag = isnull(a.confirm_flag,'0'),a.acct_id,a.acct_date " +
             "FROM yp_out_detl_yf a WITH(NOLOCK) " +
-            "where out_type in('0','1') " +
+            "where out_type in('0','1','2') " +
             "<when test='beginDate!=null'>",
             " and out_date &gt;=#{beginDate} ",
             "</when>",

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpZdDeptMapper.java

@@ -27,7 +27,7 @@ public interface YpZdDeptMapper {
      * @return
      */
     @Insert("insert into yp_zd_dept (dept_code,charge_code,use_flag)" +
-            " SELECT  dept_code,#{chargeCode},'1' FROM zy_adtward WITH(NOLOCK) where dept_code!=#{deptCode}")
+            " SELECT  code,#{chargeCode},'1' FROM zd_unit_code WITH(NOLOCK) where isnull(del_flag,0)=0 and class_code in (1,2) and code!=#{deptCode}")
     int insertExclusiveYpZdDept(YpZdDept ypZdDept);
 
     /**
@@ -76,7 +76,7 @@ public interface YpZdDeptMapper {
      */
     @Select("<script>" +
             "select (case" +
-            "        when sum(1)=(SELECT  sum(1) as number FROM zy_adtward WITH(NOLOCK))-1" +
+            "        when sum(1)=(SELECT  sum(1) as number FROM zd_unit_code WITH(NOLOCK) where isnull(del_flag,0)=0 and class_code in (1,2))-1" +
             "        then (select case when sum(1)<![CDATA[>]]>0 then 0 else 1 end from yp_zd_dept WITH(NOLOCK) where charge_code=#{chargeCode} and dept_code=#{deptCode})" +
             "        else '0'" +
             "        end) as exclusive_use_flag" +

+ 31 - 23
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpRepriceServiceImpl.java

@@ -2,10 +2,8 @@ package cn.hnthyy.thmz.service.impl.his.yp;
 
 import cn.hnthyy.thmz.Utils.ColumnSqlUtil;
 import cn.hnthyy.thmz.entity.MzException;
-import cn.hnthyy.thmz.entity.his.yp.YpBaseYf;
-import cn.hnthyy.thmz.entity.his.yp.YpReprice;
-import cn.hnthyy.thmz.entity.his.yp.YpRepriceStock;
-import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
+import cn.hnthyy.thmz.entity.his.yp.*;
+import cn.hnthyy.thmz.mapper.his.yp.YpBaseMapper;
 import cn.hnthyy.thmz.mapper.his.yp.YpBaseYfMapper;
 import cn.hnthyy.thmz.mapper.his.yp.YpRepriceMapper;
 import cn.hnthyy.thmz.mapper.his.yp.YpZdDictMapper;
@@ -41,6 +39,9 @@ public class YpRepriceServiceImpl implements YpRepricelService {
     @SuppressWarnings("all")
     @Autowired
     private YpBaseYfMapper ypBaseYfMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private YpBaseMapper ypBaseMapper;
 
     @Override
     public List<YpReprice> queryYpReprice(YpReprice ypReprice) {
@@ -98,13 +99,18 @@ public class YpRepriceServiceImpl implements YpRepricelService {
         ypBaseYf.setPackRetprice(ypZdDict.getPackRetprice());
         ypBaseYf.setRetprice(ypZdDict.getRetprice());
         ypBaseYfMapper.updateYpBaseYf(ypBaseYf);
+        YpBase ypBase = new YpBase();
+        ypBase.setChargeCode(yp.getCode());
+        ypBase.setSerial(yp.getSerial());
+        ypBase.setPackRetprice(ypZdDict.getPackRetprice());
+        ypBase.setRetprice(ypZdDict.getRetprice());
+        ypBaseMapper.updateYpBase(ypBase);
         if(ypReprice.getSerial().equals("99")){
-            YpReprice minYpReprice= ypReprice;
-            minYpReprice.setReajustSerial(2);
-            minYpReprice.setSerial("01");
-            minYpReprice.setOrigPrice(yp.getRetprice());
-            minYpReprice.setNewPrice(ypReprice.getNewPrice().divide(yp.getPackSize(),2, BigDecimal.ROUND_HALF_UP));
-            changedNotFieldsOfSql = ColumnSqlUtil.getChangedNotFieldsOfSql(new YpReprice(), minYpReprice, 1);
+            ypReprice.setReajustSerial(2);
+            ypReprice.setSerial("01");
+            ypReprice.setOrigPrice(yp.getRetprice());
+            ypReprice.setNewPrice(ypReprice.getNewPrice().divide(yp.getPackSize(),2, BigDecimal.ROUND_HALF_UP));
+            changedNotFieldsOfSql = ColumnSqlUtil.getChangedNotFieldsOfSql(new YpReprice(), ypReprice, 1);
             if (ypRepriceMapper.insertYpReprice(changedNotFieldsOfSql) != 1) {
                 throw new MzException("插入调价记录异常");
             }
@@ -113,21 +119,23 @@ public class YpRepriceServiceImpl implements YpRepricelService {
             minYpRepriceStock.setSerial("01");
             ypRepriceMapper.insertYpRepriceStockYk(minYpRepriceStock);
             ypRepriceMapper.insertYpRepriceStockYf(minYpRepriceStock);
-            YpZdDict minYpZdDict = ypZdDict;
-            minYpZdDict.setSerial("01");
-            minYpZdDict.setPackRetprice(minYpReprice.getNewPrice());
-            minYpZdDict.setRetprice(minYpZdDict.getPackRetprice());
-            minYpZdDict.setBuyPrice(ypReprice.getNewBuyPrice().divide(yp.getPackSize(),2, BigDecimal.ROUND_HALF_UP));
-            minYpZdDict.setFixPrice(minYpZdDict.getBuyPrice());
-            minYpZdDict.setYbxjPrice(minYpZdDict.getBuyPrice());
-            if (1 != ypZdDictMapper.updateYpZdDict(minYpZdDict)) {
+            ypZdDict.setSerial("01");
+            ypZdDict.setPackRetprice(ypReprice.getNewPrice());
+            ypZdDict.setRetprice(ypZdDict.getPackRetprice());
+            ypZdDict.setBuyPrice(ypReprice.getNewBuyPrice().divide(yp.getPackSize(),2, BigDecimal.ROUND_HALF_UP));
+            ypZdDict.setFixPrice(ypZdDict.getBuyPrice());
+            ypZdDict.setYbxjPrice(ypZdDict.getBuyPrice());
+            if (1 != ypZdDictMapper.updateYpZdDict(ypZdDict)) {
                 throw new MzException("更新药品价格异常");
             }
-            YpBaseYf minYpBaseYf = ypBaseYf;
-            minYpBaseYf.setSerial("01");
-            minYpBaseYf.setPackRetprice(minYpZdDict.getPackRetprice());
-            minYpBaseYf.setRetprice(minYpZdDict.getPackRetprice());
-            ypBaseYfMapper.updateYpBaseYf(minYpBaseYf);
+            ypBaseYf.setSerial("01");
+            ypBaseYf.setPackRetprice(ypZdDict.getPackRetprice());
+            ypBaseYf.setRetprice(ypZdDict.getPackRetprice());
+            ypBaseYfMapper.updateYpBaseYf(ypBaseYf);
+            ypBase.setSerial("01");
+            ypBase.setPackRetprice(ypZdDict.getPackRetprice());
+            ypBase.setRetprice(ypZdDict.getPackRetprice());
+            ypBaseMapper.updateYpBase(ypBase);
         }
         return reajustNo;
     }

+ 5 - 2
src/main/resources/static/js/yf/drug_delivery_dept.js

@@ -92,10 +92,13 @@ $(function () {
         let outDetlList = [];
         var data = $("#tb_table_detailed").jqGrid("getRowData");
         for (let i = 0; i < data.length; i++) {
-            if (parseFloat(data[i].outAmt === '' ? 0 : data[i].outAmt) > 0) {
+            if (parseFloat(data[i].outAmt === '' ? 0 : data[i].outAmt) != 0) {
                 outDetlList.push(data[i])
             }
         }
+        if(outDetlList.length === 0){
+            return errorMesageSimaple('没有需要保存的数据!');
+        }
         request({
             url: '/saveYpOutDetlYfList',
             method: 'POST',
@@ -341,7 +344,7 @@ function initDetailed() {
             {name: 'stockAmount', index: 'stockAmount', align: 'center'},
             {
                 name: 'outAmt', index: 'outAmt', align: 'center', width: 100, editable: true, edittype: 'text'
-                , editrules: {edithidden: true, number: true, minValue: 0},
+                , editrules: {edithidden: true, number: true},
                 formatter: function (cellvalue, options, rowObject) {
                     return isEmpty(cellvalue) ? 0 : cellvalue;
                 }

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

@@ -1793,7 +1793,6 @@ function sendXy(flag) {
                 }
                 groupNo === '81'?$("#submitFlagSearch").val("4"):$("#submitFlagSearch").val("3");
                 $("#submitFlagSearch").selectpicker('refresh');
-                initButtonChange("#"+(flag == 0 ? 'hz' : 'mx'), (flag == 0 ? 1 : 2));
                 if (confirm("是否需要打印当前药单的口服标签并使用摆药机?")) {
                     if (res.data) {
                         printLabelData(flag, 1);//口服药单,并使用摆药机
@@ -1806,6 +1805,7 @@ function sendXy(flag) {
                         });
                     }
                 }
+                initButtonChange("#"+(flag == 0 ? 'hz' : 'mx'), (flag == 0 ? 1 : 2));
             } else {
                 errorMesage(res);
             }

+ 1 - 1
src/main/resources/static/js/yk/drug_reprice.js

@@ -2,7 +2,7 @@
 var groupYk = window.localStorage["groupYk"];
 $(function () {
     $(".selectpicker").selectpicker();
-    if (groupYk == null) {
+    if (isEmpty(groupYk)) {
         return errorMesageSimaple('药库参数未设置,请在发药参数设置中设置');
     }
     initRecordTable();

+ 2 - 2
src/main/resources/static/js/yk/drug_storage.js

@@ -752,8 +752,8 @@ function setPrintHtml() {
         $('.sjh').remove();
         for (let i = 0; i < res['data'].length; i++) {
             let data = res['data'][i];
-            let packRetprice = keepTwoDecimal(parseFloat(data['stockAmount']) * parseFloat(data['packRetprice']));
-            let buyPrice = keepTwoDecimal(parseFloat(data['stockAmount']) * parseFloat(data['buyPrice']));
+            let packRetprice = keepTwoDecimal(parseFloat(data['buyAmt']) * parseFloat(data['packRetprice']));
+            let buyPrice = keepTwoDecimal(parseFloat(data['buyAmt']) * parseFloat(data['buyPrice']));
             packRetpriceSum += packRetprice;
             buyPriceSum += buyPrice;
             if (i === 0) {