Explorar el Código

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

java110 hace 4 años
padre
commit
5c8ea097a6

+ 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_GAS = "888800010009";//煤气
     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_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;

+ 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 ruleName;
     private String communityId;
+    private String feeConfigId;
 
     private List<TempCarFeeConfigAttrDto> tempCarFeeConfigAttrs;
 
@@ -148,4 +149,12 @@ public class TempCarFeeConfigDto extends PageDto implements Serializable {
     public void setTempCarFeeConfigAttrs(List<TempCarFeeConfigAttrDto> 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 ruleId;
     private String communityId;
+    private String feeConfigId;
 
     public String getCarType() {
         return carType;
@@ -86,5 +87,11 @@ public class TempCarFeeConfigPo implements Serializable {
         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 -->
     <insert id="saveBusinessTempCarFeeConfigInfo" parameterType="Map">
         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 (
-        #{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId}
+        #{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId},#{feeConfigId}
         )
     </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
         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
-        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
         where 1 =1
         <if test="carType !=null and carType != ''">
@@ -62,9 +62,9 @@
     <!-- 保存临时车收费标准信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveTempCarFeeConfigInfoInstance" parameterType="Map">
         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
-        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
         <if test="carType !=null and 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
         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
-        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
         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'
@@ -144,6 +144,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="feeConfigId !=null and feeConfigId != ''">
+            and t.fee_config_id= #{feeConfigId}
+        </if>
         order by t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
@@ -230,6 +233,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="feeConfigId !=null and feeConfigId != ''">
+            and t.fee_config_id= #{feeConfigId}
+        </if>
     </select>
     <!-- 查询临时车 收费规则 -->
     <select id="queryTempCarFeeRules" parameterType="Map" resultType="Map">

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

@@ -2,16 +2,23 @@ package com.java110.api.listener.fee;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.fee.IFeeBMO;
 import com.java110.api.bmo.tempCarFeeConfig.ITempCarFeeConfigBMO;
 import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO;
 import com.java110.api.listener.AbstractServiceApiPlusListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 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.intf.community.IParkingAreaInnerServiceSMO;
+import com.java110.po.fee.PayFeeConfigPo;
+import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.ServiceCodeTempCarFeeConfigConstant;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpMethod;
 
@@ -26,6 +33,10 @@ public class SaveTempCarFeeConfigListener extends AbstractServiceApiPlusListener
 
     @Autowired
     private ITempCarFeeConfigBMO tempCarFeeConfigBMOImpl;
+
+    @Autowired
+    private IFeeBMO feeBMOImpl;
+
     @Autowired
     private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl;
 
@@ -56,11 +67,31 @@ public class SaveTempCarFeeConfigListener extends AbstractServiceApiPlusListener
 
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
+        reqJson.put("feeConfigId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configId));
         tempCarFeeConfigBMOImpl.addTempCarFeeConfig(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");
+        super.insert(context, payFeeConfigPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FEE_CONFIG);
+        
     }
 
     private void dealAttr(JSONObject reqJson, DataFlowContext context) {

+ 33 - 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.JSONObject;
+import com.java110.api.bmo.fee.IFeeBMO;
 import com.java110.api.bmo.tempCarFeeConfig.ITempCarFeeConfigBMO;
 import com.java110.api.bmo.tempCarFeeConfigAttr.ITempCarFeeConfigAttrBMO;
 import com.java110.api.listener.AbstractServiceApiPlusListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 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.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpMethod;
 
+import java.util.List;
+
 /**
  * 保存临时车收费标准侦听
  * add by wuxw 2019-06-30
@@ -24,9 +33,15 @@ public class UpdateTempCarFeeConfigListener extends AbstractServiceApiPlusListen
     @Autowired
     private ITempCarFeeConfigBMO tempCarFeeConfigBMOImpl;
 
+    @Autowired
+    private ITempCarFeeConfigInnerServiceSMO tempCarFeeConfigInnerServiceSMOImpl;
+
     @Autowired
     private ITempCarFeeConfigAttrBMO tempCarFeeConfigAttrBMOImpl;
 
+    @Autowired
+    private IFeeBMO feeBMOImpl;
+
     @Override
     protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
 
@@ -44,8 +59,25 @@ public class UpdateTempCarFeeConfigListener extends AbstractServiceApiPlusListen
     @Override
     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);
 
+        //补费用项数据
+        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);
+
+
         JSONArray attrs = reqJson.getJSONArray("attrs");
         if (attrs == null || attrs.size() < 1) {
             return;
@@ -63,6 +95,7 @@ public class UpdateTempCarFeeConfigListener extends AbstractServiceApiPlusListen
             }
             tempCarFeeConfigAttrBMOImpl.updateTempCarFeeConfigAttr(attr, context);
         }
+
     }
 
     @Override

+ 66 - 0
service-common/src/main/java/com/java110/common/cmd/carInout/ListCarInParkingAreaCmd.java

@@ -0,0 +1,66 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.carInout;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.machine.CarInoutDto;
+import com.java110.intf.common.ICarInoutInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 类表述:查询 在场车辆
+ * 服务编码:carInout.listCarInParkingAreaCmd
+ * 请求路劲:/app/carInout.listCarInParkingAreaCmd
+ * add by 吴学文 at 2021-09-18 13:35:13 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "carInout.listCarInParkingAreaCmd")
+public class ListCarInParkingAreaCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(ListCarInParkingAreaCmd.class);
+
+    @Autowired
+    private ICarInoutInnerServiceSMO carInoutInnerServiceSMOImpl;
+
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "paId", "未包含停车场信息");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+        CarInoutDto carInoutDto = BeanConvertUtil.covertBean(reqJson, CarInoutDto.class);
+
+        //carInoutInnerServiceSMOImpl.queryCarInCount(carInoutDto);
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

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