lihong пре 1 месец
родитељ
комит
4597ca1fed

+ 16 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -58,6 +58,7 @@ import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -3148,6 +3149,21 @@ public class MzChargeDetailController {
         return R.ok().put("data",times);
     }
 
+    @PostMapping("/queryYjEntryPrintData")
+    @UserLoginToken
+    public R queryYjEntryPrintData(@RequestBody MzPatientMi mzPatientMi){
+        YjEntryPrintVo yjEntryPrintVo =  mzChargeDetailService.queryYjEntryPrintData(mzPatientMi.getPatientId(),mzPatientMi.getTimes());
+        return R.ok().put("data",yjEntryPrintVo);
+    }
+
+
+    @GetMapping("/queryYjEntryHistory")
+    @UserLoginToken
+    public R queryYjEntryHistory(){
+        List<YjEntryPrintVo> yjEntryPrintVo =  mzChargeDetailService.queryYjEntryHistory();
+        return R.ok().put("data",yjEntryPrintVo);
+    }
+
     @PostMapping("/getPayQcode")
     @UserLoginToken
     public R getPayQcode(@RequestBody MzChargeDetail mzChargeDetail){

+ 27 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/YjEntryPrintVo.java

@@ -0,0 +1,27 @@
+package cn.hnthyy.thmz.entity.his.mz;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:lihong
+ * @Date: 2025/7/9
+ */
+@Data
+public class YjEntryPrintVo {
+
+    private String patientId;
+    private Integer times;
+    private String name;
+    private String deptName;
+    private String doctorName;
+    private String qrCodeUrl;
+    private BigDecimal totalFee;
+    private Date visitData;
+
+    List<MzChargeDetail> mzChargeDetails;
+}

+ 29 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzChargeDetailMapper.java

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.mapper.his.mz;
 
 import cn.hnthyy.thmz.entity.his.mz.MzChargeDetail;
+import cn.hnthyy.thmz.entity.his.mz.MzPatientMi;
 import cn.hnthyy.thmz.entity.his.mz.MzYjReq;
 import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
 import cn.hnthyy.thmz.vo.MzDepositFileVo;
@@ -1247,4 +1248,32 @@ public interface MzChargeDetailMapper {
 
     @Update("update ${tableName} set tf_flag =#{tfFlag} where patient_id =#{patientId}  and times=#{times} and abs(receipt_no) =#{receiptNo} ")
     int updateTfFlag(@Param("patientId") String patientId, @Param("times") Integer times, @Param("tfFlag") Integer tfFlag, @Param("receiptNo")Integer receiptNo, @Param("tableName") String tableName);
+    @Select(" select " +
+            "   b.patient_id, " +
+            "   b.times, " +
+            "   b.charge_item_code, " +
+            "   b.tc_name, " +
+            "  convert(decimal(18,2), b.unit_price * b.quantity * b.drug_win) amount, " +
+            "   b.quantity, " +
+            "   b.unit_price, " +
+            "   b.drug_win, " +
+            "   b.name " +
+            " from mz_order_detail a, " +
+            "     mz_charge_detail b " +
+            " where a.patient_id = b.patient_id " +
+            "  and a.times = b.times " +
+            "  and b.pay_mark = '5' " +
+            "  and a.order_type = '6' " +
+            "  and b.patient_id = #{patientId}" +
+            "  and b.times = #{times}")
+    List<MzChargeDetail> selectYjEntryCharge(String patientId, Integer times);
+    @Select(" select distinct a.patient_id, b.times " +
+            " from mz_order_detail a, " +
+            "     mz_charge_detail b " +
+            " where a.patient_id = b.patient_id " +
+            "  and a.times = b.times " +
+            "  and b.pay_mark = '5' " +
+            "  and a.order_type = '6' " +
+            "  and b.doctor_code = #{userIdCode} ")
+    List<MzPatientMi> selectYjEntryHistory(String userIdCode);
 }

+ 17 - 0
src/main/java/cn/hnthyy/thmz/service/his/mz/MzChargeDetailService.java

@@ -3,8 +3,10 @@ package cn.hnthyy.thmz.service.his.mz;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.mz.MzChargeDetail;
 import cn.hnthyy.thmz.entity.his.mz.MzDepositFile;
+import cn.hnthyy.thmz.entity.his.mz.MzPatientMi;
 import cn.hnthyy.thmz.entity.his.mz.MzReceiptSerial;
 import cn.hnthyy.thmz.entity.his.mz.MzYjReq;
+import cn.hnthyy.thmz.entity.his.mz.YjEntryPrintVo;
 import cn.hnthyy.thmz.entity.thmz.Clinic;
 import cn.hnthyy.thmz.entity.thmz.DiscountVo;
 import cn.hnthyy.thmz.entity.thmz.PayInfo;
@@ -635,4 +637,19 @@ public interface MzChargeDetailService {
      * @date: 2025/7/2 10:26
      **/
     int saveYjItemEntry(MzPrescriptionVo mzPrescriptionVo);
+    /**
+     * @description:
+     * @author: lihong
+     * @date: 2025/7/9 11:07
+     * @param: mzPatientMi
+     * @return: cn.hnthyy.thmz.entity.his.mz.YjEntryPrintVo
+     **/
+    YjEntryPrintVo queryYjEntryPrintData(String patientId,Integer times);
+    /**
+     * @description:
+     * @author: lihong 
+     * @date: 2025/7/9 14:30  
+     * @return: java.util.List<cn.hnthyy.thmz.entity.his.mz.YjEntryPrintVo>
+     **/
+    List<YjEntryPrintVo> queryYjEntryHistory();
 }

+ 61 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -7902,6 +7902,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             mzChargeDetail.setDrugUnit("");
             mzChargeDetail.setInstructionCode("");
             mzChargeDetail.setSupplyCode("");
+            mzChargeDetail.setTcName(zdChargeItem.getName());
             mzChargeDetail.setWarnDept(mzPrescriptionVo.getVisitDeptCode());
             mzChargeDetail.setPriceId(mzPrescriptionVo.getDoctorCode());
             mzChargeDetail.setPriceTime(now);
@@ -7926,6 +7927,20 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 
             itemNo++;
         }
+
+        MzOrderLock mzOrderLock = new MzOrderLock();
+        mzOrderLock.setLockFlag(0);
+        mzOrderLock.setYbzf(0);
+        mzOrderLock.setUpdateId(mzPrescriptionVo.getDoctorCode());
+        mzOrderLock.setUpdateTime(now);
+        mzOrderLock.setHisOrderNum(Tools.getHisOrdNum(mzPrescriptionVo.getPatientId(),times,1));
+        mzOrderLockMapper.insert(mzOrderLock);
+        mzOrderDetailService.save(MzOrderDetail.builder()
+                .patientId(mzPrescriptionVo.getPatientId())
+                .times(times)
+                .receiptNo(0)
+                .orderType(6)
+                .build());
         mzVisitTableMapper.insertMzVisitTable(newMzVisitTable);
         MzPatientMi updateMzPatientMi = new MzPatientMi();
         updateMzPatientMi.setPatientId(mzPrescriptionVo.getPatientId());
@@ -7935,4 +7950,50 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         getMzChargeDetailService().saveMzChargeDetail(mzPrescriptionVo.getMzChargeDetailList());
         return times;
     }
+
+    /**
+     * @param patientId
+     * @param times
+     * @description:
+     * @author: lihong
+     * @date: 2025/7/9 11:07
+     * @param: mzPatientMi
+     * @return: cn.hnthyy.thmz.entity.his.mz.YjEntryPrintVo
+     */
+    @Override
+    public YjEntryPrintVo queryYjEntryPrintData(String patientId, Integer times) {
+        YjEntryPrintVo data = new YjEntryPrintVo();
+        MzVisitTable mzVisitTable = mzVisitTableService.queryByPatientIdAndTimes(patientId, times);
+        AssertUtil.isNotBlank(mzVisitTable,"没有要打印的就诊记录信息");
+        data.setPatientId(patientId);
+        data.setTimes(times);
+        ZdUnitCode zdUnitCode = zdUnitCodeService.queryByCode(mzVisitTable.getVisitDeptCode());
+        data.setDeptName(zdUnitCode == null ? "" : zdUnitCode.getName());
+        Employee employee = employeeService.queryByUserCode(mzVisitTable.getDoctorCode());
+        data.setDoctorName(employee == null ? "" :employee.getEmployeeName());
+        List<MzChargeDetail> mzChargeDetails = mzChargeDetailMapper.selectYjEntryCharge(patientId,times);
+        AssertUtil.isNotBlank(mzChargeDetails,"没有要打印的费用信息");
+        BigDecimal sum = mzChargeDetails.stream().map(MzChargeDetail::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+        log.info("sum={}",sum);
+        data.setMzChargeDetails(mzChargeDetails);
+        data.setTotalFee(sum);
+        return data;
+    }
+
+    /**
+     * @description:
+     * @author: lihong
+     * @date: 2025/7/9 14:30
+     * @return: java.util.List<cn.hnthyy.thmz.entity.his.mz.YjEntryPrintVo>
+     **/
+    @Override
+    public List<YjEntryPrintVo> queryYjEntryHistory() {
+        String userIdCode = TokenUtil.getUser().getUserIdCode();
+        List<MzPatientMi> list = mzChargeDetailMapper.selectYjEntryHistory(userIdCode);
+        if(CollUtil.isNotEmpty(list)){
+        }
+        return null;
+    }
+
+
 }

+ 3 - 0
src/main/resources/otherSource/update_table.sql

@@ -2285,3 +2285,6 @@ go
 exec sp_addextendedproperty 'MS_Description', '0 开处方不自动收取挂号费 1 开处方自动收取挂号费', 'SCHEMA', 'dbo', 'TABLE', 'mz_order_detail', 'COLUMN', 'gh_fee_flag'
 go
 
+
+--新增处方类型 20250709
+insert into mz_zd_order_type (code, name, py_code, d_code, del_flag) values ('6','医技录入处方','YJLRCF','YJLRCF','0')

+ 2 - 0
src/main/resources/static/js/mz/clinic.js

@@ -36,6 +36,8 @@ $(function () {
         wpyHide = res.data
         if(res.data === 1){
             $('#wp_order_button').removeClass('in').addClass('hide');
+            $('#healthEducationDiv').removeClass('in').addClass('hide');
+            $('#ypHealthEducationDiv').removeClass('in').addClass('hide');
         }
     })
     getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {

+ 134 - 41
src/main/resources/static/js/mz/yj_item_entry.js

@@ -497,19 +497,7 @@ function saveYjItem() {
    postAjaxJsonHttpRequst("/thmz/saveYjItemEntry",paramData,true,function (res) {
         if(res.code == 0){
             successMesageSimaple('保存成功!')
-            postAjaxJsonHttpRequst("/thmz/getPayQcode",{patientId:paramData.patientId,times:res.data},true,function (ress) {
-                if(ress.data !=''){
-                    new QRCode(document.getElementById("payQrcodeYjEntry"), ress.data);  // 设置要生成二维码的链接
-                    $("canvas").attr("id", "erw");
-                    let canvas = document.getElementById('erw');
-                    let src = canvas.toDataURL("image/png");
-                    let payQrcodeGuideCardHtml = `<img src="${src}" style="width: 100px;height: 100px"/><div style="width: 100px;margin-top: 2px;">&nbsp;&nbsp;&nbsp;微信支付</div>`;
-                    $("#payQrcodeYjEntry").html(payQrcodeGuideCardHtml)
-                }else {
-                    $("#payQrcodeYjEntry").html("")
-                }
-            })
-            setPrintDetail()
+            setPrintDetail(paramData.patientId,res.data);
             setTimeout(function () {
                 clearData()
                 clearPatient()
@@ -523,6 +511,108 @@ function saveYjItem() {
    })
 }
 
+/**
+ * 打开医技录入记录  yj_history_table
+ */
+function openYjEntryHistoryModel() {
+    $("#yjEntryModal").modal();
+}
+
+/**
+ * 初始医技费用历史列表
+ */
+function initYjHistoryTable() {
+    $('#yj_history_table').bootstrapTable("destroy");
+    $('#yj_history_table').bootstrapTable({
+        url: '/thmz/queryYjEntryHistory',         //请求后台的URL(*)
+        method: 'post',                      //请求方式(*)
+        toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: true,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        queryParams: diagQueryParams,           //传递参数(*)
+        sidePagination: "client",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 10,                       //每页的记录行数(*)
+        pageList: [10, 25, 50, 100],        //可供选择的每页的行数(*)
+        search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
+        strictSearch: true,
+        showColumns: false,                  //是否显示所有的列
+        showRefresh: false,                  //是否显示刷新按钮
+        minimumCountColumns: 2,             //最少允许的列数
+        clickToSelect: true,                //是否启用点击选中行
+        uniqueId: "ID",                     //每一行的唯一标识,一般为主键列
+        showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
+        cardView: false,                    //是否显示详细视图
+        detailView: false,
+        //rowStyle:rowStyle,//通过自定义函数设置行样式
+        ajaxOptions: {
+            headers: {
+                'Accept': 'application/json',
+                'Authorization': 'Bearer ' + localStorage.getItem("token")
+            }
+        },
+        columns: [
+            {
+                title: '操作',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    // var rowData = JSON.stringify(row);
+                    var str = '<button type="button" class="btn btn-primary  btn-sm" onclick="chongPrint(\'' + row.code + '\',\'' + row.name + '\')">选中</button>';
+                    return str;
+                }
+            },
+            {
+                field: 'code',
+                title: '诊断编码',
+                align: "center",
+                valign: 'middle'
+
+            },
+            {
+                field: 'name',
+                title: '诊断名称',
+                align: "center",
+                valign: 'middle'
+
+            }
+        ],
+        responseHandler: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var ress = eval(res);
+            if (ress.code == -1) {
+                if (ress.message != null && ress.message != '') {
+                    new PNotify({
+                        title: '错误提示',
+                        text: ress.message,
+                        type: 'error',
+                        hide: true,
+                        styling: 'bootstrap3'
+                    });
+                }
+                return {
+                    "total": 0,//总页数
+                    "rows": {}   //数据
+                };
+            }
+            return {
+                "total": ress.total,//总页数
+                "rows": ress.data   //数据
+            };
+        },
+    });
+}
+
+function chongPrint(patientId,times) {
+
+}
+
 //查询病人信息
 function queryMzPatient() {
     //getByIcCardNo  icCardNo
@@ -614,38 +704,40 @@ function initSearchList(content, searchTextIds, width, height) {
     }
 }
 
-function setPrintDetail() {
+function setPrintDetail(patientId,times) {
     if(rightData.length == 0){
         errorMesageSimaple('没有要打印的数据')
         return
     }
-    let patientId = $("#patientIdText").text()
-     $("#patientId_t").html("门诊号:"+ patientId)
-    let name = $("#nameParam").text()
-     $("#name_t").html("姓名:"+ name)
-     $("#date_t").html("日期:"+ format(new Date(),'yyyy-MM-dd'))
-    let deptName = $('#clinicDeptNo option:selected').text();
-     $("#dept_t").html("科室:"+ deptName)
-    $("#doctor_t").html("医生:"+ localStorage.getItem("userName"))
-    let html = "";
-    for (let i = 0; i <rightData.length ; i++) {
-        html += "<tr>";
-        html += ' <td  style="width: 17%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + rightData[i].zlCode + '</td>';
-        html += ' <td style="width: 45%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + rightData[i].name + '</td>';
-        html += ' <td style="width: 10%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + rightData[i].descriptions + '</td>';
-        html += ' <td style="width: 10%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + rightData[i].chargeUnit + '</td>';
-        html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + rightData[i].zlItemPrice + '</td>';
-        html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + rightData[i].itemQuantity + '</td>';
-        html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + rightData[i].totalAmountZl + '</td>';
-
-        html += "</tr>";
-    }
-    html += '<tr><td colspan="8"><div style="border:0;border-top:1px solid #000;overflow:hidden;font-size: 13px;"><div style="float: right;font-weight: 700;padding-top: 4px;padding-bottom: 4px;"><span>金额合计:</span><span id="total_count" style="margin-left: 50px;"></span></div></div></td></tr>';
-    $("#fymx_table_body").html(html);
-    let total_count =  $("#totalCharge").text();
-    $("#total_count").text(total_count);
+    postAjaxJsonHttpRequst("/thmz/queryYjEntryPrintData",{patientId:patientId,times:times},true,function (res) {
+        if(res.code == 0){
+            $("#patientId_t").html("门诊号:"+ res.patientId)
+            $("#name_t").html("姓名:"+ res.name)
+            $("#date_t").html("日期:"+ res.visitData)
+            $("#dept_t").html("科室:"+ res.deptName)
+            $("#doctor_t").html("医生:"+ res.userName)
+            let html = "";
+            for (let i = 0; i <res.data.length ; i++) {
+                html += "<tr>";
+                html += ' <td  style="width: 17%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + res.data[i].code + '</td>';
+                html += ' <td style="width: 45%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + res.data[i].name + '</td>';
+                html += ' <td style="width: 10%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + res.data[i].descriptions + '</td>';
+                html += ' <td style="width: 10%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + res.data[i].chargeUnit + '</td>';
+                html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + res.data[i].unitPrice + '</td>';
+                html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + res.data[i].quantity + '</td>';
+                html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + res.data[i].amount + '</td>';
+
+                html += "</tr>";
+            }
+            html += '<tr><td colspan="8"><div style="border:0;border-top:1px solid #000;overflow:hidden;font-size: 13px;"><div style="float: right;font-weight: 700;padding-top: 4px;padding-bottom: 4px;"><span>金额合计:</span><span id="total_count" style="margin-left: 50px;"></span></div></div></td></tr>';
+            $("#fymx_table_body").html(html);
+            $("#total_count").text(res.totalFee);
 
-    setTimeout(printChargeDetail,500)
+            setTimeout(printChargeDetail,500)
+        }else {
+            errorMesage(res)
+        }
+    })
 }
 
 function jiSuanTotalCharge() {
@@ -705,4 +797,5 @@ function setPrint() {
             }
         }
     });
-}
+}
+

+ 2 - 2
src/main/resources/templates/mz/clinic.html

@@ -1572,14 +1572,14 @@
                             </div>
                         </div>
                     </div>
-                    <div class="item form-group" style="margin-top: 20px;">
+                    <div class="item form-group" style="margin-top: 20px;" id="healthEducationDiv">
                         <label class="my_label">健康教育:</label>
                         <!--   <input id="emrHpi" class="form-control my_label_input"
                                   placeholder="请输入" type="text" data-placement="bottom-right">-->
                         <textarea id="healthEducation" class="form-control my_label_input" placeholder="请输入"
                                   style="height: 200px;"></textarea>
                     </div>
-                    <div class="item form-group" style="margin-top: 5px;">
+                    <div class="item form-group" style="margin-top: 5px;" id="ypHealthEducationDiv">
                         <label class="my_label">特殊药品健康教育:</label>
                         <!--   <input id="emrHpi" class="form-control my_label_input"
                                   placeholder="请输入" type="text" data-placement="bottom-right">-->

+ 23 - 1
src/main/resources/templates/mz/yj_item_entry.html

@@ -66,7 +66,7 @@
                                  onclick="saveYjItem()"   title="保存"><i class="fa fa-check-square-o"></i>
                             </button>
                             <button type="button" style="margin-left:3px"  class="btn btn-primary"
-                                    onclick="setPrintDetail()"   title="打印"><i class="fa fa-print"></i>
+                                    onclick="openYjEntryHistoryModel()"   title="补打"><i class="fa fa-print"></i>
                             </button>
                         </div>
                     </div>
@@ -210,3 +210,25 @@
     </div>
 </div>
 
+<!--医技录入费用历史记录-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="yjEntryModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content container" style="width: 800px;margin-left: 200px;height: 550px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title modal-title-thmz">医技录入费用记录(未交费)</h4>
+            </div>
+            <div class="modal-body">
+                <div class="col-md-12 col-sm-12 col-xs-12">
+                    <div class="x_panel">
+                        <table id="yj_history_table"></table>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>