Przeglądaj źródła

Merge branch 'dev-1.1.4' into 'dev-1.1.4'

增加号别的收费类别维护

See merge request lihong/thmz_system!111
huangshuhua 5 miesięcy temu
rodzic
commit
bb1555632b

+ 17 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/MzyZdChargeTypeController.java

@@ -225,4 +225,21 @@ public class MzyZdChargeTypeController {
         }
     }
 
+    @UserLoginToken
+    @RequestMapping(value = "/getZdChargeItemByMz", method = {RequestMethod.GET, RequestMethod.POST})
+    public Map<String, Object> getZdChargeItemByMz() {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            resultMap.put("code", 0);
+            resultMap.put("message", "查询所有的门诊收费类别成功");
+            resultMap.put("data", mzyZdChargeTypeService.selectZdChargeItemByMz());
+            return resultMap;
+        } catch (Exception e) {
+            log.error("查询所有的门诊收费类别失败,错误信息{}", e.getMessage());
+            resultMap.put("code", -1);
+            resultMap.put("message", "查询所有的门诊收费类别失败");
+            return resultMap;
+        }
+    }
+
 }

+ 4 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzyZdChargeType.java

@@ -39,4 +39,8 @@ public class MzyZdChargeType {
     private String isrubric;
     //提示内容
     private String rubricTxt;
+    //收费编码
+    private String chargeCode;
+    //收费类别
+    private String chargeCodeName;
 }

+ 12 - 4
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzyZdChargeTypeMapper.java

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.mapper.his.mz;
 
 import cn.hnthyy.thmz.entity.his.mz.MzyZdChargeType;
+import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -13,7 +14,7 @@ public interface MzyZdChargeTypeMapper {
      * 查询所有的号别
      * @return
      */
-    @Select("SELECT rtrim(code) code,rtrim(name) name,rtrim(py_code) py_code,rtrim(d_code) self_code,req_fee,clinic_fee,oth_fee,del_flag,rtrim(req_type) req_type,sort_no,print_flag,isrubric,rubric_txt FROM mzy_zd_charge_type WITH(NOLOCK) where (del_flag  <> 1  or del_flag is null )")
+    @Select("SELECT rtrim(code) code,rtrim(name) name,rtrim(py_code) py_code,rtrim(d_code) self_code,req_fee,clinic_fee,oth_fee,del_flag,rtrim(req_type) req_type,sort_no,print_flag,isrubric,rubric_txt,charge_code FROM mzy_zd_charge_type WITH(NOLOCK) where (del_flag  <> 1  or del_flag is null )")
     List<MzyZdChargeType> selectAllMzyZdChargeType();
 
     /**
@@ -21,7 +22,7 @@ public interface MzyZdChargeTypeMapper {
      * @param code
      * @return
      */
-    @Select("SELECT rtrim(code) code,rtrim(name) name,rtrim(py_code) py_code,rtrim(d_code) self_code,req_fee,clinic_fee,oth_fee,del_flag,rtrim(req_type) req_type,sort_no,print_flag,isrubric,rubric_txt FROM mzy_zd_charge_type WITH(NOLOCK) where code =#{code} ")
+    @Select("SELECT rtrim(code) code,rtrim(name) name,rtrim(py_code) py_code,rtrim(d_code) self_code,req_fee,clinic_fee,oth_fee,del_flag,rtrim(req_type) req_type,sort_no,print_flag,isrubric,rubric_txt,charge_code FROM mzy_zd_charge_type WITH(NOLOCK) where code =#{code} ")
     MzyZdChargeType selectByCode(@Param("code") String code);
 
 
@@ -100,6 +101,9 @@ public interface MzyZdChargeTypeMapper {
             "<when test='rubricTxt!=null'>",
             ",rubric_txt =#{rubricTxt}",
             "</when>",
+            "<when test='chargeCode!=null'>",
+            ",charge_code =#{chargeCode}",
+            "</when>",
             "</trim>",
             "</script>"})
     int updateMzyZdChargeType(MzyZdChargeType mzyZdChargeType);
@@ -110,7 +114,11 @@ public interface MzyZdChargeTypeMapper {
      * @return
      */
     @Insert("INSERT INTO mzy_zd_charge_type(code, name, py_code, d_code, req_fee, telreq_fee, clinic_fee, oth_fee, brochure_fee, " +
-            "back_fee, del_flag, req_type, sort_no, print_flag, qm_flag,isrubric,rubric_txt) VALUES" +
-            " (#{code}, #{name}, #{pyCode}, #{selfCode}, #{reqFee}, 0, #{clinicFee}, #{othFee}, 0, 0, #{delFlag}, #{reqType}, #{sortNo}, '1', NULL,#{isrubric},#{rubricTxt})")
+            "back_fee, del_flag, req_type, sort_no, print_flag, qm_flag,isrubric,rubric_txt,charge_code) VALUES" +
+            " (#{code}, #{name}, #{pyCode}, #{selfCode}, #{reqFee}, 0, #{clinicFee}, #{othFee}, 0, 0, #{delFlag}, #{reqType}, #{sortNo}, '1', NULL,#{isrubric},#{rubricTxt},#{chargeCode})")
     int insetMzyZdChargeType(MzyZdChargeType mzyZdChargeType);
+
+    @Select(" select rtrim(code) code, rtrim(name) name, charge_amount chargeAmount  from zd_charge_item where name like '%诊查%' and isnull(del_flag,'0') != 1 ")
+    List<ZdChargeItem> selectMzChargeItem();
+
 }

+ 3 - 0
src/main/java/cn/hnthyy/thmz/service/his/mz/MzyZdChargeTypeService.java

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.service.his.mz;
 
 import cn.hnthyy.thmz.entity.his.mz.MzyZdChargeType;
+import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
 
 import java.util.List;
 
@@ -51,4 +52,6 @@ public interface MzyZdChargeTypeService {
      * @return
      */
     String getNewCode();
+
+    List<ZdChargeItem> selectZdChargeItemByMz();
 }

+ 21 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzyZdChargeTypeServiceImpl.java

@@ -2,9 +2,11 @@ package cn.hnthyy.thmz.service.impl.his.mz;
 
 import cn.hnthyy.thmz.entity.his.mz.MzyZdChargeType;
 import cn.hnthyy.thmz.entity.his.mz.MzyZdReqtype;
+import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
 import cn.hnthyy.thmz.mapper.his.mz.MzyZdChargeTypeMapper;
 import cn.hnthyy.thmz.mapper.his.mz.MzyZdReqtypeMapper;
 import cn.hnthyy.thmz.service.his.mz.MzyZdChargeTypeService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -30,11 +32,25 @@ public class MzyZdChargeTypeServiceImpl implements MzyZdChargeTypeService {
         if (mzyZdReqtypes != null && mzyZdReqtypes.size() > 0) {
             mzyZdReqtypeMap = mzyZdReqtypes.stream().collect(Collectors.toMap(MzyZdReqtype::getCode, MzyZdReqtype::getName));
         }
+        List<ZdChargeItem> mzChargeItems = mzyZdChargeTypeMapper.selectMzChargeItem();
+        Map<String, ZdChargeItem> mzChargeItemMap = new HashMap<>();
+        if (mzChargeItems != null && !mzChargeItems.isEmpty()) {
+            mzChargeItemMap = mzChargeItems.stream().collect(Collectors.toMap(ZdChargeItem::getCode, zdChargeItem -> zdChargeItem));
+        }
         if (mzyZdReqtypeMap != null && mzyZdReqtypeMap.size() > 0 && mzyZdChargeTypes != null && mzyZdChargeTypes.size() > 0) {
                 for (MzyZdChargeType mzyZdChargeType:mzyZdChargeTypes){
                     mzyZdChargeType.setReqTypeName(mzyZdReqtypeMap.get(mzyZdChargeType.getReqType()));
         }
         }
+        assert mzyZdChargeTypes != null;
+        for (MzyZdChargeType mzyZdChargeType : mzyZdChargeTypes){
+            if(StringUtils.isNotBlank(mzyZdChargeType.getChargeCode())){
+                ZdChargeItem item = mzChargeItemMap.get(mzyZdChargeType.getChargeCode());
+                if(null != item){
+                    mzyZdChargeType.setChargeCodeName(item.getName() + '[' + item.getChargeAmount() + "¥]");
+                }
+            }
+        }
         return mzyZdChargeTypes;
     }
 
@@ -75,4 +91,9 @@ public class MzyZdChargeTypeServiceImpl implements MzyZdChargeTypeService {
         }
         return code.toString();
     }
+
+    @Override
+    public List<ZdChargeItem> selectZdChargeItemByMz() {
+        return mzyZdChargeTypeMapper.selectMzChargeItem();
+    }
 }

+ 35 - 1
src/main/resources/static/js/mz/request_type.js

@@ -5,6 +5,7 @@ $(function () {
     });
     initMzyZdChargeTypeList();
     initReqTypeSelect();
+    initChargeItemSelect();
 
     //新增号段
     $('#btn_add_work_time').click(function () {
@@ -74,7 +75,8 @@ $(function () {
                 "clinicFee": $("#clinicFee").val(),
                 "othFee": $("#otherFee").val(),
                 "isrubric":$("#isrubricSelect").val(),
-                "rubricTxt":$("#rubricTxt").val()
+                "rubricTxt":$("#rubricTxt").val(),
+                "chargeCode": $("#chargeCodeSelect").val()
             }),
             success: function (res) {
                 if (res == '401' || res == 401) {
@@ -153,6 +155,7 @@ function clearInput() {
     $("#clinicFee").val(null);
     $("#otherFee").val(null);
     $("#mzyZdChargeTypeCode").val(null);
+    $('#chargeCodeSelect').selectpicker('val', null);
 }
 
 
@@ -551,6 +554,11 @@ function initMzyZdChargeTypeList() {
                 title: '提示内容',
                 align: "center",
                 valign: 'middle'
+            }, {
+                field: 'chargeCodeName',
+                title: '收费类别',
+                align: "center",
+                valign: 'middle'
             }, {
                 title: '操作',
                 field: 'op',
@@ -673,6 +681,8 @@ function updateMzyZdChargeType(code) {
                 $("#isrubricSelect").selectpicker('val',!stringNotBlank(res.data.isrubric) ? '0':res.data.isrubric);
                 $('#isrubricSelect').selectpicker('refresh');
                 $("#mzyZdChargeTypeCode").val(code);
+                $('#chargeCodeSelect').selectpicker('val', res.data.chargeCode);
+                $('#chargeCodeSelect').selectpicker('refresh');
                 $("#editModal").modal();
             } else {
                 errorMesage(res);
@@ -742,4 +752,28 @@ function initReqTypeSelect() {
 sortNum = function (a, b) {
     var a = a ? a : -1, b = b ? b : -1
     return a - b
+}
+
+// 初始化收费类别
+function initChargeItemSelect(){
+    //初始化收费类别
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getZdChargeItemByMz',
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var html = '';
+            $.each(res.data, function (commentIndex, comment) {
+                html += '<option value="' + comment.code + '">' + comment.name + '[' + comment.chargeAmount + '¥]' + '</option>';
+            });
+            $('#chargeCodeSelect').empty();
+            $('#chargeCodeSelect').html(html);
+            $('#chargeCodeSelect').selectpicker('destroy').selectpicker('refresh');
+        }
+    });
 }

+ 8 - 0
src/main/resources/templates/mz/request_type.html

@@ -164,6 +164,14 @@
                             </select>
                         </div>
                     </div>
+                    <div class="item form-group thmz_alert">
+                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="chargeCodeSelect">收费类别
+                        </label>
+                        <div class="col-md-6 col-sm-6 col-xs-12">
+                            <select class="form-control selectpicker show-tick" title="请选择" id="chargeCodeSelect">
+                            </select>
+                        </div>
+                    </div>
                     <div class="item form-group thmz_alert">
                         <label class="control-label col-md-4 col-sm-4 col-xs-12" for="rubricTxt">提示内容 </span>
                         </label>