wuxw лет назад: 6
Родитель
Сommit
49712ee1c2

+ 1 - 0
Api/src/main/java/com/java110/api/listener/fee/SaveFeeConfigListener.java

@@ -93,6 +93,7 @@ public class SaveFeeConfigListener extends AbstractServiceApiListener {
         JSONObject businessFeeConfig = new JSONObject();
         businessFeeConfig.putAll(paramInJson);
         businessFeeConfig.put("configId", "-1");
+        businessFeeConfig.put("isDefault", "F");
         //计算 应收金额
         business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFeeConfig", businessFeeConfig);
         return business;

+ 14 - 0
Api/src/main/java/com/java110/api/listener/fee/UpdateFeeConfigListener.java

@@ -5,22 +5,30 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.api.listener.AbstractServiceApiListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
+import com.java110.core.smo.fee.IFeeConfigInnerServiceSMO;
+import com.java110.dto.fee.FeeConfigDto;
 import com.java110.entity.center.AppService;
 import com.java110.event.service.api.ServiceDataFlowEvent;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.CommonConstant;
 import com.java110.utils.constant.ServiceCodeFeeConfigConstant;
 import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.ResponseEntity;
 
+import java.util.List;
+
 /**
  * 保存费用项侦听
  * add by wuxw 2019-06-30
  */
 @Java110Listener("updateFeeConfigListener")
 public class UpdateFeeConfigListener extends AbstractServiceApiListener {
+    @Autowired
+    private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
+
     @Override
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
 
@@ -83,6 +91,11 @@ public class UpdateFeeConfigListener extends AbstractServiceApiListener {
      * @return 订单服务能够接受的报文
      */
     private JSONObject updateFeeConfig(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+        FeeConfigDto feeConfigDto = new FeeConfigDto();
+        feeConfigDto.setCommunityId(paramInJson.getString("communityId"));
+        feeConfigDto.setConfigId(paramInJson.getString("configId"));
+        List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
+        Assert.listOnlyOne(feeConfigDtos, "未找到该费用项");
 
 
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
@@ -91,6 +104,7 @@ public class UpdateFeeConfigListener extends AbstractServiceApiListener {
         business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
         JSONObject businessFeeConfig = new JSONObject();
         businessFeeConfig.putAll(paramInJson);
+        businessFeeConfig.put("isDefault", feeConfigDtos.get(0).getIsDefault());
         //计算 应收金额
         business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFeeConfig", businessFeeConfig);
         return business;

+ 2 - 2
WebService/src/main/resources/components/feePackage/edit-feeConfig/editFeeConfig.html

@@ -57,7 +57,7 @@
                                         </option>
                                     </select></div>
                             </div>
-                            <div class="form-group row" v-if="addFeeConfigInfo.computingFormula != '2002'">
+                            <div class="form-group row" v-if="editFeeConfigInfo.computingFormula != '2002'">
                                 <label class="col-sm-2 col-form-label">计费单价</label>
                                 <div class="col-sm-10">
                                     <input v-model="editFeeConfigInfo.squarePrice" type="text" placeholder="必填,请填写计费单价"
@@ -65,7 +65,7 @@
                                 </div>
                             </div>
                             <div class="form-group row">
-                                <label class="col-sm-2 col-form-label">{{addFeeConfigInfo.computingFormula == '1001' ?'附加费用':'固定费用'}}</label>
+                                <label class="col-sm-2 col-form-label">{{editFeeConfigInfo.computingFormula == '1001' ?'附加费用':'固定费用'}}</label>
                                 <div class="col-sm-10">
                                     <input v-model="editFeeConfigInfo.additionalAmount" type="text"
                                            placeholder="必填,请填写附加费用" class="form-control">

+ 5 - 1
WebService/src/main/resources/components/feePackage/edit-feeConfig/editFeeConfig.js

@@ -197,6 +197,8 @@
                 });
             },
             refreshEditFeeConfigInfo: function() {
+                var _feeTypeCds = vc.component.editFeeConfigInfo.feeTypeCds;
+                var _computingFormulas = vc.component.editFeeConfigInfo.computingFormulas;
                 vc.component.editFeeConfigInfo = {
                     configId: '',
                     feeTypeCd: '',
@@ -208,7 +210,9 @@
                     squarePrice: '',
                     additionalAmount: '',
                     isDefault:''
-                }
+                };
+                vc.component.editFeeConfigInfo.feeTypeCds = _feeTypeCds;
+                vc.component.editFeeConfigInfo.computingFormulas = _computingFormulas;
             }
         }
     });

+ 7 - 3
WebService/src/main/resources/components/feePackage/feeConfig-manage/feeConfigManage.html

@@ -25,7 +25,9 @@
                         <div class="col-sm-3">
                             <select class="custom-select" v-model="feeConfigManageInfo.conditions.feeTypeCd">
                                 <option selected value="">请选择费用类型</option>
-                                <option v-for="(item,index) in feeConfigManageInfo.feeTypeCds" :key="index" v-bind:value="item.statusCd">{{item.name}}</option>
+                                <option v-for="(item,index) in feeConfigManageInfo.feeTypeCds" :key="index"
+                                        v-bind:value="item.statusCd">{{item.name}}
+                                </option>
                             </select></div>
                         <div class="col-sm-1">
                             <button type="button" class="btn btn-primary btn-sm" v-on:click="_queryFeeConfigMethod()">
@@ -65,7 +67,7 @@
                             <th class="text-center">计费起始时间</th>
                             <th class="text-center">计费终止时间</th>
                             <th class="text-center">计费单价</th>
-                            <th class="text-center">附加费用</th>
+                            <th class="text-center">附加/固定费用</th>
                             <th class="text-center">操作</th>
 
 
@@ -79,7 +81,9 @@
                             <td class="text-center">{{feeConfig.feeFlagName}}</td>
                             <td class="text-center">{{feeConfig.startTime}}</td>
                             <td class="text-center">{{feeConfig.endTime}}</td>
-                            <td class="text-center">{{feeConfig.squarePrice}}元</td>
+                            <td class="text-center">{{feeConfig.computingFormula == '2002' ?
+                                '-':feeConfig.squarePrice+'元'}}
+                            </td>
                             <td class="text-center">{{feeConfig.additionalAmount}}元</td>
                             <td class="text-center">
                                 <div class="btn-group">

+ 10 - 10
java110-db/src/main/resources/mapper/fee/FeeConfigServiceDaoImplMapper.xml

@@ -50,10 +50,10 @@
         <if test="feeName !=null and feeName != ''">
             and t.fee_name= #{feeName}
         </if>
-        <if test="startTime !=null and startTime != ''">
+        <if test="startTime !=null ">
             and t.start_time= #{startTime}
         </if>
-        <if test="endTime !=null and endTime != ''">
+        <if test="endTime !=null ">
             and t.end_time= #{endTime}
         </if>
         <if test="communityId !=null and communityId != ''">
@@ -98,10 +98,10 @@
         <if test="feeName !=null and feeName != ''">
             and t.fee_name= #{feeName}
         </if>
-        <if test="startTime !=null and startTime != ''">
+        <if test="startTime !=null ">
             and t.start_time= #{startTime}
         </if>
-        <if test="endTime !=null and endTime != ''">
+        <if test="endTime !=null ">
             and t.end_time= #{endTime}
         </if>
         <if test="communityId !=null and communityId != ''">
@@ -157,10 +157,10 @@
         <if test="feeName !=null and feeName != ''">
             and t.fee_name= #{feeName}
         </if>
-        <if test="startTime !=null and startTime != ''">
+        <if test="startTime !=null ">
             and t.start_time= #{startTime}
         </if>
-        <if test="endTime !=null and endTime != ''">
+        <if test="endTime !=null ">
             and t.end_time= #{endTime}
         </if>
         <if test="communityId !=null and communityId != ''">
@@ -204,10 +204,10 @@
         <if test="feeName !=null and feeName != ''">
             , t.fee_name= #{feeName}
         </if>
-        <if test="startTime !=null and startTime != ''">
+        <if test="startTime !=null ">
             , t.start_time= #{startTime}
         </if>
-        <if test="endTime !=null and endTime != ''">
+        <if test="endTime !=null ">
             , t.end_time= #{endTime}
         </if>
         <if test="communityId !=null and communityId != ''">
@@ -261,10 +261,10 @@
         <if test="feeName !=null and feeName != ''">
             and t.fee_name= #{feeName}
         </if>
-        <if test="startTime !=null and startTime != ''">
+        <if test="startTime !=null ">
             and t.start_time= #{startTime}
         </if>
-        <if test="endTime !=null and endTime != ''">
+        <if test="endTime !=null ">
             and t.end_time= #{endTime}
         </if>
         <if test="communityId !=null and communityId != ''">