Sfoglia il codice sorgente

优化 临时车收费标准时加入 普通收费标准

java110 4 anni fa
parent
commit
37a97e9ece

+ 6 - 0
java110-bean/src/main/java/com/java110/dto/fee/FeeConfigDto.java

@@ -28,10 +28,16 @@ public class FeeConfigDto extends PageDto implements Serializable {
     public static final String FEE_TYPE_CD_METER = "888800010015";//水费
     public static final String FEE_TYPE_CD_METER = "888800010015";//水费
     public static final String FEE_TYPE_CD_GAS = "888800010009";//煤气
     public static final String FEE_TYPE_CD_GAS = "888800010009";//煤气
     public static final String FEE_TYPE_CD_SYSTEM = "888800010000";//系统
     public static final String FEE_TYPE_CD_SYSTEM = "888800010000";//系统
+    public static final String FEE_TYPE_CD_PARKING = "888800010008";//系统
 
 
     public static final String CONFIG_ID_RENTING = "920000000000000000";//租赁费用项
     public static final String CONFIG_ID_RENTING = "920000000000000000";//租赁费用项
     public static final String CONFIG_ID_GOODS = "930000000000000000";//商品费用项
     public static final String CONFIG_ID_GOODS = "930000000000000000";//商品费用项
 
 
+    public static final String COMPUTING_FORMULA_TEMP_CAR = "9999";
+
+    public static final String PAYMENT_CD_PRE = "1200";
+    public static final String PAYMENT_CD_AFTER = "2100";
+
 
 
 
 
     private String feeTypeCd;
     private String feeTypeCd;

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/tempCarFeeConfig/TempCarFeeConfigDto.java

@@ -27,6 +27,7 @@ public class TempCarFeeConfigDto extends PageDto implements Serializable {
     private String ruleId;
     private String ruleId;
     private String ruleName;
     private String ruleName;
     private String communityId;
     private String communityId;
+    private String feeConfigId;
 
 
     private List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrs;
     private List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrs;
 
 
@@ -148,4 +149,12 @@ public class TempCarFeeConfigDto extends PageDto implements Serializable {
     public void setTempCarFeeConfigAttrs(List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrs) {
     public void setTempCarFeeConfigAttrs(List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrs) {
         this.tempCarFeeConfigAttrs = tempCarFeeConfigAttrs;
         this.tempCarFeeConfigAttrs = tempCarFeeConfigAttrs;
     }
     }
+
+    public String getFeeConfigId() {
+        return feeConfigId;
+    }
+
+    public void setFeeConfigId(String feeConfigId) {
+        this.feeConfigId = feeConfigId;
+    }
 }
 }

+ 7 - 0
java110-bean/src/main/java/com/java110/po/tempCarFeeConfig/TempCarFeeConfigPo.java

@@ -13,6 +13,7 @@ public class TempCarFeeConfigPo implements Serializable {
     private String endTime;
     private String endTime;
     private String ruleId;
     private String ruleId;
     private String communityId;
     private String communityId;
+    private String feeConfigId;
 
 
     public String getCarType() {
     public String getCarType() {
         return carType;
         return carType;
@@ -86,5 +87,11 @@ public class TempCarFeeConfigPo implements Serializable {
         this.communityId = communityId;
         this.communityId = communityId;
     }
     }
 
 
+    public String getFeeConfigId() {
+        return feeConfigId;
+    }
 
 
+    public void setFeeConfigId(String feeConfigId) {
+        this.feeConfigId = feeConfigId;
+    }
 }
 }

+ 12 - 6
java110-db/src/main/resources/mapper/fee/TempCarFeeConfigServiceDaoImplMapper.xml

@@ -7,9 +7,9 @@
     <!-- 保存临时车收费标准信息 add by wuxw 2018-07-03 -->
     <!-- 保存临时车收费标准信息 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessTempCarFeeConfigInfo" parameterType="Map">
     <insert id="saveBusinessTempCarFeeConfigInfo" parameterType="Map">
         insert into business_temp_car_fee_config(
         insert into business_temp_car_fee_config(
-        car_type,operate,config_id,fee_name,pa_id,area_num,start_time,end_time,b_id,rule_id,community_id
+        car_type,operate,config_id,fee_name,pa_id,area_num,start_time,end_time,b_id,rule_id,community_id,fee_config_id
         ) values (
         ) values (
-        #{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId}
+        #{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId},#{feeConfigId}
         )
         )
     </insert>
     </insert>
 
 
@@ -19,7 +19,7 @@
         select t.car_type,t.car_type carType,t.operate,t.config_id,t.config_id configId,t.fee_name,t.fee_name
         select t.car_type,t.car_type carType,t.operate,t.config_id,t.config_id configId,t.fee_name,t.fee_name
         feeName,t.pa_id,t.pa_id paId,t.area_num,t.area_num areaNum,t.start_time,t.start_time
         feeName,t.pa_id,t.pa_id paId,t.area_num,t.area_num areaNum,t.start_time,t.start_time
         startTime,t.end_time,t.end_time endTime,t.b_id,t.b_id bId,t.rule_id,t.rule_id
         startTime,t.end_time,t.end_time endTime,t.b_id,t.b_id bId,t.rule_id,t.rule_id
-        ruleId,t.community_id,t.community_id communityId
+        ruleId,t.community_id,t.community_id communityId,t.fee_config_id,t.fee_config_id feeConfigId
         from business_temp_car_fee_config t
         from business_temp_car_fee_config t
         where 1 =1
         where 1 =1
         <if test="carType !=null and carType != ''">
         <if test="carType !=null and carType != ''">
@@ -62,9 +62,9 @@
     <!-- 保存临时车收费标准信息至 instance表中 add by wuxw 2018-07-03 -->
     <!-- 保存临时车收费标准信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveTempCarFeeConfigInfoInstance" parameterType="Map">
     <insert id="saveTempCarFeeConfigInfoInstance" parameterType="Map">
         insert into temp_car_fee_config(
         insert into temp_car_fee_config(
-        car_type,config_id,fee_name,pa_id,area_num,status_cd,start_time,end_time,b_id,rule_id,community_id
+        car_type,config_id,fee_name,pa_id,area_num,status_cd,start_time,end_time,b_id,rule_id,community_id,fee_config_id
         ) select
         ) select
-        t.car_type,t.config_id,t.fee_name,t.pa_id,t.area_num,'0',t.start_time,t.end_time,t.b_id,t.rule_id,t.community_id
+        t.car_type,t.config_id,t.fee_name,t.pa_id,t.area_num,'0',t.start_time,t.end_time,t.b_id,t.rule_id,t.community_id,t.fee_config_id
         from business_temp_car_fee_config t where 1=1
         from business_temp_car_fee_config t where 1=1
         <if test="carType !=null and carType != ''">
         <if test="carType !=null and carType != ''">
             and t.car_type= #{carType}
             and t.car_type= #{carType}
@@ -106,7 +106,7 @@
         select t.car_type,t.car_type carType,t.config_id,t.config_id configId,t.fee_name,t.fee_name
         select t.car_type,t.car_type carType,t.config_id,t.config_id configId,t.fee_name,t.fee_name
         feeName,t.pa_id,t.pa_id paId,t.area_num,t.area_num areaNum,t.status_cd,t.status_cd
         feeName,t.pa_id,t.pa_id paId,t.area_num,t.area_num areaNum,t.status_cd,t.status_cd
         statusCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.b_id,t.b_id bId,t.rule_id,t.rule_id
         statusCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.b_id,t.b_id bId,t.rule_id,t.rule_id
-        ruleId,t.community_id,t.community_id communityId,tcfr.rule_name ruleName,td.name carTypeName
+        ruleId,t.community_id,t.community_id communityId,tcfr.rule_name ruleName,td.name carTypeName,t.fee_config_id,t.fee_config_id feeConfigId
         from temp_car_fee_config t
         from temp_car_fee_config t
         left join temp_car_fee_rule tcfr on t.rule_id = tcfr.rule_id and tcfr.status_cd = '0'
         left join temp_car_fee_rule tcfr on t.rule_id = tcfr.rule_id and tcfr.status_cd = '0'
         left join t_dict td on t.car_type = td.status_cd and td.table_name = 'temp_car_fee_config' and td.table_columns = 'car_type'
         left join t_dict td on t.car_type = td.status_cd and td.table_name = 'temp_car_fee_config' and td.table_columns = 'car_type'
@@ -144,6 +144,9 @@
         <if test="communityId !=null and communityId != ''">
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
             and t.community_id= #{communityId}
         </if>
         </if>
+        <if test="feeConfigId !=null and feeConfigId != ''">
+            and t.fee_config_id= #{feeConfigId}
+        </if>
         order by t.create_time desc
         order by t.create_time desc
         <if test="page != -1 and page != null ">
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
             limit #{page}, #{row}
@@ -230,6 +233,9 @@
         <if test="communityId !=null and communityId != ''">
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
             and t.community_id= #{communityId}
         </if>
         </if>
+        <if test="feeConfigId !=null and feeConfigId != ''">
+            and t.fee_config_id= #{feeConfigId}
+        </if>
     </select>
     </select>
     <!-- 查询临时车 收费规则 -->
     <!-- 查询临时车 收费规则 -->
     <select id="queryTempCarFeeRules" parameterType="Map" resultType="Map">
     <select id="queryTempCarFeeRules" parameterType="Map" resultType="Map">

+ 31 - 1
service-api/src/main/java/com/java110/api/listener/fee/SaveTempCarFeeConfigListener.java

@@ -2,16 +2,22 @@ package com.java110.api.listener.fee;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.fee.IFeeBMO;
 import com.java110.api.bmo.tempCarFeeConfig.ITempCarFeeConfigBMO;
 import com.java110.api.bmo.tempCarFeeConfig.ITempCarFeeConfigBMO;
 import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO;
 import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO;
 import com.java110.api.listener.AbstractServiceApiPlusListener;
 import com.java110.api.listener.AbstractServiceApiPlusListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.fee.FeeConfigDto;
+import com.java110.dto.fee.FeeDto;
 import com.java110.dto.parking.ParkingAreaDto;
 import com.java110.dto.parking.ParkingAreaDto;
 import com.java110.intf.community.IParkingAreaInnerServiceSMO;
 import com.java110.intf.community.IParkingAreaInnerServiceSMO;
+import com.java110.po.fee.PayFeeConfigPo;
 import com.java110.utils.constant.ServiceCodeTempCarFeeConfigConstant;
 import com.java110.utils.constant.ServiceCodeTempCarFeeConfigConstant;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpMethod;
 
 
@@ -26,6 +32,10 @@ public class SaveTempCarFeeConfigListener extends AbstractServiceApiPlusListener
 
 
     @Autowired
     @Autowired
     private ITempCarFeeConfigBMO tempCarFeeConfigBMOImpl;
     private ITempCarFeeConfigBMO tempCarFeeConfigBMOImpl;
+
+    @Autowired
+    private IFeeBMO feeBMOImpl;
+
     @Autowired
     @Autowired
     private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl;
     private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl;
 
 
@@ -56,11 +66,31 @@ public class SaveTempCarFeeConfigListener extends AbstractServiceApiPlusListener
 
 
     @Override
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
+        reqJson.put("feeConfigId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configId));
         tempCarFeeConfigBMOImpl.addTempCarFeeConfig(reqJson, context);
         tempCarFeeConfigBMOImpl.addTempCarFeeConfig(reqJson, context);
 
 
         //处理房屋属性
         //处理房屋属性
         dealAttr(reqJson, context);
         dealAttr(reqJson, context);
+
+        //补费用项数据
+        PayFeeConfigPo payFeeConfigPo = new PayFeeConfigPo();
+        payFeeConfigPo.setAdditionalAmount("0");
+        payFeeConfigPo.setBillType(FeeConfigDto.BILL_TYPE_YEAR);
+        payFeeConfigPo.setCommunityId(reqJson.getString("communityId"));
+        payFeeConfigPo.setComputingFormula(FeeConfigDto.COMPUTING_FORMULA_TEMP_CAR);
+        payFeeConfigPo.setComputingFormulaText("");
+        payFeeConfigPo.setConfigId(reqJson.getString("feeConfigId"));
+        payFeeConfigPo.setEndTime(reqJson.getString("endTime"));
+        payFeeConfigPo.setStartTime(reqJson.getString("startTime"));
+        payFeeConfigPo.setFeeFlag(FeeDto.FEE_FLAG_ONCE);
+        payFeeConfigPo.setFeeName(reqJson.getString("feeName"));
+        payFeeConfigPo.setFeeTypeCd(FeeConfigDto.FEE_TYPE_CD_PARKING);
+        payFeeConfigPo.setIsDefault(FeeConfigDto.DEFAULT_FEE_CONFIG);
+        payFeeConfigPo.setPaymentCd(FeeConfigDto.PAYMENT_CD_PRE);
+        payFeeConfigPo.setPaymentCycle("1");
+        payFeeConfigPo.setSquarePrice("0");
+
+        feeBMOImpl.addFeeConfig(BeanConvertUtil.beanCovertJson(payFeeConfigPo), context);
     }
     }
 
 
     private void dealAttr(JSONObject reqJson, DataFlowContext context) {
     private void dealAttr(JSONObject reqJson, DataFlowContext context) {

+ 31 - 0
service-api/src/main/java/com/java110/api/listener/fee/UpdateTempCarFeeConfigListener.java

@@ -2,18 +2,27 @@ package com.java110.api.listener.fee;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.fee.IFeeBMO;
 import com.java110.api.bmo.tempCarFeeConfig.ITempCarFeeConfigBMO;
 import com.java110.api.bmo.tempCarFeeConfig.ITempCarFeeConfigBMO;
 import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO;
 import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO;
 import com.java110.api.listener.AbstractServiceApiPlusListener;
 import com.java110.api.listener.AbstractServiceApiPlusListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.dto.fee.FeeConfigDto;
+import com.java110.dto.fee.FeeDto;
+import com.java110.dto.tempCarFeeConfig.TempCarFeeConfigDto;
+import com.java110.intf.fee.ITempCarFeeConfigInnerServiceSMO;
+import com.java110.po.fee.PayFeeConfigPo;
 import com.java110.utils.constant.ServiceCodeTempCarFeeConfigConstant;
 import com.java110.utils.constant.ServiceCodeTempCarFeeConfigConstant;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.StringUtil;
 import com.java110.utils.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpMethod;
 
 
+import java.util.List;
+
 /**
 /**
  * 保存临时车收费标准侦听
  * 保存临时车收费标准侦听
  * add by wuxw 2019-06-30
  * add by wuxw 2019-06-30
@@ -24,9 +33,15 @@ public class UpdateTempCarFeeConfigListener extends AbstractServiceApiPlusListen
     @Autowired
     @Autowired
     private ITempCarFeeConfigBMO tempCarFeeConfigBMOImpl;
     private ITempCarFeeConfigBMO tempCarFeeConfigBMOImpl;
 
 
+    @Autowired
+    private ITempCarFeeConfigInnerServiceSMO tempCarFeeConfigInnerServiceSMOImpl;
+
     @Autowired
     @Autowired
     private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl;
     private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl;
 
 
+    @Autowired
+    private IFeeBMO feeBMOImpl;
+
     @Override
     @Override
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
 
 
@@ -44,6 +59,13 @@ public class UpdateTempCarFeeConfigListener extends AbstractServiceApiPlusListen
     @Override
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
 
 
+        TempCarFeeConfigDto tempCarFeeConfigDto = new TempCarFeeConfigDto();
+        tempCarFeeConfigDto.setConfigId(reqJson.getString("configId"));
+        tempCarFeeConfigDto.setCommunityId(reqJson.getString("communityId"));
+        List<TempCarFeeConfigDto> tempCarFeeConfigDtos = tempCarFeeConfigInnerServiceSMOImpl.queryTempCarFeeConfigs(tempCarFeeConfigDto);
+
+        Assert.listOnlyOne(tempCarFeeConfigDtos, "临时车收费标准不存在");
+
         tempCarFeeConfigBMOImpl.updateTempCarFeeConfig(reqJson, context);
         tempCarFeeConfigBMOImpl.updateTempCarFeeConfig(reqJson, context);
 
 
         JSONArray attrs = reqJson.getJSONArray("attrs");
         JSONArray attrs = reqJson.getJSONArray("attrs");
@@ -63,6 +85,15 @@ public class UpdateTempCarFeeConfigListener extends AbstractServiceApiPlusListen
             }
             }
             tempCarFeeConfigAttrBMOImpl.updateTempCarFeeConfigAttr(attr, context);
             tempCarFeeConfigAttrBMOImpl.updateTempCarFeeConfigAttr(attr, context);
         }
         }
+        //补费用项数据
+        PayFeeConfigPo payFeeConfigPo = new PayFeeConfigPo();
+
+        payFeeConfigPo.setCommunityId(reqJson.getString("communityId"));
+        payFeeConfigPo.setConfigId(tempCarFeeConfigDtos.get(0).getFeeConfigId());
+        payFeeConfigPo.setEndTime(reqJson.getString("endTime"));
+        payFeeConfigPo.setStartTime(reqJson.getString("startTime"));
+        payFeeConfigPo.setFeeName(reqJson.getString("feeName"));
+        feeBMOImpl.updateFeeConfig(BeanConvertUtil.beanCovertJson(payFeeConfigPo), context);
     }
     }
 
 
     @Override
     @Override

+ 2 - 0
service-fee/src/main/java/com/java110/fee/listener/tempCarFeeConfig/AbstractTempCarFeeConfigBusinessServiceDataFlowListener.java

@@ -47,6 +47,7 @@ public abstract class AbstractTempCarFeeConfigBusinessServiceDataFlowListener ex
         businessTempCarFeeConfigInfo.put("endTime", businessTempCarFeeConfigInfo.get("end_time"));
         businessTempCarFeeConfigInfo.put("endTime", businessTempCarFeeConfigInfo.get("end_time"));
         businessTempCarFeeConfigInfo.put("ruleId", businessTempCarFeeConfigInfo.get("rule_id"));
         businessTempCarFeeConfigInfo.put("ruleId", businessTempCarFeeConfigInfo.get("rule_id"));
         businessTempCarFeeConfigInfo.put("communityId", businessTempCarFeeConfigInfo.get("community_id"));
         businessTempCarFeeConfigInfo.put("communityId", businessTempCarFeeConfigInfo.get("community_id"));
+        businessTempCarFeeConfigInfo.put("feeConfigId", businessTempCarFeeConfigInfo.get("fee_config_id"));
         businessTempCarFeeConfigInfo.remove("bId");
         businessTempCarFeeConfigInfo.remove("bId");
         businessTempCarFeeConfigInfo.put("statusCd", statusCd);
         businessTempCarFeeConfigInfo.put("statusCd", statusCd);
     }
     }
@@ -81,6 +82,7 @@ public abstract class AbstractTempCarFeeConfigBusinessServiceDataFlowListener ex
         currentTempCarFeeConfigInfo.put("endTime", currentTempCarFeeConfigInfo.get("end_time"));
         currentTempCarFeeConfigInfo.put("endTime", currentTempCarFeeConfigInfo.get("end_time"));
         currentTempCarFeeConfigInfo.put("ruleId", currentTempCarFeeConfigInfo.get("rule_id"));
         currentTempCarFeeConfigInfo.put("ruleId", currentTempCarFeeConfigInfo.get("rule_id"));
         currentTempCarFeeConfigInfo.put("communityId", currentTempCarFeeConfigInfo.get("community_id"));
         currentTempCarFeeConfigInfo.put("communityId", currentTempCarFeeConfigInfo.get("community_id"));
+        currentTempCarFeeConfigInfo.put("feeConfigId", currentTempCarFeeConfigInfo.get("fee_config_id"));
 
 
 
 
         currentTempCarFeeConfigInfo.put("operate", StatusConstant.OPERATE_DEL);
         currentTempCarFeeConfigInfo.put("operate", StatusConstant.OPERATE_DEL);