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
6ff4d9726a

+ 2 - 0
src/main/java/cn/hnthyy/thmz/controller/yf/YfSpiritAnestheticPrintController.java

@@ -59,6 +59,8 @@ public class YfSpiritAnestheticPrintController {
             sendMedicineVos.forEach(mzSendMedicineVo -> {
                 String warnDeptName = zdUnitCodeService.queryDeptNameByIdInCache(mzSendMedicineVo.getWarnDept());
                 mzSendMedicineVo.setWarnDeptName(warnDeptName);
+                String execName = zdUnitCodeService.queryDeptNameByIdInCache(mzSendMedicineVo.getExecUnit());
+                mzSendMedicineVo.setExecName(execName);
                 if(StringUtils.isNotBlank(mzSendMedicineVo.getDoctorCode())){
                     Employee employee = employeeService.queryByUserCode(mzSendMedicineVo.getDoctorCode());
                     mzSendMedicineVo.setEmployeeName(employee.getEmployeeName());

+ 9 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/yf/YfSpiritAnestheticPrintMapper.java

@@ -80,7 +80,8 @@ public interface YfSpiritAnestheticPrintMapper {
             " b.specification," +
             " icd_text=isnull(e.admiss_diag_str,'')," +
             " charge_item_code=charge_code," +
-            " a.manu_no" +
+            " a.manu_no," +
+            " p.exec_unit" +
             " from yp_zy_patient a WITH(NOLOCK),yp_zd_dict b WITH(NOLOCK),a_patient_mi c WITH(NOLOCK),zy_patient e WITH(NOLOCK),view_yz_all_order p WITH(NOLOCK)" +
             " where a.charge_code=b.code and" +
             "       a.serial=b.serial and" +
@@ -114,6 +115,7 @@ public interface YfSpiritAnestheticPrintMapper {
     @Select({"<script>" +
             "SELECT doctor_name = case when isnull(a.doctor_name,'00000')='00000' then a.drawer else a.doctor_name end," +
             "       warn_dept=a.ward_code," +
+            "       exec_unit=a.section_code," +
             "       id=a.inpatient_no," +
             "       a.admiss_times," +
             "       quantity = a.amount," +
@@ -165,13 +167,17 @@ public interface YfSpiritAnestheticPrintMapper {
             "       age=datediff(year,i.birth_date,getdate())," +
             "       k.supply_name," +
             "       frequency=g.frequ_code," +
-            "       a.manu_no" +
+            "       a.manu_no," +
+            "       a.act_order_no," +
+            "       g.exec_unit," +
+            "       h2.name as exec_name" +
             " FROM  yp_zy_patient a WITH(NOLOCK)," +
             "       zy_patient b WITH(NOLOCK)," +
             "       a_employee_mi c WITH(NOLOCK)," +
             "       yp_zd_dict d WITH(NOLOCK)," +
             "       yp_zd_manufactory e WITH(NOLOCK)," +
             "       zd_unit_code h WITH(NOLOCK)," +
+            "       zd_unit_code h2 WITH(NOLOCK)," +
             "       a_patient_mi i WITH(NOLOCK)," +
             "       view_yz_all_order g WITH(NOLOCK)," +
             "       yz_supply_type k WITH(NOLOCK)" +
@@ -183,6 +189,7 @@ public interface YfSpiritAnestheticPrintMapper {
             "       d.manu_code*= e.code  and" +
             "       a.inpatient_no*=i.inpatient_no and" +
             "       b.admiss_dept=h.code and" +
+            "       g.exec_unit=h2.code and" +
             "       a.act_order_no = g.act_order_no and" +
             "       g.supply_code *= k.supply_code and" +
             "       <when test='sendDrugRecordVo.beginDate != null'>" +

+ 3 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfSpiritAnestheticPrintServiceImpl.java

@@ -140,6 +140,9 @@ public class YfSpiritAnestheticPrintServiceImpl implements YfSpiritAnestheticPri
             if(zdUnitCode != null){
                 sendDrugRecord.setWarnDeptName(zdUnitCode.getName());
             }
+            if(StringUtils.isNotBlank(sendDrugRecord.getExecUnit())){
+                sendDrugRecord.setExecName(sendDrugRecord.getExecUnit());
+            }
         });
         return sendDrugRecordVos;
     }

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

@@ -284,6 +284,7 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
             YfWardVo vo = new YfWardVo();
             BeanUtils.copyProperties(zyDrug, vo);
             vo.setOccTime(zyDrug.getChargeDate());
+            vo.setDrawer(zyDrug.getOpIdCode());
             yfWardVos.add(vo);
         });
         return yfWardVos;
@@ -408,6 +409,7 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
                 if (yzYpZyOrder.getPageClass().equals("A")) {
                     ypZyPatient.setSectionCode(yzYpZyOrder.getExecUnit());
                     ypZyPatient.setAcctSign("2");
+                    ypZyPatient.setActOrderNo(3);
                 } else {
                     ypZyPatient.setAcctSign((yzYpZyOrder.getAmount() == 0 || yzYpZyOrder.getPageClass().equals("HT")) ? "2" : "0");
                     ypZyPatient.setSectionCode("");//必须为空或null,会导致医嘱查不到已发药单

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

@@ -16,6 +16,8 @@ import cn.hnthyy.thmz.service.his.yp.YpZdManufactoryService;
 import cn.hnthyy.thmz.vo.YpBaseYfVo;
 import cn.hnthyy.thmz.vo.YpOutDetlVo;
 import cn.hnthyy.thmz.vo.YpZdDictVo;
+import lombok.extern.slf4j.Slf4j;
+import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
@@ -34,6 +36,7 @@ import java.util.List;
  * @time: 2021/7/28 17:09
  */
 @Service
+@Slf4j
 public class YpBaseYfServiceImpl implements YpBaseYfService {
     @SuppressWarnings("all")
     @Autowired
@@ -131,12 +134,16 @@ public class YpBaseYfServiceImpl implements YpBaseYfService {
                 ypBaseYf.setSplitPercent(ypOutDetlVo.getSplitPercent());
                 if(ypBaseYfMapper.insertYpBaseYf(ypBaseYf) == 0){
                     throw new MzException("药品编码"+ypBaseYf.getChargeCode()+"入库出错");
+                }else{
+                    log.info("接收入库{},新增药房药品库存成功[{}]", ypOutDetlVo.getDrawNo(), JSONObject.valueToString(ypBaseYf));
                 }
             }else{//更新药房药品库存
-                stockValue = packRetprice.multiply(new BigDecimal(amount));
+                stockValue = packRetprice.multiply(new BigDecimal(amount)).setScale(2,BigDecimal.ROUND_HALF_UP);
                 if(ypBaseYfMapper.updateStockAmount(ypOutDetlVo.getChargeCode(),serial
                         ,ypOutDetlVo.getGroupNoOut(),amount, stockValue) == 0){
                     throw new MzException("药品编码"+ypOutDetlVo.getChargeCode()+"入库出错");
+                }else{
+                    log.info("接收入库{},更新药房药品库存成功,药品编码{},规格{},数量{}", ypOutDetlVo.getDrawNo(), ypOutDetlVo.getChargeCode(), serial, amount);
                 }
                 ypBaseYfMapper.updateResetVirtual(ypOutDetlVo.getChargeCode(), serial, ypOutDetlVo.getGroupNoOut());
             }

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

@@ -105,6 +105,10 @@ public class MzSendMedicineVo implements Serializable {
     private String warnDept;
     //申请科室
     private String warnDeptName;
+    //执行科室
+    private String execUnit;
+    //执行科室名称
+    private String execName;
     //诊断
     private String icdText;
     //给药方式编码

+ 8 - 0
src/main/java/cn/hnthyy/thmz/vo/SendDrugRecordVo.java

@@ -28,6 +28,10 @@ public class SendDrugRecordVo implements Serializable {
     private String warnDeptName;
     //申请科室编码
     private String warnDept;
+    // 执行科室
+    private String execUnit;
+    // 执行科室名称
+    private String execName;
     //诊断
     private String icdText;
     //药品名称
@@ -66,4 +70,8 @@ public class SendDrugRecordVo implements Serializable {
     private Integer queryScope;
     //批号
     private String manuNo;
+    /**
+     * 医嘱号
+     */
+    private Integer actOrderNo;
 }

+ 2 - 2
src/main/resources/static/js/yf/spirit_anesthetic_print.js

@@ -157,7 +157,7 @@ function getSpiritAnestheticPrintData() {
                     html += '<td style="text-align: center;">' + data.chargeDate + '</td>';
                     html += '<td class="xtd" style="text-align: left;">' + (isEmpty(data.manuNo)?"":data.manuNo) + '</td>';
                     html += '<td class="xtd" style="text-align: center;">' + data.employeeName + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.warnDeptName + '</td>';
+                    html += '<td class="xtd" style="text-align: center;">' + data.warnDeptName+'<br>'+(isEmpty(data.execName)?'':'/'+data.execName) + '</td>';
                     html += '<td class="xtd" ></td>';
                     html += '<td class="xtd" ></td>';
                     html += '</tr>';
@@ -243,7 +243,7 @@ function getSendDrugRecordData() {
                     html += '<td class="xtd" style="text-align: center;">' + data.name + '</td>';
                     html += '<td class="xtd" style="text-align: center;">' + sex + '</td>';
                     html += '<td class="xtd" style="text-align: center;">' + age.substring(0, age.indexOf('岁')) + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.warnDeptName + '</td>';
+                    html += '<td class="xtd" style="text-align: left;">' + data.warnDeptName+'<br>'+(isEmpty(data.execName)?'':'/'+data.execName) + '</td>';
                     html += '<td>' + data.icdText + '</td>';
                     html += '<td class="xtd" style="text-align: center;">' + data.chargeCode + '</td>';
                     html += '<td>' + data.drugName + '</td>';

+ 2 - 2
src/main/resources/templates/yf/spirit_anesthetic_print.html

@@ -108,7 +108,7 @@
                             <td class="xtd" style="text-align: center;width: 45px;">姓名</td>
                             <td class="xtd" style="text-align: center;width: 30px;">性别</td>
                             <td class="xtd" style="text-align: center;width: 30px;">年龄</td>
-                            <td class="xtd" style="text-align: center;width: 65px;">科室</td>
+                            <td class="xtd" style="text-align: center;width: 65px;">申请科室<br>/执行科室</td>
                             <td style="text-align: center;width: 120px;">诊断</td>
                             <td class="xtd" style="text-align: center;width: 45px;">编码</td>
                             <td style="text-align: center;width: 80px;">药名</td>
@@ -146,7 +146,7 @@
                             <td style="text-align: center;width: 45px;">发药日期</td>
                             <td style="text-align: center;width: 45px;">批号</td>
                             <td class="xtd" style="text-align: center;width: 45px;">医师</td>
-                            <td class="xtd" style="text-align: center;width: 70px;">科室</td>
+                            <td class="xtd" style="text-align: center;width: 70px;">申请科室<br>/执行科室</td>
                             <td class="xtd" style="text-align: center;width: 45px;">复核人</td>
                             <td class="xtd" style="text-align: center;width: 45px;">发药人</td>
                         </tr>