Преглед изворни кода

临时口服打印添加有效期

hsh пре 1 година
родитељ
комит
441049438c

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

@@ -672,4 +672,10 @@ public interface YpInDetlMapper {
             "group by c.class_code" +
             "</script>")
     List<Map<String,Object>> selectDrugClassInMoneyCount(Map map);
+
+    @Select(" select min(eff_date) as effDate from yp_in_detl where charge_code = #{chargeCode} and current_stock > 0 ")
+    String selectEffDateByCode(@Param("chargeCode") String chargeCode);
+
+    @Select(" select max(eff_date) as effDate from yp_in_detl where charge_code = #{chargeCode} and current_stock = 0 ")
+    String selectEffDateZeroByCode(@Param("chargeCode") String chargeCode);
 }

+ 10 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfWardPrescriptionServiceImpl.java

@@ -28,6 +28,7 @@ import cn.hnthyy.thmz.mapper.his.ResponceTypeMapper;
 import cn.hnthyy.thmz.mapper.his.mz.EmployeeMapper;
 import cn.hnthyy.thmz.mapper.his.mz.MzPharmacyMapper;
 import cn.hnthyy.thmz.mapper.his.yp.YpBaseYfMapper;
+import cn.hnthyy.thmz.mapper.his.yp.YpInDetlMapper;
 import cn.hnthyy.thmz.mapper.his.yp.YpMzFytjMapper;
 import cn.hnthyy.thmz.mapper.his.yp.YpYzSendRecordMapper;
 import cn.hnthyy.thmz.mapper.his.yp.YpZdDictMapper;
@@ -164,6 +165,9 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
     @SuppressWarnings("all")
     @Autowired
     private YpYzSendRecordMapper ypYzSendRecordMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private YpInDetlMapper ypInDetlMapper;
 
     @Override
     public List<YzYpPageNoVo> queryYzYpPageNo(YzYpPageNoVo yzYpPageNoVo) {
@@ -1036,6 +1040,12 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
                 yfWardVo.setName(aPatientMi.getName());
                 yfWardVo.setDrugName(ypZdDict.getName());
                 yfWardVo.setSpecification(ypZdDict.getSpecification());
+                // 查询最近有效期
+                String effDate = ypInDetlMapper.selectEffDateByCode(ypZdDict.getCode());
+                if(null == effDate){
+                    effDate = ypInDetlMapper.selectEffDateZeroByCode(ypZdDict.getCode());
+                }
+                yfWardVo.setEffDate(effDate);
             } else {
                 yfWardVos.remove(i);
                 i--;

+ 4 - 0
src/main/java/cn/hnthyy/thmz/vo/YfWardVo.java

@@ -219,4 +219,8 @@ public class YfWardVo {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
     private Date confirmTime;
+    /**
+     * 有效时间
+     */
+    private String effDate;
 }

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

@@ -1671,6 +1671,9 @@ function printLabel(datas, isMx) {
                     $(".dose").text(data.dose + data.doseUnit);
                     $(".dosage").text(data.dosage.replace(".0", ""));
                     $(".instruction").text(data.instruction);
+                    if(pageClass == 6){
+                        $(".effDate").text(format(data.effDate, "yyyy/MM/dd"));
+                    }
                     LODOP.ADD_PRINT_HTM("1mm", "3mm", "RightMargin:1mm", "BottomMargin:3mm", strStyle + document.getElementById("bqdy_table_div").innerHTML);
                     LODOP.NewPageA();
                     break;

+ 6 - 5
src/main/resources/templates/yf/ward_prescription.html

@@ -207,13 +207,13 @@
                         <tr>
                             <td colspan="5" style="text-align: left;border: transparent !important;">
                                 <span>科&nbsp;&nbsp;&nbsp;&nbsp;室:</span><span class="wardName" style="display: inline-block;"></span>
+                                <span>床号:</span><span class="bedNo" style="font-weight: 700;font-size: 16px;"></span>
                             </td>
                         </tr>
                         <tr>
                             <td colspan="5" style="text-align: left;border: transparent !important;">
                                 <span>住院号:</span><span class="inpatientNo" style="font-weight: 700;width: 80px;display: inline-block;"></span>
                                 <span>性别:</span><span class="sex" style="width: 40px;display: inline-block;"></span>
-                                <span>床号:</span><span class="bedNo" style="font-weight: 700;font-size: 26px;"></span>
                             </td>
                         </tr>
                         <tr>
@@ -222,10 +222,6 @@
                                 <span>年龄:</span><span class="age" style="display: inline-block;"></span>
                             </td>
                         </tr>
-                        <tr>
-                            <td colspan="5" style="text-align: left;border: transparent !important;"><span style="font-size: 10px;">&nbsp;</span>
-                            </td>
-                        </tr>
                         <tr>
                             <td colspan="5" style="text-align: left;border: transparent !important;">
                                 <span>药品名称:</span><span class="drugName"></span>
@@ -239,6 +235,11 @@
                                 <span>剂量:</span><span class="dose" style="font-weight: 700;"></span>
                             </td>
                         </tr>
+                        <tr>
+                            <td colspan="5" style="text-align: left;border: transparent !important;">
+                                <span>有效期:</span><span class="effDate" style="display: inline-block;">&nbsp;</span>
+                            </td>
+                        </tr>
                         <tr>
                             <td colspan="5" style="text-align: left;border: transparent !important;">
                                 <span>服药时间:</span><span class="occTime"></span>