Bläddra i källkod

加入 临时车收费规则功能

java110 5 år sedan
förälder
incheckning
67a012f260
16 ändrade filer med 732 tillägg och 274 borttagningar
  1. 1 1
      java110-bean/src/main/java/com/java110/dto/tempCarFeeConfigAttr/TempCarFeeConfigAttrDto.java
  2. 85 0
      java110-bean/src/main/java/com/java110/dto/tempCarFeeConfig/TempCarFeeRuleDto.java
  3. 92 0
      java110-bean/src/main/java/com/java110/dto/tempCarFeeConfig/TempCarFeeRuleSpecDto.java
  4. 2 0
      java110-bean/src/main/java/com/java110/vo/ResultVo.java
  5. 229 199
      java110-db/src/main/resources/mapper/fee/TempCarFeeConfigServiceDaoImplMapper.xml
  6. 79 19
      java110-generator/src/main/resources/web/template_1.json
  7. 1 1
      java110-interface/src/main/java/com/java110/intf/fee/ITempCarFeeConfigAttrInnerServiceSMO.java
  8. 10 1
      java110-interface/src/main/java/com/java110/intf/fee/ITempCarFeeConfigInnerServiceSMO.java
  9. 1 1
      service-api/src/main/java/com/java110/api/listener/fee/ListTempCarFeeConfigAttrsListener.java
  10. 54 0
      service-fee/src/main/java/com/java110/fee/api/TempCarFeeApi.java
  11. 32 0
      service-fee/src/main/java/com/java110/fee/bmo/tempCarFee/IGetTempCarFeeRules.java
  12. 44 0
      service-fee/src/main/java/com/java110/fee/bmo/tempCarFee/impl/GetTempCarFeeRulesImpl.java
  13. 20 12
      service-fee/src/main/java/com/java110/fee/dao/ITempCarFeeConfigServiceDao.java
  14. 44 23
      service-fee/src/main/java/com/java110/fee/dao/impl/TempCarFeeConfigServiceDaoImpl.java
  15. 1 1
      service-fee/src/main/java/com/java110/fee/smo/impl/TempCarFeeConfigAttrInnerServiceSMOImpl.java
  16. 37 16
      service-fee/src/main/java/com/java110/fee/smo/impl/TempCarFeeConfigInnerServiceSMOImpl.java

+ 1 - 1
java110-bean/src/main/java/com/java110/dto/tempCarFeeConfigAttr/TempCarFeeConfigAttrDto.java

@@ -1,4 +1,4 @@
-package com.java110.dto.tempCarFeeConfigAttr;
+package com.java110.dto.tempCarFeeConfig;
 
 import com.java110.dto.PageDto;
 import java.io.Serializable;

+ 85 - 0
java110-bean/src/main/java/com/java110/dto/tempCarFeeConfig/TempCarFeeRuleDto.java

@@ -0,0 +1,85 @@
+package com.java110.dto.tempCarFeeConfig;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @ClassName FloorDto
+ * @Description 临时车 停车费规则实体类
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class TempCarFeeRuleDto extends PageDto implements Serializable {
+
+    private String ruleId;
+    private String ruleName;
+    private String beanName;
+    private String remark;
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+    private List<TempCarFeeRuleSpecDto> tempCarFeeRuleSpecs;
+
+    public String getRuleId() {
+        return ruleId;
+    }
+
+    public void setRuleId(String ruleId) {
+        this.ruleId = ruleId;
+    }
+
+    public String getRuleName() {
+        return ruleName;
+    }
+
+    public void setRuleName(String ruleName) {
+        this.ruleName = ruleName;
+    }
+
+    public String getBeanName() {
+        return beanName;
+    }
+
+    public void setBeanName(String beanName) {
+        this.beanName = beanName;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public List<TempCarFeeRuleSpecDto> getTempCarFeeRuleSpecs() {
+        return tempCarFeeRuleSpecs;
+    }
+
+    public void setTempCarFeeRuleSpecs(List<TempCarFeeRuleSpecDto> tempCarFeeRuleSpecs) {
+        this.tempCarFeeRuleSpecs = tempCarFeeRuleSpecs;
+    }
+}

+ 92 - 0
java110-bean/src/main/java/com/java110/dto/tempCarFeeConfig/TempCarFeeRuleSpecDto.java

@@ -0,0 +1,92 @@
+package com.java110.dto.tempCarFeeConfig;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 临时车 停车费规则规格实体类
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class TempCarFeeRuleSpecDto extends PageDto implements Serializable {
+
+    private String ruleId;
+    private String[] ruleIds;
+    private String specId;
+    private String specName;
+    private String seq;
+    private String remark;
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+    public String getRuleId() {
+        return ruleId;
+    }
+
+    public void setRuleId(String ruleId) {
+        this.ruleId = ruleId;
+    }
+
+    public String getSpecId() {
+        return specId;
+    }
+
+    public void setSpecId(String specId) {
+        this.specId = specId;
+    }
+
+    public String getSpecName() {
+        return specName;
+    }
+
+    public void setSpecName(String specName) {
+        this.specName = specName;
+    }
+
+    public String getSeq() {
+        return seq;
+    }
+
+    public void setSeq(String seq) {
+        this.seq = seq;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public String[] getRuleIds() {
+        return ruleIds;
+    }
+
+    public void setRuleIds(String[] ruleIds) {
+        this.ruleIds = ruleIds;
+    }
+}

+ 2 - 0
java110-bean/src/main/java/com/java110/vo/ResultVo.java

@@ -308,4 +308,6 @@ public class ResultVo implements Serializable {
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
         return responseEntity;
     }
+
+
 }

+ 229 - 199
java110-db/src/main/resources/mapper/fee/TempCarFeeConfigServiceDaoImplMapper.xml

@@ -5,228 +5,258 @@
 <mapper namespace="tempCarFeeConfigServiceDaoImpl">
 
     <!-- 保存临时车收费标准信息 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
-) values (
-#{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId}
-)
-       </insert>
-
-
-       <!-- 查询临时车收费标准信息(Business) add by wuxw 2018-07-03 -->
-       <select id="getBusinessTempCarFeeConfigInfo" parameterType="Map" resultType="Map">
-           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 
-from business_temp_car_fee_config t 
-where 1 =1 
-<if test="carType !=null and carType != ''">
-   and t.car_type= #{carType}
-</if> 
-<if test="operate !=null and operate != ''">
-   and t.operate= #{operate}
-</if> 
-<if test="configId !=null and configId != ''">
-   and t.config_id= #{configId}
-</if> 
-<if test="feeName !=null and feeName != ''">
-   and t.fee_name= #{feeName}
-</if> 
-<if test="paId !=null and paId != ''">
-   and t.pa_id= #{paId}
-</if> 
-<if test="areaNum !=null and areaNum != ''">
-   and t.area_num= #{areaNum}
-</if> 
-<if test="startTime !=null and startTime != ''">
-   and t.start_time= #{startTime}
-</if> 
-<if test="endTime !=null and endTime != ''">
-   and t.end_time= #{endTime}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="ruleId !=null and ruleId != ''">
-   and t.rule_id= #{ruleId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-
-       </select>
+    <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
+        ) values (
+        #{carType},#{operate},#{configId},#{feeName},#{paId},#{areaNum},#{startTime},#{endTime},#{bId},#{ruleId},#{communityId}
+        )
+    </insert>
 
 
+    <!-- 查询临时车收费标准信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessTempCarFeeConfigInfo" parameterType="Map" resultType="Map">
+        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
+        from business_temp_car_fee_config t
+        where 1 =1
+        <if test="carType !=null and carType != ''">
+            and t.car_type= #{carType}
+        </if>
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
+        <if test="feeName !=null and feeName != ''">
+            and t.fee_name= #{feeName}
+        </if>
+        <if test="paId !=null and paId != ''">
+            and t.pa_id= #{paId}
+        </if>
+        <if test="areaNum !=null and areaNum != ''">
+            and t.area_num= #{areaNum}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="ruleId !=null and ruleId != ''">
+            and t.rule_id= #{ruleId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
+    </select>
 
 
     <!-- 保存临时车收费标准信息至 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
-) 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 from business_temp_car_fee_config t where 1=1
-<if test="carType !=null and carType != ''">
-   and t.car_type= #{carType}
-</if> 
-   and t.operate= 'ADD'
-<if test="configId !=null and configId != ''">
-   and t.config_id= #{configId}
-</if> 
-<if test="feeName !=null and feeName != ''">
-   and t.fee_name= #{feeName}
-</if> 
-<if test="paId !=null and paId != ''">
-   and t.pa_id= #{paId}
-</if> 
-<if test="areaNum !=null and areaNum != ''">
-   and t.area_num= #{areaNum}
-</if> 
-<if test="startTime !=null and startTime != ''">
-   and t.start_time= #{startTime}
-</if> 
-<if test="endTime !=null and endTime != ''">
-   and t.end_time= #{endTime}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="ruleId !=null and ruleId != ''">
-   and t.rule_id= #{ruleId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
+        car_type,config_id,fee_name,pa_id,area_num,status_cd,start_time,end_time,b_id,rule_id,community_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
+        from business_temp_car_fee_config t where 1=1
+        <if test="carType !=null and carType != ''">
+            and t.car_type= #{carType}
+        </if>
+        and t.operate= 'ADD'
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
+        <if test="feeName !=null and feeName != ''">
+            and t.fee_name= #{feeName}
+        </if>
+        <if test="paId !=null and paId != ''">
+            and t.pa_id= #{paId}
+        </if>
+        <if test="areaNum !=null and areaNum != ''">
+            and t.area_num= #{areaNum}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="ruleId !=null and ruleId != ''">
+            and t.rule_id= #{ruleId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
     </insert>
 
 
-
     <!-- 查询临时车收费标准信息 add by wuxw 2018-07-03 -->
     <select id="getTempCarFeeConfigInfo" parameterType="Map" resultType="Map">
-        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 
-from temp_car_fee_config t 
-where 1 =1 
-<if test="carType !=null and carType != ''">
-   and t.car_type= #{carType}
-</if> 
-<if test="configId !=null and configId != ''">
-   and t.config_id= #{configId}
-</if> 
-<if test="feeName !=null and feeName != ''">
-   and t.fee_name= #{feeName}
-</if> 
-<if test="paId !=null and paId != ''">
-   and t.pa_id= #{paId}
-</if> 
-<if test="areaNum !=null and areaNum != ''">
-   and t.area_num= #{areaNum}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="startTime !=null and startTime != ''">
-   and t.start_time= #{startTime}
-</if> 
-<if test="endTime !=null and endTime != ''">
-   and t.end_time= #{endTime}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="ruleId !=null and ruleId != ''">
-   and t.rule_id= #{ruleId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        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
+        from temp_car_fee_config t
+        where 1 =1
+        <if test="carType !=null and carType != ''">
+            and t.car_type= #{carType}
+        </if>
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
+        <if test="feeName !=null and feeName != ''">
+            and t.fee_name= #{feeName}
+        </if>
+        <if test="paId !=null and paId != ''">
+            and t.pa_id= #{paId}
+        </if>
+        <if test="areaNum !=null and areaNum != ''">
+            and t.area_num= #{areaNum}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="ruleId !=null and ruleId != ''">
+            and t.rule_id= #{ruleId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改临时车收费标准信息 add by wuxw 2018-07-03 -->
     <update id="updateTempCarFeeConfigInfoInstance" parameterType="Map">
-        update  temp_car_fee_config t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="carType !=null and carType != ''">
-, t.car_type= #{carType}
-</if> 
-<if test="feeName !=null and feeName != ''">
-, t.fee_name= #{feeName}
-</if> 
-<if test="paId !=null and paId != ''">
-, t.pa_id= #{paId}
-</if> 
-<if test="areaNum !=null and areaNum != ''">
-, t.area_num= #{areaNum}
-</if> 
-<if test="startTime !=null and startTime != ''">
-, t.start_time= #{startTime}
-</if> 
-<if test="endTime !=null and endTime != ''">
-, t.end_time= #{endTime}
-</if> 
-<if test="ruleId !=null and ruleId != ''">
-, t.rule_id= #{ruleId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
- where 1=1 <if test="configId !=null and configId != ''">
-and t.config_id= #{configId}
-</if> 
-<if test="bId !=null and bId != ''">
-and t.b_id= #{bId}
-</if> 
+        update temp_car_fee_config t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="carType !=null and carType != ''">
+            , t.car_type= #{carType}
+        </if>
+        <if test="feeName !=null and feeName != ''">
+            , t.fee_name= #{feeName}
+        </if>
+        <if test="paId !=null and paId != ''">
+            , t.pa_id= #{paId}
+        </if>
+        <if test="areaNum !=null and areaNum != ''">
+            , t.area_num= #{areaNum}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            , t.start_time= #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            , t.end_time= #{endTime}
+        </if>
+        <if test="ruleId !=null and ruleId != ''">
+            , t.rule_id= #{ruleId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        where 1=1
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
 
     </update>
 
     <!-- 查询临时车收费标准数量 add by wuxw 2018-07-03 -->
-     <select id="queryTempCarFeeConfigsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from temp_car_fee_config t 
-where 1 =1 
-<if test="carType !=null and carType != ''">
-   and t.car_type= #{carType}
-</if> 
-<if test="configId !=null and configId != ''">
-   and t.config_id= #{configId}
-</if> 
-<if test="feeName !=null and feeName != ''">
-   and t.fee_name= #{feeName}
-</if> 
-<if test="paId !=null and paId != ''">
-   and t.pa_id= #{paId}
-</if> 
-<if test="areaNum !=null and areaNum != ''">
-   and t.area_num= #{areaNum}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="startTime !=null and startTime != ''">
-   and t.start_time= #{startTime}
-</if> 
-<if test="endTime !=null and endTime != ''">
-   and t.end_time= #{endTime}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="ruleId !=null and ruleId != ''">
-   and t.rule_id= #{ruleId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-
-
-     </select>
+    <select id="queryTempCarFeeConfigsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from temp_car_fee_config t
+        where 1 =1
+        <if test="carType !=null and carType != ''">
+            and t.car_type= #{carType}
+        </if>
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
+        <if test="feeName !=null and feeName != ''">
+            and t.fee_name= #{feeName}
+        </if>
+        <if test="paId !=null and paId != ''">
+            and t.pa_id= #{paId}
+        </if>
+        <if test="areaNum !=null and areaNum != ''">
+            and t.area_num= #{areaNum}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="ruleId !=null and ruleId != ''">
+            and t.rule_id= #{ruleId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+    </select>
+    <!-- 查询临时车 收费规则 -->
+    <select id="queryTempCarFeeRules" parameterType="Map" resultType="Map">
+        select
+        t.rule_id ruleId,t.rule_name ruleName,t.remark,t.bean_name beanName
+        from temp_car_fee_rule t
+        where 1=1
+        and t.status_cd = '0'
+        <if test="ruleId !=null and ruleId != ''">
+            and t.rule_id= #{ruleId}
+        </if>
+    </select>
+
+    <!-- 查询临时车 收费规则 -->
+    <select id="queryTempCarFeeRuleSpecs" parameterType="Map" resultType="Map">
+        select t.rule_id ruleId,t.spec_id specId,t.spec_name specName,t.seq from
+        temp_car_fee_rule_spec t
+        where t.status_cd = '0'
+        and t.rule_id = #{ruleId}
+        <if test="specId !=null and specId != ''">
+        and t.spec_id = #{specId}
+        </if>
+        <if test="ruleIds !=null">
+            and t.rule_id in
+            <foreach collection="ruleIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        order by t.seq
+    </select>
 
 </mapper>

+ 79 - 19
java110-generator/src/main/resources/web/template_1.json

@@ -1,48 +1,108 @@
 {
-  "templateName": "优惠申请类型",
+  "templateName": "临时车收费标准",
   "directories": "property",
-  "templateCode": "applyRoomDiscountType",
-  "templateKey": "applyType",
-  "templateKeyName": "类型",
-  "searchCode": "applyType",
-  "searchName": "类型",
+  "templateCode": "tempCarFeeConfig",
+  "templateKey": "configId",
+  "templateKeyName": "标准ID",
+  "searchCode": "configId",
+  "searchName": "标准ID",
   "conditions": [
     {
-      "name": "类型名称",
+      "name": "标准名称",
       "inputType": "input",
-      "code": "typeName",
+      "code": "feeName",
       "whereCondition": "equal"
     },
     {
-      "name": "类型",
+      "name": "停车场",
       "inputType": "input",
-      "code": "applyType",
+      "code": "paId",
+      "whereCondition": "equal"
+    },
+    {
+      "name": "车辆类型",
+      "inputType": "select",
+      "selectValue":"9901,9904,9905",
+      "selectValueName":"家用小汽车,电动车,三轮车",
+      "code": "carType",
       "whereCondition": "equal"
     }
   ],
   "columns": [
     {
-      "code": "typeName",
-      "cnCode": "类型名称",
-      "desc": "必填,请填写类型名称",
+      "code": "feeName",
+      "cnCode": "标准名称",
+      "desc": "必填,请填写标准名称",
       "required": true,
       "hasDefaultValue": false,
       "inputType": "input",
       "limit": "maxLength",
       "limitParam": "64",
-      "limitErrInfo": "类型名称格式错误",
+      "limitErrInfo": "标准名称格式错误",
       "show": true
     },
     {
-      "code": "typeDesc",
-      "cnCode": "类型描述",
-      "desc": "选填,请填写类型描述",
-      "required": false,
+      "code": "paId",
+      "cnCode": "停车场",
+      "desc": "选填,请选择停车场",
+      "required": true,
       "hasDefaultValue": false,
       "inputType": "input",
       "limit": "maxLength",
       "limitParam": "512",
-      "limitErrInfo": "类型描述错误",
+      "limitErrInfo": "停车场错误",
+      "show": true
+    },
+    {
+      "code": "carType",
+      "cnCode": "车辆类型",
+      "desc": "选填,请选择车辆类型",
+      "required": true,
+      "hasDefaultValue": false,
+      "inputType": "select",
+      "selectValue":"9901,9904,9905",
+      "selectValueName":"家用小汽车,电动车,三轮车",
+      "limit": "maxLength",
+      "limitParam": "512",
+      "limitErrInfo": "车辆类型错误",
+      "show": true
+    },
+    {
+      "code": "ruleId",
+      "cnCode": "收费规则",
+      "desc": "选填,请选择收费规则",
+      "required": true,
+      "hasDefaultValue": false,
+      "inputType": "select",
+      "selectValue":"9901,9904,9905",
+      "selectValueName":"规则1,规则2,规则3",
+      "limit": "maxLength",
+      "limitParam": "512",
+      "limitErrInfo": "收费规则错误",
+      "show": true
+    },
+    {
+      "code": "startTime",
+      "cnCode": "开始时间",
+      "desc": "选填,请选择开始时间",
+      "required": true,
+      "hasDefaultValue": false,
+      "inputType": "input",
+      "limit": "date",
+      "limitParam": "",
+      "limitErrInfo": "开始时间错误",
+      "show": true
+    },
+    {
+      "code": "endTime",
+      "cnCode": "结束时间",
+      "desc": "选填,请选择结束时间",
+      "required": true,
+      "hasDefaultValue": false,
+      "inputType": "input",
+      "limit": "date",
+      "limitParam": "",
+      "limitErrInfo": "结束时间错误",
       "show": true
     }
   ]

+ 1 - 1
java110-interface/src/main/java/com/java110/intf/fee/ITempCarFeeConfigAttrInnerServiceSMO.java

@@ -1,7 +1,7 @@
 package com.java110.intf.fee;
 
 import com.java110.config.feign.FeignConfiguration;
-import com.java110.dto.tempCarFeeConfigAttr.TempCarFeeConfigAttrDto;
+import com.java110.dto.tempCarFeeConfig.TempCarFeeConfigAttrDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;

+ 10 - 1
java110-interface/src/main/java/com/java110/intf/fee/ITempCarFeeConfigInnerServiceSMO.java

@@ -2,6 +2,7 @@ package com.java110.intf.fee;
 
 import com.java110.config.feign.FeignConfiguration;
 import com.java110.dto.tempCarFeeConfig.TempCarFeeConfigDto;
+import com.java110.dto.tempCarFeeConfig.TempCarFeeRuleDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -24,7 +25,6 @@ public interface ITempCarFeeConfigInnerServiceSMO {
     /**
      * <p>查询小区楼信息</p>
      *
-     *
      * @param tempCarFeeConfigDto 数据对象分享
      * @return TempCarFeeConfigDto 对象数据
      */
@@ -39,4 +39,13 @@ public interface ITempCarFeeConfigInnerServiceSMO {
      */
     @RequestMapping(value = "/queryTempCarFeeConfigsCount", method = RequestMethod.POST)
     int queryTempCarFeeConfigsCount(@RequestBody TempCarFeeConfigDto tempCarFeeConfigDto);
+
+    /**
+     * 查询临时车收费规则
+     *
+     * @param tempCarFeeRuleDto
+     * @return
+     */
+    @RequestMapping(value = "/queryTempCarFeeRules", method = RequestMethod.POST)
+    List<TempCarFeeRuleDto> queryTempCarFeeRules(@RequestBody TempCarFeeRuleDto tempCarFeeRuleDto);
 }

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

@@ -5,7 +5,7 @@ import com.java110.api.listener.AbstractServiceApiListener;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.dto.tempCarFeeConfigAttr.TempCarFeeConfigAttrDto;
+import com.java110.dto.tempCarFeeConfig.TempCarFeeConfigAttrDto;
 import com.java110.intf.fee.ITempCarFeeConfigAttrInnerServiceSMO;
 import com.java110.utils.constant.ServiceCodeTempCarFeeConfigAttrConstant;
 import com.java110.utils.util.BeanConvertUtil;

+ 54 - 0
service-fee/src/main/java/com/java110/fee/api/TempCarFeeApi.java

@@ -0,0 +1,54 @@
+/*
+ * 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.fee.api;
+
+import com.java110.dto.tempCarFeeConfig.TempCarFeeRuleDto;
+import com.java110.fee.bmo.tempCarFee.IGetTempCarFeeRules;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 临时车费接口类
+ *
+ * @desc add by 吴学文 14:53
+ */
+@RestController
+@RequestMapping(value = "/tempCarFee")
+public class TempCarFeeApi {
+
+    @Autowired
+    private IGetTempCarFeeRules getTempCarFeeRulesImpl;
+
+    /**
+     * 查询;临时车停车收费规则
+     *
+     * @param ruleId 规则ID
+     * @return
+     * @serviceCode /tempCarFee/queryTempCarFeeRules
+     * @path /app/tempCarFee/queryTempCarFeeRules
+     */
+    @RequestMapping(value = "/queryTempCarFeeRules", method = RequestMethod.GET)
+    public ResponseEntity<String> queryTempCarFeeRules(
+            @RequestParam(value = "ruleId", required = false) String ruleId) {
+        TempCarFeeRuleDto tempCarFeeRuleDto = new TempCarFeeRuleDto();
+        tempCarFeeRuleDto.setRuleId(ruleId);
+        return getTempCarFeeRulesImpl.queryRules(tempCarFeeRuleDto);
+    }
+}

+ 32 - 0
service-fee/src/main/java/com/java110/fee/bmo/tempCarFee/IGetTempCarFeeRules.java

@@ -0,0 +1,32 @@
+package com.java110.fee.bmo.tempCarFee;/*
+ * 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.
+ */
+
+import com.java110.dto.tempCarFeeConfig.TempCarFeeRuleDto;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 查询临时车收费规则
+ */
+public interface IGetTempCarFeeRules {
+
+    /**
+     * 查询规则
+     *
+     * @param tempCarFeeRuleDto 收费规则 入参
+     * @return 收费规则及规则规格
+     */
+    ResponseEntity<String> queryRules(TempCarFeeRuleDto tempCarFeeRuleDto);
+}

+ 44 - 0
service-fee/src/main/java/com/java110/fee/bmo/tempCarFee/impl/GetTempCarFeeRulesImpl.java

@@ -0,0 +1,44 @@
+/*
+ * 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.fee.bmo.tempCarFee.impl;
+
+import com.java110.dto.tempCarFeeConfig.TempCarFeeRuleDto;
+import com.java110.fee.bmo.tempCarFee.IGetTempCarFeeRules;
+import com.java110.intf.fee.ITempCarFeeConfigInnerServiceSMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @desc add by 吴学文 15:03
+ */
+@Service
+public class GetTempCarFeeRulesImpl implements IGetTempCarFeeRules {
+
+    @Autowired
+    private ITempCarFeeConfigInnerServiceSMO tempCarFeeConfigInnerServiceSMOImpl;
+
+    @Override
+    public ResponseEntity<String> queryRules(TempCarFeeRuleDto tempCarFeeRuleDto) {
+
+        List<TempCarFeeRuleDto> tempCarFeeRuleDtos = tempCarFeeConfigInnerServiceSMOImpl.queryTempCarFeeRules(tempCarFeeRuleDto);
+
+        return ResultVo.createResponseEntity(tempCarFeeRuleDtos);
+    }
+}

+ 20 - 12
service-fee/src/main/java/com/java110/fee/dao/ITempCarFeeConfigServiceDao.java

@@ -2,11 +2,6 @@ package com.java110.fee.dao;
 
 
 import com.java110.utils.exception.DAOException;
-import com.java110.entity.merchant.BoMerchant;
-import com.java110.entity.merchant.BoMerchantAttr;
-import com.java110.entity.merchant.Merchant;
-import com.java110.entity.merchant.MerchantAttr;
-
 
 import java.util.List;
 import java.util.Map;
@@ -15,23 +10,24 @@ import java.util.Map;
  * 临时车收费标准组件内部之间使用,没有给外围系统提供服务能力
  * 临时车收费标准服务接口类,要求全部以字符串传输,方便微服务化
  * 新建客户,修改客户,删除客户,查询客户等功能
- *
+ * <p>
  * Created by wuxw on 2016/12/27.
  */
 public interface ITempCarFeeConfigServiceDao {
 
     /**
      * 保存 临时车收费标准信息
+     *
      * @param businessTempCarFeeConfigInfo 临时车收费标准信息 封装
      * @throws DAOException 操作数据库异常
      */
     void saveBusinessTempCarFeeConfigInfo(Map businessTempCarFeeConfigInfo) throws DAOException;
 
 
-
     /**
      * 查询临时车收费标准信息(business过程)
      * 根据bId 查询临时车收费标准信息
+     *
      * @param info bId 信息
      * @return 临时车收费标准信息
      * @throws DAOException DAO异常
@@ -39,21 +35,19 @@ public interface ITempCarFeeConfigServiceDao {
     List<Map> getBusinessTempCarFeeConfigInfo(Map info) throws DAOException;
 
 
-
-
     /**
      * 保存 临时车收费标准信息 Business数据到 Instance中
+     *
      * @param info
      * @throws DAOException DAO异常
      */
     void saveTempCarFeeConfigInfoInstance(Map info) throws DAOException;
 
 
-
-
     /**
      * 查询临时车收费标准信息(instance过程)
      * 根据bId 查询临时车收费标准信息
+     *
      * @param info bId 信息
      * @return 临时车收费标准信息
      * @throws DAOException DAO异常
@@ -61,9 +55,9 @@ public interface ITempCarFeeConfigServiceDao {
     List<Map> getTempCarFeeConfigInfo(Map info) throws DAOException;
 
 
-
     /**
      * 修改临时车收费标准信息
+     *
      * @param info 修改信息
      * @throws DAOException DAO异常
      */
@@ -78,4 +72,18 @@ public interface ITempCarFeeConfigServiceDao {
      */
     int queryTempCarFeeConfigsCount(Map info);
 
+    /**
+     * 查询临时车收费规则
+     *
+     * @param info
+     * @return
+     */
+    List<Map> queryTempCarFeeRules(Map info);
+
+    /**
+     * 查询临时车收费规则规格
+     * @param info
+     * @return
+     */
+    public List<Map> queryTempCarFeeRuleSpecs(Map info);
 }

+ 44 - 23
service-fee/src/main/java/com/java110/fee/dao/impl/TempCarFeeConfigServiceDaoImpl.java

@@ -1,15 +1,14 @@
 package com.java110.fee.dao.impl;
 
 import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.fee.dao.ITempCarFeeConfigServiceDao;
 import com.java110.utils.constant.ResponseConstant;
 import com.java110.utils.exception.DAOException;
 import com.java110.utils.util.DateUtil;
-import com.java110.core.base.dao.BaseServiceDao;
-import com.java110.fee.dao.ITempCarFeeConfigServiceDao;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 import java.util.Map;
@@ -26,6 +25,7 @@ public class TempCarFeeConfigServiceDaoImpl extends BaseServiceDao implements IT
 
     /**
      * 临时车收费标准信息封装
+     *
      * @param businessTempCarFeeConfigInfo 临时车收费标准信息 封装
      * @throws DAOException DAO异常
      */
@@ -33,17 +33,18 @@ public class TempCarFeeConfigServiceDaoImpl extends BaseServiceDao implements IT
     public void saveBusinessTempCarFeeConfigInfo(Map businessTempCarFeeConfigInfo) throws DAOException {
         businessTempCarFeeConfigInfo.put("month", DateUtil.getCurrentMonth());
         // 查询business_user 数据是否已经存在
-        logger.debug("保存临时车收费标准信息 入参 businessTempCarFeeConfigInfo : {}",businessTempCarFeeConfigInfo);
-        int saveFlag = sqlSessionTemplate.insert("tempCarFeeConfigServiceDaoImpl.saveBusinessTempCarFeeConfigInfo",businessTempCarFeeConfigInfo);
+        logger.debug("保存临时车收费标准信息 入参 businessTempCarFeeConfigInfo : {}", businessTempCarFeeConfigInfo);
+        int saveFlag = sqlSessionTemplate.insert("tempCarFeeConfigServiceDaoImpl.saveBusinessTempCarFeeConfigInfo", businessTempCarFeeConfigInfo);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存临时车收费标准数据失败:"+ JSONObject.toJSONString(businessTempCarFeeConfigInfo));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存临时车收费标准数据失败:" + JSONObject.toJSONString(businessTempCarFeeConfigInfo));
         }
     }
 
 
     /**
      * 查询临时车收费标准信息
+     *
      * @param info bId 信息
      * @return 临时车收费标准信息
      * @throws DAOException DAO异常
@@ -51,43 +52,44 @@ public class TempCarFeeConfigServiceDaoImpl extends BaseServiceDao implements IT
     @Override
     public List<Map> getBusinessTempCarFeeConfigInfo(Map info) throws DAOException {
 
-        logger.debug("查询临时车收费标准信息 入参 info : {}",info);
+        logger.debug("查询临时车收费标准信息 入参 info : {}", info);
 
-        List<Map> businessTempCarFeeConfigInfos = sqlSessionTemplate.selectList("tempCarFeeConfigServiceDaoImpl.getBusinessTempCarFeeConfigInfo",info);
+        List<Map> businessTempCarFeeConfigInfos = sqlSessionTemplate.selectList("tempCarFeeConfigServiceDaoImpl.getBusinessTempCarFeeConfigInfo", info);
 
         return businessTempCarFeeConfigInfos;
     }
 
 
-
     /**
      * 保存临时车收费标准信息 到 instance
-     * @param info   bId 信息
+     *
+     * @param info bId 信息
      * @throws DAOException DAO异常
      */
     @Override
     public void saveTempCarFeeConfigInfoInstance(Map info) throws DAOException {
-        logger.debug("保存临时车收费标准信息Instance 入参 info : {}",info);
+        logger.debug("保存临时车收费标准信息Instance 入参 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.insert("tempCarFeeConfigServiceDaoImpl.saveTempCarFeeConfigInfoInstance",info);
+        int saveFlag = sqlSessionTemplate.insert("tempCarFeeConfigServiceDaoImpl.saveTempCarFeeConfigInfoInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存临时车收费标准信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存临时车收费标准信息Instance数据失败:" + JSONObject.toJSONString(info));
         }
     }
 
 
     /**
      * 查询临时车收费标准信息(instance)
+     *
      * @param info bId 信息
      * @return List<Map>
      * @throws DAOException DAO异常
      */
     @Override
     public List<Map> getTempCarFeeConfigInfo(Map info) throws DAOException {
-        logger.debug("查询临时车收费标准信息 入参 info : {}",info);
+        logger.debug("查询临时车收费标准信息 入参 info : {}", info);
 
-        List<Map> businessTempCarFeeConfigInfos = sqlSessionTemplate.selectList("tempCarFeeConfigServiceDaoImpl.getTempCarFeeConfigInfo",info);
+        List<Map> businessTempCarFeeConfigInfos = sqlSessionTemplate.selectList("tempCarFeeConfigServiceDaoImpl.getTempCarFeeConfigInfo", info);
 
         return businessTempCarFeeConfigInfos;
     }
@@ -95,28 +97,30 @@ public class TempCarFeeConfigServiceDaoImpl extends BaseServiceDao implements IT
 
     /**
      * 修改临时车收费标准信息
+     *
      * @param info 修改信息
      * @throws DAOException DAO异常
      */
     @Override
     public void updateTempCarFeeConfigInfoInstance(Map info) throws DAOException {
-        logger.debug("修改临时车收费标准信息Instance 入参 info : {}",info);
+        logger.debug("修改临时车收费标准信息Instance 入参 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.update("tempCarFeeConfigServiceDaoImpl.updateTempCarFeeConfigInfoInstance",info);
+        int saveFlag = sqlSessionTemplate.update("tempCarFeeConfigServiceDaoImpl.updateTempCarFeeConfigInfoInstance", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改临时车收费标准信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改临时车收费标准信息Instance数据失败:" + JSONObject.toJSONString(info));
         }
     }
 
-     /**
+    /**
      * 查询临时车收费标准数量
+     *
      * @param info 临时车收费标准信息
      * @return 临时车收费标准数量
      */
     @Override
     public int queryTempCarFeeConfigsCount(Map info) {
-        logger.debug("查询临时车收费标准数据 入参 info : {}",info);
+        logger.debug("查询临时车收费标准数据 入参 info : {}", info);
 
         List<Map> businessTempCarFeeConfigInfos = sqlSessionTemplate.selectList("tempCarFeeConfigServiceDaoImpl.queryTempCarFeeConfigsCount", info);
         if (businessTempCarFeeConfigInfos.size() < 1) {
@@ -127,4 +131,21 @@ public class TempCarFeeConfigServiceDaoImpl extends BaseServiceDao implements IT
     }
 
 
+
+    @Override
+    public List<Map> queryTempCarFeeRules(Map info) {
+        logger.debug("查询临时车收费规则信息 入参 info : {}", info);
+
+        List<Map> businessTempCarFeeConfigInfos = sqlSessionTemplate.selectList("tempCarFeeConfigServiceDaoImpl.queryTempCarFeeRules", info);
+
+        return businessTempCarFeeConfigInfos;
+    }
+    @Override
+    public List<Map> queryTempCarFeeRuleSpecs(Map info) {
+        logger.debug("查询临时车收费规则规格信息 入参 info : {}", info);
+
+        List<Map> businessTempCarFeeConfigInfos = sqlSessionTemplate.selectList("tempCarFeeConfigServiceDaoImpl.queryTempCarFeeRuleSpecs", info);
+
+        return businessTempCarFeeConfigInfos;
+    }
 }

+ 1 - 1
service-fee/src/main/java/com/java110/fee/smo/impl/TempCarFeeConfigAttrInnerServiceSMOImpl.java

@@ -3,7 +3,7 @@ package com.java110.fee.smo.impl;
 
 import com.java110.fee.dao.ITempCarFeeConfigAttrServiceDao;
 import com.java110.intf.fee.ITempCarFeeConfigAttrInnerServiceSMO;
-import com.java110.dto.tempCarFeeConfigAttr.TempCarFeeConfigAttrDto;
+import com.java110.dto.tempCarFeeConfig.TempCarFeeConfigAttrDto;
 import com.java110.intf.user.IUserInnerServiceSMO;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.core.base.smo.BaseServiceSMO;

+ 37 - 16
service-fee/src/main/java/com/java110/fee/smo/impl/TempCarFeeConfigInnerServiceSMOImpl.java

@@ -2,11 +2,13 @@ package com.java110.fee.smo.impl;
 
 
 import com.java110.core.base.smo.BaseServiceSMO;
-import com.java110.intf.fee.ITempCarFeeConfigInnerServiceSMO;
 import com.java110.dto.PageDto;
 import com.java110.dto.tempCarFeeConfig.TempCarFeeConfigDto;
+import com.java110.dto.tempCarFeeConfig.TempCarFeeRuleDto;
+import com.java110.dto.tempCarFeeConfig.TempCarFeeRuleSpecDto;
 import com.java110.dto.user.UserDto;
 import com.java110.fee.dao.ITempCarFeeConfigServiceDao;
+import com.java110.intf.fee.ITempCarFeeConfigInnerServiceSMO;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -60,26 +62,45 @@ public class TempCarFeeConfigInnerServiceSMOImpl extends BaseServiceSMO implemen
         }
     }
 
-    /**
-     * 获取批量userId
-     *
-     * @param tempCarFeeConfigs 小区楼信息
-     * @return 批量userIds 信息
-     */
-    private String[] getUserIds(List<TempCarFeeConfigDto> tempCarFeeConfigs) {
-        List<String> userIds = new ArrayList<String>();
-        for (TempCarFeeConfigDto tempCarFeeConfig : tempCarFeeConfigs) {
-            userIds.add(tempCarFeeConfig.getConfigId());
-        }
-
-        return userIds.toArray(new String[userIds.size()]);
-    }
-
     @Override
     public int queryTempCarFeeConfigsCount(@RequestBody TempCarFeeConfigDto tempCarFeeConfigDto) {
         return tempCarFeeConfigServiceDaoImpl.queryTempCarFeeConfigsCount(BeanConvertUtil.beanCovertMap(tempCarFeeConfigDto));
     }
 
+    @Override
+    public List<TempCarFeeRuleDto> queryTempCarFeeRules(@RequestBody TempCarFeeRuleDto tempCarFeeRuleDto) {
+
+        List<TempCarFeeRuleDto> tempCarFeeRuleDtos = BeanConvertUtil.covertBeanList(tempCarFeeConfigServiceDaoImpl.queryTempCarFeeRules(BeanConvertUtil.beanCovertMap(tempCarFeeRuleDto)), TempCarFeeRuleDto.class);
+        freshRuleSpecs(tempCarFeeRuleDtos);
+        return tempCarFeeRuleDtos;
+    }
+
+    private void freshRuleSpecs(List<TempCarFeeRuleDto> tempCarFeeRuleDtos) {
+        if (tempCarFeeRuleDtos == null || tempCarFeeRuleDtos.size() < 1) {
+            return;
+        }
+        List<String> ruleIds = new ArrayList<>();
+        for (TempCarFeeRuleDto tempCarFeeRuleDto : tempCarFeeRuleDtos) {
+            ruleIds.add(tempCarFeeRuleDto.getRuleId());
+        }
+
+        TempCarFeeRuleSpecDto tempCarFeeRuleSpecDto = new TempCarFeeRuleSpecDto();
+        tempCarFeeRuleSpecDto.setRuleIds(ruleIds.toArray(new String[ruleIds.size()]));
+        List<TempCarFeeRuleSpecDto> tempCarFeeRuleSpecDtos = BeanConvertUtil.covertBeanList(
+                tempCarFeeConfigServiceDaoImpl.queryTempCarFeeRuleSpecs(
+                        BeanConvertUtil.beanCovertMap(tempCarFeeRuleSpecDto)), TempCarFeeRuleSpecDto.class);
+        List<TempCarFeeRuleSpecDto> tCarFeeRuleSpecDtos = null;
+        for (TempCarFeeRuleDto tempCarFeeRuleDto : tempCarFeeRuleDtos) {
+            tCarFeeRuleSpecDtos = new ArrayList<>();
+            for (TempCarFeeRuleSpecDto tCarFeeRuleSpecDto : tempCarFeeRuleSpecDtos) {
+                if (tempCarFeeRuleDto.getRuleId().equals(tCarFeeRuleSpecDto.getRuleId())) {
+                    tCarFeeRuleSpecDtos.add(tCarFeeRuleSpecDto);
+                }
+            }
+            tempCarFeeRuleDto.setTempCarFeeRuleSpecs(tCarFeeRuleSpecDtos);
+        }
+    }
+
     public ITempCarFeeConfigServiceDao getTempCarFeeConfigServiceDaoImpl() {
         return tempCarFeeConfigServiceDaoImpl;
     }