Procházet zdrojové kódy

加入费用项变更记录

wuxw před 2 roky
rodič
revize
bc4374875b

+ 33 - 0
java110-db/src/main/resources/mapper/report/ReportCommunityServiceDaoImplMapper.xml

@@ -331,4 +331,37 @@
         </if>
     </select>
 
+    <select id="queryHisFeeConfigCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from business_pay_fee_config t
+        left join c_business cb on t.b_id = cb.b_id
+        left join c_orders co on cb.o_id = co.o_id
+        left join u_user uu on co.user_id = uu.user_id
+        where 1=1
+        and t.config_id = #{configId}
+        and t.community_id = #{communityId}
+    </select>
+
+    <select id="queryHisFeeConfigs" parameterType="Map" resultType="Map">
+        select t.operate,t.fee_type_cd feeTypeCd,t.computing_formula
+        computingFormula,t.additional_amount additionalAmount,t.bill_type
+        billType,t.computing_formula_text computingFormulaText,t.square_price squarePrice,t.payment_cd paymentCd,t.is_default
+        isDefault,t.config_id configId,t.fee_flag feeFlag,t.fee_name
+        feeName,t.payment_cycle paymentCycle,t.start_time startTime,t.end_time
+        endTime,t.community_id communityId,t.deduct_from deductFrom,
+        t.pay_online payOnline,t.scale,t.decimal_place decimalPlace,t.units,t.b_id bId,
+        uu.`name` userName
+        from business_pay_fee_config t
+        left join c_business cb on t.b_id = cb.b_id
+        left join c_orders co on cb.o_id = co.o_id
+        left join u_user uu on co.user_id = uu.user_id
+        where 1=1
+        and t.config_id = #{configId}
+        and t.community_id = #{communityId}
+        order by t.create_time desc,t.operate
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
 </mapper>

+ 16 - 0
java110-interface/src/main/java/com/java110/intf/report/IReportCommunityInnerServiceSMO.java

@@ -78,4 +78,20 @@ public interface IReportCommunityInnerServiceSMO {
 
     @RequestMapping(value = "/queryHisFees", method = RequestMethod.POST)
     List<FeeDto> queryHisFees(@RequestBody FeeDto feeDto);
+
+    /**
+     * 查询费用项数量
+     * @param feeDto
+     * @return
+     */
+    @RequestMapping(value = "/queryHisFeeConfigCount", method = RequestMethod.POST)
+    int queryHisFeeConfigCount(@RequestBody FeeDto feeDto);
+
+    /**
+     * 查询费用项
+     * @param feeDto
+     * @return
+     */
+    @RequestMapping(value = "/queryHisFeeConfigs", method = RequestMethod.POST)
+    List<FeeDto> queryHisFeeConfigs(@RequestBody FeeDto feeDto);
 }

+ 56 - 0
service-report/src/main/java/com/java110/report/cmd/fee/QueryHisFeeConfigCmd.java

@@ -0,0 +1,56 @@
+package com.java110.report.cmd.fee;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.fee.FeeDto;
+import com.java110.intf.report.IReportCommunityInnerServiceSMO;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 查询收费项目 变更记录
+ */
+@Java110Cmd(serviceCode = "fee.queryHisFeeConfig")
+public class QueryHisFeeConfigCmd extends Cmd{
+
+    @Autowired
+    private IReportCommunityInnerServiceSMO reportCommunityInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+
+        Assert.hasKeyAndValue(reqJson,"configId","未包含费用ID");
+        Assert.hasKeyAndValue(reqJson,"communityId","未包含小区");
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+
+
+        int row = reqJson.getInteger("row");
+        FeeDto feeDto = BeanConvertUtil.covertBean(reqJson, FeeDto.class);
+
+        int total = reportCommunityInnerServiceSMOImpl.queryHisFeeConfigCount(feeDto);
+//        int count = 0;
+        List<FeeDto> feeDtos = null;
+        if (total > 0) {
+            feeDtos = reportCommunityInnerServiceSMOImpl.queryHisFeeConfigs(feeDto);
+        } else {
+            feeDtos = new ArrayList<>();
+        }
+
+        ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) total / (double) row), total, feeDtos);
+        context.setResponseEntity(responseEntity);
+    }
+}

+ 4 - 0
service-report/src/main/java/com/java110/report/dao/IReportCommunityServiceDao.java

@@ -103,4 +103,8 @@ public interface IReportCommunityServiceDao {
     int queryHisFeeCount(Map info);
 
     List<Map> queryHisFees(Map info);
+
+    int queryHisFeeConfigCount(Map map);
+
+    List<Map> queryHisFeeConfigs(Map map);
 }

+ 21 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportCommunityServiceDaoImpl.java

@@ -190,4 +190,25 @@ public class ReportCommunityServiceDaoImpl extends BaseServiceDao implements IRe
 
         return businessOwnerCarInfos;
     }
+
+    @Override
+    public int queryHisFeeConfigCount(Map info) {
+        logger.debug("查询 queryHisFeeConfigCount 入参 info : {}", info);
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportCommunityServiceDaoImpl.queryHisFeeConfigCount", info);
+        if (infos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(infos.get(0).get("count").toString());
+    }
+
+    @Override
+    public List<Map> queryHisFeeConfigs(Map info) {
+        logger.debug("查询 queryHisFees 入参 info : {}", info);
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportCommunityServiceDaoImpl.queryHisFeeConfigs", info);
+
+        return infos;
+    }
 }

+ 20 - 0
service-report/src/main/java/com/java110/report/smo/impl/ReportCommunityInnerServiceSMOImpl.java

@@ -140,6 +140,26 @@ public class ReportCommunityInnerServiceSMOImpl extends BaseServiceSMO implement
         return feeDtos;
     }
 
+    @Override
+    public int queryHisFeeConfigCount(@RequestBody FeeDto feeDto) {
+        return reportCommunityServiceDaoImpl.queryHisFeeConfigCount(BeanConvertUtil.beanCovertMap(feeDto));
+    }
+
+    @Override
+    public List<FeeDto> queryHisFeeConfigs(@RequestBody FeeDto feeDto) {
+        int page = feeDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            feeDto.setPage((page - 1) * feeDto.getRow());
+        }
+
+        List<FeeDto> feeDtos = BeanConvertUtil.covertBeanList(
+                reportCommunityServiceDaoImpl.queryHisFeeConfigs(BeanConvertUtil.beanCovertMap(feeDto)),
+                FeeDto.class);
+
+        return feeDtos;
+    }
+
     /**
      * 获取批量userId
      *