Selaa lähdekoodia

校期开发完成,长期口服标签处理

WANGJIALIANG 2 vuotta sitten
vanhempi
commit
b7d2f52b74

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

@@ -299,12 +299,12 @@ public class YfIncomingRecordsController {
      * @return
      */
     @UserLoginToken
-    @RequestMapping(value = "/getYpInDetlYfEffDate", method = {RequestMethod.GET})
-    public Map<String, Object> getYpInDetlYfEffDate(@RequestParam(value = "groupNo") String groupNo, @RequestParam(value = "effMonth") Integer effMonth
+    @RequestMapping(value = "/getYpInDetlEffDate", method = {RequestMethod.GET})
+    public Map<String, Object> getYpInDetlEffDate(@RequestParam(value = "groupNo") String groupNo, @RequestParam(value = "effMonth") Integer effMonth
             , @RequestParam(value = "chargeCode",required = false) String chargeCode) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
-            List<YpEffDateVo> ypInDetlYfs = ypInDetlYfService.queryYpInDetlYfEffDate(groupNo, chargeCode, effMonth);
+            List<YpEffDateVo> ypInDetlYfs = ypInDetlYfService.queryYpInDetlEffDate(groupNo, chargeCode, effMonth);
             resultMap.put("code", 0);
             resultMap.put("message", "查询药品效期成功");
             resultMap.put("data", ypInDetlYfs);

+ 43 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpInDetlYfMapper.java

@@ -191,6 +191,49 @@ public interface YpInDetlYfMapper {
             "</script>")
     List<YpEffDateVo> selectYpInDetlYfEffDate(@Param("groupNo") String groupNo, @Param("chargeCode") String chargeCode, @Param("effMonth") Integer effMonth);
 
+    /**
+     * 药库药品效期查询
+     * @param groupNo
+     * @param chargeCode
+     * @return
+     */
+    @Select("<script>" +
+            "SELECT\n" +
+            "  a.in_date,\n" +
+            "  a.charge_code,\n" +
+            "  a.serial,\n" +
+            "  a.in_seri,\n" +
+            "  a.current_stock,\n" +
+            "  a.manu_code,\n" +
+            "  a.in_docu_no,\n" +
+            "  a.eff_date,\n" +
+            "  a.license_no,\n" +
+            "  a.eff_del_flag,\n" +
+            "  b.name,\n" +
+            "  specification = b.specification,\n" +
+            "  manufactory_name = c.name,\n" +
+            "  xq=datediff(month,getdate(),a.eff_date),\n" +
+            "  b.py_code,\n" +
+            "  b.d_code\n" +
+            "FROM yp_in_detl  a,yp_zd_dict b\n" +
+            "    left join yp_zd_manufactory c on b.manu_code=c.code,\n" +
+            "     (select charge_code,stock_amount=sum(stock_amount) from yp_base where group_no = #{groupNo} group by charge_code) d\n" +
+            "     where a.charge_code=b.code and\n" +
+            "           a.serial=b.serial and\n" +
+            "          datediff(month,getdate(),a.eff_date)<![CDATA[<=]]>#{effMonth} and\n" +
+            "          a.group_no = #{groupNo} and\n" +
+            "<when test='chargeCode != null and chargeCode != \"\"'>" +
+            "  a.charge_code = #{chargeCode} and" +
+            "</when>" +
+            "          a.charge_code = d.charge_code and\n" +
+            "          a.current_stock <![CDATA[>]]> 0 and\n" +
+            "          isnull(a.eff_del_flag,'0')='0' and\n" +
+            "          isnull(b.visible_flag,'0')<![CDATA[<>]]>'1' and\n" +
+            "          isnull(b.del_flag,'0')<![CDATA[<>]]>'1'\n" +
+            "     order by xq,a.charge_code" +
+            "</script>")
+    List<YpEffDateVo> selectYpInDetlYkEffDate(@Param("groupNo") String groupNo, @Param("chargeCode") String chargeCode, @Param("effMonth") Integer effMonth);
+
 
     /**
      * 更新有效期显示状态

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/his/yp/YpInDetlYfService.java

@@ -35,7 +35,7 @@ public interface YpInDetlYfService {
      * @param effMonth
      * @return
      */
-    List<YpEffDateVo> queryYpInDetlYfEffDate(String groupNo, String chargeCode, Integer effMonth);
+    List<YpEffDateVo> queryYpInDetlEffDate(String groupNo, String chargeCode, Integer effMonth);
 
     /**
      * 更新有效期显示状态

+ 6 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpInDetlYfServiceImpl.java

@@ -37,8 +37,12 @@ public class YpInDetlYfServiceImpl implements YpInDetlYfService {
     }
 
     @Override
-    public List<YpEffDateVo> queryYpInDetlYfEffDate(String groupNo, String chargeCode, Integer effMonth) {
-        return ypInDetlYfMapper.selectYpInDetlYfEffDate(groupNo, chargeCode, effMonth);
+    public List<YpEffDateVo> queryYpInDetlEffDate(String groupNo, String chargeCode, Integer effMonth) {
+        if(Integer.parseInt(groupNo)>=61){
+            return ypInDetlYfMapper.selectYpInDetlYfEffDate(groupNo, chargeCode, effMonth);
+        }else{
+            return ypInDetlYfMapper.selectYpInDetlYkEffDate(groupNo, chargeCode, effMonth);
+        }
     }
 
     @Override

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

@@ -1704,6 +1704,9 @@ function sendXy(flag) {
                 } else {
                     getPrintDetail(1);
                 }
+                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);//口服药单,并使用摆药机
@@ -1716,9 +1719,6 @@ function sendXy(flag) {
                         });
                     }
                 }
-                groupNo === '81'?$("#submitFlagSearch").val("4"):$("#submitFlagSearch").val("3");
-                $("#submitFlagSearch").selectpicker('refresh');
-                initButtonChange("#"+(flag == 0 ? 'hz' : 'mx'), (flag == 0 ? 1 : 2));
             } else {
                 errorMesage(res);
             }

+ 10 - 7
src/main/resources/static/js/yf/yf_inventory_list.js

@@ -164,7 +164,7 @@ function getChildCom(node){
 function initEffDateTable() {
     $('#eff_table').bootstrapTable('destroy');
     $('#eff_table').bootstrapTable({
-        url: '/thmz/getYpInDetlYfEffDate',         //请求后台的URL(*)
+        url: '/thmz/getYpInDetlEffDate',         //请求后台的URL(*)
         method: 'GET',                      //请求方式(*)
         striped: true,                      //是否显示行间隔色
         cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
@@ -241,6 +241,15 @@ function initEffDateTable() {
                     return value == null ? "-" : format(value, "yyyy-MM-dd");
                 }
             },
+            {
+                field: 'currentStock',
+                title: '现时库存',
+                align: "center",
+                visible: ($("#groupNoSearchText").val()>=61?false:true),
+                formatter: function (value, row, index) {
+                    return keepTwoDecimal(value);
+                }
+            },
             {
                 field: 'manufactoryName',
                 title: '生产厂商',
@@ -248,12 +257,6 @@ function initEffDateTable() {
                 valign: 'middle'
             }
         ],
-        rowStyle: function (row, index) {
-            /*if (isMultiple == 0 && row.visibleFlagMz == 1 && row.visibleFlagZy == 1) {
-                return { css: { 'background-color': 'red' } };
-            }*/
-            return {css:{}}
-        },
         responseHandler: function (res) {
             if (res == '401' || res == 401) {
                 window.location.href = '/thmz/login/view'