Browse Source

提交患者管理品业务代码

bzd_wsp 4 months ago
parent
commit
2d21fa648a

+ 71 - 9
health-admin/src/main/java/com/bzd/web/controller/gxhpz/DrugConfigController.java

@@ -28,7 +28,7 @@ public class DrugConfigController extends BaseController {
     @Autowired
     @Autowired
     private DrugConfigService drugConfigService;
     private DrugConfigService drugConfigService;
     @RequiresPermissions("gxhpz:yppz:view")
     @RequiresPermissions("gxhpz:yppz:view")
-    @GetMapping("index")
+    @GetMapping("/index")
     public String recipe()
     public String recipe()
     {
     {
         return prefix + "/drugconfigList";
         return prefix + "/drugconfigList";
@@ -68,6 +68,34 @@ public class DrugConfigController extends BaseController {
         return prefix + "/drugconfigDetail";
         return prefix + "/drugconfigDetail";
     }
     }
     /**
     /**
+     * 查询药品库s_gxhpz_product_info
+     */
+    @RequiresPermissions("dtp:yppz:view")
+    @PostMapping("/searchDrugs")
+    @ResponseBody
+    public AjaxResult searchDrugs() throws Exception {
+        PageData pd = this.getPageData();
+       String query = (String) pd.get("query");
+        if(query.equals("") || query==null){
+            return AjaxResult.success();
+        }
+        List<PageData> pds =drugConfigService.selectproductByCodeAndName(pd);
+            return  AjaxResult.success(pds);
+    }
+    @RequiresPermissions("dtp:yppz:view")
+    @PostMapping("/searchDrugsObject")
+    @ResponseBody
+    public AjaxResult searchDrugsObject() throws Exception {
+        PageData pd = this.getPageData();
+        String query = (String) pd.get("query");
+        if(query.equals("") || query==null){
+            return AjaxResult.success();
+        }
+        PageData pdo =drugConfigService.selectOneproductByCodeAndName(pd);
+        return  AjaxResult.success(pdo);
+    }
+
+    /**
      * 药品新增保存
      * 药品新增保存
      */
      */
     @RequiresPermissions("gxhpz:yppz:add")
     @RequiresPermissions("gxhpz:yppz:add")
@@ -75,10 +103,18 @@ public class DrugConfigController extends BaseController {
     @PostMapping("/savedrugConfig")
     @PostMapping("/savedrugConfig")
     @ResponseBody
     @ResponseBody
     public AjaxResult savedrugConfig() throws Exception {
     public AjaxResult savedrugConfig() throws Exception {
-        PageData pd = new PageData();
-        pd = this.getPageData();
-        PageData object = drugConfigService.save(pd);
-        return AjaxResult.success(object.get("result").toString(),object);
+        PageData pd = this.getPageData();
+        Object pds = drugConfigService.findOne(pd);
+        if(pds !=null){
+            return AjaxResult.error("药品编码已存在,药品重复");
+        }
+        int result = drugConfigService.save(pd);
+        if(result>0){
+            return AjaxResult.success();
+        }else {
+            return AjaxResult.error("失败");
+        }
+
     }
     }
     @Log(title = "删除", businessType = BusinessType.DELETE)
     @Log(title = "删除", businessType = BusinessType.DELETE)
     @RequiresPermissions("gxhpz:yppz:remove")
     @RequiresPermissions("gxhpz:yppz:remove")
@@ -129,9 +165,10 @@ public class DrugConfigController extends BaseController {
         PageData pd = this.getPageData();
         PageData pd = this.getPageData();
         Integer update = drugConfigService.update(pd);
         Integer update = drugConfigService.update(pd);
         if(update!=1){
         if(update!=1){
-            return error("修改失败");
+            return  AjaxResult.error("失败");
+        }else {
+            return AjaxResult.success("成功");
         }
         }
-        return toAjax(update);
     }
     }
     /**
     /**
      * 药品配置-启用停用
      * 药品配置-启用停用
@@ -171,14 +208,14 @@ public class DrugConfigController extends BaseController {
     {
     {
         String str="";
         String str="";
         PageData pd = this.getPageData();
         PageData pd = this.getPageData();
-        String status = (String) pd.get("dvalueStatus");
+        String status = (String) pd.get("status");
         if(status.equals("0")){
         if(status.equals("0")){
             str = "停用";
             str = "停用";
 
 
         }else {
         }else {
             str = "启用";
             str = "启用";
         }
         }
-        Integer update = drugConfigService.changedvalueStatus(pd);
+        Integer update = drugConfigService.changeStatus(pd);
         if(update!=1){
         if(update!=1){
             return AjaxResult.error(str+"失败");
             return AjaxResult.error(str+"失败");
         }else {
         }else {
@@ -251,4 +288,29 @@ public class DrugConfigController extends BaseController {
         List<PageData> pageData = drugConfigService.getAllDrugs(pd);
         List<PageData> pageData = drugConfigService.getAllDrugs(pd);
         return  getDataTable(pageData);
         return  getDataTable(pageData);
     }
     }
+    /**
+     * D值关联-启用停用
+     */
+    @RequiresPermissions("gxhpz:dzpz:edit")
+    @Log(title = "D值关联-启用停用", businessType = BusinessType.UPDATE)
+    @PostMapping("/changesdvalueStatus")
+    @ResponseBody
+    public AjaxResult changesdvalueStatus() throws Exception{
+        String str="";
+        PageData pd = this.getPageData();
+        String dvalueStatus = (String) pd.get("dvalueStatus");
+        if(dvalueStatus.equals("0")){
+            str = "停止";
+
+        }else {
+            str = "启用";
+        }
+        Integer update = drugConfigService.changedvalueStatus(pd);
+        if(update!=1){
+            return AjaxResult.error(str+"失败");
+        }else {
+            return AjaxResult.success(str+"成功");
+        }
+
+    }
 }
 }

+ 11 - 32
health-admin/src/main/java/com/bzd/web/controller/gxhpz/DvalueConfigController.java

@@ -81,6 +81,8 @@ public class DvalueConfigController extends BaseController {
         int result = dvalueConfigService.save(pd);
         int result = dvalueConfigService.save(pd);
         if(result>0){
         if(result>0){
             return AjaxResult.success("成功");
             return AjaxResult.success("成功");
+        }if(result == -1){
+            return AjaxResult.warn("D值编码已存在");
         }else {
         }else {
             return AjaxResult.error("失败");
             return AjaxResult.error("失败");
         }
         }
@@ -156,40 +158,17 @@ public class DvalueConfigController extends BaseController {
         }else {
         }else {
             str = "启用";
             str = "启用";
         }
         }
-        Integer update = dvalueConfigService.changeStatus(pd);
-        if(update!=1){
+        String update = dvalueConfigService.changeStatus(pd);
+        if(update.equals("error")){
             return AjaxResult.error(str+"失败");
             return AjaxResult.error(str+"失败");
-        }else {
-            return AjaxResult.success(str+"成功");
+        } else if(update.equals("有绑定药品不能删除!")){
+           return AjaxResult.error(str+"失败"+update);
+         }else {
+            return AjaxResult.success(update);
         }
         }
 
 
     }
     }
-    /**
-     * D值关联-启用停用
-     */
-    @RequiresPermissions("gxhpz:dzpz:edit")
-    @Log(title = "D值关联-启用停用", businessType = BusinessType.UPDATE)
-    @PostMapping("/changedvalueStatus")
-    @ResponseBody
-    public AjaxResult changedvalueStatus() throws Exception
-    {
-        String str="";
-        PageData pd = this.getPageData();
-        String dvalueStatus = (String) pd.get("dvalueStatus");
-        if(dvalueStatus.equals("0")){
-            str = "停止";
 
 
-        }else {
-            str = "启用";
-        }
-        Integer update = dvalueConfigService.changedvalueStatus(pd);
-        if(update!=1){
-            return AjaxResult.error(str+"失败");
-        }else {
-            return AjaxResult.success(str+"成功");
-        }
-
-    }
 
 
 
 
     @PostMapping("/searchDvalue")
     @PostMapping("/searchDvalue")
@@ -199,9 +178,9 @@ public class DvalueConfigController extends BaseController {
         PageData pd = this.getPageData();
         PageData pd = this.getPageData();
         String query = (String) pd.get("query");
         String query = (String) pd.get("query");
         System.out.println(query);
         System.out.println(query);
-        // 根据业务逻辑决定先尝试匹配 dValueCode 还是 dValueName
+        // 根据业务逻辑决定先尝试匹配 d_value_code 还是 dValueName
         pd.put("query", query);
         pd.put("query", query);
-        pd.put("dValueCode", query);
+        pd.put("d_value_code", query);
         pd.put("dValueName", query);
         pd.put("dValueName", query);
         try {
         try {
             Object result = dvalueConfigService.findOne(pd);
             Object result = dvalueConfigService.findOne(pd);
@@ -225,7 +204,7 @@ public class DvalueConfigController extends BaseController {
         int s5id= IdUtils.get5randomNumber();
         int s5id= IdUtils.get5randomNumber();
         pd.put("createdBy",getLoginName());
         pd.put("createdBy",getLoginName());
         pd.put("createdTime", DateUtils.getTime());
         pd.put("createdTime", DateUtils.getTime());
-        pd.put("dValueCode",s5id);
+        pd.put("d_value_code",s5id);
         pd.put("dValueName",nameValue);
         pd.put("dValueName",nameValue);
         try {
         try {
             Object result = dvalueConfigService.save(pd);
             Object result = dvalueConfigService.save(pd);

+ 51 - 40
health-admin/src/main/resources/templates/gxhpz/addRepurchasedGoods.html

@@ -13,9 +13,9 @@
         <div class="customize-form-group">
         <div class="customize-form-group">
             <label style="color:olive;font-size: 15px;">复购配置->关联D值品:</label>
             <label style="color:olive;font-size: 15px;">复购配置->关联D值品:</label>
             <input name="dValueKey" placeholder="输入D值品名称或D值id查询" class="styled-input" type="text" id="dValueKeyInput">
             <input name="dValueKey" placeholder="输入D值品名称或D值id查询" class="styled-input" type="text" id="dValueKeyInput">
-            <input name="dValueId" placeholder="D值品id" class="styled-input" type="text" readonly id="dValueIdInput">
-            <input name="dValueName" placeholder="D值品名称" class="styled-input" type="hidden" id="dValueName">
-            <button type="button" data-toggle="modal" data-target="#myModal" class="styled-input" style="width: 70px; color: #1E9FFF" id="addDvalueButton">新增D值</button>
+            <input name="dValueId" placeholder="D值品id" class="styled-input" style="width: 60px;" type="text" readonly id="dValueIdInput">
+            <input name="dValueNameInput" placeholder="" class="styled-input" type="text" disabled id="dValueNameInput">
+            <button type="button" data-toggle="modal" data-target="#myModal" class="styled-input" style="width: 70px; color: #1E9FFF" id="addDvalueButton111">新增D值</button>
         </div>
         </div>
         <p class="pull-right">
         <p class="pull-right">
         <div class="customize-form-group">
         <div class="customize-form-group">
@@ -203,8 +203,9 @@ if(drugData != null || drugData != undefined){
                         if(data.code==0){
                         if(data.code==0){
 
 
                             // 如果找到匹配的数据,更新 dValueId 输入框
                             // 如果找到匹配的数据,更新 dValueId 输入框
-                            $('#dValueIdInput').val(data.data.dValueCode);
-                            $('#dValueKeyInput').val(data.data.dValueCode);
+                            $('#dValueIdInput').val(data.data.d_value_code);
+                            $('#dValueKeyInput').val(data.data.d_value_code);
+                            $('#dValueNameInput').val(data.data.dValueName);
 
 
                             updateButtonVisibility(); // 更新按钮可见性
                             updateButtonVisibility(); // 更新按钮可见性
             //                 var row = `
             //                 var row = `
@@ -253,7 +254,7 @@ if(drugData != null || drugData != undefined){
     // callBack获取父窗口方法(方式二) $('#myModal').modal('show');  $('#myModal').modal('hide');  $.modal.close(); openId = document.getElementById('openId').value;
     // callBack获取父窗口方法(方式二) $('#myModal').modal('show');  $('#myModal').modal('hide');  $.modal.close(); openId = document.getElementById('openId').value;
     function selectUsersToParentCallBack2(){
     function selectUsersToParentCallBack2(){
         var options = {
         var options = {
-            title: '药品信息',
+            title: '添加维护D值品',
             width: 1000,
             width: 1000,
             height: 600,
             height: 600,
             url: prefix + '/allDrugsInfo',
             url: prefix + '/allDrugsInfo',
@@ -313,61 +314,69 @@ if(drugData != null || drugData != undefined){
         // 检查表格中是否已经存在该药品
         // 检查表格中是否已经存在该药品
         return $('#drugInfoTable tbody tr[data-product-id="' + productId + '"]').length > 0;
         return $('#drugInfoTable tbody tr[data-product-id="' + productId + '"]').length > 0;
     }
     }
-
+    function getSelectedSaveStatus() {
+        return $('input[name="saveStatus"]:checked').val();
+    }
+    function getTableData() {
+        var tableRows = [];
+        $('#drugInfoTable tbody tr').each(function(index, row) {
+            var rowData = {
+                mdmCode: $(row).find('td:eq(0)').text().trim(),
+                productName: $(row).find('td:eq(1)').text().trim(),
+                genericName: $(row).find('td:eq(2)').text().trim(),
+                specification: $(row).find('td:eq(3)').text().trim(),
+                packaging: $(row).find('td:eq(4)').text().trim(),
+                manufacturerShortName: $(row).find('td:eq(5)').text().trim(),
+                // 隐藏列的数据可以从data-*属性中获取
+                isFollowUpManaged: $(row).data('is-follow-up-managed'),
+                isColdChainManaged: $(row).data('is-cold-chain-managed'),
+                isRegisteredManaged: $(row).data('is-registered-managed'),
+                isCharityAidManaged: $(row).data('is-charity-aid-managed'),
+                administrationMethod: $(row).data('administration-method'),
+                indicationDescription: $(row).data('indication-description'),
+                dosageAndAdministration: $(row).data('dosage-and-administration'),
+                productId: $(row).data('product-id')
+            };
+            tableRows.push(rowData);
+        });
+        return tableRows;
+    }
     function submitDrugInfo() {
     function submitDrugInfo() {
         debugger
         debugger
        // $('#dValueIdInput').val('');
        // $('#dValueIdInput').val('');
         var dValueId = $('#dValueIdInput').val().trim();
         var dValueId = $('#dValueIdInput').val().trim();
+        var dValueName = $('#dValueNameInput').val().trim();
         if (!dValueId) {
         if (!dValueId) {
             $.modal.alertWarning("请输入有效的D值id");
             $.modal.alertWarning("请输入有效的D值id");
             return;
             return;
         }
         }
         var flag = false;
         var flag = false;
-        var submitMethod1="/savedvalueconfig";
-        var submitMethod2="/dvalueconfigEdit";
-       var saveStatus = $('#saveStatus').val()
+       var saveStatus = getSelectedSaveStatus();
         console.log("saveStatus===="+saveStatus);
         console.log("saveStatus===="+saveStatus);
         if(saveStatus =='' || saveStatus ==undefined){
         if(saveStatus =='' || saveStatus ==undefined){
             $.modal.alertWarning("请选择提交方式");
             $.modal.alertWarning("请选择提交方式");
             return false;
             return false;
         }
         }
-
-        // 收集表格中的所有数据
-        var drugData = [];
-        $('#drugInfoTable tbody tr').each(function() {
-            var row = $(this);
-            drugData.push({
-                mdmCode: row.find('td').eq(0).text().trim(),
-                productName: row.find('td').eq(1).text().trim(),
-                genericName: row.find('td').eq(2).text().trim(),
-                specification: row.find('td').eq(3).text().trim(),
-                manufacturerShortName: row.find('td').eq(4).text().trim(),
-
-                isFollowUpManaged: row.find('td').eq(5).text().trim(),
-                isColdChainManaged: row.find('td').eq(6).text().trim(),
-                isRegisteredManaged: row.find('td').eq(7).text().trim() ,
-                isCharityAidManaged: row.find('td').eq(8).text().trim(),
-                administrationMethod: row.find('td').eq(9).text().trim(),
-                indicationDescription: row.find('td').eq(10).text().trim(),
-                dosageAndAdministration: row.find('td').eq(11).text().trim(),
-                productId: row.data('product-id')
-            });
-        });
-
+        var saveStatusIn=null;
+        if(saveStatus=="保存"){
+            saveStatusIn=0;
+        }
+        if(saveStatus=="保存并启用"){
+            saveStatusIn= 1;
+        }
         // 创建一个 FormData 对象用于提交表单数据
         // 创建一个 FormData 对象用于提交表单数据
         var formData = new FormData();
         var formData = new FormData();
-        formData.append('saveStatus', $('#saveStatus').val());
+        formData.append('saveStatus', saveStatusIn);
         formData.append('dValueId', dValueId);
         formData.append('dValueId', dValueId);
+        formData.append('dValueName', dValueName);
+        formData.append('type', '1');//标记为关联配置操作
         // 将药物数据序列化为 JSON 字符串并添加到 FormData 中
         // 将药物数据序列化为 JSON 字符串并添加到 FormData 中
-        if(drugData.length>=2){
-            $.modal.alertWarning("单次只能添加一个药品");
-            return false;
-        }
-        formData.append('drugData', JSON.stringify(drugData));
+
+        formData.append('drugData', JSON.stringify(getTableData()));
 
 
         // 发送 AJAX 请求或构建表单进行提交
         // 发送 AJAX 请求或构建表单进行提交
         $.ajax({
         $.ajax({
-            url: prefix_dzpz + "/savedvalueconfig",
+            url: prefix + "/editDrugConfig",
             method: 'POST',
             method: 'POST',
             data: formData,
             data: formData,
             processData: false,  // 不处理数据,因为 data 已经是字符串
             processData: false,  // 不处理数据,因为 data 已经是字符串
@@ -409,6 +418,7 @@ if(drugData != null || drugData != undefined){
                     // 如果找到匹配的数据,更新 dValueId 输入框
                     // 如果找到匹配的数据,更新 dValueId 输入框
                     $('#dValueIdInput').val(data.data.dvauleid);
                     $('#dValueIdInput').val(data.data.dvauleid);
                     $('#dValueKeyInput').val(data.data.dValueName);
                     $('#dValueKeyInput').val(data.data.dValueName);
+                    $('#dValueNameInput').val(data.data.dValueName);
                     flag = true;
                     flag = true;
                     // 关闭模态框
                     // 关闭模态框
                     $('#myModal').modal('hide');
                     $('#myModal').modal('hide');
@@ -416,6 +426,7 @@ if(drugData != null || drugData != undefined){
                 }else{
                 }else{
                     $('#dValueIdInput').val("");
                     $('#dValueIdInput').val("");
                     $('#dValueKeyInput').val("");
                     $('#dValueKeyInput').val("");
+                    $('#dValueNameInput').val("");
                     $.modal.alertError(data.msg);
                     $.modal.alertError(data.msg);
                 }
                 }
 
 

+ 2 - 2
health-admin/src/main/resources/templates/gxhpz/allDrugsInfo.html

@@ -2,7 +2,7 @@
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
 <head>
 	<meta charset="UTF-8">
 	<meta charset="UTF-8">
-	<th:block th:include="include :: header('药品库信息')" />
+	<th:block th:include="include :: header('患者管理品')" />
 	<th:block th:include="include :: layout-latest-css" />
 	<th:block th:include="include :: layout-latest-css" />
 	<th:block th:include="include :: ztree-css" />
 	<th:block th:include="include :: ztree-css" />
 </head>
 </head>
@@ -71,7 +71,7 @@
 			exportUrl: prefix + "/export",
 			exportUrl: prefix + "/export",
 			//sortName: "createTime",
 			//sortName: "createTime",
 			//sortOrder: "desc",
 			//sortOrder: "desc",
-			modalName: "药品信息",
+			modalName: "患者管理品",
 			showFooter:true,  //是否显示表格底部区域。
 			showFooter:true,  //是否显示表格底部区域。
 			clickToSelect: true, //是否启用点击行时选中整行的功能。
 			clickToSelect: true, //是否启用点击行时选中整行的功能。
 			singleSelect: true, //是否仅允许选择一行
 			singleSelect: true, //是否仅允许选择一行

+ 275 - 20
health-admin/src/main/resources/templates/gxhpz/drugconfigAdd.html

@@ -3,23 +3,27 @@
 <head>
 <head>
     <th:block th:include="include :: header('门店积分商品列表新增')" />
     <th:block th:include="include :: header('门店积分商品列表新增')" />
     <th:block th:include="include :: ztree-css" />
     <th:block th:include="include :: ztree-css" />
+    <th:block th:include="include :: select2-css" />
+    <th:block th:include="include :: bootstrap-select-css" />
 </head>
 </head>
 <body class="white-bg">
 <body class="white-bg">
 <div class="wrapper wrapper-content animated fadeInRight ibox-content">
 <div class="wrapper wrapper-content animated fadeInRight ibox-content">
     <form id="form-SSpglJfspProductinfo-add" class="customize-search-form">
     <form id="form-SSpglJfspProductinfo-add" class="customize-search-form">
         <div class="customize-form-group-container">
         <div class="customize-form-group-container">
+
             <div class="customize-form-group">
             <div class="customize-form-group">
-                <label class="is-required">药品编码:</label>
-                <input name="mdmCode" placeholder="请输入药品编码" id="mdmCode" class="styled-input" type="text" required>
-            </div>
-            <div class="customize-form-group">
-                <label>D值品编码:</label>
-                <input name="dValueCode" placeholder="请输入D值品编码" id="dValueCode" class="styled-input" type="text">
-            </div>
-            <div class="customize-form-group">
-                <label>D值品名称:</label>
-                <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" class="styled-input" type="text">
+                <label>药品编码</label>
+                <select class="styled-input" id="mdmCode" name="mdmCode">
+                    <option value="">--药品编码或药品名--</option>
+                </select>
             </div>
             </div>
+
+<!--            <div class="customize-form-group">-->
+<!--                <label class="is-required">药品编码:</label>-->
+<!--                <input name="mdmCode" placeholder="请输入药品编码或药品名称" id="mdmCode" class="styled-input" type="text" required>-->
+<!--                <div id="suggestions" class="dropdown-list"></div>-->
+<!--            </div>-->
+
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>规格:</label>
                 <label>规格:</label>
                 <input name="specification" placeholder="请输入规格" id="specification" class="styled-input" type="text">
                 <input name="specification" placeholder="请输入规格" id="specification" class="styled-input" type="text">
@@ -42,21 +46,33 @@
                 <label>厂家简称:</label>
                 <label>厂家简称:</label>
                 <input name="manufacturerShortName" placeholder="请输入厂家简称" id="manufacturerShortName" class="styled-input" type="text">
                 <input name="manufacturerShortName" placeholder="请输入厂家简称" id="manufacturerShortName" class="styled-input" type="text">
             </div>
             </div>
+            <div class=" panel panel-warning" style="width: 720px">
+                <div class="panel-heading">
+                    <i class="fa fa-info-circle"></i> 以下是选择项的说明
+                </div>
+                <div class="panel-body">
+                    <p>是否随访管品说明</p>
+                    <p>分是否冷链管理品说明</p>
+                    <p>是否登记管理品说明</p>
+                    <p>是否慈善援助管理品说明</p>
+                </div>
+
+            </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
-                <label>是否随访管理品:</label>
-                <select name="isFollowUpManaged" id="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                <label class="is-required">是否随访管理品:</label>
+                <select name="isFollowUpManaged" id="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" required>
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                 </select>
                 </select>
             </div>
             </div>
-            <div class="customize-form-group">
-                <label>是否冷链管理品:</label>
-                <select name="isColdChainManaged" id="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+            <div class="customize-form-group" id="isColdChainManagedDiv">
+                <label class="is-required">是否冷链管理品:</label>
+                <select name="isColdChainManaged" id="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" required>
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                 </select>
                 </select>
             </div>
             </div>
-            <div class="customize-form-group">
+            <div class="customize-form-group" id="isRegisteredManagedDiv">
                 <label>是否登记管理品:</label>
                 <label>是否登记管理品:</label>
                 <select name="isRegisteredManaged" id="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
                 <select name="isRegisteredManaged" id="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
                     <option value="">请选择</option>
                     <option value="">请选择</option>
@@ -71,8 +87,8 @@
                 </select>
                 </select>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
-                <label>给药方式:</label>
-                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}">
+                <label class="is-required">给药方式:</label>
+                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}" required>
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                 </select>
                 </select>
@@ -87,7 +103,6 @@
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>状态:</label>
                 <label>状态:</label>
                 <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
                 <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
-                    <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                 </select>
                 </select>
             </div>
             </div>
@@ -96,8 +111,12 @@
 </div>
 </div>
 <th:block th:include="include :: footer" />
 <th:block th:include="include :: footer" />
 <th:block th:include="include :: ztree-js" />
 <th:block th:include="include :: ztree-js" />
+<th:block th:include="include :: select2-js" />
+<th:block th:include="include :: bootstrap-select-js" />
 <script type="text/javascript">
 <script type="text/javascript">
-
+    var prefix = ctx + "yppz/drugConfig";
+    var isRegisteredManaged;
+    var dtp_flag;
     function submitHandler() {
     function submitHandler() {
         if ($.validate.form()) {
         if ($.validate.form()) {
             add();
             add();
@@ -120,6 +139,242 @@
             }
             }
         });
         });
     }
     }
+
+    // $(document).ready(function() {
+    //     let timeout;
+    //
+    //     // 监听 dValueKey 输入框的 input 事件
+    //     $('#mdmCode').on('input', function() {
+    //
+    //         clearTimeout(timeout);
+    //         var query = $('#mdmCode').val().trim();
+    //         console.log("query===="+query);
+    //         // 如果输入为空,清空 dValueId 输入框并停止进一步操作
+    //         if (!query) {
+    //             $('#mdmCode').val('');
+    //             $('#genericName').val('');
+    //             $('#productName').val('');
+    //             $('#manufacturerShortName').val('');
+    //             $('#packaging').val('');
+    //             $('#specification').val('');
+    //
+    //             $('#isFollowUpManaged').val('');
+    //             $('#isColdChainManaged').val('');
+    //             $('#isRegisteredManaged').val('');
+    //             $('#isCharityAidManaged').val('');
+    //
+    //             updateButtonVisibility1(); // 更新按钮可见性
+    //             return;
+    //         }
+    //
+    //         // 使用防抖机制延迟发送请求
+    //         timeout = setTimeout(() => {
+    //             // 发送 AJAX 请求到服务器查询数据
+    //             hzparam={query:query};//模拟微信扫码获取微信openId
+    //             console.log("hzparam===="+hzparam);
+    //             // 清空表格中的所有数据行
+    //             // $('#drugInfoTable tbody').empty();
+    //             $.ajax({
+    //                 cache: true,
+    //                 type: "POST",
+    //                 url: prefix+'/searchDrugs', // 替换为实际的搜索 URL
+    //                 data: hzparam,
+    //                 async: false,
+    //                 success: function (data) {
+    //                     console.log("data===="+data);
+    //                     if(data.code==0){
+    //                         $('#mdmCode').val(data.data.product_code);
+    //                         $('#genericName').val(data.data.generic_name);
+    //                         $('#productName').val(data.data.product_name);
+    //                         $('#manufacturerShortName').val(data.data.manufacturer_abbreviation);
+    //                         $('#packaging').val(data.data.packaging);
+    //                         $('#specification').val(data.data.specification);
+    //
+    //                         $('#isFollowUpManaged').val(data.data.follow_up_item);
+    //                         $('#isColdChainManaged').val(data.data.cold_chain_item);
+    //                         $('#isRegisteredManaged').val(data.data.registered_item);
+    //                         $('#isCharityAidManaged').val(data.data.charity_aid_item);
+    //
+    //
+    //                         //$('#dtp_flag').val(data.data.dtp_flag);
+    //                         dtp_flag=data.data.dtp_flag;
+    //                         updateButtonVisibility1(); // 更新按钮可见性
+    //                         if(dtp_flag==="D"){
+    //                             isRegisteredManaged =1;
+    //                             $('#isRegisteredManaged').val(isRegisteredManaged);
+    //                         }
+    //
+    //                     }else{
+    //                         // 清空表格中的所有数据行
+    //                         // $('#drugInfoTable tbody').empty();
+    //                         // 如果没有找到匹配的数据,清空 dValueId 输入框
+    //                         $('#mdmCode').val('');
+    //                         $('#genericName').val('');
+    //                         $('#productName').val('');
+    //                         $('#manufacturerShortName').val('');
+    //                         $('#packaging').val('');
+    //                         $('#specification').val('');
+    //
+    //                         $('#isFollowUpManaged').val('');
+    //                         $('#isColdChainManaged').val('');
+    //                         $('#isRegisteredManaged').val('');
+    //                         $('#isCharityAidManaged').val('');
+    //
+    //                         updateButtonVisibility1(); // 更新按钮可见性
+    //                     }
+    //                 },
+    //                 error: function(error) {
+    //                     // 清空 dValueId 输入框
+    //                     $('#mdmCode').val('');
+    //                     $('#genericName').val('');
+    //                     $('#productName').val('');
+    //                     $('#manufacturerShortName').val('');
+    //                     $('#packaging').val('');
+    //                     $('#specification').val('');
+    //
+    //                     $('#isFollowUpManaged').val('');
+    //                     $('#isColdChainManaged').val('');
+    //                     $('#isRegisteredManaged').val('');
+    //                     $('#isCharityAidManaged').val('');
+    //
+    //                 }
+    //             });
+    //
+    //         }, 1300); // 300ms 的延迟
+    //     });
+    //     // 页面加载时检查 dValueIdInput 的初始状态
+    //     updateButtonVisibility1();
+    // });
+        $(document).ready(function() {
+            // 初始化 Select2
+            $('#mdmCode').select2({
+                placeholder: '--药品编码或药品名--',
+                allowClear: true,
+                ajax: {
+                    url: prefix + '/searchDrugs', // 替换为实际的搜索 URL
+                    dataType: 'json',
+                    delay: 300,
+                    method: 'POST', // 使用 POST 方法
+                    data: function (params) {
+                        return {
+                            query: params.term // search term
+                        };
+                    },
+                    processResults: function (data) {
+                        if (data.code == 0) {
+                            return {
+                                results: data.data.map(function(item) {
+                                    return { id: item.product_code, text: item.product_code + ' - ' + item.product_name, product_code: item.product_code };
+                                })
+                            };
+                        } else {
+                            return { results: [] };
+                        }
+                    },
+                    cache: true
+                }
+            });
+
+            // 处理选择事件
+            $('#mdmCode').on('select2:select', function (e) {
+                var selectedData = e.params.data;
+                var selectedProductCode = selectedData.product_code;
+                console.log("Selected Product Code:", selectedProductCode);
+
+                // 再次发送 AJAX 请求以获取详细信息
+                hzparam = { query: selectedProductCode };
+                $.ajax({
+                    cache: true,
+                    type: "POST",
+                    url: prefix + '/searchDrugsObject', // 替换为实际的获取详情 URL
+                    data: hzparam,
+                    async: false,
+                    success: function(data) {
+                        console.log("details====" + JSON.stringify(data));
+                        if (data.code == 0) {
+                            populateFormFields(data.data);
+                        } else {
+                            clearFormFields();
+                        }
+                    },
+                    error: function(error) {
+                        clearFormFields();
+                    }
+                });
+            });
+
+            // 清空表单字段
+            function clearFormFields() {
+                $('#mdmCode').val('').trigger('change');
+                $('#genericName').val('');
+                $('#productName').val('');
+                $('#manufacturerShortName').val('');
+                $('#packaging').val('');
+                $('#specification').val('');
+
+                $('#isFollowUpManaged').val('');
+                $('#isColdChainManaged').val('');
+                $('#isRegisteredManaged').val('');
+                $('#isCharityAidManaged').val('');
+            }
+
+            // 填充表单字段
+            function populateFormFields(data) {
+                $('#mdmCode').val(data.product_code);//.trigger('change')
+                $('#genericName').val(data.generic_name);
+                $('#productName').val(data.product_name);
+                $('#manufacturerShortName').val(data.manufacturer_abbreviation);
+                $('#packaging').val(data.packaging);
+                $('#specification').val(data.specification);
+
+                $('#isFollowUpManaged').val(data.follow_up_item);
+                $('#isColdChainManaged').val(data.cold_chain_item);
+                $('#isRegisteredManaged').val(data.registered_item);
+                $('#isCharityAidManaged').val(data.charity_aid_item);
+
+                dtp_flag = data.dtp_flag;
+               // updateButtonVisibility1(); // 更新按钮可见性
+                if (dtp_flag === "D") {
+                    isRegisteredManaged = 1;
+                    $('#isRegisteredManaged').val(isRegisteredManaged);
+                }
+            }
+
+            // 页面加载时检查初始状态
+            updateButtonVisibility1();
+        });
+    function updateButtonVisibility1() {
+        var dValueId = $('#mdmCode').val().trim();
+        if (dtp_flag==="D") {
+            $('#isRegisteredManagedDiv').hide();
+        } else {
+            $('#isRegisteredManagedDiv').show();
+        }
+    }
 </script>
 </script>
+<style>
+    .styled-input {
+        padding: 5px;
+        width: 200px;
+        position: relative;
+    }
+    .dropdown-list {
+        position: absolute;
+        border: 1px solid #ccc;
+        background-color: white;
+        z-index: 1000;
+        max-height: 150px;
+        overflow-y: auto;
+        width: 100%;
+        box-sizing: border-box;
+    }
+    .dropdown-item {
+        padding: 5px;
+        cursor: pointer;
+    }
+    .dropdown-item:hover {
+        background-color: #f0f0f0;
+    }
+</style>
 </body>
 </body>
 </html>
 </html>

+ 34 - 21
health-admin/src/main/resources/templates/gxhpz/drugconfigDetail.html

@@ -25,7 +25,7 @@
 				</div>
 				</div>
 				<div class="form-group">
 				<div class="form-group">
 					<label class="col-sm-4 control-label">D值品编码:</label>
 					<label class="col-sm-4 control-label">D值品编码:</label>
-					<div class="col-sm-8 form-control-static" th:text="${dValueCode}"></div>
+					<div class="col-sm-8 form-control-static" th:text="${d_value_code}"></div>
 				</div>
 				</div>
 				<div class="form-group">
 				<div class="form-group">
 					<label class="col-sm-4 control-label">D值品名称:</label>
 					<label class="col-sm-4 control-label">D值品名称:</label>
@@ -45,6 +45,22 @@
 					<label class="col-sm-4 control-label">包装:</label>
 					<label class="col-sm-4 control-label">包装:</label>
 					<div class="col-sm-8 form-control-static" th:text="${packaging}"></div>
 					<div class="col-sm-8 form-control-static" th:text="${packaging}"></div>
 				</div>
 				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">D值关联更新时间:</label>
+					<div class="col-sm-8 form-control-static" th:text="${dvupdatedTime}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">D值关联时间:</label>
+					<div class="col-sm-8 form-control-static" th:text="${#temporals.format(dvcreatedTime, 'yyyy-MM-dd HH:mm:ss')}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">D值更新人:</label>
+					<div class="col-sm-8 form-control-static" th:text="${dvupdatedby}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">状态:</label>
+					<div class="col-sm-8 form-control-static" th:text="${status == 1 ? '启用' : '停用'}"></div>
+				</div>
 			</div>
 			</div>
 
 
 			<!-- 第二列 -->
 			<!-- 第二列 -->
@@ -80,30 +96,27 @@
 				</div>
 				</div>
 
 
 
 
-<!--				<div class="form-group">-->
-<!--					<label class="col-sm-4 control-label">给药方式:</label>-->
-<!--					<div class="col-sm-8 form-control-static" th:text="${administrationMethod}"></div>-->
-<!--				</div>-->
-<!--				<div class="form-group">-->
-<!--					<label class="col-sm-4 control-label">创建人:</label>-->
-<!--					<div class="col-sm-8 form-control-static" th:text="${createdBy}"></div>-->
-<!--				</div>-->
-<!--				<div class="form-group">-->
-<!--					<label class="col-sm-4 control-label">创建时间:</label>-->
-<!--					<div class="col-sm-8 form-control-static" th:text="${#temporals.format(createdTime, 'yyyy-MM-dd HH:mm:ss')}"></div>-->
-<!--				</div>-->
-<!--				<div class="form-group">-->
-<!--					<label class="col-sm-4 control-label">更新人:</label>-->
-<!--					<div class="col-sm-8 form-control-static" th:text="${updatedBy}"></div>-->
-<!--				</div>-->
+				<div class="form-group">
+					<label class="col-sm-4 control-label">给药方式:</label>
+					<div class="col-sm-8 form-control-static" th:text="${administrationMethod}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">创建人:</label>
+					<div class="col-sm-8 form-control-static" th:text="${createdBy}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">创建时间:</label>
+					<div class="col-sm-8 form-control-static" th:text="${#temporals.format(createdTime, 'yyyy-MM-dd HH:mm:ss')}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">更新人:</label>
+					<div class="col-sm-8 form-control-static" th:text="${updatedBy}"></div>
+				</div>
 				<div class="form-group">
 				<div class="form-group">
 					<label class="col-sm-4 control-label">更新时间:</label>
 					<label class="col-sm-4 control-label">更新时间:</label>
 					<div class="col-sm-8 form-control-static" th:text="${#temporals.format(updatedTime, 'yyyy-MM-dd HH:mm:ss')}"></div>
 					<div class="col-sm-8 form-control-static" th:text="${#temporals.format(updatedTime, 'yyyy-MM-dd HH:mm:ss')}"></div>
 				</div>
 				</div>
-<!--				<div class="form-group">-->
-<!--					<label class="col-sm-4 control-label">状态:</label>-->
-<!--					<div class="col-sm-8 form-control-static" th:text="${status == 1 ? '启用' : '停用'}"></div>-->
-<!--				</div>-->
+
 			</div>
 			</div>
 		</div>
 		</div>
 	</form>
 	</form>

+ 15 - 13
health-admin/src/main/resources/templates/gxhpz/drugconfigEdit.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
 <head>
-    <th:block th:include="include :: header('门店积分商品列表修改')" />
+    <th:block th:include="include :: header('患者管理品编辑页面')" />
 </head>
 </head>
 <body>
 <body>
 <div class="ui-layout-center">
 <div class="ui-layout-center">
@@ -15,7 +15,7 @@
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>D值品编码:</label>
                 <label>D值品编码:</label>
-                <input name="dValueCode" placeholder="D值品编码" th:value="${dValueCode}" class="styled-input" type="text" disabled>
+                <input name="d_value_code" placeholder="D值品编码" th:value="${d_value_code}" class="styled-input" type="text" disabled>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>D值品名称:</label>
                 <label>D值品名称:</label>
@@ -36,28 +36,28 @@
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label class="is-required">商品名:</label>
                 <label class="is-required">商品名:</label>
-                <input name="productName" placeholder="请输入商品名" th:value="${productName}" class="styled-input" type="text" required>
+                <input name="productName" placeholder="请输入商品名" th:value="${productName}" class="styled-input" type="text" disabled>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>厂家简称:</label>
                 <label>厂家简称:</label>
-                <input name="manufacturerShortName" placeholder="请输入厂家简称" th:value="${manufacturerShortName}" class="styled-input" type="text">
+                <input name="manufacturerShortName" placeholder="请输入厂家简称" th:value="${manufacturerShortName}" class="styled-input" type="text" disabled>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
-                <label>是否随访管理品:</label>
-                <select name="isFollowUpManaged" id="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isFollowUpManaged}" disabled>
+                <label class="is-required">是否随访管理品:</label>
+                <select name="isFollowUpManaged" id="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isFollowUpManaged}" required>
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  th:selected="${dict.dictValue}==${isFollowUpManaged}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  th:selected="${dict.dictValue}==${isFollowUpManaged}"></option>
                 </select>
                 </select>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>是否冷链管理品:</label>
                 <label>是否冷链管理品:</label>
-                <select name="isColdChainManaged" id="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isColdChainManaged}" disabled>
+                <select name="isColdChainManaged" id="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isColdChainManaged}" >
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isColdChainManaged}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isColdChainManaged}"></option>
                 </select>
                 </select>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
-                <label>是否登记管理品:</label>
+                <label class="is-required">是否登记管理品:</label>
                 <select name="isRegisteredManaged" id="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isRegisteredManaged}" required>
                 <select name="isRegisteredManaged" id="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isRegisteredManaged}" required>
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isRegisteredManaged}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isRegisteredManaged}"></option>
@@ -65,28 +65,28 @@
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>是否慈善援助管理品:</label>
                 <label>是否慈善援助管理品:</label>
-                <select name="isCharityAidManaged" id="isCharityAidManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isCharityAidManaged}" disabled>
+                <select name="isCharityAidManaged" id="isCharityAidManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isCharityAidManaged}" >
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isCharityAidManaged}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isCharityAidManaged}"></option>
                 </select>
                 </select>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>给药方式:</label>
                 <label>给药方式:</label>
-                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}" th:value="${administrationMethod}" disabled>
+                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}" th:value="${administrationMethod}" >
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictLabel}==${administrationMethod}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictLabel}==${administrationMethod}"></option>
                 </select>
                 </select>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>企业流向管理方式:</label>
                 <label>企业流向管理方式:</label>
-                <select name="enterpriseFlowManagement" id="enterpriseFlowManagement" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}" th:value="${enterpriseFlowManagement}" disabled>
+                <select name="enterpriseFlowManagement" id="enterpriseFlowManagement" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}" th:value="${enterpriseFlowManagement}" >
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${enterpriseFlowManagement}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${enterpriseFlowManagement}"></option>
                 </select>
                 </select>
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
-                <label>状态:</label>
-                <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}" th:value="${status}" disabled>
+                <label class="is-required">状态:</label>
+                <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}" th:value="${status}" required>
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${status}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${status}"></option>
                 </select>
                 </select>
@@ -104,6 +104,8 @@
 <script>
 <script>
     function edit() {
     function edit() {
         var data = $("#form-SSpglJfspProductinfo-edit").serializeArray();
         var data = $("#form-SSpglJfspProductinfo-edit").serializeArray();
+        data.push({name: 'type', value: '0'});
+        console.log(data);
         $.ajax({
         $.ajax({
             cache : true,
             cache : true,
             type : "POST",
             type : "POST",

+ 105 - 66
health-admin/src/main/resources/templates/gxhpz/drugconfigList.html

@@ -31,7 +31,7 @@
                 <!-- D值品编码 -->
                 <!-- D值品编码 -->
                 <div class="customize-form-group">
                 <div class="customize-form-group">
                     <label>D值品编码:</label>
                     <label>D值品编码:</label>
-                    <input type="text" class="styled-input" placeholder="请输入D值品编码" name="dValueCode"/>
+                    <input type="text" class="styled-input" placeholder="请输入D值品编码" name="d_value_code"/>
                 </div>
                 </div>
 
 
                 <!-- D值品名称 -->
                 <!-- D值品名称 -->
@@ -63,7 +63,13 @@
                     <label>厂家简称:</label>
                     <label>厂家简称:</label>
                     <input type="text" class="styled-input" placeholder="请输入厂家简称" name="manufacturerShortName"/>
                     <input type="text" class="styled-input" placeholder="请输入厂家简称" name="manufacturerShortName"/>
                 </div>
                 </div>
-
+                    <div class="customize-form-group">
+                        <label>是否关联D值:</label>
+                        <select name="isdvalue" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                            <option value="">请选择</option>
+                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                        </select>
+                    </div>
                 <!-- 是否随访管理品 -->
                 <!-- 是否随访管理品 -->
                 <div class="customize-form-group">
                 <div class="customize-form-group">
                     <label>是否随访管理品:</label>
                     <label>是否随访管理品:</label>
@@ -127,30 +133,30 @@
              </div>
              </div>
              </form>
              </form>
             </div>
             </div>
-
+            <div class="container-div">
             <div class="btn-group-sm" id="toolbar" role="group">
             <div class="btn-group-sm" id="toolbar" role="group">
                 <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
                 <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
                     <i class="fa fa-plus"></i> 新增患者管理品
                     <i class="fa fa-plus"></i> 新增患者管理品
                 </a>
                 </a>
-                 <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:user:edit">
-                    <i class="fa fa-edit"></i> 修改
-                </a>
                 <a class="btn btn-success" onclick="$.operate.add2()" shiro:hasPermission="system:user:add">
                 <a class="btn btn-success" onclick="$.operate.add2()" shiro:hasPermission="system:user:add">
                     <i class="fa fa-plus"></i> 新增复购配置
                     <i class="fa fa-plus"></i> 新增复购配置
                 </a>
                 </a>
 <!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">-->
 <!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">-->
 <!--                    <i class="fa fa-remove"></i> 删除-->
 <!--                    <i class="fa fa-remove"></i> 删除-->
 <!--                </a>-->
 <!--                </a>-->
-
+<!--                <a class="btn btn-success" onclick="orderColumns()">-->
+<!--                    <i class="fa fa-refresh"></i> 恢复顺序-->
+<!--                </a>-->
             </div>
             </div>
 
 
-            <div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
-                <table id="bootstrap-table" class="fixed-layout-table"></table>
+            <div class="col-sm-12 select-table table-bordered" style="width: 100%; overflow-x: auto;">
+<!--                <p class="select-title">按住表格列拖拽</p>-->
+                <table id="bootstrap-table"  class="fixed-layout-table"></table>
+            </div>
             </div>
             </div>
         </div>
         </div>
     </div>
     </div>
 </div>
 </div>
-
 <th:block th:include="include :: footer" />
 <th:block th:include="include :: footer" />
 <th:block th:include="include :: layout-latest-js" />
 <th:block th:include="include :: layout-latest-js" />
 <th:block th:include="include :: bootstrap-table-fixed-columns-js" />
 <th:block th:include="include :: bootstrap-table-fixed-columns-js" />
@@ -190,7 +196,7 @@
             /*exportUrl: prefix + "/export",
             /*exportUrl: prefix + "/export",
             importUrl: prefix + "/importData",
             importUrl: prefix + "/importData",
             importTemplateUrl: prefix + "/importTemplate",*/
             importTemplateUrl: prefix + "/importTemplate",*/
-            sortName: "id",
+            sortName: "d_value_code",
             sortOrder: "asc",
             sortOrder: "asc",
             modalName: "药品配置",
             modalName: "药品配置",
             modalName2: "复购配置",
             modalName2: "复购配置",
@@ -204,48 +210,27 @@
             fixedColumns: true,
             fixedColumns: true,
             //fixedNumber: 3,
             //fixedNumber: 3,
             fixedRightNumber: 1,
             fixedRightNumber: 1,
-            columns: [{
-                checkbox: true
-            },
+            columns: [
+                // {
+                // checkbox: true
+                // },
                 { field: 'id', title: '主键', align: 'center', visible: false },
                 { field: 'id', title: '主键', align: 'center', visible: false },
                 { field: 'mdmCode', title: '药品编码', align: 'center' },
                 { field: 'mdmCode', title: '药品编码', align: 'center' },
-                { field: 'dValueCode', title: 'D值品编码', align: 'center' },
                 {
                 {
                     visible: editFlag == 'hidden' ? false : true,
                     visible: editFlag == 'hidden' ? false : true,
                     title: 'D值关联状态',
                     title: 'D值关联状态',
                     align: 'center',
                     align: 'center',
                     formatter: function (value, row, index) {
                     formatter: function (value, row, index) {
+                        // 返回拼接后的字符串,既包含原始值也包含问号图标
                         return statusTools2(row);
                         return statusTools2(row);
                     }
                     }
                 },
                 },
-
-                { field: 'dValueCode', title: 'D值品编码', align: 'center' },
+                { field: 'd_value_code', title: 'D值品编码', align: 'center' },
                 { field: 'dValueName', title: 'D值品名称', align: 'center' },
                 { field: 'dValueName', title: 'D值品名称', align: 'center' },
                 { field: 'genericName', title: '通用名', align: 'center' },
                 { field: 'genericName', title: '通用名', align: 'center' },
                 { field: 'productName', title: '商品名', align: 'center' },
                 { field: 'productName', title: '商品名', align: 'center' },
-                {
-                    visible: editFlag == 'hidden' ? false : true,
-                    title: '配置状态',
-                    align: 'center',
-                    formatter: function (value, row, index) {
-                        return statusTools(row);
-                    }
-                },
                 { field: 'specification', title: '规格', align: 'center' },
                 { field: 'specification', title: '规格', align: 'center' },
                 { field: 'packaging', title: '包装', align: 'center' },
                 { field: 'packaging', title: '包装', align: 'center' },
-                // { field: 'status', title: '状态', align: 'center'  ,
-                //     formatter: function(value, row, index) {
-                //         switch (value) {
-                //             case 0:
-                //                 return '<span class=\"btn-danger">已停用</span>';
-                //                 break;
-                //             case 1:
-                //                 return '<span class=\"btn-primary">已启用</span>';
-                //                 break;
-                //             default:
-                //                 return '<span class=\"btn-warning">-</span>';
-                //         }
-                //     }},
                 { field: 'manufacturerShortName', title: '厂家简称', align: 'center' },
                 { field: 'manufacturerShortName', title: '厂家简称', align: 'center' },
                 { field: 'isFollowUpManaged', title: '是否随访管理品', align: 'center',
                 { field: 'isFollowUpManaged', title: '是否随访管理品', align: 'center',
                     formatter: function(value, row, index) {
                     formatter: function(value, row, index) {
@@ -301,27 +286,53 @@
                     } },
                     } },
                 { field: 'administrationMethod', title: '给药方式', align: 'center' },
                 { field: 'administrationMethod', title: '给药方式', align: 'center' },
                 { field: 'enterpriseFlowManagement', title: '企业流向管理方式', align: 'center' },
                 { field: 'enterpriseFlowManagement', title: '企业流向管理方式', align: 'center' },
-                { field: 'updatedTime', title: '更新日期', align: 'center' },
+                { field: 'updatedTime', title: '管理品更新日期', align: 'center' },
+                { field: 'createdTime', title: '管理品创建时间', align: 'center' },
+                { field: 'dvcreatedTime', title: 'D值关联时间', align: 'center' },
+                { field: 'dvupdatedTime', title: 'D值更新时间', align: 'center' },
                 { field: 'indicationDescription', title: '说明书适应症', align: 'center' },
                 { field: 'indicationDescription', title: '说明书适应症', align: 'center' },
                 { field: 'dosageAndAdministration', title: '用法用量', align: 'center' },
                 { field: 'dosageAndAdministration', title: '用法用量', align: 'center' },
-                { field: 'saleStatus', title: '销售状态', align: 'center' ,
-                    formatter: function(value, row, index) {
-                        switch (value) {
-                            case 0:
-                                return '停售';
-                                break;
-                            case 1:
-                                return '可售';
-                                break;
-                            default:
-                                return '-';
-                        }
-                    }},
-                { field: 'createdBy', title: '创建人', align: 'center' },
-                { field: 'createdTime', title: '创建时间', align: 'center' },
-                { field: 'updatedBy', title: '更新人', align: 'center' },
                 { field: 'manufacturer', title: '厂家', align: 'center' },
                 { field: 'manufacturer', title: '厂家', align: 'center' },
-                { field: 'productImagePath', title: '商品图片路径', align: 'center' },
+                { field: 'createdBy', title: '创建人', align: 'center' },
+                // {
+                //     visible: editFlag == 'hidden' ? false : true,
+                //     title: '配置状态',
+                //     align: 'center',
+                //     formatter: function (value, row, index) {
+                //         return statusTools(row);
+                //     }
+                // },
+                // { field: 'status', title: '状态', align: 'center'  ,
+                //     formatter: function(value, row, index) {
+                //         switch (value) {
+                //             case 0:
+                //                 return '<span class=\"btn-danger">已停用</span>';
+                //                 break;
+                //             case 1:
+                //                 return '<span class=\"btn-primary">已启用</span>';
+                //                 break;
+                //             default:
+                //                 return '<span class=\"btn-warning">-</span>';
+                //         }
+                //     }},
+                // { field: 'saleStatus', title: '销售状态', align: 'center' ,
+                //     formatter: function(value, row, index) {
+                //         switch (value) {
+                //             case 0:
+                //                 return '停售';
+                //                 break;
+                //             case 1:
+                //                 return '可售';
+                //                 break;
+                //             default:
+                //                 return '-';
+                //         }
+                //     }},
+                // { field: 'createdTime', title: '创建时间', align: 'center' },
+                // { field: 'updatedBy', title: '更新人', align: 'center' },
+                // { field: 'dvupdatedby', title: 'D值更新人', align: 'center' },
+                // { field: 'productImagePath', title: '商品图片路径', align: 'center' },
+
                 {
                 {
                     title: '操作',
                     title: '操作',
                     align: 'center',
                     align: 'center',
@@ -341,7 +352,34 @@
         };
         };
         $.table.init(options);
         $.table.init(options);
     }
     }
-
+    function orderColumns() {
+        $('#bootstrap-table').bootstrapTable('orderColumns', {
+            id: 0,
+            mdmCode: 1,
+            'D值关联状态': 2, // 注意:这个字段没有指定field属性,因此不能直接使用这个名称来排序。
+            d_value_code: 3,
+            dValueName: 4,
+            genericName: 5,
+            productName: 6,
+            specification: 7,
+            packaging: 8,
+            manufacturerShortName: 9,
+            isFollowUpManaged: 10,
+            isColdChainManaged: 11,
+            isRegisteredManaged: 12,
+            isCharityAidManaged: 13,
+            administrationMethod: 14,
+            enterpriseFlowManagement: 15,
+            updatedTime: 16,
+            createdTime: 17,
+            dvcreatedTime: 18,
+            dvupdatedTime: 19,
+            indicationDescription: 20,
+            dosageAndAdministration: 21,
+            manufacturer: 22,
+            createdBy: 23
+        })
+    }
     /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
     /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
     function resetPre() {
     function resetPre() {
         resetDate();
         resetDate();
@@ -376,13 +414,13 @@
     /* D值关联和停用*/
     /* D值关联和停用*/
     function statusTools2(row) {
     function statusTools2(row) {
         if (row.dvalueStatus == '2') {
         if (row.dvalueStatus == '2') {
-            '<a  class="btn btn-success btn-xs ' + editFlag + '" onclick="$.operate.edit2(\'' + row.id + '\')">去关联</a>&nbsp;|状态:未关联 ';
-        }else if (row.dvalueStatus == 1){
-            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="stoped(\'' + row.id + '\')" style="color: green;"></i>启用';
-        }else if (row.dvalueStatus == 0){
-            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="start(\'' + row.id + '\')" style="color: red;"></i>停止';
-        } else{
-            return '<a  class="btn btn-success btn-xs ' + editFlag + '" onclick="$.operate.edit2(\'' + row.id + '\')">去关联</a>&nbsp;|状态:未关联 ';
+            return '<a class="btn btn-success btn-xs ' + editFlag + '" onclick="$.operate.edit2(\'' + row.id + '\')">去关联</a>&nbsp;|状态:未关联 ';
+        } else if (row.dvalueStatus == 1) {
+            return '<i class="fa fa-toggle-on text-info fa-2x" onclick="stoped(\'' + row.id + '\')" style="color: green; font-size: 16px;">启用中</i>';
+        } else if (row.dvalueStatus == 0) {
+            return '<i class="fa fa-toggle-off text-info fa-2x" onclick="start(\'' + row.id + '\')" style="color: red;font-size: 16px;">已停止</i>';
+        } else {
+            return '<a class="btn btn-success btn-xs ' + editFlag + '" onclick="$.operate.edit2(\'' + row.id + '\')">去关联</a>&nbsp;|状态:未关联 ';
         }
         }
             }
             }
     /* 停用 */
     /* 停用 */
@@ -414,13 +452,13 @@
     /* 启用关联 */
     /* 启用关联 */
     function start(id) {
     function start(id) {
         $.modal.confirm("确认要启用D值关联吗?", function() {
         $.modal.confirm("确认要启用D值关联吗?", function() {
-            $.operate.post(prefix + "/changedvalueStatus", { "id": id, "dvalueStatus": 1 });
+            $.operate.post(prefix + "/changesdvalueStatus", { "id": id, "dvalueStatus": 1 });
         })
         })
     }
     }
     /* 停止关联 */
     /* 停止关联 */
     function stoped(id) {
     function stoped(id) {
         $.modal.confirm("确认要停用D值关联吗?", function() {
         $.modal.confirm("确认要停用D值关联吗?", function() {
-            $.operate.post(prefix + "/changedvalueStatus", { "id": id, "dvalueStatus": 0 });
+            $.operate.post(prefix + "/changesdvalueStatus", { "id": id, "dvalueStatus": 0 });
         })
         })
     }
     }
 
 
@@ -434,3 +472,4 @@
 </body>
 </body>
 
 
 </html>
 </html>
+//

+ 3 - 64
health-admin/src/main/resources/templates/gxhpz/dvalueconfigAdd.html

@@ -10,81 +10,20 @@
 
 
             <div class="customize-form-group-container"> <div class="customize-form-group">
             <div class="customize-form-group-container"> <div class="customize-form-group">
                 <label>D值品编码:</label>
                 <label>D值品编码:</label>
-                <input name="dValueCode" placeholder="请输入D值品编码" id="dValueCode" class="styled-input" type="text">
-            </div>
-            <div class="customize-form-group">
-                <label class="is-required">药品编码:</label>
-                <input name="mdmCode" placeholder="请输入药品编码" id="mdmCode" class="styled-input" type="text" required>
+                <input name="d_value_code" placeholder="请输入D值品编码" id="d_value_code" class="styled-input" type="text">
             </div>
             </div>
+
             <div class="customize-form-group">
             <div class="customize-form-group">
                 <label>D值品名称:</label>
                 <label>D值品名称:</label>
                 <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" class="styled-input" type="text">
                 <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" class="styled-input" type="text">
             </div>
             </div>
             <div class="customize-form-group">
             <div class="customize-form-group">
-                <label>规格:</label>
-                <input name="specification" placeholder="请输入规格" id="specification" class="styled-input" type="text">
-            </div>
-            <div class="customize-form-group">
-                <label class="is-required">通用名:</label>
-                <input name="genericName" placeholder="请输入通用名" id="genericName" class="styled-input" type="text" required>
-            </div>
-            <div class="customize-form-group">
-                <label class="is-required">商品名:</label>
-                <input name="productName" placeholder="请输入商品名" id="productName" class="styled-input" type="text" required>
-            </div>
-            <div class="customize-form-group">
                 <label>配置状态:</label>
                 <label>配置状态:</label>
                 <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
                 <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
                     <option value="">请选择</option>
                     <option value="">请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                 </select>
                 </select>
             </div>
             </div>
-
-                <!-- 以下可能不要 -->
-
-            <div class="customize-form-group">
-                <label>ICD适应症:</label>
-                <select name="icdIndication" id="icdIndication" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
-                    <option value="">请选择</option>
-                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                </select>
-            </div>
-            <div class="customize-form-group">
-                <label>适应症编码:</label>
-                <select name="indicationCode" id="indicationCode" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
-                    <option value="">请选择</option>
-                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                </select>
-            </div>
-            <div class="customize-form-group">
-                <label>单位:</label>
-                <select name="unit" id="unit" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
-                    <option value="">请选择</option>
-                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                </select>
-            </div>
-            <div class="customize-form-group">
-                <label>用量:</label>
-                <select name="dosage" id="dosage" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
-                    <option value="">请选择</option>
-                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                </select>
-            </div>
-            <div class="customize-form-group">
-                <label>给药方式:</label>
-                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}">
-                    <option value="">请选择</option>
-                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                </select>
-            </div>
-            <div class="customize-form-group">
-                <label>频次:</label>
-                <select name="frequency" id="frequency" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}">
-                    <option value="">请选择</option>
-                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
-                </select>
-            </div>
-
         </div>
         </div>
     </form>
     </form>
 </div>
 </div>
@@ -103,7 +42,7 @@
         $.ajax({
         $.ajax({
             cache : true,
             cache : true,
             type : "POST",
             type : "POST",
-            url : ctx + "/dzpz/dvalueConfig/savedvalueconfig",
+            url : ctx + "dzpz/dvalueConfig/savedvalueconfig",
             data : data,
             data : data,
             async : false,
             async : false,
             error : function(request) {
             error : function(request) {

+ 2 - 58
health-admin/src/main/resources/templates/gxhpz/dvalueconfigDetail.html

@@ -10,14 +10,10 @@
 		<div class="row">
 		<div class="row">
 			<!-- 第一列 -->
 			<!-- 第一列 -->
 			<div class="col-sm-6">
 			<div class="col-sm-6">
-				<div class="form-group">
-					<label class="col-sm-2 control-label">药品编码:</label>
-					<div class="form-control-static" th:text="${mdmCode}">
-					</div>
-				</div>
+
 				<div class="form-group">
 				<div class="form-group">
 					<label class="col-sm-2 control-label">D值品编码:</label>
 					<label class="col-sm-2 control-label">D值品编码:</label>
-					<div class="form-control-static" th:text="${dValueCode}">
+					<div class="form-control-static" th:text="${d_value_code}">
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="form-group">
 				<div class="form-group">
@@ -25,59 +21,7 @@
 					<div class="form-control-static" th:text="${dValueName}">
 					<div class="form-control-static" th:text="${dValueName}">
 					</div>
 					</div>
 				</div>
 				</div>
-				<div class="form-group">
-					<label class="col-sm-2 control-label">规格:</label>
-					<div class="form-control-static" th:text="${specification}">
-					</div>
-				</div>
-				<div class="form-group">
-					<label class="col-sm-2 control-label">通用名:</label>
-					<div class="form-control-static" th:text="${genericName}">
-					</div>
-				</div>
-				<div class="form-group">
-					<label class="col-sm-2 control-label">商品名:</label>
-					<div class="form-control-static" th:text="${productName}">
-					</div>
-				</div>
-				<div class="form-group">
-					<label class="col-sm-2 control-label">ICD适应症:</label>
-					<div class="form-control-static" th:text="${icdIndication}">
-					</div>
-				</div>
-				<div class="form-group">
-					<label class="col-sm-2 control-label">适应症编码:</label>
-					<div class="form-control-static" th:text="${indicationCode}">
-					</div>
-				</div>
-				<div class="form-group">
-					<label class="col-sm-2 control-label">给药方式:</label>
-					<div class="form-control-static" th:text="${administrationMethod}">
-					</div>
-				</div>
 
 
-		</div>
-		<div class="col-sm-6">
-			<div class="form-group">
-				<label class="col-sm-2 control-label">用量:</label>
-				<div class="form-control-static" th:text="${dosage}">
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-2 control-label">单位:</label>
-				<div class="form-control-static" th:text="${unit}">
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-2 control-label">频次:</label>
-				<div class="form-control-static" th:text="${frequency}">
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="col-sm-2 control-label">创建人:</label>
-				<div class="form-control-static" th:text="${createdBy}">
-				</div>
-			</div>
 			<div class="form-group">
 			<div class="form-group">
 				<label class="col-sm-2 control-label">创建时间:</label>
 				<label class="col-sm-2 control-label">创建时间:</label>
 				<div class="form-control-static" th:text="${#temporals.format(createdTime, 'yyyy-MM-dd HH:mm:ss')}">
 				<div class="form-control-static" th:text="${#temporals.format(createdTime, 'yyyy-MM-dd HH:mm:ss')}">

+ 7 - 62
health-admin/src/main/resources/templates/gxhpz/dvalueconfigEdit.html

@@ -9,30 +9,17 @@
 
 
         <div class="customize-form-group-container">
         <div class="customize-form-group-container">
             <input type="hidden" id="id" name="id" th:value="${id}">
             <input type="hidden" id="id" name="id" th:value="${id}">
-            <div class="customize-form-group-container"> <div class="customize-form-group">
+            <div class="customize-form-group-container">
+                <div class="customize-form-group">
                 <label>D值品编码:</label>
                 <label>D值品编码:</label>
-                <input name="dValueCode" placeholder="请输入D值品编码" id="dValueCode"  th:value="${dValueCode}" class="styled-input" type="text">
+                <input name="d_value_code" placeholder="请输入D值品编码" id="d_value_code"  th:value="${d_value_code}" class="styled-input" disabled type="text">
             </div>
             </div>
-                <div class="customize-form-group">
-                    <label class="is-required">药品编码:</label>
-                    <input name="mdmCode" placeholder="请输入药品编码" id="mdmCode"  th:value="${mdmCode}" class="styled-input" type="text" required>
-                </div>
+
                 <div class="customize-form-group">
                 <div class="customize-form-group">
                     <label>D值品名称:</label>
                     <label>D值品名称:</label>
                     <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" th:value="${dValueName}" class="styled-input" type="text">
                     <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" th:value="${dValueName}" class="styled-input" type="text">
                 </div>
                 </div>
-                <div class="customize-form-group">
-                    <label>规格:</label>
-                    <input name="specification" placeholder="请输入规格" id="specification" th:value="${specification}" class="styled-input" type="text">
-                </div>
-                <div class="customize-form-group">
-                    <label class="is-required">通用名:</label>
-                    <input name="genericName" placeholder="请输入通用名" id="genericName" th:value="${genericName}" class="styled-input" type="text" required>
-                </div>
-                <div class="customize-form-group">
-                    <label class="is-required">商品名:</label>
-                    <input name="productName" placeholder="请输入商品名" id="productName" th:value="${productName}" class="styled-input" type="text" required>
-                </div>
+
                 <div class="customize-form-group">
                 <div class="customize-form-group">
                     <label>配置状态:</label>
                     <label>配置状态:</label>
                     <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}" th:value="${status}">
                     <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}" th:value="${status}">
@@ -41,51 +28,9 @@
                     </select>
                     </select>
                 </div>
                 </div>
 
 
-                <!-- 以下可能不要 -->
-
-                <div class="customize-form-group">
-                    <label>ICD适应症:</label>
-                    <select name="icdIndication" id="icdIndication" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${icdIndication}">
-                        <option value="">请选择</option>
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${icdIndication}"></option>
-                    </select>
-                </div>
-                <div class="customize-form-group">
-                    <label>适应症编码:</label>
-                    <select name="indicationCode" id="indicationCode" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${indicationCode}">
-                        <option value="">请选择</option>
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${indicationCode}"></option>
-                    </select>
-                </div>
-                <div class="customize-form-group">
-                    <label>单位:</label>
-                    <select name="unit" id="unit" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${unit}">
-                        <option value="">请选择</option>
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${unit}"></option>
-                    </select>
-                </div>
-                <div class="customize-form-group">
-                    <label>用量:</label>
-                    <select name="dosage" id="dosage" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${dosage}">
-                        <option value="">请选择</option>
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${dosage}"></option>
-                    </select>
-                </div>
-                <div class="customize-form-group">
-                    <label>给药方式:</label>
-                    <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}" th:value="${administrationMethod}">
-                        <option value="">请选择</option>
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictLabel}==${administrationMethod}"></option>
-                    </select>
-                </div>
-                <div class="customize-form-group">
-                    <label>频次:</label>
-                    <select name="frequency" id="frequency" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}" th:value="${frequency}">
-                        <option value="">请选择</option>
-                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictLabel}==${frequency}"></option>
-                    </select>
-                </div>
+            </div>
         </div>
         </div>
+
     </form>
     </form>
 </div>
 </div>
 <div class="main-content">
 <div class="main-content">

+ 8 - 33
health-admin/src/main/resources/templates/gxhpz/dvalueconfigList.html

@@ -22,31 +22,17 @@
                 </div>
                 </div>
                 <form id="SSpglJfspProductinfo-form" class="customize-search-form">
                 <form id="SSpglJfspProductinfo-form" class="customize-search-form">
                 <div class="customize-form-group-container">
                 <div class="customize-form-group-container">
-                <!-- 药品编码 -->
-                <div class="customize-form-group">
-                    <label>药品编码:</label>
-                    <input type="text" class="styled-input" placeholder="请输入药品编码" name="mdmCode"/>
-                </div>
+
                 <!-- D值品编码 -->
                 <!-- D值品编码 -->
                 <div class="customize-form-group">
                 <div class="customize-form-group">
                     <label>D值品编码:</label>
                     <label>D值品编码:</label>
-                    <input type="text" class="styled-input" placeholder="请输入D值品编码" name="dValueCode"/>
+                    <input type="text" class="styled-input" placeholder="请输入D值品编码" name="d_value_code"/>
                 </div>
                 </div>
                 <!-- D值品名称 -->
                 <!-- D值品名称 -->
                 <div class="customize-form-group">
                 <div class="customize-form-group">
                     <label>D值品名称:</label>
                     <label>D值品名称:</label>
                     <input type="text" class="styled-input" placeholder="请输入D值品名称" name="dValueName"/>
                     <input type="text" class="styled-input" placeholder="请输入D值品名称" name="dValueName"/>
                 </div>
                 </div>
-                <!-- 通用名 -->
-                <div class="customize-form-group">
-                    <label>通用名:</label>
-                    <input type="text" class="styled-input" placeholder="请输入通用名" name="genericName"/>
-                </div>
-                <!-- 商品名 -->
-                <div class="customize-form-group">
-                    <label>商品名:</label>
-                    <input type="text" class="styled-input" placeholder="请输入商品名" name="productName"/>
-                </div>
                 <!-- 状态 -->
                 <!-- 状态 -->
                 <div class="customize-form-group">
                 <div class="customize-form-group">
                     <label>状态:</label>
                     <label>状态:</label>
@@ -126,12 +112,8 @@
             fixedRightNumber: 1,
             fixedRightNumber: 1,
             columns: [
             columns: [
                 { field: 'id', title: '主键', align: 'center', visible: false },
                 { field: 'id', title: '主键', align: 'center', visible: false },
-                { field: 'mdmCode', title: '药品编码', align: 'center' },
-                { field: 'dValueCode', title: 'D值品编码', align: 'center' },
+                { field: 'd_value_code', title: 'D值品编码', align: 'center' },
                 { field: 'dValueName', title: 'D值品名称', align: 'center' },
                 { field: 'dValueName', title: 'D值品名称', align: 'center' },
-                { field: 'specification', title: '规格', align: 'center' },
-                { field: 'genericName', title: '通用名', align: 'center' },
-                { field: 'productName', title: '商品名', align: 'center' },
                 {
                 {
                     visible: editFlag == 'hidden' ? false : true,
                     visible: editFlag == 'hidden' ? false : true,
                     title: '配置状态',
                     title: '配置状态',
@@ -153,23 +135,16 @@
                 //                 return '<span class=\"btn-warning">-</span>';
                 //                 return '<span class=\"btn-warning">-</span>';
                 //         }
                 //         }
                 //     } },
                 //     } },
-                { field: 'administrationMethod', title: '给药方式', align: 'center' },
-                { field: 'icdIndication', title: 'ICD适应症', align: 'center' },
-                { field: 'indicationCode', title: '适应症编码', align: 'center' },
-                { field: 'dosage', title: '用量', align: 'center' },
-                { field: 'unit', title: '单位', align: 'center' },
-                { field: 'frequency', title: '频次', align: 'center' },
                 { field: 'updatedTime', title: '更新日期', align: 'center' },
                 { field: 'updatedTime', title: '更新日期', align: 'center' },
                 {
                 {
                     title: '操作',
                     title: '操作',
                     align: 'center',
                     align: 'center',
-                    width: 165,
                     formatter: function(value, row, index) {
                     formatter: function(value, row, index) {
                         if (row.id) {
                         if (row.id) {
                             var actions = [];
                             var actions = [];
-                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
+                            // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
                             actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.operate.view(\'' + row.id + '\')"><i class="fa fa-eye"></i>详情</a> ');
                             actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.operate.view(\'' + row.id + '\')"><i class="fa fa-eye"></i>详情</a> ');
-                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
+                            // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                             return actions.join('');
                             return actions.join('');
                         } else {
                         } else {
                             return "";
                             return "";
@@ -206,16 +181,16 @@
     /* 用户状态显示 */
     /* 用户状态显示 */
     function statusTools(row) {
     function statusTools(row) {
         if (row.status == 0) {
         if (row.status == 0) {
-            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')" style="color: red;"></i> ';
+            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id +'\')" style="color: red;"></i> ';
         } else {
         } else {
-            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')" style="color: green;"></i>  ';
+            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id+'\')" style="color: green;"></i>  ';
         }
         }
     }
     }
 
 
     /* 用户管理-停用 */
     /* 用户管理-停用 */
     function disable(id) {
     function disable(id) {
         $.modal.confirm("确认要停用配置吗?", function() {
         $.modal.confirm("确认要停用配置吗?", function() {
-            $.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
+            $.operate.post(prefix + "/changeStatus", { "id": id,"status": 0 });
         })
         })
     }
     }
 
 

+ 69 - 25
health-system/src/main/java/com/bzd/system/service/gxhpz/DrugConfigService.java

@@ -4,12 +4,16 @@ import com.bzd.common.config.dao.DaoBase;
 import com.bzd.common.config.dao.DaoSupport;
 import com.bzd.common.config.dao.DaoSupport;
 import com.bzd.common.config.dao.PageData;
 import com.bzd.common.config.dao.PageData;
 import com.bzd.common.utils.DateUtils;
 import com.bzd.common.utils.DateUtils;
+import com.bzd.common.utils.StringUtils;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
+
 import static com.bzd.common.utils.ShiroUtils.getSysUser;
 import static com.bzd.common.utils.ShiroUtils.getSysUser;
 
 
 @Service
 @Service
@@ -29,6 +33,12 @@ public class DrugConfigService {
     public List<PageData> findForList(final PageData pd) throws Exception {
     public List<PageData> findForList(final PageData pd) throws Exception {
         return (List<PageData>) daoSupport.findForList("drugConfigMapper.selectDrugConfig", pd);
         return (List<PageData>) daoSupport.findForList("drugConfigMapper.selectDrugConfig", pd);
     }
     }
+    public List<PageData> selectproductByCodeAndName(final PageData pd) throws Exception {
+        return    (List<PageData>) daoSupport.findForList("drugConfigMapper.selectproductByCodeAndName", pd);
+    }
+    public PageData selectOneproductByCodeAndName(final PageData pd) throws Exception {
+        return    (PageData) daoSupport.findForObject("drugConfigMapper.selectOneproductByCodeAndName", pd);
+    }
 
 
     /**
     /**
      * 查询单个
      * 查询单个
@@ -47,23 +57,11 @@ public class DrugConfigService {
      * @throws Exception
      * @throws Exception
      */
      */
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
-    public PageData save(final PageData pd) throws Exception {
-        pd.put("createTime", DateUtils.getTime());//处方表 处方单号时间
-        pd.put("id", "Id");//处方单表id主键
-        pd.put("storeId", getSysUser().getDeptId());
-        int result = daoSupport.save("drugConfigMapper.addDrugConfig", pd);
-        PageData resultpageData = new PageData();
-        if(result>0){
-            resultpageData.put("id", "Id");//处方单表id主键
-            Object prescription =  daoSupport.findForObject("drugConfigMapper.selectOne", resultpageData);
-            resultpageData.put("result", "200");
-            resultpageData.put("prescription", prescription);
-            return resultpageData;
-        }else{
-            resultpageData.put("id", "Id");//处方单表id主键
-            resultpageData.put("result","300");
-            return resultpageData;
-        }
+    public int save(final PageData pd) throws Exception {
+        pd.put("createdBy", getSysUser().getUserId());
+        pd.put("createdTime", DateUtils.getTime());
+
+        return daoSupport.save("drugConfigMapper.addDrugConfig", pd);
     }
     }
 
 
     /**
     /**
@@ -83,7 +81,55 @@ public class DrugConfigService {
      * @throws Exception
      * @throws Exception
      */
      */
     public Integer update(PageData pd) throws Exception {
     public Integer update(PageData pd) throws Exception {
-        return daoSupport.update("drugConfigMapper.updateDrugConfig", pd);
+        String type = (String) pd.get("type");
+        if(type.equals("1")){
+            int result1=0;
+            String dValueId = (String) pd.get("dValueId");
+            String dValueName = (String) pd.get("dValueName");
+            Object drugData =pd.get("drugData");
+            if(StringUtils.isNotNull(drugData)){
+                try {
+                    // 将 JSON 字符串转换为 List<Map<String, Object>>
+                    ObjectMapper objectMapper = new ObjectMapper();
+                    List<Map<String, Object>> rowsList = objectMapper.readValue(drugData.toString(), List.class);
+                    // 遍历列表并调用插入数据接口
+                    for (Map<String, Object> hbs : rowsList) {
+                        PageData pd4=new PageData();
+                        pd4.put("d_value_code", dValueId);
+                        pd4.put("dValueName", dValueName);
+                        pd4.put("mdmCode", hbs.get("mdmCode"));
+                        pd4.put("dvalueStatus", pd.get("saveStatus"));
+//                        pd4.put("specification", hbs.get("specification"));
+//                        pd4.put("manufacturerShortName", hbs.get("manufacturerShortName"));
+//                        pd4.put("isFollowUpManaged", hbs.get("isFollowUpManaged"));
+//                        pd4.put("isColdChainManaged", hbs.get("isColdChainManaged"));
+//                        pd4.put("isRegisteredManaged", hbs.get("isRegisteredManaged"));
+//                        pd4.put("isCharityAidManaged", hbs.get("isCharityAidManaged"));
+//                        pd4.put("administrationMethod", hbs.get("administrationMethod"));
+//                        pd4.put("dosageAndAdministration", hbs.get("dosageAndAdministration"));
+//                        pd4.put("enterpriseFlowManagement", hbs.get("enterpriseFlowManagement"));
+                        //pd4.put("createdBy", pd.get("createdBy"));
+                        //pd4.put("createdTime", pd.get("createdTime"));
+                        pd4.put("dvupdatedby", getSysUser().getUserId());
+                        pd4.put("dvcreatedTime", DateUtils.getTime());
+                        pd4.put("remarks", pd.get("remarks"));
+                        result1 = daoSupport.update("drugConfigMapper.updateDrugConfig2", pd4);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            if(result1>0 ){
+                return 1;
+            }else{
+                return 0;
+            }
+        }else{
+            pd.put("updatedBy", getSysUser().getUserId());
+            pd.put("updatedTime", DateUtils.getTime());
+            return daoSupport.update("drugConfigMapper.updateDrugConfig", pd);
+
+        }
     }
     }
 
 
     /**
     /**
@@ -97,9 +143,12 @@ public class DrugConfigService {
         pd.put("updatedBy", getSysUser().getUserId());
         pd.put("updatedBy", getSysUser().getUserId());
         return daoSupport.update("drugConfigMapper.changeStatus", pd);
         return daoSupport.update("drugConfigMapper.changeStatus", pd);
     }
     }
-
+    /**配置药查询**/
+    public List<PageData> getAllDrugs(final PageData pd) throws Exception {
+        return (List<PageData>) daoSupport.findForList("drugConfigMapper.getAllDrugConfig", pd);
+    }
     /**
     /**
-     * 启用停用配置
+     * 启用停用D值配关联
      * @param pd
      * @param pd
      * @return
      * @return
      * @throws Exception
      * @throws Exception
@@ -109,10 +158,5 @@ public class DrugConfigService {
         pd.put("updatedBy", getSysUser().getUserId());
         pd.put("updatedBy", getSysUser().getUserId());
         return daoSupport.update("drugConfigMapper.changedvalueStatus", pd);
         return daoSupport.update("drugConfigMapper.changedvalueStatus", pd);
     }
     }
-    /**配置药查询**/
-    public List<PageData> getAllDrugs(final PageData pd) throws Exception {
-        return (List<PageData>) daoSupport.findForList("drugConfigMapper.getAllDrugConfig", pd);
-    }
-
 
 
 }
 }

+ 30 - 94
health-system/src/main/java/com/bzd/system/service/gxhpz/DvalueConfigService.java

@@ -4,14 +4,12 @@ import com.bzd.common.config.dao.DaoBase;
 import com.bzd.common.config.dao.DaoSupport;
 import com.bzd.common.config.dao.DaoSupport;
 import com.bzd.common.config.dao.PageData;
 import com.bzd.common.config.dao.PageData;
 import com.bzd.common.utils.DateUtils;
 import com.bzd.common.utils.DateUtils;
-import com.bzd.common.utils.StringUtils;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
+
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 
 
 import static com.bzd.common.utils.ShiroUtils.getSysUser;
 import static com.bzd.common.utils.ShiroUtils.getSysUser;
 
 
@@ -29,7 +27,7 @@ public class DvalueConfigService {
      * @throws Exception
      * @throws Exception
      */
      */
     public List<PageData> findForList(final PageData pd) throws Exception {
     public List<PageData> findForList(final PageData pd) throws Exception {
-        return (List<PageData>) daoSupport.findForList("dvalueConfigMapper.selectDValueConfig", pd);
+        return (List<PageData>) daoSupport.findForList("dvalueMapper.selectDValue", pd);
     }
     }
 
 
     /**
     /**
@@ -39,7 +37,10 @@ public class DvalueConfigService {
      * @throws Exception
      * @throws Exception
      */
      */
     public Object findOne(final PageData pd) throws Exception {
     public Object findOne(final PageData pd) throws Exception {
-        return daoSupport.findForObject("dvalueConfigMapper.selectOne", pd);
+        return daoSupport.findForObject("dvalueMapper.selectOne", pd);
+    }
+    public Object checkValueByCode(final PageData pd) throws Exception {
+        return daoSupport.findForObject("dvalueMapper.checkValueByCode", pd);
     }
     }
 
 
     /**
     /**
@@ -50,82 +51,13 @@ public class DvalueConfigService {
      */
      */
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public int save(final PageData pd) throws Exception {
     public int save(final PageData pd) throws Exception {
-        Integer  saveStatusIn=null;
-        int result1=0;
-        int result2=0;
-        pd.put("createdBy", getSysUser().getUserId());
-        pd.put("updatedBy", getSysUser().getUserId());
-        pd.put("updatedTime", DateUtils.getTime());
-        pd.put("createdTime", DateUtils.getTime());
-        String saveStatus = (String) pd.get("saveStatus");
-        String dValueId = (String) pd.get("dValueId");
-        Object drugData =pd.get("drugData");
-        if(!dValueId.equals("") && drugData!=null){
-            pd.put("dValueCode", dValueId);
-        }
-        if(saveStatus.equals("保存")){
-            saveStatusIn=0;
-        }
-        if(saveStatus.equals("保存并启用")){
-            saveStatusIn= 1;
-        }
-        daoSupport.save("dvalueConfigMapper.updateDValue", pd);
-        PageData pd2=new PageData();
-        pd2.put("dValueCode",dValueId);
-        pd2= (PageData) daoSupport.findForObject("dvalueConfigMapper.selectOne", pd);
-        if(pd2!=null){
-            pd.put("dValueName", pd2.get("dValueName"));
-        }
-        if(StringUtils.isNotNull(drugData)){
-            try {
-                // 将 JSON 字符串转换为 List<Map<String, Object>>
-                ObjectMapper objectMapper = new ObjectMapper();
-                List<Map<String, Object>> rowsList = objectMapper.readValue(drugData.toString(), List.class);
-
-                // 遍历列表并调用插入数据接口
-                for (Map<String, Object> hbs : rowsList) {
-                    PageData pd3=new PageData();
-                    PageData pd4=new PageData();
-                    pd4.put("dValueCode", pd.get("dValueCode"));
-                    pd4.put("dValueName", pd2.get("dValueName"));
-                    pd4.put("mdmCode", hbs.get("mdmCode"));
-                    pd4.put("updatedBy", pd.get("updatedBy"));
-                    pd4.put("updatedTime", pd.get("updatedTime"));
-                    pd4.put("dvalueStatus", saveStatusIn);
-
-                    pd3.put("dValueCode", pd.get("dValueCode"));
-                    pd3.put("dValueName", pd2.get("dValueName"));
-                    pd3.put("mdmCode", hbs.get("mdmCode"));
-                    pd3.put("specification", hbs.get("specification"));
-                    pd3.put("genericName", hbs.get("genericName"));
-                    pd3.put("icdIndication", hbs.get("icdIndication"));
-                    pd3.put("indicationCode", hbs.get("indicationCode"));
-                    pd3.put("administrationMethod", hbs.get("administrationMethod"));
-                    pd3.put("unit", hbs.get("unit"));
-                    pd3.put("dosage", hbs.get("dosage"));
-                    pd3.put("frequency", hbs.get("frequency"));
-                   // pd3.put("createdBy", pd.get("createdBy"));
-                    //pd3.put("createdTime", pd.get("createdTime"));
-                    pd3.put("updatedBy", pd.get("updatedBy"));
-                    pd3.put("updatedTime", pd.get("updatedTime"));
-                    pd3.put("status",  saveStatusIn);
-                    pd3.put("remarks", pd.get("remarks"));
-                     result1 =  daoSupport.save("dvalueConfigMapper.updateDValue", pd3);
-                     result2 = daoSupport.save("drugConfigMapper.updateDrugConfigByDrugCode", pd4);
-                    //daoSupport.save("dvalueConfigMapper.insertDValueConfig", pd3);
-
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-        if(result1>0 && result2>0){
-            return 1;
-        }else{
-            return 0;
+        Object o=daoSupport.findForObject("dvalueMapper.checkValueByCode", pd);
+        if(o!=null){
+            return -1;
+        }else {
+            return  daoSupport.save("dvalueMapper.insertDValue", pd);
         }
         }
 
 
-
     }
     }
 
 
     /**
     /**
@@ -135,7 +67,7 @@ public class DvalueConfigService {
      * @throws Exception
      * @throws Exception
      */
      */
     public Integer del(List<String> ids) throws Exception {
     public Integer del(List<String> ids) throws Exception {
-        return daoSupport.delete("dvalueConfigMapper.deleteDvalueConfigByIds", ids);
+        return daoSupport.delete("dvalueMapper.deleteDvalueByIds", ids);
     }
     }
 
 
     /**
     /**
@@ -145,7 +77,7 @@ public class DvalueConfigService {
      * @throws Exception
      * @throws Exception
      */
      */
     public Integer update(PageData pd) throws Exception {
     public Integer update(PageData pd) throws Exception {
-        return daoSupport.update("dvalueConfigMapper.updateDValueConfig", pd);
+        return daoSupport.update("dvalueMapper.updateDValue", pd);
     }
     }
 
 
     /**
     /**
@@ -154,21 +86,25 @@ public class DvalueConfigService {
      * @return
      * @return
      * @throws Exception
      * @throws Exception
      */
      */
-    public Integer changeStatus(PageData pd) throws Exception {
+    public String changeStatus(PageData pd) throws Exception {
         pd.put("updatedTime", DateUtils.getTime());
         pd.put("updatedTime", DateUtils.getTime());
         pd.put("updatedBy", getSysUser().getUserId());
         pd.put("updatedBy", getSysUser().getUserId());
-        return daoSupport.update("dvalueConfigMapper.changeStatus", pd);
-    }
-    /**
-     * 启用停用D值配关联
-     * @param pd
-     * @return
-     * @throws Exception
-     */
-    public Integer changedvalueStatus(PageData pd) throws Exception {
-        pd.put("updatedTime", DateUtils.getTime());
-        pd.put("updatedBy", getSysUser().getUserId());
-        return daoSupport.update("dvalueConfigMapper.changedvalueStatus", pd);
+        PageData pdd= (PageData) daoSupport.findForObject("dvalueMapper.selectOneById", pd);
+        Long d_value_code= (Long) pdd.get("d_value_code");
+        PageData pd1 = new PageData();
+        pd1.put("d_value_code",d_value_code);
+        List<PageData> list= (List<PageData>) daoSupport.findForList("drugConfigMapper.selectDrugConfigByd_value_code", pd1);
+        if(list.size()>0){
+            return "有绑定药品不能停用!";
+        }else {
+          int result=  daoSupport.update("dvalueMapper.changeStatus", pd);
+          if(result>0){
+              return "success";
+          }else{
+              return "error";
+          }
+        }
     }
     }
 
 
+
 }
 }

+ 177 - 23
health-system/src/main/resources/mapper/gxhpz/drugConfigMapper.xml

@@ -3,14 +3,52 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="drugConfigMapper">
 <mapper namespace="drugConfigMapper">
+    <select id="selectOne" parameterType="pd" resultType="pd">
+        select * from s_gxhpz_drugconfig where  1=1 and mdmCode = #{mdmCode}
+    </select>
+    <select id="selectDrugConfigByd_value_code" parameterType="pd" resultType="pd">
+        select * from s_gxhpz_drugconfig where  d_value_code = #{d_value_code} and dvalueStatus is not null
+    </select>
+    <select id="selectproductByCodeAndName" parameterType="pd" resultType="pd">
+        SELECT
+            p.*,
+            d.registered_item,
+            d.follow_up_item,
+            d.cold_chain_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
+        WHERE
+            p.product_name LIKE CONCAT('%', #{query}, '%')
+           OR p.product_code LIKE CONCAT('%', #{query}, '%')
+    </select>
+    <select id="selectOneproductByCodeAndName" parameterType="pd" resultType="pd">
+        SELECT
+            p.*,
+            d.registered_item,
+            d.follow_up_item,
+            d.cold_chain_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
+        WHERE p.product_code = #{query}
+    </select>
 
 
     <select id="selectDrugConfig" parameterType="pd" resultType="pd">
     <select id="selectDrugConfig" parameterType="pd" resultType="pd">
         select * from s_gxhpz_drugconfig where 1=1
         select * from s_gxhpz_drugconfig where 1=1
         <if test="mdmCode != null and mdmCode != ''">
         <if test="mdmCode != null and mdmCode != ''">
             and mdmCode = #{mdmCode}
             and mdmCode = #{mdmCode}
         </if>
         </if>
-        <if test="dValueCode != null and dValueCode != ''">
-            and dValueCode = #{dValueCode}
+        <if test="d_value_code != null and d_value_code != ''">
+            and d_value_code = #{d_value_code}
         </if>
         </if>
         <if test="dValueName != null and dValueName != ''">
         <if test="dValueName != null and dValueName != ''">
             and dValueName = #{dValueName}
             and dValueName = #{dValueName}
@@ -87,16 +125,114 @@
         <if test="id != null and id != ''">
         <if test="id != null and id != ''">
             and id = #{id}
             and id = #{id}
         </if>
         </if>
+         ORDER BY d_value_code ASC
     </select>
     </select>
 
 
+    <update id="updateDrugConfig2" parameterType="map">
+        update s_gxhpz_drugconfig
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="d_value_code != null">
+                d_value_code = #{d_value_code},
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                dValueName = #{dValueName},
+            </if>
+            <if test="specification != null and specification != ''">
+                specification = #{specification},
+            </if>
+            <if test="genericName != null and genericName != ''">
+                genericName = #{genericName},
+            </if>
+            <if test="productName != null and productName != ''">
+                productName = #{productName},
+            </if>
+            <if test="packaging != null and packaging != ''">
+                packaging = #{packaging},
+            </if>
+            <if test="productImagePath != null and productImagePath != ''">
+                productImagePath = #{productImagePath},
+            </if>
+            <if test="manufacturer != null and manufacturer != ''">
+                manufacturer = #{manufacturer},
+            </if>
+            <if test="manufacturerShortName != null and manufacturerShortName != ''">
+                manufacturerShortName = #{manufacturerShortName},
+            </if>
+            <if test="isFollowUpManaged != null and isFollowUpManaged != ''">
+                isFollowUpManaged = #{isFollowUpManaged},
+            </if>
+            <if test="isColdChainManaged != null and isColdChainManaged != ''">
+                isColdChainManaged = #{isColdChainManaged},
+            </if>
+            <if test="isRegisteredManaged != null and isRegisteredManaged != ''">
+                isRegisteredManaged = #{isRegisteredManaged},
+            </if>
+            <if test="isCharityAidManaged != null and isCharityAidManaged != ''">
+                isCharityAidManaged = #{isCharityAidManaged},
+            </if>
+            <if test="administrationMethod != null and administrationMethod != ''">
+                administrationMethod = #{administrationMethod},
+            </if>
+            <if test="enterpriseFlowManagement != null and enterpriseFlowManagement != ''">
+                enterpriseFlowManagement = #{enterpriseFlowManagement},
+            </if>
+            <if test="indicationDescription != null and indicationDescription != ''">
+                indicationDescription = #{indicationDescription},
+            </if>
+            <if test="dosageAndAdministration != null and dosageAndAdministration != ''">
+                dosageAndAdministration = #{dosageAndAdministration},
+            </if>
+            <if test="saleStatus != null">
+                saleStatus = #{saleStatus},
+            </if>
+            <if test="dvalueStatus != null">
+                dvalueStatus= #{dvalueStatus},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="createdBy != null and createdBy != ''">
+                createdBy = #{createdBy},
+            </if>
+            <if test="createdTime != null">
+                createdTime = #{createdTime},
+            </if>
+            <if test="updatedBy != null and updatedBy != ''">
+                updatedBy = #{updatedBy},
+            </if>
+            <if test="updatedTime != null">
+                updatedTime = #{updatedTime},
+            </if>
+
+            <if test="dvupdatedby != null and dvupdatedby != ''">
+                dvupdatedby = #{dvupdatedby},
+            </if>
+            <if test="dvupdatedTime != null">
+                dvupdatedTime = #{dvupdatedTime},
+            </if>
+            <if test="dvcreatedTime != null">
+                dvcreatedTime = #{dvcreatedTime},
+            </if>
+
+
+            <if test="remarks != null and remarks != ''">
+                remarks = #{remarks},
+            </if>
+        </trim>
+        <where>
+            <if test="mdmCode != null and mdmCode != ''">
+                mdmCode = #{mdmCode}
+            </if>
+        </where>
+    </update>
     <update id="updateDrugConfig" parameterType="map">
     <update id="updateDrugConfig" parameterType="map">
         update s_gxhpz_drugconfig
         update s_gxhpz_drugconfig
         <trim prefix="SET" suffixOverrides=",">
         <trim prefix="SET" suffixOverrides=",">
             <if test="mdmCode != null and mdmCode !='' ">
             <if test="mdmCode != null and mdmCode !='' ">
                 mdmCode = #{mdmCode},
                 mdmCode = #{mdmCode},
             </if>
             </if>
-            <if test="dValueCode != null">
-                dValueCode = #{dValueCode},
+            <if test="d_value_code != null">
+                d_value_code = #{d_value_code},
             </if>
             </if>
             <if test="dValueName != null and dValueName != ''">
             <if test="dValueName != null and dValueName != ''">
                 dValueName = #{dValueName},
                 dValueName = #{dValueName},
@@ -167,6 +303,15 @@
             <if test="updatedTime != null">
             <if test="updatedTime != null">
                 updatedTime = #{updatedTime},
                 updatedTime = #{updatedTime},
             </if>
             </if>
+            <if test="dvupdatedby != null and dvupdatedby != ''">
+                dvupdatedby = #{dvupdatedby},
+            </if>
+            <if test="dvupdatedTime != null">
+                dvupdatedTime = #{dvupdatedTime},
+            </if>
+            <if test="dvcreatedTime != null">
+                dvcreatedTime = #{dvcreatedTime},
+            </if>
             <if test="remarks != null and remarks != ''">
             <if test="remarks != null and remarks != ''">
                 remarks = #{remarks},
                 remarks = #{remarks},
             </if>
             </if>
@@ -181,8 +326,8 @@
         update s_gxhpz_drugconfig
         update s_gxhpz_drugconfig
         <trim prefix="SET" suffixOverrides=",">
         <trim prefix="SET" suffixOverrides=",">
 
 
-            <if test="dValueCode != null">
-                dValueCode = #{dValueCode},
+            <if test="d_value_code != null">
+                d_value_code = #{d_value_code},
             </if>
             </if>
             <if test="dValueName != null and dValueName != ''">
             <if test="dValueName != null and dValueName != ''">
                 dValueName = #{dValueName},
                 dValueName = #{dValueName},
@@ -203,6 +348,15 @@
             <if test="updatedTime != null">
             <if test="updatedTime != null">
                 updatedTime = #{updatedTime},
                 updatedTime = #{updatedTime},
             </if>
             </if>
+            <if test="dvupdatedby != null and dvupdatedby != ''">
+                dvupdatedby = #{dvupdatedby},
+            </if>
+            <if test="dvupdatedTime != null">
+                dvupdatedTime = #{dvupdatedTime},
+            </if>
+            <if test="dvcreatedTime != null">
+                dvcreatedTime = #{dvcreatedTime},
+            </if>
         </trim>
         </trim>
         <where>
         <where>
             <if test="mdmCode != null and mdmCode != ''">
             <if test="mdmCode != null and mdmCode != ''">
@@ -215,7 +369,7 @@
         update s_gxhpz_drugconfig set  status = #{status}, updatedBy = #{updatedBy},updatedTime = #{updatedTime} where   id = #{id}
         update s_gxhpz_drugconfig set  status = #{status}, updatedBy = #{updatedBy},updatedTime = #{updatedTime} where   id = #{id}
     </update>
     </update>
     <update id="changedvalueStatus" parameterType="pd">
     <update id="changedvalueStatus" parameterType="pd">
-        update s_gxhpz_drugconfig set  dvalueStatus = #{dvalueStatus}, updatedBy = #{updatedBy},updatedTime = #{updatedTime} where   id = #{id}
+        update s_gxhpz_drugconfig set  dvalueStatus = #{dvalueStatus}, dvupdatedby = #{updatedBy},dvupdatedTime = #{updatedTime} where   id = #{id}
     </update>
     </update>
 
 
     <insert id="addDrugConfig" parameterType="map">
     <insert id="addDrugConfig" parameterType="map">
@@ -224,8 +378,8 @@
             <if test="mdmCode != null and mdmCode != ''">
             <if test="mdmCode != null and mdmCode != ''">
                 mdmCode,
                 mdmCode,
             </if>
             </if>
-            <if test="dValueCode != null">
-                dValueCode,
+            <if test="d_value_code != null">
+                d_value_code,
             </if>
             </if>
             <if test="dValueName != null and dValueName != ''">
             <if test="dValueName != null and dValueName != ''">
                 dValueName,
                 dValueName,
@@ -251,16 +405,16 @@
             <if test="manufacturerShortName != null and manufacturerShortName != ''">
             <if test="manufacturerShortName != null and manufacturerShortName != ''">
                 manufacturerShortName,
                 manufacturerShortName,
             </if>
             </if>
-            <if test="isFollowUpManaged != null">
+            <if test="isFollowUpManaged != null and isFollowUpManaged != ''">
                 isFollowUpManaged,
                 isFollowUpManaged,
             </if>
             </if>
-            <if test="isColdChainManaged != null">
+            <if test="isColdChainManaged != null and isColdChainManaged != ''">
                 isColdChainManaged,
                 isColdChainManaged,
             </if>
             </if>
-            <if test="isRegisteredManaged != null">
+            <if test="isRegisteredManaged != null and isRegisteredManaged != ''">
                 isRegisteredManaged,
                 isRegisteredManaged,
             </if>
             </if>
-            <if test="isCharityAidManaged != null">
+            <if test="isCharityAidManaged != null and isCharityAidManaged != ''">
                 isCharityAidManaged,
                 isCharityAidManaged,
             </if>
             </if>
             <if test="administrationMethod != null and administrationMethod != ''">
             <if test="administrationMethod != null and administrationMethod != ''">
@@ -287,13 +441,13 @@
             <if test="createdBy != null and createdBy != ''">
             <if test="createdBy != null and createdBy != ''">
                 createdBy,
                 createdBy,
             </if>
             </if>
-            <if test="createdTime != null">
+            <if test="createdTime != null and createdTime != ''">
                 createdTime,
                 createdTime,
             </if>
             </if>
             <if test="updatedBy != null and updatedBy != ''">
             <if test="updatedBy != null and updatedBy != ''">
                 updatedBy,
                 updatedBy,
             </if>
             </if>
-            <if test="updatedTime != null">
+            <if test="updatedTime != null and updatedTime != ''">
                 updatedTime,
                 updatedTime,
             </if>
             </if>
             <if test="remarks != null and remarks != ''">
             <if test="remarks != null and remarks != ''">
@@ -304,8 +458,8 @@
             <if test="mdmCode != null and mdmCode != ''">
             <if test="mdmCode != null and mdmCode != ''">
                 #{mdmCode},
                 #{mdmCode},
             </if>
             </if>
-            <if test="dValueCode != null">
-                #{dValueCode},
+            <if test="d_value_code != null and d_value_code != ''">
+                #{d_value_code},
             </if>
             </if>
             <if test="dValueName != null and dValueName != ''">
             <if test="dValueName != null and dValueName != ''">
                 #{dValueName},
                 #{dValueName},
@@ -331,16 +485,16 @@
             <if test="manufacturerShortName != null and manufacturerShortName != ''">
             <if test="manufacturerShortName != null and manufacturerShortName != ''">
                 #{manufacturerShortName},
                 #{manufacturerShortName},
             </if>
             </if>
-            <if test="isFollowUpManaged != null">
+            <if test="isFollowUpManaged != null and isFollowUpManaged != ''">
                 #{isFollowUpManaged},
                 #{isFollowUpManaged},
             </if>
             </if>
-            <if test="isColdChainManaged != null">
+            <if test="isColdChainManaged != null and isColdChainManaged != ''">
                 #{isColdChainManaged},
                 #{isColdChainManaged},
             </if>
             </if>
-            <if test="isRegisteredManaged != null">
+            <if test="isRegisteredManaged != null and isRegisteredManaged != ''">
                 #{isRegisteredManaged},
                 #{isRegisteredManaged},
             </if>
             </if>
-            <if test="isCharityAidManaged != null">
+            <if test="isCharityAidManaged != null and isCharityAidManaged != ''">
                 #{isCharityAidManaged},
                 #{isCharityAidManaged},
             </if>
             </if>
             <if test="administrationMethod != null and administrationMethod != ''">
             <if test="administrationMethod != null and administrationMethod != ''">
@@ -368,13 +522,13 @@
             <if test="createdBy != null and createdBy != ''">
             <if test="createdBy != null and createdBy != ''">
                 #{createdBy},
                 #{createdBy},
             </if>
             </if>
-            <if test="createdTime != null">
+            <if test="createdTime != null and createdTime != ''">
                 #{createdTime},
                 #{createdTime},
             </if>
             </if>
             <if test="updatedBy != null and updatedBy != ''">
             <if test="updatedBy != null and updatedBy != ''">
                 #{updatedBy},
                 #{updatedBy},
             </if>
             </if>
-            <if test="updatedTime != null">
+            <if test="updatedTime != null and updatedTime != ''">
                 #{updatedTime},
                 #{updatedTime},
             </if>
             </if>
             <if test="remarks != null and remarks != ''">
             <if test="remarks != null and remarks != ''">

+ 11 - 11
health-system/src/main/resources/mapper/gxhpz/dvalueConfigMapper.xml

@@ -6,8 +6,8 @@
 
 
     <select id="selectDValueConfig" parameterType="pd" resultType="pd">
     <select id="selectDValueConfig" parameterType="pd" resultType="pd">
         select * from s_gxhpz_dvalueconfig where 1=1
         select * from s_gxhpz_dvalueconfig where 1=1
-        <if test="dValueCode != null and dValueCode != ''">
-            and dValueCode = #{dValueCode}
+        <if test="d_value_code != null and d_value_code != ''">
+            and d_value_code = #{d_value_code}
         </if>
         </if>
         <if test="mdmCode != null and mdmCode != ''">
         <if test="mdmCode != null and mdmCode != ''">
             and mdmCode = #{mdmCode}
             and mdmCode = #{mdmCode}
@@ -75,7 +75,7 @@
         where 1=1
         where 1=1
         <if test="query != null and query != ''">
         <if test="query != null and query != ''">
             AND (v.dValueName LIKE CONCAT('%', #{query}, '%')
             AND (v.dValueName LIKE CONCAT('%', #{query}, '%')
-            OR v.dValueCode = #{query})
+            OR v.d_value_code = #{query})
         </if>
         </if>
 
 
         LIMIT 1
         LIMIT 1
@@ -83,8 +83,8 @@
     <update id="updateDValueConfig" parameterType="pd">
     <update id="updateDValueConfig" parameterType="pd">
         update s_gxhpz_dvalueconfig
         update s_gxhpz_dvalueconfig
         <trim prefix="SET " suffix="" prefixOverrides="," suffixOverrides=",">
         <trim prefix="SET " suffix="" prefixOverrides="," suffixOverrides=",">
-            <if test="dValueCode != null and dValueCode != ''">
-                dValueCode = #{dValueCode},
+            <if test="d_value_code != null and d_value_code != ''">
+                d_value_code = #{d_value_code},
             </if>
             </if>
             <if test="mdmCode != null and mdmCode != ''">
             <if test="mdmCode != null and mdmCode != ''">
                 mdmCode = #{mdmCode},
                 mdmCode = #{mdmCode},
@@ -190,8 +190,8 @@
             </if>
             </if>
 
 
         </trim>
         </trim>
-        <if test="dValueCode != null and dValueCode != ''">
-            where dValueCode = #{dValueCode}
+        <if test="d_value_code != null and d_value_code != ''">
+            where d_value_code = #{d_value_code}
         </if>
         </if>
     </update>
     </update>
     <delete id="deleteDvalueConfigByIds" parameterType="java.util.List">
     <delete id="deleteDvalueConfigByIds" parameterType="java.util.List">
@@ -213,8 +213,8 @@
     <insert id="insertDValueConfig" parameterType="pd">
     <insert id="insertDValueConfig" parameterType="pd">
         insert into s_gxhpz_dvalueconfig
         insert into s_gxhpz_dvalueconfig
         <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
         <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
-            <if test="dValueCode != null and dValueCode != ''">
-                dValueCode,
+            <if test="d_value_code != null and d_value_code != ''">
+                d_value_code,
             </if>
             </if>
             <if test="mdmCode != null and mdmCode != ''">
             <if test="mdmCode != null and mdmCode != ''">
                 mdmCode,
                 mdmCode,
@@ -269,8 +269,8 @@
             </if>
             </if>
         </trim>
         </trim>
         <trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
         <trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
-            <if test="dValueCode != null and dValueCode != ''">
-                #{dValueCode},
+            <if test="d_value_code != null and d_value_code != ''">
+                #{d_value_code},
             </if>
             </if>
             <if test="mdmCode != null and mdmCode != ''">
             <if test="mdmCode != null and mdmCode != ''">
                 #{mdmCode},
                 #{mdmCode},