Przeglądaj źródła

增加收费比例设置

hurugang 4 lat temu
rodzic
commit
635ea055ce

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

@@ -611,6 +611,9 @@ public class MzChargeDetailController {
                 returnMzChargeDetail.setPriceTime(md.getPriceTime());
             }
             BigDecimal price= (md.getUnitPrice() == null ? BigDecimal.ZERO : md.getUnitPrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
+            if(BigDecimal.ZERO.compareTo(price)==0){
+                price=BigDecimal.valueOf(0.01);
+            }
             BigDecimal tempAmount = price.multiply(BigDecimal.valueOf(md.getQuantity() == null ? 1D : md.getQuantity())).multiply(BigDecimal.valueOf(md.getDrugWin() == null ? 1D : md.getDrugWin()));
             returnMzChargeDetail.setAmount(returnMzChargeDetail.getAmount().add(tempAmount));
         }

+ 13 - 0
src/main/java/cn/hnthyy/thmz/controller/ZdChargeItemController.java

@@ -266,6 +266,19 @@ public class ZdChargeItemController {
                 resultMap.put("message", "是否加价不能为空");
                 return resultMap;
             }
+            if(YesNoEnum.YES.code.equals(zdChargeItem.getCo())){
+                if(StringUtils.isBlank(zdChargeItem.getXlCode())){
+                    resultMap.put("code", -1);
+                    resultMap.put("message", "加价率不能为空");
+                    return resultMap;
+                }
+                Double xlCode = Double.valueOf(zdChargeItem.getXlCode());
+                if(xlCode==null){
+                    resultMap.put("code", -1);
+                    resultMap.put("message", "加价率格式不正确");
+                    return resultMap;
+                }
+            }
             if(StringUtils.isBlank(zdChargeItem.getAuditCode())){
                 resultMap.put("code", -1);
                 resultMap.put("message", "核算码不能为空");

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/ZdChargeItem.java

@@ -110,6 +110,8 @@ public class ZdChargeItem {
     private String execUnitName;
     //是否加价
     private Integer co;
+    //加价比例
+    private String xlCode;
     //操作用户idcode
     private String operId;
 }

+ 8 - 5
src/main/java/cn/hnthyy/thmz/mapper/his/ZdChargeItemMapper.java

@@ -23,7 +23,7 @@ public interface ZdChargeItemMapper {
                     "            rtrim(self_flag) self_flag,rtrim(separate_flag) separate_flag,rtrim(suppress_flag) suppress_flag,py_code,d_code wb_code,bill_item_zy,bill_item_mz," +
                     "            charge_unit,percent_group_zy,percent_group_mz,rtrim(in_out_flag) in_out_flag,n_code yn_code,class_code,s_code bz_code,discription,rtrim(del_flag) del_flag," +
                     "            rtrim(yp_flag) yp_flag,bill_item_code,rtrim(xnh_flag) xnh_flag,add_date,hnsyb_code,hnsyb_name,xnh_code,xnh_name,xnh_ratio,xnh_quotamoney,rtrim(xnh_status) xnh_status," +
-                    "            yb_flag_new,yb_comment_new,yb_bl_new,charge_amount_lwg,percent_group_1  percent_group1,yb_name,yb_comment,cl_code,e_code yb_code,co FROM (SELECT ROW_NUMBER() OVER (ORDER BY zd_charge_item_page.add_date desc) ",
+                    "            yb_flag_new,yb_comment_new,yb_bl_new,charge_amount_lwg,percent_group_1  percent_group1,yb_name,yb_comment,cl_code,e_code yb_code,co,xl_code FROM (SELECT ROW_NUMBER() OVER (ORDER BY zd_charge_item_page.add_date desc) ",
             "AS RowNumber,* from dbo.zd_charge_item zd_charge_item_page where 1=1 ",
             "<when test='zdChargeItem.delFlag!=null'>",
             " and del_flag =#{zdChargeItem.delFlag}",
@@ -100,7 +100,7 @@ public interface ZdChargeItemMapper {
             "rtrim(self_flag) self_flag,rtrim(separate_flag) separate_flag,rtrim(suppress_flag) suppress_flag,py_code,d_code wb_code,bill_item_zy,bill_item_mz," +
             "charge_unit,percent_group_zy,percent_group_mz,rtrim(in_out_flag) in_out_flag,n_code yn_code,class_code,s_code bz_code,discription,rtrim(del_flag) del_flag, " +
             "rtrim(yp_flag) yp_flag,bill_item_code,rtrim(xnh_flag) xnh_flag,add_date,hnsyb_code,hnsyb_name,xnh_code,xnh_name,xnh_ratio,xnh_quotamoney,rtrim(xnh_status) xnh_status," +
-            "yb_flag_new,yb_comment_new,yb_bl_new,e_code yb_code,cl_code,co from zd_charge_item where  code = #{code,jdbcType=VARCHAR} ")
+            "yb_flag_new,yb_comment_new,yb_bl_new,e_code yb_code,cl_code,co,xl_code from zd_charge_item where  code = #{code,jdbcType=VARCHAR} ")
        //     " and (del_flag != 1 or del_flag is null) " )
     ZdChargeItem selectZdChargeItemByCode(@Param("code") String code);
 
@@ -118,7 +118,7 @@ public interface ZdChargeItemMapper {
             "charge_unit,percent_group_zy,percent_group_mz,rtrim(in_out_flag) in_out_flag,n_code yn_code,class_code,s_code bz_code,discription,rtrim(del_flag) del_flag, ",
             "rtrim(yp_flag) yp_flag,bill_item_code,rtrim(xnh_flag) xnh_flag,add_date,hnsyb_code,hnsyb_name,xnh_code,xnh_name,xnh_ratio,xnh_quotamoney,rtrim(xnh_status) xnh_status,",
            // "yb_flag_new,yb_comment_new,yb_bl_new from zd_charge_item where (del_flag != 1 or del_flag is null) ",
-            "yb_flag_new,yb_comment_new,yb_bl_new,e_code yb_code,cl_code,co from zd_charge_item  ",
+            "yb_flag_new,yb_comment_new,yb_bl_new,e_code yb_code,cl_code,co,xl_code from zd_charge_item  ",
             "<when test='codes!=null'>",
             " where code in",
             "<foreach item='item' index='index' collection='codes' open='(' separator=',' close=')'>",
@@ -144,10 +144,10 @@ public interface ZdChargeItemMapper {
      */
     @Insert("INSERT INTO zd_charge_item ( code, name, charge_amount, percentag1, percentag2, percentag3, percentag4, percentag5, self_flag, separate_flag," +
             " suppress_flag, py_code, d_code, del_flag, charge_unit, percent_group_mz, class_code, e_code, s_code, add_date, xnh_code, xnh_name,audit_code," +
-            "bill_item_mz,bill_item_zy,exec_unit,s_code,discription,cl_code,co,oper_id ) VALUES (" +
+            "bill_item_mz,bill_item_zy,exec_unit,discription,cl_code,co,oper_id,xl_code ) VALUES (" +
             " #{code}, #{name}, #{chargeAmount}, #{percentag1}, #{percentag2}, #{percentag3}, #{percentag4}, #{percentag5}, #{selfFlag}, #{separateFlag}, " +
             "#{suppressFlag}, #{pyCode}, #{wbCode}, #{delFlag}, #{chargeUnit}, #{percentGroupMz}, #{classCode}, #{ybCode}, #{bzCode}, #{addDate}, #{xnhCode}, #{xnhName}" +
-            ",#{auditCode},#{billItemMz},#{billItemZy},#{execUnit},#{bzCode} ,#{discription}, #{clCode},#{co},#{operId}  )")
+            ",#{auditCode},#{billItemMz},#{billItemZy},#{execUnit} ,#{discription}, #{clCode},#{co},#{operId},#{xlCode}  )")
     int insertZdChargeItem(ZdChargeItem zdChargeItem);
 
 
@@ -230,6 +230,9 @@ public interface ZdChargeItemMapper {
             "<when test='co!=null'>",
             ",co =#{co}",
             "</when>",
+            "<when test='xlCode!=null'>",
+            ",xl_code =#{xlCode}",
+            "</when>",
             "<when test='operId!=null'>",
             ",oper_id =#{operId}",
             "</when>",

+ 21 - 7
src/main/resources/static/js/charge_detail.js

@@ -134,7 +134,7 @@ function initZdChargeItemList() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    if (value != null && value != undefined) {
+                    if (value != null && value != undefined && value!="") {
                         return value.toFixed(2);
                     }
                     return "";
@@ -146,7 +146,7 @@ function initZdChargeItemList() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    if (value != null && value != undefined) {
+                    if (value != null && value != undefined && value!="") {
                         return value.toFixed(2);
                     }
                     return "";
@@ -157,7 +157,7 @@ function initZdChargeItemList() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    if (value != null && value != undefined) {
+                    if (value != null && value != undefined && value!="") {
                         return value.toFixed(2);
                     }
                     return "";
@@ -168,7 +168,7 @@ function initZdChargeItemList() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    if (value != null && value != undefined) {
+                    if (value != null && value != undefined && value!="") {
                         return value.toFixed(2);
                     }
                     return "";
@@ -179,7 +179,7 @@ function initZdChargeItemList() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    if (value != null && value != undefined) {
+                    if (value != null && value != undefined && value!="") {
                         return value.toFixed(2);
                     }
                     return "";
@@ -190,7 +190,7 @@ function initZdChargeItemList() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    if (value != null && value != undefined) {
+                    if (value != null && value != undefined && value!="") {
                         return value.toFixed(2);
                     }
                 }
@@ -289,6 +289,17 @@ function initZdChargeItemList() {
                         return "是";
                     }
                 }
+            }, {
+                field: 'xlCode',
+                title: '加价率',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    if (value != null && value != undefined && value!="") {
+                        return parseFloat(value).toFixed(2);
+                    }
+                    return "";
+                }
             }
             , {
                 field: 'execUnitName',
@@ -641,6 +652,7 @@ function updateZdChargeItem(code) {
                 $("#clCodeParams").val(res.data.clCode);
                 $('#coParams').selectpicker('val', res.data.co);
                 $('#coParams').selectpicker('refresh');
+                $("#xlCodeParams").val(res.data.xlCode);
                 $("#code").val(res.data.code);
                 $("div.bs-example-modal-lg").modal();
             } else {
@@ -700,7 +712,8 @@ $('#save').click(function () {
             "percentag3": $("#percentag3Params").val(),"percentag4": $("#percentag4Params").val(),"percentag5": $("#percentag5Params").val(),
             "auditCode": $("#auditCodeParams").val(),"billItemMz": $("#billItemMzParams").val(),
             "billItemZy": $("#billItemZyParams").val(),"execUnit": $("#execUnitParams").val(),"bzCode": $("#bzCodeParams").val(),
-            "discription": $("#discriptionParams").val(),"clCode": $("#clCodeParams").val(),"co": $("#coParams").val(),"code": $("#code").val()}),
+            "discription": $("#discriptionParams").val(),"clCode": $("#clCodeParams").val(),"co": $("#coParams").val(),"xlCode": $("#xlCodeParams").val(),
+            "code": $("#code").val()}),
         success: function (res) {
             if (res == '401' || res == 401) {
                 window.location.href = '/thmz/login/view'
@@ -750,5 +763,6 @@ function clearInput() {
     $("#clCodeParams").val(null);
     $('#coParams').selectpicker('val', 0);
     $('#coParams').selectpicker('refresh');
+    $("#xlCodeParams").val(null);
     $("#code").val(null);
 }

+ 8 - 0
src/main/resources/templates/charge_detail.html

@@ -239,6 +239,14 @@
                                             id="coParams" title="请选择"></select>
                                 </div>
                             </div>
+                            <div class="item form-group">
+                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="xlCodeParams">加价率
+                                </label>
+                                <div class="col-md-6 col-sm-6 col-xs-12">
+                                    <input type="number" id="xlCodeParams"
+                                           class="form-control col-md-7 col-xs-12">
+                                </div>
+                            </div>
                             <div class="item form-group">
                                 <label class="control-label col-md-3 col-sm-3 col-xs-12" for="auditCodeParams">核算码 <span
                                         class="required">*</span></label>