Преглед на файлове

update 修改 页面D 值计算

bzd_lxf преди 7 месеца
родител
ревизия
ada7580188

+ 93 - 24
health-admin/src/main/resources/templates/dtp/recipe/edit.html

@@ -108,7 +108,7 @@
                 <th class="is-required">单次剂量数</th>
                 <th class="is-required">单次剂量单位</th>
                 <th class="is-required">用药频次</th>
-                <th class="is-required">用药天数(购药包装单位)</th>
+                <th class="is-required">购药包装单位</th>
                 <th>D值品用药天数</th>
 
             </tr>
@@ -433,7 +433,16 @@
                 singleDoseUnit: $(row).find('select[name="singleDoseUnit"]').val(),
                 dosageFrequency: $(row).find('select[name="dosageFrequency"]').val(),
                 dosageFrequencyDays: $(row).find('input[name="dosageFrequencyDays"]').val(),
-                dvalueDays: $(row).find('input[name="dvalueDays"]').val()
+                dvalueDays: $(row).find('input[name="dvalueDays"]').val(),
+
+                dosageMax: $(row).find('input[name="dosageMax"]').val(),
+                unitMax: $(row).find('input[name="unitMax"]').val(),
+                dosageMin: $(row).find('input[name="dosageMin"]').val(),
+                unitMin: $(row).find('input[name="unitMin"]').val(),
+                dosageNormal: $(row).find('input[name="dosageNormal"]').val(),
+                unitNormal: $(row).find('input[name="unitNormal"]').val(),
+                packingValue: $(row).find('input[name="packingValue"]').val(),
+                packingUnit: $(row).find('input[name="packingUnit"]').val(),
             };
             if (rowData.packageQuantity == ''|| rowData.packageQuantity == null|| rowData.packageQuantity == undefined){
                 $.modal.alertError("请输入包装数量");
@@ -455,12 +464,34 @@
                 falg = false;
                 return falg;
             }
+            debugger
+            /* 计算 D 值天数*/
+            var dcnum = rowData.singleDoseValue; // 单次用量
+            var pcnum = rowData.dosageFrequency; // 用药频次  eg: 一天一次
+            console.log("单次剂量数值"+dcnum+"频次"+pcnum +" 相乘:"+(dcnum*pcnum));
+            if((dcnum*pcnum)>rowData.dosageMax){
+                console.log("单次剂量数值*频次不能大于最大值")
+            }
+            if((dcnum*pcnum)<rowData.dosageMin){
+                console.log("单次剂量数值*频次不能小于最小值")
+            }
+            // 计算 D 值
+            var num = rowData.packageQuantity;  // 买药数量
+            var dnum = (num*rowData.dosageFrequencyDays)/(dcnum*pcnum);   //  买药数量 * 包装单位数量 / 频次天数 = D 值天数
+            console.log("计算D值天数: "+dnum);
+            rowData.dvalueDays = dnum;
             // 将每一行的数据对象添加到数组中
             tableRows.push(rowData);
         });
         if (!falg){
             return;
         }
+        if (tableRows.length > 0) {
+            formData.append('drugData', JSON.stringify(tableRows));
+        }else{
+            $.modal.alertError("请添加药品");
+            return;
+        }
         var id = $('#id').val().trim();
         var prescriptionNumber = $('#prescriptionNumber').val().trim();
         if(id!=''){
@@ -513,7 +544,6 @@
             return;
         }
         var tableBody = $('#drugInfoTable tbody');
-
         rows.forEach(function(item) {
             // 动态选择所有列并映射到更具描述性的名称
             var columnsData = {
@@ -533,7 +563,16 @@
                 followUpItem: item.followUpItem,
                 coldChainItem: item.coldChainItem,
                 flowItem: item.flowItem,
-                charityAidItem: item.charityAidItem
+                charityAidItem: item.charityAidItem,
+
+                dosageMax: item.dosageMax,
+                unitMax: item.unitMax,
+                dosageMin: item.dosageMin,
+                unitMin: item.unitMin,
+                dosageNormal: item.dosageNormal,
+                unitNormal: item.unitNormal,
+                packingValue: item.packingValue,
+                packingUnit: item.packingUnit,
             };
 
             // 检查是否已经存在该药品
@@ -554,10 +593,19 @@
                     <td class="hidden-column">${columnsData.registeredItem === 1 ? '是' : '否'}</td>
                     <td class="hidden-column">${columnsData.charityAidItem === 1 ? '是' : '否'}</td>
                     <td class="hidden-column">${columnsData.packaging}</td>
-                    <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" style="width: 170px;" type="number"></td>
-                    <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" style="width: 170px;" type="number"></td>
+
+                    <td class="hidden-column"><input name="dosageMax" value="${columnsData.dosageMax}"/></td>
+                    <td class="hidden-column"><input name="unitMax" value="${columnsData.unitMax}"/></td>
+                    <td class="hidden-column"><input name="dosageMin" value="${columnsData.dosageMin}"/></td>
+                    <td class="hidden-column"><input name="unitMin" value="${columnsData.unitMin}"/></td>
+                    <td class="hidden-column"><input name="dosageNormal" value="${columnsData.dosageNormal}"/></td>
+                    <td class="hidden-column"><input name="unitNormal" value="${columnsData.unitNormal}"/></td>
+                    <td class="hidden-column"><input name="packingValue" value="${columnsData.packingValue}"/></td>
+                    <td class="hidden-column"><input name="packingUnit" value="${columnsData.packingUnit}"/></td>
+                    <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" style="width: 130px;" type="number"></td>
+                    <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" style="width: 130px;" type="number"></td>
                     <td>
-                        <select name="singleDoseUnit" id="singleDoseUnit${columnsData.productId}" class="styled-input" style="width: 170px;" required>
+                        <select name="singleDoseUnit" id="singleDoseUnit${columnsData.productId}" class="styled-input" style="width: 130px;" required>
                             <option value="">请选择</option>
                             <!--<option value="1">mg</option>
                             <option value="2">g</option>
@@ -565,7 +613,7 @@
                         </select>
                     </td>
                     <td>
-                        <select name="dosageFrequency" id="dosageFrequency${columnsData.productId}" class="styled-input" style="width: 170px;" required>
+                        <select name="dosageFrequency" id="dosageFrequency${columnsData.productId}" class="styled-input" style="width: 130px;" required>
                             <option value="">请选择</option>
                             <!--<option value="1">一日1次</option>
                             <option value="2">一日2次</option>
@@ -574,13 +622,14 @@
                             <option value="5">每周2次</option>-->
                         </select>
                     </td>
-                    <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="用药频次换算天数" class="styled-input" style="width: 170px;" type="number"></td>
-                    <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" style="width: 140px;" type="number"></td>
+                    <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="购药包装单位" class="styled-input" style="width: 130px;" type="number"></td>
+                    <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" style="width: 110px;" type="number"></td>
                 </tr>
             `;
                 tableBody.append(row);
                 dataInfo(columnsData.productId)
-                bindDosageFrequencyChangeListener(columnsData.productId);
+                $('#dosageFrequencyDays'+columnsData.productId).val(columnsData.packingValue);
+                //bindDosageFrequencyChangeListener(columnsData.productId);
             } else {
                 $.modal.alertWarning(`药品 ${columnsData.productName} 已经添加了`);
             }
@@ -599,16 +648,12 @@
         var selectElement = document.getElementById('singleDoseUnit' + productId);
         var pcselectElement = document.getElementById('dosageFrequency' + productId);
         storeTypes.forEach(function(item, index){
-            console.log("item"+item.dictLabel);
-            console.log("dictValue"+item.dictValue);
             var option = document.createElement("option");
             option.value = item.dictValue;
             option.text = item.dictLabel;
             selectElement.add(option);
         })
         pcTypes.forEach(function(item, index){
-            console.log("item"+item.dictLabel);
-            console.log("dictValue"+item.dictValue);
             var option = document.createElement("option");
             option.value = item.dictValue;
             option.text = item.dictLabel;
@@ -739,6 +784,8 @@
             }
         });
     }
+
+    /* 这里是去查询 使用药的信息*/
     $(document).ready(function() {
         var id = $('#id').val().trim();
         var datas=[];
@@ -805,7 +852,18 @@
                 singleDoseUnit: item.singleDoseUnit,
                 dosageFrequency: item.dosageFrequency,
                 dosageFrequencyDays: item.dosageFrequencyDays,
-                charityAidItem: item.charityAidItem
+                charityAidItem: item.charityAidItem,
+
+                dosageMax: item.dosage_max,
+                unitMax: item.unit_max,
+                dosageMin: item.dosage_min,
+                unitMin: item.unit_min,
+                dosageNormal: item.dosage_normal,
+                unitNormal: item.unit_normal,
+                packingValue: item.packing_value,
+                packingUnit: item.packing_unit,
+
+                dvalueDays: item.dvalueDays,
             };
 
             // 检查是否已经存在该药品
@@ -826,10 +884,19 @@
                     <td class="hidden-column">${columnsData.registeredItem === 1 ? '是' : '否'}</td>
                     <td class="hidden-column">${columnsData.charityAidItem === 1 ? '是' : '否'}</td>
                     <td class="hidden-column">${columnsData.packaging}</td>
-                    <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" style="width: 170px;" type="number"></td>
-                    <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" style="width: 170px;" type="number"></td>
+
+                    <td class="hidden-column"><input name="dosageMax" value="${columnsData.dosageMax}"/></td>
+                    <td class="hidden-column"><input name="unitMax" value="${columnsData.unitMax}"/></td>
+                    <td class="hidden-column"><input name="dosageMin" value="${columnsData.dosageMin}"/></td>
+                    <td class="hidden-column"><input name="unitMin" value="${columnsData.unitMin}"/></td>
+                    <td class="hidden-column"><input name="dosageNormal" value="${columnsData.dosageNormal}"/></td>
+                    <td class="hidden-column"><input name="unitNormal" value="${columnsData.unitNormal}"/></td>
+                    <td class="hidden-column"><input name="packingValue" value="${columnsData.packingValue}"/></td>
+                    <td class="hidden-column"><input name="packingUnit" value="${columnsData.packingUnit}"/></td>
+                    <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" style="width: 130px;" type="number"></td>
+                    <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" style="width: 130px;" type="number"></td>
                     <td>
-                        <select name="singleDoseUnit" id="singleDoseUnit${columnsData.productId}" class="styled-input" style="width: 170px;" required>
+                        <select name="singleDoseUnit" id="singleDoseUnit${columnsData.productId}" class="styled-input" style="width: 130px;" required>
                             <option value="">请选择</option>
                             <!--<option value="1">mg</option>
                             <option value="2">g</option>
@@ -837,7 +904,7 @@
                         </select>
                     </td>
                     <td>
-                        <select name="dosageFrequency" id="dosageFrequency${columnsData.productId}" class="styled-input" style="width: 170px;" required>
+                        <select name="dosageFrequency" id="dosageFrequency${columnsData.productId}" class="styled-input" style="width: 130px;" required>
                             <option value="">请选择</option>
                             <!--<option value="1">一日1次</option>
                             <option value="2">一日2次</option>
@@ -846,19 +913,21 @@
                             <option value="5">每周2次</option>-->
                         </select>
                     </td>
-                    <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="用药频次换算天数" class="styled-input" style="width: 170px;" type="number"></td>
-                    <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" style="width: 140px;" type="number"></td>
+                    <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="购药包装单位" class="styled-input" style="width: 100px;" type="number"><span id="ycode${columnsData.productId}"></span></td>
+                    <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" style="width: 100px;" type="number"></td>
                 </tr>
             `;
                 tableBody.append(row);
                 dataInfo(columnsData.productId)
-                bindDosageFrequencyChangeListener(columnsData.productId);
+                //bindDosageFrequencyChangeListener(columnsData.productId);
                 $('#packageQuantity'+columnsData.productId ).val(columnsData.packageQuantity);
+                $('#dvalueDays'+columnsData.productId ).val(columnsData.dvalueDays);
                 $('#singleDoseValue'+columnsData.productId ).val(columnsData.singleDoseValue);
                 // 设置 select 元素的值,这将会选中 value 与 columnsData.singleDoseValue 匹配的 option
                 $('#singleDoseUnit'+columnsData.productId).val(columnsData.singleDoseUnit);
                 $('#dosageFrequency'+columnsData.productId).val(columnsData.dosageFrequency);
-                $('#dosageFrequencyDays'+columnsData.productId).val(columnsData.dosageFrequencyDays);
+                $('#dosageFrequencyDays'+columnsData.productId).val(columnsData.packingValue);
+                $('#ycode'+columnsData.productId).text(columnsData.packingUnit);
             } else {
                 $.modal.alertWarning(`药品 ${columnsData.productName} 已经添加了`);
             }

+ 51 - 5
health-admin/src/main/resources/templates/dtp/recipe/newRecipe.html

@@ -135,7 +135,7 @@
                     <th class="is-required">单次剂量数</th>
                     <th class="is-required">单次剂量单位</th>
                     <th class="is-required">用药频次</th>
-                    <th class="is-required">用药天数</th>
+                    <th class="is-required">购药包装单位</th>
                     <th>D值品用药天数</th>
 
                 </tr>
@@ -509,7 +509,16 @@ function initTab(datas){
                 singleDoseUnit: $(row).find('select[name="singleDoseUnit"]').val(),
                 dosageFrequency: $(row).find('select[name="dosageFrequency"]').val(),
                 dosageFrequencyDays: $(row).find('input[name="dosageFrequencyDays"]').val(),
-                dvalueDays: $(row).find('input[name="dvalueDays"]').val()
+                dvalueDays: $(row).find('input[name="dvalueDays"]').val(),
+
+                dosageMax: $(row).find('input[name="dosageMax"]').val(),
+                unitMax: $(row).find('input[name="unitMax"]').val(),
+                dosageMin: $(row).find('input[name="dosageMin"]').val(),
+                unitMin: $(row).find('input[name="unitMin"]').val(),
+                dosageNormal: $(row).find('input[name="dosageNormal"]').val(),
+                unitNormal: $(row).find('input[name="unitNormal"]').val(),
+                packingValue: $(row).find('input[name="packingValue"]').val(),
+                packingUnit: $(row).find('input[name="packingUnit"]').val(),
             };
             if (rowData.packageQuantity == ''|| rowData.packageQuantity == null|| rowData.packageQuantity == undefined){
                 $.modal.alertError("请输入包装数量");
@@ -531,6 +540,21 @@ function initTab(datas){
                 falg = false;
                 return falg;
             }
+            /* 计算 D 值天数*/
+            var dcnum = rowData.singleDoseValue; // 单次用量
+            var pcnum = rowData.dosageFrequency; // 用药频次  eg: 一天一次
+            console.log("单次剂量数值"+dcnum+"频次"+pcnum +" 相乘:"+(dcnum*pcnum));
+            if((dcnum*pcnum)>rowData.dosageMax){
+                console.log("单次剂量数值*频次不能大于最大值")
+            }
+            if((dcnum*pcnum)<rowData.dosageMin){
+                console.log("单次剂量数值*频次不能小于最小值")
+            }
+            // 计算 D 值
+            var num = rowData.packageQuantity;  // 买药数量
+            var dnum = (num*rowData.dosageFrequencyDays)/(dcnum*pcnum);   //  买药数量 * 包装单位数量 / 频次天数 = D 值天数
+            console.log("计算D值天数: "+dnum);
+            rowData.dvalueDays = dnum;
             // 将每一行的数据对象添加到数组中
             tableRows.push(rowData);
         });
@@ -748,7 +772,18 @@ function initTab(datas){
                 followUpItem: item.followUpItem,
                 coldChainItem: item.coldChainItem,
                 flowItem: item.flowItem,
-                charityAidItem: item.charityAidItem
+                charityAidItem: item.charityAidItem,
+
+                dosageMax: item.dosageMax,
+                unitMax: item.unitMax,
+                dosageMin: item.dosageMin,
+                unitMin: item.unitMin,
+                dosageNormal: item.dosageNormal,
+                unitNormal: item.unitNormal,
+                packingValue: item.packingValue,
+                packingUnit: item.packingUnit,
+
+                dvalueDays: item.dvalueDays,
             };
 
             // 检查是否已经存在该药品
@@ -769,6 +804,15 @@ function initTab(datas){
                     <td class="hidden-column">${columnsData.registeredItem === 1 ? '是' : '否'}</td>
                     <td class="hidden-column">${columnsData.charityAidItem === 1 ? '是' : '否'}</td>
                     <td class="hidden-column">${columnsData.packaging}</td>
+
+                    <td class="hidden-column"><input name="dosageMax" value="${columnsData.dosageMax}"/></td>
+                    <td class="hidden-column"><input name="unitMax" value="${columnsData.unitMax}"/></td>
+                    <td class="hidden-column"><input name="dosageMin" value="${columnsData.dosageMin}"/></td>
+                    <td class="hidden-column"><input name="unitMin" value="${columnsData.unitMin}"/></td>
+                    <td class="hidden-column"><input name="dosageNormal" value="${columnsData.dosageNormal}"/></td>
+                    <td class="hidden-column"><input name="unitNormal" value="${columnsData.unitNormal}"/></td>
+                    <td class="hidden-column"><input name="packingValue" value="${columnsData.packingValue}"/></td>
+                    <td class="hidden-column"><input name="packingUnit" value="${columnsData.packingUnit}"/></td>
                     <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" style="width: 170px;" type="number"></td>
                     <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" style="width: 170px;" type="number"></td>
                     <td>
@@ -789,13 +833,15 @@ function initTab(datas){
                             <option value="5">每周2次</option>-->
                         </select>
                     </td>
-                    <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="用药频次换算天数" class="styled-input" style="width: 170px;" type="number"></td>
+                    <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="购药包装单位" class="styled-input" style="width: 170px;" type="number"><span id="ycode${columnsData.productId}"></span></td>
                     <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" style="width: 140px;" type="number"></td>
                 </tr>
             `;
                 tableBody.append(row);
                 dataInfo(columnsData.productId);
-                bindDosageFrequencyChangeListener(columnsData.productId);
+                //bindDosageFrequencyChangeListener(columnsData.productId);
+                $('#dosageFrequencyDays'+columnsData.productId).val(columnsData.packingValue);
+                $('#ycode'+columnsData.productId).text(columnsData.packingUnit);
             } else {
                 $.modal.alertWarning(`药品 ${columnsData.productName} 已经添加了`);
             }

+ 70 - 171
health-admin/src/main/resources/templates/dtp/recipe/recipe.html

@@ -128,181 +128,80 @@
 			fixedRightNumber: 1,
 			columns: [{
 				checkbox: true
-			}, {
-				field: "id",
-				title: "ID",
-				visible: false,
-			}, {
-				field: "prescriptionNumber",
-				title: "处方单号"
-			}, {
-				field: "saleOrderNumber",
-				title: "销售单号"
-			}, {
-				field: "hospital",
-				title: "医院"
-			}, {
-				field: "department",
-				title: "科室"
-			}, {
-				field: "prescribingDoctor",
-				title: "处方医生"
-			}, {
-				field: "attendingDoctor",
-				title: "主管医生"
-			}, {
-				field: "patientName",
-				title: "患者姓名"
-			}, {
-				field: "gender",
-				title: "性别",
-				formatter: function(value, row, index) {
-					switch (value) {
-						case 0:
-							return "男";
-							break;
-						case 1:
-							return "女";
-							break;
-						default:
-							return "未知";
+			}, {field: "id",title: "ID",visible: false},
+				{ field: "mdmCode", title: "药品编码" },
+				{ field: "administrationMethod", title: "给药方式" },
+				{ field: "productName", title: "商品名称" },
+				{ field: "genericName", title: "通用名称" },
+				{ field: "specification", title: "规格" },
+				{ field: "prescriptionNumber", title: "处方单号" },
+				{ field: "dvalueDays", title: "剂量天数" },
+				{ field: "prescriptionNumber", title: "处方单号" },
+				{ field: "saleOrderNumber", title: "销售单号" },
+				{ field: "hospital", title: "医院" },
+				{ field: "department", title: "科室" },
+				{ field: "prescribingDoctor", title: "处方医生" },
+				{ field: "attendingDoctor", title: "主管医生" },
+				{ field: "patientName", title: "患者姓名" },
+				{ field: "gender", title: "性别", formatter: function(value, row, index) {
+						switch (value) {
+							case 0: return "男";
+							case 1: return "女";
+							default: return "未知";
+						}
 					}
-				}
-			}, {
-				field: "age",
-				title: "年龄"
-			} ,{
-				field: "patientPhone",
-				title: "患者手机号"
-			}, {
-				field: "storeName",
-				title: "建档门店",
-				visible: false,
-			}, {
-				field: "registrant",
-				title: "登记人"
-			}, {
-				field: "reviewingName",
-				title: "审核药师姓名"
-			}, {
-				field: "prescriptionType",
-				title: "处方类型",
-				formatter: function(value, row, index) {
-					switch (value) {
-						case 1:
-							return "电子处方";
-							break;
-						case 2:
-							return "纸质处方";
-							break;
-						default:
-							return "";
+				},
+				{ field: "age", title: "年龄" },
+				{ field: "patientPhone", title: "患者手机号" },
+				{ field: "storeName", title: "建档门店", visible: false },
+				{ field: "registrant", title: "登记人" },
+				{ field: "reviewingName", title: "审核药师姓名" },
+				{ field: "prescriptionType", title: "处方类型", formatter: function(value, row, index) {
+						switch (value) {
+							case 1: return "电子处方";
+							case 2: return "纸质处方";
+							default: return "";
+						}
 					}
-				}
-			}, {
-				field: "status",
-				title: "状态",
-				formatter: function(value, row, index) {
-					switch (value) {
-						case 1:
-							return "订单已完成";
-							break;
-						case 2:
-							return "待上传处方";
-							break;
-						case 3:
-							return "待确认信息";
-							break;
-						case 4:
-							return "待处方登记";
-							break;
-						case 5:
-							return "待订单销售";
-							break;
-						case 6:
-							return "待绑定患者";
-							break;
-						case 7:
-							return "处方已完成";
-							break;
-						case 8:
-							return "订单已退款";
-							break;
-						default:
-							return "待确认信息";
+				},
+				{ field: "status", title: "状态", formatter: function(value, row, index) {
+						switch (value) {
+							case 1: return "订单已完成";
+							case 2: return "待上传处方";
+							case 3: return "待确认信息";
+							case 4: return "待处方登记";
+							case 5: return "待订单销售";
+							case 6: return "待绑定患者";
+							case 7: return "处方已完成";
+							case 8: return "订单已退款";
+							default: return "待确认信息";
+						}
 					}
-				}
-			}, {
-				field: "createdTime",
-				title: "创建时间"
-			}, {
-				field: "updatedTime",
-				title: "最后更新时间",
-				visible: false,
-			}, {
-				field: "prescriptionImageUrl",
-				title: "处方图片URL",
-				visible: false,
-			}, {
-				field: "invoiceImageUrl",
-				title: "发票图片URL",
-				visible: false,
-			}, {
-				field: "prescriptionIssueDate",
-				title: "处方开具日期"
-			}, {
-				field: "saleDate",
-				title: "销售日期"
-			}, {
-				field: "registrationDate",
-				title: "处方登记日期"
-			}, {
-				field: "drugVarietyCount",
-				title: "药品品种数",
-				visible: false,
-			}, {
-				field: "drugQuantity",
-				title: "处方取药数量"
-			}, {
-				field: "invoiceCode",
-				title: "发票编码",
-				visible: false,
-			}, {
-				field: "drugsLinkId",
-				title: "处方关联的处方购药药表ID",
-				visible: false,
-			}, {
-				field: "reviewStatus",
-				title: "处方审核状态",
-				formatter: function(value, row, index) {
-					switch (value) {
-						case 0:
-							return "审核不通过";
-							break;
-						case 1:
-							return "审核通过";
-							break;
-						default:
-							return "待审核";
+				},
+				{ field: "createdTime", title: "创建时间" },
+				{ field: "updatedTime", title: "最后更新时间", visible: false },
+				{ field: "prescriptionImageUrl", title: "处方图片URL", visible: false },
+				{ field: "invoiceImageUrl", title: "发票图片URL", visible: false },
+				{ field: "prescriptionIssueDate", title: "处方开具日期" },
+				{ field: "saleDate", title: "销售日期" },
+				{ field: "registrationDate", title: "处方登记日期" },
+				{ field: "drugVarietyCount", title: "药品品种数", visible: false },
+				{ field: "drugQuantity", title: "处方取药数量" },
+				{ field: "invoiceCode", title: "发票编码", visible: false },
+				{ field: "drugsLinkId", title: "处方关联的处方购药药表ID", visible: false },
+				{ field: "reviewStatus", title: "处方审核状态", formatter: function(value, row, index) {
+						switch (value) {
+							case 0: return "审核不通过";
+							case 1: return "审核通过";
+							default: return "待审核";
+						}
 					}
-				}
-			}, {
-				field: "source",
-				title: "处方来源",
-				visible: false,
-			}, {
-				field: "drugRoute",
-				title: "用药途径",
-				visible: false,
-			}, {
-				field: "storeId",
-				title: "建档门店ID",
-				visible: false,
-			}, {
-				field: "remarks",
-				title: "备注",
-				visible: false,
-			}, {
+				},
+				{ field: "source", title: "处方来源", visible: false },
+				{ field: "drugRoute", title: "用药途径", visible: false },
+				{ field: "storeId", title: "建档门店ID", visible: false },
+				{ field: "remarks", title: "备注", visible: false },
+				{
 				title: '操作',
 				align: 'center',
 				width: 165,

+ 35 - 10
health-admin/src/main/resources/templates/gxhpz/allProduct.html

@@ -82,6 +82,14 @@
 				{
 					checkbox: true
 				},
+				{ field: "dosage_max", title: "最大剂量数量",visible: false },
+				{ field: "unit_max", title: "最大剂量单位",visible: false },
+				{ field: "dosage_min", title: "最小剂量数量" ,visible: false},
+				{ field: "unit_min", title: "最小剂量单位" ,visible: false},
+				{ field: "dosage_normal", title: "常见计量数量",visible: false },
+				{ field: "unit_normal", title: "常见计量单位",visible: false },
+				{ field: "packing_value", title: "包装单位值",visible: false },
+				{ field: "packing_unit", title: "包装单位",visible: false },
 				{
 					field: "id",
 					title: "编号",
@@ -405,7 +413,7 @@
 					visible: false
 				}, {
 					"field": "is_insurance_drug",
-					"title": "是否医保药品 (1: 是, 0: 否)",
+					"title": "是否医保药品",
 					align: 'center',
 					visible: true,
 					formatter: function(value, row, index) {
@@ -426,7 +434,7 @@
 				},
 				{
 					"field": "prescription_required",
-					"title": "是否凭处方销售 (1: 是, 0: 否)",
+					"title": "是否凭处方销售",
 					align: 'center',
 					visible: false,
 					formatter: function(value, row, index) {
@@ -435,7 +443,7 @@
 				},
 				{
 					"field": "prohibit_ordering",
-					"title": "禁止请货 (1: 是, 0: 否)",
+					"title": "禁止请货",
 					align: 'center',
 					visible: false,
 					formatter: function(value, row, index) {
@@ -476,7 +484,7 @@
 				},
 				{
 					"field": "registered_item",
-					"title": "是否登记管理品 (1: 是, 0: 否)",
+					"title": "是否登记管理品",
 					align: 'center',
 					visible: true,
 					formatter: function(value, row, index) {
@@ -485,7 +493,7 @@
 				},
 				{
 					"field": "follow_up_item",
-					"title": "是否随访管理品 (1: 是, 0: 否)",
+					"title": "是否随访管理品",
 					align: 'center',
 					visible: true,
 					formatter: function(value, row, index) {
@@ -494,7 +502,7 @@
 				},
 				{
 					"field": "cold_chain_item",
-					"title": "是否冷链管理品 (1: 是, 0: 否)",
+					"title": "是否冷链管理品",
 					align: 'center',
 					visible: true,
 					formatter: function(value, row, index) {
@@ -521,7 +529,7 @@
 				},
 				{
 					"field": "charity_aid_item",
-					"title": "是否慈善援助管理品 (1: 是, 0: 否)",
+					"title": "是否慈善援助管理品",
 					align: 'center',
 					visible: true,
 					formatter: function(value, row, index) {
@@ -582,8 +590,16 @@
 			follow_up_item: $.table.selectColumns('follow_up_item'),
 			cold_chain_item: $.table.selectColumns('cold_chain_item'),
 			flow_item: $.table.selectColumns('flow_item'),
-			charity_aid_item: $.table.selectColumns('charity_aid_item')
-			// Add more fields as needed
+			charity_aid_item: $.table.selectColumns('charity_aid_item'),
+
+			dosage_max: $.table.selectColumns('dosage_max'),
+			unit_max: $.table.selectColumns('unit_max'),
+			dosage_min: $.table.selectColumns('dosage_min'),
+			unit_min: $.table.selectColumns('unit_min'),
+			dosage_normal: $.table.selectColumns('dosage_normal'),
+			unit_normal: $.table.selectColumns('unit_normal'),
+			packing_value: $.table.selectColumns('packing_value'),
+			packing_unit: $.table.selectColumns('packing_unit'),
 		};
 
 		// 构建返回的对象数组
@@ -604,7 +620,16 @@
 			followUpItem: columnsData.follow_up_item,
 			coldChainItem: columnsData.cold_chain_item,
 			flowItem: columnsData.flow_item,
-			charityAidItem: columnsData.charity_aid_item
+			charityAidItem: columnsData.charity_aid_item,
+
+			dosageMax: columnsData.dosage_max,
+			unitMax: columnsData.unit_max,
+			dosageMin: columnsData.dosage_min,
+			unitMin: columnsData.unit_min,
+			dosageNormal: columnsData.dosage_normal,
+			unitNormal: columnsData.unit_normal,
+			packingValue: columnsData.packing_value,
+			packingUnit: columnsData.packing_unit,
 			// Add more mappings as needed
 		}];
 

+ 31 - 84
health-system/src/main/java/com/bzd/system/service/DTPService.java

@@ -273,7 +273,11 @@ public class DTPService {
                             pageData.put("singleDoseUnit", lxr.get("singleDoseUnit"));//处方单次剂量单位
                             pageData.put("dosageFrequency", lxr.get("dosageFrequency"));//规范用药频次
                             pageData.put("dosageFrequencyDays", lxr.get("dosageFrequencyDays"));//用药频次换算使用天数 下拉带出来的 要去字典的value
-                            pageData.put("dvalueDays", 1);//待计算
+                            if(lxr.get("dvalueDays")!=null){
+                                pageData.put("dvalueDays", lxr.get("dvalueDays"));
+                            }else {
+                                pageData.put("dvalueDays", 0);
+                            }
 
 
                             // 添加其他可能需要的字段(如果有的话)
@@ -310,28 +314,8 @@ public class DTPService {
                 pd.put("createdBy", getSysUser().getUserId());
                 pd.put("createTime", DateUtils.getTime());
 
-                // 直接从表单数据填充
-                pd.put("hospital", pd.get("hospital"));
-                pd.put("prescribingDoctor", pd.get("prescribingDoctor"));
-                pd.put("department", pd.get("department"));
-                pd.put("prescriptionDiagnosis", pd.get("prescriptionDiagnosis"));
-                pd.put("attendingDoctor", pd.get("attendingDoctor"));
-                pd.put("clinicalDiagnosis", pd.get("clinicalDiagnosis"));
-                pd.put("prescriptionImageUrl", pd.get("prescriptionImageUrl"));
-                pd.put("prescriptionIssueDate", pd.get("prescriptionIssueDate"));
-                pd.put("invoiceImageUrl", pd.get("invoiceImageUrl"));
-                pd.put("invoiceCode", pd.get("invoiceCode"));
                 pd.put("registrationDate", DateUtils.getTime());
-                pd.put("registerPharmacistName", pd.get("registerPharmacistName"));
-                pd.put("registrant", pd.get("registrant"));
-                pd.put("reviewingName", pd.get("reviewingName"));
                 pd.put("drugQuantity", drugQuantity);
-        pd.put("prescriptionType", pd.get("prescriptionType"));
-                // 患者信息
-                pd.put("patientId", pd.get("patientId"));
-                pd.put("patientName", pd.get("patientName"));
-                pd.put("gender", pd.get("gender"));
-                pd.put("age", pd.get("age"));
                 int result = daoSupport.save("DTPCFDJMapper.insertPrescriptionRegistration", pd);
                 if(resultDrug>0 && result>0){
                     returnPageData.put("code", 200);
@@ -555,8 +539,6 @@ public class DTPService {
     }
     @Transactional(rollbackFor = Exception.class)
     public int updateCFDJ(final PageData pd) throws Exception {
-
-
         Object drugList = pd.get("drugData");//获取药品信息列表
         Integer Id = IdUtils.get10randomNumber();//生成处方单号
         List<PageData> addList = new ArrayList<>();
@@ -571,6 +553,7 @@ public class DTPService {
                 drugQuantity=rowsdrugList.size();//处方取药数量
                 // 遍历列表并调用插入数据接口
                 if (rowsdrugList.size() > 0) {
+                    dao.executeBatch("DTPCFDJMapper.batchDeleteDrugPurchaseRecord", pd);  // 直接删除 所有的药品信息然后新增
                     for (Map<String, Object> lxr : rowsdrugList) {
                         PageData pageData = new PageData();
 
@@ -591,12 +574,12 @@ public class DTPService {
                         pageData.put("singleDoseUnit", lxr.get("singleDoseUnit"));
                         pageData.put("dosageFrequency", lxr.get("dosageFrequency"));
                         pageData.put("dosageFrequencyDays", lxr.get("dosageFrequencyDays"));
-                        pageData.put("dvalueDays", 1);
-
-
-                        // 添加其他可能需要的字段(如果有的话)
+                        if(lxr.get("dvalueDays")!=null){
+                            pageData.put("dvalueDays", lxr.get("dvalueDays"));
+                        }else {
+                            pageData.put("dvalueDays", 0);
+                        }
                         pageData.put("medicationRoute", lxr.get("medicationRoute"));
-                        //pageData.put("sales", lxr.get("sales"));
                         pageData.put("prescriptionNumber", pd.get("prescriptionNumber"));
                         pageData.put("prescriptionDate", DateUtils.getTime());
                         pageData.put("hospital", lxr.get("hospital"));
@@ -606,71 +589,35 @@ public class DTPService {
                         pageData.put("clinicalDiagnosis", lxr.get("clinicalDiagnosis"));
                         pageData.put("registrant", lxr.get("registrant"));
                         pageData.put("registrationDate", DateUtils.getTime());
-//                        pageData.put("saleDate", lxr.get("saleDate"));
-//                        pageData.put("pharmacyName", lxr.get("pharmacyName"));
-//                        pageData.put("updatedBy", lxr.get("updatedBy"));
-//                        pageData.put("updatedTime", lxr.get("updatedTime"));
-//                        pageData.put("remarks", lxr.get("remarks"));
                         addList.add(pageData);
+                        dao.executeBatch("DTPCFDJMapper.batchAddDrugPurchaseRecordNew", pageData);
                     }
-                    final HashMap<String, Object> addMap = new HashMap<String, Object>();
-                    addMap.put("dataList", addList);
-                    resultDrug= dao.executeBatch("DTPCFDJMapper.batchDeleteDrugPurchaseRecord", pd);
-                    resultDrug= dao.executeBatch("DTPCFDJMapper.batchAddDrugPurchaseRecord", addMap);
                 }
+                pd.put("storeId", getSysUser().getDeptId());
+                pd.put("storeName", getSysUser().getDeptId()); // 假设 getDeptName() 可以获取部门名称
+                pd.put("createdBy", getSysUser().getUserId());
+                pd.put("createTime", DateUtils.getTime());
 
+                pd.put("registrationDate", DateUtils.getTime());
+                pd.put("drugQuantity", drugQuantity);
+                // 患者信息
+                if (StringUtils.isNotNull(pd.get("gender"))){
+                    String gender = pd.get("gender").toString();
+                    if (gender.equals("男")){
+                        pd.put("gender", "1");
+                    }else if(gender.equals("女")){
+                        pd.put("gender", "0");
+                    }else {
+                        pd.put("gender", "3");
+                    }
+                }
+                return daoSupport.save("DTPCFDJMapper.updatePrescriptionRegistration", pd);
             } catch (Exception e) {
                 e.printStackTrace();
             }
 
         }
-
-        System.out.println("当前用户信息getUserId:" + getSysUser().getUserId());
-        System.out.println("当前用户信息getDeptId:" + getSysUser().getDeptId());
-        // 从表单数据填充
-        pd.put("prescriptionNumber", pd.get("prescriptionNumber")); // 处方单表id主键,Id 应该是某个方式生成的唯一标识符
-        pd.put("storeId", getSysUser().getDeptId());
-        pd.put("storeName", getSysUser().getDeptId()); // 假设 getDeptName() 可以获取部门名称
-        pd.put("createdBy", getSysUser().getUserId());
-        pd.put("createTime", DateUtils.getTime());
-
-        // 直接从表单数据填充
-        pd.put("hospital", pd.get("hospital"));
-        pd.put("prescribingDoctor", pd.get("prescribingDoctor"));
-        pd.put("department", pd.get("department"));
-        pd.put("prescriptionDiagnosis", pd.get("prescriptionDiagnosis"));
-        pd.put("attendingDoctor", pd.get("attendingDoctor"));
-        pd.put("clinicalDiagnosis", pd.get("clinicalDiagnosis"));
-        pd.put("prescriptionImageUrl", pd.get("prescriptionImageUrl"));
-        pd.put("prescriptionIssueDate", pd.get("prescriptionIssueDate"));
-        pd.put("invoiceImageUrl", pd.get("invoiceImageUrl"));
-        pd.put("invoiceCode", pd.get("invoiceCode"));
-        pd.put("registrationDate", DateUtils.getTime());
-        pd.put("registerPharmacistName", pd.get("registerPharmacistName"));
-        pd.put("registrant", pd.get("registrant"));
-        pd.put("reviewingName", pd.get("reviewingName"));
-        pd.put("drugQuantity", drugQuantity);
-        pd.put("prescriptionType", pd.get("prescriptionType"));
-        // 患者信息
-//        pd.put("patientId", pd.get("patientId"));
-        pd.put("patientName", pd.get("patientName"));
-        if (StringUtils.isNotNull(pd.get("gender"))){
-            String gender = pd.get("gender").toString();
-            if (gender.equals("男")){
-                pd.put("gender", "1");
-            }else if(gender.equals("女")){
-                pd.put("gender", "0");
-            }else {
-                pd.put("gender", "3");
-            }
-        }
-        pd.put("age", pd.get("age"));
-        int result = daoSupport.save("DTPCFDJMapper.updatePrescriptionRegistration", pd);
-        if(resultDrug>0 && result>0){
-            return 1;
-        }else {
-            return 0;
-        }
+        return 0;
     }
 
 }

+ 26 - 3
health-system/src/main/resources/mapper/gxhpz/drugConfigMapper.xml

@@ -598,9 +598,32 @@
     </select>
     <!--配置过的药品查询-->
     <select id="getAllProductInfo" parameterType="pd" resultType="pd">
-
-        select p.*,d.is_insurance_drug,d.insurance_category,d.purchase_limit_quantity,d.prescription_required,d.prohibit_ordering,d.mid_pack_order_logic,d.max_order_limit,d.drug_delivery_way,d.registered_item,d.follow_up_item,d.cold_chain_item,d.flow_item,d.charity_aid_item
-        from s_gxhpz_product_info p left join s_gxhpz_product_dtpinfo d on p.product_code = d.product_code
+        SELECT
+            p.*,
+            d.is_insurance_drug,
+            d.insurance_category,
+            d.purchase_limit_quantity,
+            d.prescription_required,
+            d.prohibit_ordering,
+            d.mid_pack_order_logic,
+            d.max_order_limit,
+            d.drug_delivery_way,
+            d.registered_item,
+            d.follow_up_item,
+            d.cold_chain_item,
+            d.flow_item,
+            d.dosage_max,
+            d.dosage_min,
+            d.unit_max,
+            d.unit_min,
+            d.unit_normal,
+            d.dosage_normal,
+            d.packing_value,
+            d.packing_unit,
+            d.charity_aid_item
+        FROM
+            s_gxhpz_product_info p
+            LEFT JOIN s_gxhpz_product_dtpinfo d ON p.product_code = d.product_code
         <where>
             <if test="id != null">
                 AND p.id = #{id}

+ 93 - 53
health-system/src/main/resources/mapper/mdyy/DTPCFDJMapper.xml

@@ -6,136 +6,163 @@
 
     <!-- 查询 -->
     <select id="selectPrescriptionRegistration" parameterType="pd" resultType="pd">
-        select * from s_dtp_prescription_registration where 1=1
+        SELECT
+        sddpr.mdmCode,
+        sddpr.administrationMethod,
+        sddpr.productName,
+        sddpr.genericName,
+        sddpr.specification,
+        sddpr.prescriptionNumber,
+        sddpr.dvalueDays,
+        sdpr.*
+        FROM
+        s_dtp_prescription_registration sdpr
+        LEFT JOIN s_dtp_drug_purchase_record sddpr ON sddpr.prescriptionNumber = sdpr.prescriptionNumber
+        WHERE 1=1
+        <if test="mdmCode != null and mdmCode != ''">
+            and sddpr.mdmCode = #{mdmCode}
+        </if>
+        <if test="administrationMethod != null and administrationMethod != ''">
+            and sddpr.administrationMethod = #{administrationMethod}
+        </if>
+        <if test="productName != null and productName != ''">
+            and sddpr.productName = #{productName}
+        </if>
+        <if test="genericName != null and genericName != ''">
+            and sddpr.genericName = #{genericName}
+        </if>
+        <if test="specification != null and specification != ''">
+            and sddpr.specification = #{specification}
+        </if>
+        <if test="prescriptionNumber != null and prescriptionNumber != ''">
+            and sddpr.prescriptionNumber = #{prescriptionNumber}
+        </if>
+        <if test="dvalueDays != null">
+            and sddpr.dvalueDays = #{dvalueDays}
+        </if>
         <if test="hospital != null and hospital != ''">
-            and hospital = #{hospital}
+            and sdpr.hospital = #{hospital}
         </if>
         <if test="prescribingDoctor != null and prescribingDoctor != ''">
-            and prescribingDoctor = #{prescribingDoctor}
+            and sdpr.prescribingDoctor = #{prescribingDoctor}
         </if>
         <if test="department != null and department != ''">
-            and department = #{department}
+            and sdpr.department = #{department}
         </if>
         <if test="prescriptionDiagnosis != null and prescriptionDiagnosis != ''">
-            and prescriptionDiagnosis = #{prescriptionDiagnosis}
+            and sdpr.prescriptionDiagnosis = #{prescriptionDiagnosis}
         </if>
         <if test="attendingDoctor != null and attendingDoctor != ''">
-            and attendingDoctor = #{attendingDoctor}
+            and sdpr.attendingDoctor = #{attendingDoctor}
         </if>
         <if test="clinicalDiagnosis != null and clinicalDiagnosis != ''">
-            and clinicalDiagnosis = #{clinicalDiagnosis}
+            and sdpr.clinicalDiagnosis = #{clinicalDiagnosis}
         </if>
         <if test="prescriptionImageUrl != null and prescriptionImageUrl != ''">
-            and prescriptionImageUrl = #{prescriptionImageUrl}
+            and sdpr.prescriptionImageUrl = #{prescriptionImageUrl}
         </if>
         <if test="prescriptionIssueDate != null">
-            and prescriptionIssueDate = #{prescriptionIssueDate}
+            and sdpr.prescriptionIssueDate = #{prescriptionIssueDate}
         </if>
         <if test="saleDate != null">
-            and saleDate = #{saleDate}
+            and sdpr.saleDate = #{saleDate}
         </if>
         <if test="registrationDate != null">
-            and registrationDate = #{registrationDate}
+            and sdpr.registrationDate = #{registrationDate}
         </if>
         <if test="drugVarietyCount != null">
-            and drugVarietyCount = #{drugVarietyCount}
+            and sdpr.drugVarietyCount = #{drugVarietyCount}
         </if>
         <if test="drugQuantity != null">
-            and drugQuantity = #{drugQuantity}
+            and sdpr.drugQuantity = #{drugQuantity}
         </if>
         <if test="invoiceCode != null and invoiceCode != ''">
-            and invoiceCode = #{invoiceCode}
+            and sdpr.invoiceCode = #{invoiceCode}
         </if>
         <if test="invoiceImageUrl != null and invoiceImageUrl != ''">
-            and invoiceImageUrl = #{invoiceImageUrl}
+            and sdpr.invoiceImageUrl = #{invoiceImageUrl}
         </if>
         <if test="registerPharmacistName != null and registerPharmacistName != ''">
-            and registerPharmacistName = #{registerPharmacistName}
+            and sdpr.registerPharmacistName = #{registerPharmacistName}
         </if>
         <if test="registrant != null and registrant != ''">
-            and registrant = #{registrant}
+            and sdpr.registrant = #{registrant}
         </if>
         <if test="reviewingName != null and reviewingName != ''">
-            and reviewingName = #{reviewingName}
+            and sdpr.reviewingName = #{reviewingName}
         </if>
         <if test="prescriptionNumber != null and prescriptionNumber != ''">
-            and prescriptionNumber = #{prescriptionNumber}
+            and sdpr.prescriptionNumber = #{prescriptionNumber}
         </if>
         <if test="salesOrderNumber != null and salesOrderNumber != ''">
-            and salesOrderNumber = #{salesOrderNumber}
+            and sdpr.salesOrderNumber = #{salesOrderNumber}
         </if>
         <if test="patientId != null">
-            and patientId = #{patientId}
+            and sdpr.patientId = #{patientId}
         </if>
         <if test="patientName != null and patientName != ''">
-            and patientName = #{patientName}
+            and sdpr.patientName = #{patientName}
         </if>
         <if test="patientPhone != null and patientPhone != ''">
-            and patientPhone = #{patientPhone}
+            and sdpr.patientPhone = #{patientPhone}
         </if>
         <if test="gender != null">
-            and gender = #{gender}
+            and sdpr.gender = #{gender}
         </if>
         <if test="age != null">
-            and age = #{age}
+            and sdpr.age = #{age}
         </if>
         <if test="drugsLinkId != null">
-            and drugsLinkId = #{drugsLinkId}
+            and sdpr.drugsLinkId = #{drugsLinkId}
         </if>
         <if test="status != null and status != ''">
-            and status = #{status}
+            and sdpr.status = #{status}
         </if>
-        <if test="reviewStatus != null ">
-            and reviewStatus = #{reviewStatus}
+        <if test="reviewStatus != null">
+            and sdpr.reviewStatus = #{reviewStatus}
         </if>
         <if test="prescriptionType != null and prescriptionType != ''">
-            and prescriptionType = #{prescriptionType}
+            and sdpr.prescriptionType = #{prescriptionType}
         </if>
         <if test="source != null and source != ''">
-            and source = #{source}
+            and sdpr.source = #{source}
         </if>
         <if test="drugRoute != null and drugRoute != ''">
-            and drugRoute = #{drugRoute}
+            and sdpr.drugRoute = #{drugRoute}
         </if>
         <if test="storeId != null and storeId != ''">
-            and storeId = #{storeId}
+            and sdpr.storeId = #{storeId}
         </if>
         <if test="storeName != null and storeName != ''">
-            and storeName = #{storeName}
+            and sdpr.storeName = #{storeName}
         </if>
         <if test="createdBy != null and createdBy != ''">
-            and createdBy = #{createdBy}
+            and sdpr.createdBy = #{createdBy}
         </if>
         <if test="createdTime != null">
-            and createdTime = #{createdTime}
+            and sdpr.createdTime = #{createdTime}
         </if>
         <if test="updatedBy != null and updatedBy != ''">
-            and updatedBy = #{updatedBy}
+            and sdpr.updatedBy = #{updatedBy}
         </if>
         <if test="updatedTime != null">
-            and updatedTime = #{updatedTime}
+            and sdpr.updatedTime = #{updatedTime}
         </if>
         <if test="remarks != null and remarks != ''">
-            and remarks = #{remarks}
+            and sdpr.remarks = #{remarks}
         </if>
         <if test="id != null and id != ''">
-            and id = #{id}
+            and sdpr.id = #{id}
         </if>
-        <if test="id != null and id != ''">
-            and id = #{id}
+        <if test="createTime != null and createTime != ''">
+            and sdpr.createTime = #{createTime}
         </if>
-        <if test="createTime !=null and createTime !='' ">
-            and createTime = #{createTime}
+        <if test="query != null and query != ''">
+            AND (sdpr.patientName LIKE CONCAT('%', #{query}, '%') or sdpr.patientPhone = #{query})
         </if>
-        <if test="query != null and query!=''">
-            AND patientName LIKE CONCAT('%', #{query}, '%') or patientPhone = #{query}
+        <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
+            and sdpr.registrationDate between #{beginTime} and #{endTime}
         </if>
-
-        <if test="beginTime != null and beginTime!='' and endTime != null and endTime!=''">
-            and registrationDate between #{beginTime} and #{endTime}
-        </if>
-
-
     </select>
 
     <!-- 根据patientId查询单条记录 -->
@@ -151,7 +178,20 @@
     </select>
     <!-- 根据prescriptionNumber查询多条条记录 -->
     <select id="selectListRecordByPrescriptionNumber" parameterType="pd" resultType="pd">
-        select * from s_dtp_drug_purchase_record where prescriptionNumber=#{prescriptionNumber}
+        SELECT
+            sddpr.*,
+            dtp.dosage_max,
+            dtp.dosage_min,
+            dtp.unit_max,
+            dtp.unit_min,
+            dtp.unit_normal,
+            dtp.dosage_normal,
+            dtp.packing_value,
+            dtp.packing_unit
+        FROM
+            s_dtp_drug_purchase_record sddpr
+            left join s_gxhpz_product_dtpinfo dtp on dtp.product_code = sddpr.mdmCode
+            where sddpr.prescriptionNumber=#{prescriptionNumber}
     </select>
     <!-- 根据ID查询单条记录 -->
     <select id="selectOneById" parameterType="pd" resultType="pd">