2 Commits 2369dadbd2 ... daa446c59e

Author SHA1 Message Date
  sxb daa446c59e Merge remote-tracking branch 'origin/master' 4 months ago
  sxb c09a69692a 编码水价 4 months ago

+ 4 - 0
collect-fees/fees-px-api/src/main/java/com/tofly/feesapi/sfgl/entity/vo/SfJsJg.java

@@ -35,6 +35,10 @@ public class SfJsJg {
     @JsonSerialize(using = MoneySerializer.class)
     private BigDecimal ysljf = BigDecimal.ZERO;
 
+    @ApiModelProperty(value = "应收水资源费", position = 11)
+    @JsonSerialize(using = MoneySerializer.class)
+    private BigDecimal ysszyf = BigDecimal.ZERO;
+
     @ApiModelProperty(value = "应收滞纳金", position = 9)
     @JsonSerialize(using = MoneySerializer.class)
     private BigDecimal znj = BigDecimal.ZERO;

+ 26 - 6
collect-fees/fees-px-api/src/main/java/com/tofly/feesapi/sfgl/service/impl/YyQfmxServiceImpl.java

@@ -466,6 +466,13 @@ public class YyQfmxServiceImpl extends ServiceImpl<YyQfmxMapper, YyQfmx> impleme
         }
     }
 
+    /**
+     * 水费计算模块
+     * @param cbkxx
+     * @param sjsl
+     * @param czyUserDetails
+     * @return
+     */
     @Override
     public SfJsJg sfJs(YhCbkxx cbkxx, BigDecimal sjsl, CzyUserDetails czyUserDetails) {
         sjCache();//缓存表价信息(计算前必须)
@@ -674,13 +681,13 @@ public class YyQfmxServiceImpl extends ServiceImpl<YyQfmxMapper, YyQfmx> impleme
         List<BigDecimal> sfs = getMxValues(values, "sf");
         List<BigDecimal> wsfs = getMxValues(values, "wsf");
         List<BigDecimal> ljfs = getMxValues(values, "ljf");
-
+        List<BigDecimal> szyfs = getMxValues(values, "szyf");//水资源费
 
         BigDecimal yssl = sls.stream().reduce(BigDecimal.ZERO, (x, y) -> x.add(y));
         BigDecimal yssf = sfs.stream().reduce(BigDecimal.ZERO, (x, y) -> x.add(y));
         BigDecimal yswsf = wsfs.stream().reduce(BigDecimal.ZERO, (x, y) -> x.add(y));
         BigDecimal ysljf = ljfs.stream().reduce(BigDecimal.ZERO, (x, y) -> x.add(y));
-
+        BigDecimal ysszyf = szyfs.stream().reduce(BigDecimal.ZERO, (x, y) -> x.add(y));
         try {
             org.apache.commons.beanutils.BeanUtils.populate(sfJsJg, values);
             CbjsfsEnum cbjsfs = getCbjsfs(slMap, values);//抄表计算方式(0正常单价,1一表多价,2阶梯,3 一表多价含阶梯;用于判断计价类型,处理显示水价)
@@ -690,9 +697,10 @@ public class YyQfmxServiceImpl extends ServiceImpl<YyQfmxMapper, YyQfmx> impleme
             sfJsJg.setJtzqljl(ljslMap.containsKey("ljsljsh") ? ljslMap.get("ljsljsh") : BigDecimal.ZERO);
             sfJsJg.setYssl(yssl);
             sfJsJg.setYssf(yssf);
-            sfJsJg.setYsljf(ysljf);
+            sfJsJg.setYsljf(ysljf);//垃圾费按月收取或按量收取
+            sfJsJg.setYsszyf(ysszyf);//应收水资源费
             sfJsJg.setYswsf(yswsf);
-            sfJsJg.setYsje(yssf.add(ysljf).add(yswsf));
+            sfJsJg.setYsje(yssf.add(ysljf).add(yswsf).add(ysszyf));
         } catch (IllegalAccessException e) {
             throw new RuntimeException(e);
         } catch (InvocationTargetException e) {
@@ -702,6 +710,12 @@ public class YyQfmxServiceImpl extends ServiceImpl<YyQfmxMapper, YyQfmx> impleme
         return sfJsJg;
     }
 
+    /**
+     * 抄表正常计算
+     * @param slMap
+     * @param values
+     * @return
+     */
     private CbjsfsEnum getCbjsfs(TreeMap<String, String> slMap, Map<String, Object> values) {
         CbjsfsEnum cbjsfs = CbjsfsEnum.正常单价计费;
         if (slMap.containsKey("L0")) {
@@ -968,6 +982,12 @@ public class YyQfmxServiceImpl extends ServiceImpl<YyQfmxMapper, YyQfmx> impleme
         return count.get();
     }
 
+    /**
+     *
+     * 算费:水费=基础水费+水资源费+垃圾费+污水费处理
+     * @param cblrs
+     * @return
+     */
     private int sf(List<YyCblr> cblrs) {
         //查询总表
         List<Map<String, String>> listcblr = cblrService.lambdaQuery()
@@ -1104,8 +1124,8 @@ public class YyQfmxServiceImpl extends ServiceImpl<YyQfmxMapper, YyQfmx> impleme
 
             BigDecimal jtZszl = BigDecimal.ZERO;//阶梯止数增量
             try {
-                rksqs = BigDecimal.valueOf(Long.parseLong(DbHelper.getDbHelper().getValue("select value from sys_config where pzid='jt_jcrks'")));
-                jtzl = BigDecimal.valueOf(Long.parseLong(DbHelper.getDbHelper().getValue("select value from sys_config where pzid='jt_zl'")));
+                rksqs = BigDecimal.valueOf(Long.parseLong(DbHelper.getDbHelper().getValue(String.format("select jtrksj from bm_sj where jtbz='1' and code='%s' ",sjbm))));
+                jtzl = BigDecimal.valueOf(Long.parseLong(DbHelper.getDbHelper().getValue(String.format("select jtrksl from bm_sj where jtbz='1' and code='%s'",sjbm))));
             } catch (Exception e) {
                 throw new FeesException(e.getMessage(), FeesErrorCode.BUSINESS_ERROR);
             }