Browse Source

优化门特费用标记。

lighter 4 years ago
parent
commit
2a9892526c

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>5.5</version>
+    <version>5.7</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
 

+ 8 - 5
src/main/java/thyyxxk/webserver/controller/markmtfees/MarkMtFeesController.java

@@ -5,12 +5,10 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.pojo.ResultVo;
-import thyyxxk.webserver.pojo.markmtfees.CssybApplyInfo;
-import thyyxxk.webserver.pojo.markmtfees.MarkMtFeeParam;
-import thyyxxk.webserver.pojo.markmtfees.QueryMtInfoParam;
-import thyyxxk.webserver.pojo.markmtfees.UploadMtFeeParam;
+import thyyxxk.webserver.pojo.markmtfees.*;
 import thyyxxk.webserver.service.markmtfees.MarkMtFeesService;
 
+import java.util.List;
 import java.util.Map;
 
 @RestController
@@ -44,9 +42,14 @@ public class MarkMtFeesController {
         return service.insertMtFees(param);
     }
 
+    @PostMapping("/deleteMtFees")
+    public ResultVo<String> deleteMtFees(@RequestBody OrderNo param) {
+        return service.deleteMtFees(param);
+    }
+
     @GetMapping("/cssybMtPreCal")
     public ResultVo<Object> cssybMtPreCal(@RequestParam("patientId") String patientId,
-                                                       @RequestParam("times") Integer times) {
+                                          @RequestParam("times") Integer times) {
         return service.cssybMtPreCal(patientId, times);
     }
 

+ 9 - 8
src/main/java/thyyxxk/webserver/dao/his/markmtfees/MarkMtFeesDao.java

@@ -1,9 +1,6 @@
 package thyyxxk.webserver.dao.his.markmtfees;
 
-import org.apache.ibatis.annotations.Insert;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.pojo.markmtfees.*;
 
 import java.util.List;
@@ -57,12 +54,16 @@ public interface MarkMtFeesDao {
 
     @Insert("insert into t_mt_receipt (patient_id, times, receipt_no, order_no, item_no, his_item_name, " +
             "his_item_code, fee_date, input_date, medi_item_type, charge_fee, price, quantity, drug_win, " +
-            "input_staff, input_man, serial_no, yb_trans_flag) values (" +
+            "input_staff, input_man, serial_no, yb_trans_flag, charge_type) values (" +
             "#{patientId},#{times},#{receiptNo},#{orderNo},#{itemNo},#{drugName},#{chargeItemCode}," +
             "#{priceTime},getdate(),#{billItemCode},#{chargeFee},#{unitPrice},#{quantity},#{drugWin}," +
-            "#{doctorCode},#{doctorName},#{serialNo},0)")
+            "#{doctorCode},#{doctorName},#{serialNo},0, #{groupNo})")
     void insertBatchedMtFeeInfo(MzReceipt param);
 
+    @Delete("delete from t_mt_receipt where patient_id=#{patientId} and times=#{times} and " +
+            "receipt_no=#{receiptNo} and order_no=#{orderNo}")
+    void deleteMtFees(OrderNo param);
+
     @Select("SELECT a.patient_id,a.social_no,a.name,a.lv_date,a.sex,a.response_type,a.charge_type,a.times,a.age," +
             "a.birth_day,responce_name=b.name,address=a.adress,phone_no=a.phone_no FROM " +
             "mz_patient_mi a,mz_zd_responce_type b,mz_visit_table c WHERE a.patient_id=#{patientId} and " +
@@ -89,7 +90,7 @@ public interface MarkMtFeesDao {
             "a.charge_bill_code,a.quantity,a.unit_price,a.orig_price,a.pay_mark,a.serial,a.serial_no,a.charge_date," +
             "a.group_no,specification=b.specification,a.confirm_flag,a.print_flag,a.exec_dept,a.warn_dept,a.drug_win," +
             "a.supply_code,a.drug_quan,a.drug_unit,a.frequency,a.price_id,a.price_time,dosage=b.dosage,a.windows_no_yf," +
-            "a.bill_item_code,doctor_code,cash_id,a.name,responce_type,a.tc_no,tc_name," +
+            "a.bill_item_code,doctor_code,cash_id,a.name,responce_type,a.tc_no,tc_name,a.instruction_text," +
             "doctorName=(select rtrim(name) from a_employee_mi where code=doctor_code)," +
             "del_flag=case when isnull(b.del_flag,'0')='1' or isnull(e.visible_flag_mz,'0')='1' then '1' else '0' end " +
             "FROM mz_charge_detail a,yp_zd_dict b,yp_base_yf e,mz_zd_supply_type c WHERE a.charge_item_code=b.code and " +
@@ -103,7 +104,7 @@ public interface MarkMtFeesDao {
             "specification=case when a.bill_item_code='TC' then '处方套餐' else b.charge_unit end," +
             "a.confirm_flag,a.print_flag,a.exec_dept,a.warn_dept,a.drug_win,a.supply_code,a.drug_quan,a.drug_unit," +
             "a.frequency,a.price_id,a.price_time,dosage=char(4),a.windows_no_yf,a.bill_item_code,doctor_code,cash_id," +
-            "a.name,responce_type,tc_no,tc_name," +
+            "a.name,responce_type,tc_no,tc_name,a.instruction_text," +
             "doctorName=(select rtrim(name) from a_employee_mi where code=doctor_code)," +
             "del_flag=isnull(b.del_flag,'0') FROM mz_charge_detail a,zd_charge_item " +
             "b,mz_zd_supply_type c WHERE a.charge_item_code*=b.code and a.patient_id=#{patientId} AND a.times=#{times} and " +

+ 3 - 0
src/main/java/thyyxxk/webserver/pojo/markmtfees/MzReceipt.java

@@ -21,9 +21,11 @@ public class MzReceipt {
     private String serial;
     private String serialNo;
     private Date chargeDate;
+    // 00 项目,其他 药品
     private String groupNo;
     private String specification;
     private Integer confirmFlag;
+    private String instructionText;
     private Integer drugWin;
     private Date priceTime;
     private String dosage;
@@ -35,6 +37,7 @@ public class MzReceipt {
     private String tcNo;
     private String tcName;
     private BigDecimal chargeFee;
+    private Boolean checked;
 
     public String getDrugName() {
         return null == drugName ? "" : (drugName).trim();

+ 5 - 1
src/main/java/thyyxxk/webserver/pojo/markmtfees/OrderNo.java

@@ -6,6 +6,10 @@ import java.math.BigDecimal;
 
 @Data
 public class OrderNo {
-    private Integer order;
+    private String patientId;
+    private Integer times;
+    private Integer receiptNo;
+    private Integer orderNo;
     private BigDecimal totalFee;
+    private Boolean status;
 }

+ 19 - 3
src/main/java/thyyxxk/webserver/service/markmtfees/MarkMtFeesService.java

@@ -110,11 +110,12 @@ public class MarkMtFeesService {
         }
         map.put("mzPatient", mzPatients.get(0));
         map.put("mzVisit", mzVisit);
+
         List<MzReceipt> mzReceipts = dao.selectMzReceipts(patientId, times, mzVisit.getReceiptNo());
         mzReceipts.removeIf(item -> item.getBillItemCode().equals("TC") || item.getPayMark() != 5 || item.getChargeItemCode().equals("BILL99"));
-//        mzReceipts.removeIf(item -> item.getBillItemCode().trim().equals("TC") || item.getPayMark() == 5 || item.getChargeItemCode().equals("BILL99"));
         Map<Integer, List<MzReceipt>> temp = new HashMap<>();
         mzReceipts.forEach(item -> {
+            item.setChecked(true);
             if (!temp.containsKey(item.getOrderNo())) {
                 List<MzReceipt> list = new ArrayList<>();
                 list.add(item);
@@ -126,12 +127,17 @@ public class MarkMtFeesService {
         List<OrderNo> orderNos = new ArrayList<>();
         for (Map.Entry<Integer, List<MzReceipt>> entry : temp.entrySet()) {
             OrderNo orderNo = new OrderNo();
-            orderNo.setOrder(entry.getKey());
+            orderNo.setPatientId(patientId);
+            orderNo.setTimes(times);
+            orderNo.setReceiptNo(mzVisit.getReceiptNo());
+            orderNo.setOrderNo(entry.getKey());
             BigDecimal total = new BigDecimal("0.00");
             for (MzReceipt item : entry.getValue()) {
                 total = total.add(item.getChargeFee());
             }
             orderNo.setTotalFee(total);
+            int count = dao.selectFeeCount(patientId, times, mzVisit.getReceiptNo(), entry.getKey());
+            orderNo.setStatus(count > 0);
             orderNos.add(orderNo);
         }
         map.put("orderNos", orderNos);
@@ -143,6 +149,7 @@ public class MarkMtFeesService {
         if (param.getResponceType().equals("02")) {
             param.setYbType("13");
         }
+        log.info("recep: {}", param.getReceipts());
         MzReceipt receipt = param.getReceipts().get(0);
         int count = dao.selectFeeCount(receipt.getPatientId(), receipt.getTimes(),
                 receipt.getReceiptNo(), receipt.getOrderNo());
@@ -151,7 +158,16 @@ public class MarkMtFeesService {
         }
         dao.insertMzChargeYb(receipt.getPatientId(), receipt.getTimes(), receipt.getReceiptNo(),
                 receipt.getOrderNo(), param.getResponceType(), param.getYbType());
-        param.getReceipts().forEach(dao::insertBatchedMtFeeInfo);
+        param.getReceipts().forEach(item -> {
+            if (item.getChecked()) {
+                dao.insertBatchedMtFeeInfo(item);
+            }
+        });
+        return ResultVoUtil.success();
+    }
+
+    public ResultVo<String> deleteMtFees(OrderNo param) {
+        dao.deleteMtFees(param);
         return ResultVoUtil.success();
     }