| | |
| | | reportQueryRecord.setCommunityId(reqJson.getString("communityId")); |
| | | reportQueryRecord.setQueryStatus("0"); |
| | | reportQueryRecord.setEndYear(currentYear+""); |
| | | reportQueryRecord.setOperator("白单流水汇总表"); |
| | | List<ReportQueryRecord> reportQueryRecords = reportFeeInnerServiceSMOImpl.queryReport(BeanConvertUtil.beanCovertMap(reportQueryRecord)); |
| | | |
| | | if(reportQueryRecords.size()>0 && !reqJson.containsKey("reload")){ |
| | | if(reportQueryRecords.size()>0 && reqJson.containsKey("reload")){ |
| | | ResultVo resultVo = new ResultVo(JSONObject.parse(reportQueryRecords.get(reportQueryRecords.size()-1).getReportContent())); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | |
| | | reportQueryRecord.setQueryStatus("0"); |
| | | reportQueryRecord.setEndYear(currentYear+""); |
| | | reportQueryRecord.setReportContent(JSONObject.toJSONString(feeDto)); |
| | | reportQueryRecord.setOperator("白单流水汇总表"); |
| | | |
| | | |
| | | int i = reportFeeInnerServiceSMOImpl.saveReport(BeanConvertUtil.beanCovertMap(reportQueryRecord)); |
| | | |
| | |
| | | int doYear = endYear - startYear; |
| | | LinkedList<FeeDto> col1 = new LinkedList<>(); |
| | | FeeDto col = new FeeDto(); |
| | | BigDecimal[] col1Fee = new BigDecimal[doYear - 1 + 20]; |
| | | double[] col1Fee = new double[doYear - 1 + 20]; |
| | | col.setReport(col1Fee); |
| | | col.setCurYear("收入合计(白单流水)"); |
| | | col1.add(col); |
| | | |
| | | LinkedList<FeeDto> col2 = new LinkedList<>(); |
| | | BigDecimal[] col2Fee = new BigDecimal[doYear - 1 + 20]; |
| | | double[] col2Fee = new double[doYear - 1 + 20]; |
| | | col = new FeeDto(); |
| | | col.setReport(col2Fee); |
| | | col.setCurYear("物业费+代收合计"); |
| | |
| | | |
| | | LinkedList<FeeDto> col4 = new LinkedList<>(); |
| | | col = new FeeDto(); |
| | | col.setReport(new BigDecimal[doYear - 1 + 20]); |
| | | col.setReport(new double[doYear - 1 + 20]); |
| | | col.setCurYear("物业费代收合计"); |
| | | col3.add(col); |
| | | |
| | | BigDecimal[] col4Fee = new BigDecimal[doYear - 1 + 20]; |
| | | BigDecimal[] colByCar = new BigDecimal[doYear - 1 + 20]; |
| | | BigDecimal[] colByOther = new BigDecimal[doYear - 1 + 20]; |
| | | double[] col4Fee = new double[doYear - 1 + 20]; |
| | | double[] colByCar = new double[doYear - 1 + 20]; |
| | | double[] colByOther = new double[doYear - 1 + 20]; |
| | | |
| | | LinkedList carFeeList = new LinkedList(); |
| | | FeeDto fee = new FeeDto(); |
| | | fee.setCurYear("停车费合计(3+...+7)"); |
| | | fee.setReport(colByCar); |
| | | fee.setRow(0); |
| | | carFeeList.add(fee); |
| | | |
| | | |
| | | LinkedList otherFeeList = new LinkedList(); |
| | | FeeDto fee2 = new FeeDto(); |
| | | fee2.setCurYear("其他类合计(8+...+22)"); |
| | | fee2.setReport(colByOther); |
| | | fee2.setRow(0); |
| | | otherFeeList.add(fee2); |
| | | |
| | | reportFeeDtoLists.add(col1); |
| | | reportFeeDtoLists.add(col2); |
| | | reportFeeDtoLists.add(col2); |
| | | reportFeeDtoLists.add(col4); |
| | | int ind = 1; |
| | | |
| | | int[] arr = new int[endYear - startYear + 1]; |
| | | for (int i = startYear; i <= endYear; i++) { |
| | | int[] arr = new int[endYear - startYear + 1 - 2]; |
| | | for (int i = startYear; i <= endYear - 2; i++) { |
| | | arr[i-startYear] = i; |
| | | } |
| | | List<Map> result = reportFeeInnerServiceSMOImpl.repostPaidInFee(feeQueryParams); |
| | | List<Map> resultLT = reportFeeInnerServiceSMOImpl.repostPaidInFeeTwo(feeQueryParams); |
| | | for (Map map : result) { |
| | | if (map.containsKey("fee_type_cd") && map.get("fee_type_cd").equals("630000007")){ |
| | | for (Map map2 : resultLT) { |
| | | if (!map.get("费用所属年份").equals("类型总计") && map2.containsKey("年份")&&((Long)map2.get("年份")) == Integer.parseInt((String)map.get("费用所属年份"))){ |
| | | map.put("该年应缴总额",((BigDecimal)map.get("该年应缴总额")).add((BigDecimal)map2.get("应缴金额"))); |
| | | map.put(map2.get("年份")+"年实缴", ((BigDecimal)map.get(map2.get("年份")+"年实缴")).add((BigDecimal)map2.get("实缴金额"))); |
| | | } |
| | | if (!map.get("费用所属年份").equals("类型总计") && (Long)map2.get("年份") == currentYear && map2.containsKey("月份") && Integer.parseInt((String) map.get("费用所属年份")) == currentYear){ |
| | | Long month = (Long)map2.get("月份"); |
| | | map.put("当年"+(month > 9 ? month : "0" + month)+"月实缴",((BigDecimal)map.get("当年"+(month > 9 ? month : "0" + month)+"月实缴")).add((BigDecimal) map2.get("实缴金额"))); |
| | | } |
| | | |
| | | if (map.get("费用所属年份").equals("类型总计") && map2.containsKey("年份")){ |
| | | map.put("该年应缴总额",((BigDecimal)map.get("该年应缴总额")).add((BigDecimal)map2.get("应缴金额"))); |
| | | map.put(map2.get("年份")+"年实缴", ((BigDecimal)map.get(map2.get("年份")+"年实缴")).add((BigDecimal)map2.get("实缴金额"))); |
| | | } |
| | | if (map.get("费用所属年份").equals("类型总计") && (Long)map2.get("年份") == currentYear && map2.containsKey("月份")){ |
| | | Long month = (Long)map2.get("月份"); |
| | | map.put("当年"+(month > 9 ? month : "0" + month)+"月实缴",((BigDecimal)map.get("当年"+(month > 9 ? month : "0" + month)+"月实缴")).add((BigDecimal) map2.get("实缴金额"))); |
| | | } |
| | | } |
| | | BigDecimal allPayable = new BigDecimal(0); |
| | | for (int a : arr){ |
| | | BigDecimal bigDecimal = (BigDecimal) map.get(a+"年实缴"); |
| | | allPayable=allPayable.add(bigDecimal); |
| | | } |
| | | map.put("每月费用", new BigDecimal(((BigDecimal) map.get("该年应缴总额")).doubleValue() / ((Long) map.get("应收月份数")))); |
| | | map.put("当年收缴率", new BigDecimal(allPayable.doubleValue() / ((BigDecimal) map.get("该年应缴总额")).doubleValue() * 100)); |
| | | } |
| | | } |
| | | DictDto dictDto = new DictDto(); |
| | | dictDto.setTableName("pay_fee_config"); |
| | | dictDto.setTableColumns("fee_type_cd"); |
| | |
| | | LinkedList<FeeDto> feeDtos = new LinkedList<>();//总的 |
| | | int kg = 0; |
| | | for (Map map : result){ |
| | | if(map.get("费用所属年份").equals("类型总计") && map.get("fee_type_cd").equals(dictDto1.getStatusCd())){ |
| | | BigDecimal[] doubles = new BigDecimal[doYear - 1 + 20]; |
| | | doubles[0] = (BigDecimal) map.get("该年应缴总额"); |
| | | doubles[1] = (BigDecimal) map.get("每月费用"); |
| | | doubles[2] = (BigDecimal) map.get("应收月份数"); |
| | | doubles[3] = (BigDecimal) map.get("当年收缴率"); |
| | | doubles[4] = (BigDecimal) map.get("折扣金额"); |
| | | if(map.get("费用所属年份").equals("类型总计") && map.containsKey("fee_type_cd") && map.get("fee_type_cd").equals(dictDto1.getStatusCd())){ |
| | | double[] doubles = new double[doYear - 1 + 20]; |
| | | doubles[0] = doubleUse(((BigDecimal) map.get("该年应缴总额")).doubleValue()); |
| | | doubles[1] = doubleUse(((BigDecimal) map.get("每月费用")).doubleValue()); |
| | | doubles[2] = doubleUse(((Long) map.get("应收月份数")).doubleValue()); |
| | | doubles[3] = doubleUse(((BigDecimal) map.get("当年收缴率")).doubleValue()); |
| | | doubles[4] = doubleUse(((BigDecimal) map.get("折扣金额")).doubleValue()); |
| | | int inde = 0; |
| | | for (int i : arr){ |
| | | if(i < currentYear){ |
| | | inde++; |
| | | doubles[i - startYear + 5] = (BigDecimal) map.get(i + "年实缴"); |
| | | doubles[i - startYear + 5] = doubleUse(((BigDecimal) map.get(i + "年实缴")).doubleValue()); |
| | | } |
| | | } |
| | | doubles[inde + 5] =(BigDecimal) map.get("当年预算"); |
| | | doubles[inde + 6] =(BigDecimal) map.get(currentYear + "年实缴"); |
| | | doubles[inde + 7] =(BigDecimal) map.get("当年折扣总额"); |
| | | doubles[inde + 8] =(BigDecimal) map.get("当年欠款"); |
| | | doubles[inde + 5] =doubleUse(((BigDecimal) map.get("当年预算")).doubleValue()); |
| | | doubles[inde + 6] =doubleUse(((BigDecimal) map.get(currentYear + "年实缴")).doubleValue()); |
| | | doubles[inde + 7] =doubleUse(((BigDecimal) map.get("当年折扣总额")).doubleValue()); |
| | | doubles[inde + 8] =doubleUse(((BigDecimal) map.get("当年欠款")).doubleValue()); |
| | | |
| | | for (int i = 1 ; i <= 12 ; i++){ |
| | | doubles[inde + 8 + i] =(BigDecimal) map.get("当年"+(i < 10 ? "0"+i : i) +"月实缴"); |
| | | doubles[inde + 8 + i] =doubleUse(((BigDecimal) map.get("当年"+(i < 10 ? "0"+i : i) +"月实缴")).doubleValue()); |
| | | } |
| | | feeDto.setCurYear(dictDto1.getName()+"总计"); |
| | | if(Integer.parseInt(dictDto1.getStatusCd())%630000000 < 3){ |
| | | for(int i = 0 ; i < doubles.length ; i++){ |
| | | if(i == 3){ |
| | | if (doubles[i].intValue() != 0){ |
| | | col1Fee[i] = BigDecimal.valueOf((doubles[i].add(col1Fee[i])).doubleValue()/2); |
| | | col2Fee[i] = BigDecimal.valueOf((doubles[i].add(col1Fee[i])).doubleValue()/2); |
| | | if (doubles[i] != 0){ |
| | | col1Fee[i] = doubleUse((doubles[i]+col1Fee[i])/2); |
| | | col2Fee[i] = doubleUse((doubles[i]+col2Fee[i])/2); |
| | | } |
| | | }else{ |
| | | col1Fee[i].add(doubleUse(doubles[i])); |
| | | col2Fee[i].add(doubleUse(doubles[i])); |
| | | col1Fee[i] = doubleUse(doubles[i]+col1Fee[i]); |
| | | col2Fee[i] = doubleUse(doubles[i]+col2Fee[i]); |
| | | } |
| | | } |
| | | } |
| | | else if(Integer.parseInt(dictDto1.getStatusCd())%630000000 < 8){ |
| | | for(int i = 0 ; i < doubles.length ; i++){ |
| | | if(i == 3){ |
| | | if (doubles[i].intValue() != 0){ |
| | | col1Fee[i] = BigDecimal.valueOf((doubles[i].add(col1Fee[i])).doubleValue()/2); |
| | | col2Fee[i] = BigDecimal.valueOf((doubles[i].add(col1Fee[i])).doubleValue()/2); |
| | | if (doubles[i] != 0){ |
| | | col1Fee[i] = doubleUse((doubles[i]+col1Fee[i])/2); |
| | | colByCar[i] = doubleUse((doubles[i]+colByCar[i])/2); |
| | | } |
| | | }else{ |
| | | col1Fee[i].add(doubleUse(doubles[i])); |
| | | col2Fee[i].add(doubleUse(doubles[i])); |
| | | col1Fee[i] = doubleUse(doubles[i]+col1Fee[i]); |
| | | colByCar[i] = doubleUse(colByCar[i] + doubles[i]); |
| | | } |
| | | } |
| | | }else{ |
| | | for(int i = 0 ; i < doubles.length ; i++){ |
| | | if(i == 3){ |
| | | if (doubles[i].intValue() != 0){ |
| | | col1Fee[i] = BigDecimal.valueOf((doubles[i].add(col1Fee[i])).doubleValue()/2); |
| | | col2Fee[i] = BigDecimal.valueOf((doubles[i].add(col1Fee[i])).doubleValue()/2); |
| | | if (doubles[i] != 0){ |
| | | col1Fee[i] = doubleUse((doubles[i]+col1Fee[i])/2); |
| | | colByOther[i] = doubleUse((doubles[i]+colByOther[i])/2); |
| | | } |
| | | }else{ |
| | | col1Fee[i].add(doubleUse(doubles[i])); |
| | | col2Fee[i].add(doubleUse(doubles[i])); |
| | | col1Fee[i] = doubleUse(doubles[i]+col1Fee[i]); |
| | | colByOther[i] = doubleUse(colByOther[i] + doubles[i]); |
| | | } |
| | | } |
| | | } |
| | |
| | | feeDto.setCurYear("类型总计"); |
| | | } |
| | | if (feeDto.getReport() == null){ |
| | | feeDto.setReport(new BigDecimal[doYear - 1 + 20]); |
| | | feeDto.setReport(new double[doYear - 1 + 20]); |
| | | } |
| | | if(feeDto.getFeeTypeCdName() == null) { |
| | | feeDto.setFeeTypeCdName(dictDto1.getName()); |
| | |
| | | kg = 0; |
| | | for (Map map : result){ |
| | | if(map.get("费用所属年份").equals(i+"") && map.get("fee_type_cd").equals(dictDto1.getStatusCd())){ |
| | | BigDecimal[] doubles = new BigDecimal[doYear - 1 + 20]; |
| | | doubles[0] = (BigDecimal) map.get("该年应缴总额"); |
| | | doubles[1] = (BigDecimal) map.get("每月费用"); |
| | | doubles[2] = (BigDecimal) map.get("应收月份数"); |
| | | doubles[3] = (BigDecimal) map.get("当年收缴率"); |
| | | doubles[4] = (BigDecimal) map.get("折扣金额"); |
| | | double[] doubles = new double[doYear - 1 + 20]; |
| | | doubles[0] = doubleUse(((BigDecimal) map.get("该年应缴总额")).doubleValue()); |
| | | doubles[1] = map.get("每月费用") == null ? 0 : doubleUse(((BigDecimal) map.get("每月费用")).doubleValue()); |
| | | doubles[2] = doubleUse(((Long) map.get("应收月份数")).doubleValue()); |
| | | doubles[3] = doubleUse(((BigDecimal) map.get("当年收缴率")).doubleValue()); |
| | | doubles[4] = doubleUse(((BigDecimal) map.get("折扣金额")).doubleValue()); |
| | | int inde = 0; |
| | | for (int in : arr){ |
| | | if(in < currentYear){ |
| | | if(in < currentYear && !(map.get("费用所属年份").equals("类型总计"))){ |
| | | inde++; |
| | | doubles[in - startYear + 5] = (BigDecimal) map.get(i + "年实缴"); |
| | | doubles[in - startYear + 5] = doubleUse(((BigDecimal) map.get(in + "年实缴")).doubleValue()); |
| | | } |
| | | } |
| | | doubles[inde + 5] =(BigDecimal) map.get("当年预算"); |
| | | doubles[inde + 6] =(BigDecimal) map.get(currentYear + "年实缴"); |
| | | doubles[inde + 7] =(BigDecimal) map.get("当年折扣总额"); |
| | | doubles[inde + 8] =(BigDecimal) map.get("当年欠款"); |
| | | doubles[inde + 5] =doubleUse(((BigDecimal) map.get("当年预算")).doubleValue()); |
| | | doubles[inde + 6] =doubleUse(((BigDecimal) map.get(currentYear + "年实缴")).doubleValue()); |
| | | doubles[inde + 7] =doubleUse(((BigDecimal) map.get("当年折扣总额")).doubleValue()); |
| | | doubles[inde + 8] =doubleUse(((BigDecimal) map.get("当年欠款")).doubleValue()); |
| | | |
| | | for (int in = 1 ; in <= 12 ; in++){ |
| | | doubles[inde + 8 + in] =(BigDecimal) map.get("当年"+(in < 10 ? "0"+in : in) +"月实缴"); |
| | | doubles[inde + 8 + in] =doubleUse(((BigDecimal) map.get("当年"+(in < 10 ? "0"+in : in) +"月实缴")).doubleValue()); |
| | | } |
| | | feeDto = new FeeDto(); |
| | | feeDto.setFeeTypeCdName(dictDto1.getName()); |
| | |
| | | feeDto = new FeeDto(); |
| | | feeDto.setFeeTypeCdName(dictDto1.getName()); |
| | | feeDto.setCurYear(String.valueOf(i)); |
| | | feeDto.setReport(new BigDecimal[doYear - 1 + 20]); |
| | | feeDto.setReport(new double[doYear - 1 + 20]); |
| | | feeDto.setCount(ind); |
| | | feeDtos2.add(feeDto); |
| | | } |
| | |
| | | linkedList.add(feeDto1); |
| | | reportFeeDtoLists.add(linkedList); |
| | | } |
| | | if (ind == 3){ |
| | | LinkedList linkedList = new LinkedList(); |
| | | FeeDto feeDto1 = new FeeDto(); |
| | | feeDto1.setCurYear("停车费合计(3+...+7)"); |
| | | feeDto1.setReport(colByCar); |
| | | linkedList.add(feeDto1); |
| | | reportFeeDtoLists.add(linkedList); |
| | | if (ind == 2){ |
| | | // fee.setCurYear("停车费合计(3+...+7)"); |
| | | // fee.setReport(colByCar); |
| | | // carFeeList.add(fee); |
| | | reportFeeDtoLists.add(carFeeList); |
| | | } |
| | | if (ind == 8){ |
| | | LinkedList linkedList = new LinkedList(); |
| | | FeeDto feeDto1 = new FeeDto(); |
| | | feeDto1.setCurYear("其他类合计(8+...+22)"); |
| | | feeDto1.setReport(colByOther); |
| | | linkedList.add(feeDto1); |
| | | reportFeeDtoLists.add(linkedList); |
| | | if (ind == 7){ |
| | | // fee2.setCurYear("其他类合计(8+...+22)"); |
| | | // fee2.setReport(colByOther); |
| | | // otherFeeList.add(fee2); |
| | | reportFeeDtoLists.add(otherFeeList); |
| | | } |
| | | ind ++; |
| | | } |
| | | } |
| | | public BigDecimal doubleUse(BigDecimal num){ |
| | | return num; |
| | | public double doubleUse(double num){ |
| | | return (int)(num * 100) / 100.0; |
| | | } |
| | | } |