| @@ -65,6 +65,15 @@ public class WxBillAll { | |||
| @io.swagger.annotations.ApiModelProperty(value = "欠缴总额", name = "totalOwe") | |||
| private Integer totalOwe; | |||
| private List<String> billTypeList; | |||
| public List<String> getBillTypeList() { | |||
| return billTypeList; | |||
| } | |||
| public void setBillTypeList(List<String> billTypeList) { | |||
| this.billTypeList = billTypeList; | |||
| } | |||
| public Integer getRentOwe() { | |||
| return rentOwe; | |||
| @@ -0,0 +1,43 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumBillTypeStr { | |||
| RENT("租金", "租金"), | |||
| RENT_D("租赁押金", "租赁押金"), | |||
| PROPERTY("物业费","物业费"), | |||
| PROPERTY_D("物业押金", "物业押金"), | |||
| W("水费", "水费"), | |||
| D("电费", "电费"), | |||
| K("空调费", "空调费"), | |||
| O("其他", "其他"), | |||
| O_D("其他押金", "其他押金"), | |||
| ; | |||
| public static EnumBillTypeStr getEnum(String code) { | |||
| for (EnumBillTypeStr value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private String code; | |||
| private String message; | |||
| EnumBillTypeStr(String String, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public String getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -71,6 +71,8 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| @Autowired | |||
| WxBillOtherMapper wxBillOtherMapper; | |||
| @Autowired | |||
| WxBillAllMapper wxBillAllMapper; | |||
| @Autowired | |||
| MarkingDataReportService markingDataReportService; | |||
| @Override | |||
| @@ -2397,9 +2399,15 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| datamap.put("otherzjsjl", 0); | |||
| } | |||
| //欠缴数据 | |||
| //==========欠缴数据========= | |||
| BigDecimal totalOwe = new BigDecimal(0); | |||
| payinfo = wxBillRentMapper.queryOweInfo(params); | |||
| WxBillAll wxBillAll = new WxBillAll(); | |||
| wxBillAll.setTenantId(tenantId); | |||
| wxBillAll.setMonth(new SimpleDateFormat("yyyy-MM").format(startDate)); | |||
| List<String> billTypeList = new ArrayList<>(); | |||
| billTypeList.add(EnumBillTypeStr.RENT.getCode()); | |||
| wxBillAll.setBillTypeList(billTypeList); | |||
| payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); | |||
| if (payinfo != null) { | |||
| BigDecimal owe = (BigDecimal) payinfo.get("owe"); | |||
| totalOwe = totalOwe.add(owe); | |||
| @@ -2408,7 +2416,10 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| datamap.put("rentOwe", 0); | |||
| } | |||
| payinfo = wxBillPropertyMapper.queryOweInfo(params); | |||
| billTypeList = new ArrayList<>(); | |||
| billTypeList.add(EnumBillTypeStr.PROPERTY.getCode()); | |||
| wxBillAll.setBillTypeList(billTypeList); | |||
| payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); | |||
| if (payinfo != null) { | |||
| BigDecimal owe = (BigDecimal) payinfo.get("owe"); | |||
| totalOwe = totalOwe.add(owe); | |||
| @@ -2417,25 +2428,35 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| datamap.put("propertyOwe", 0); | |||
| } | |||
| payinfo = wxBillOtherMapper.queryOweInfo(params); | |||
| billTypeList = new ArrayList<>(); | |||
| billTypeList.add(EnumBillTypeStr.O_D.getCode()); | |||
| billTypeList.add(EnumBillTypeStr.PROPERTY_D.getCode()); | |||
| billTypeList.add(EnumBillTypeStr.RENT_D.getCode()); | |||
| wxBillAll.setBillTypeList(billTypeList); | |||
| payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); | |||
| if (payinfo != null) { | |||
| BigDecimal owe = (BigDecimal) payinfo.get("owe"); | |||
| totalOwe = totalOwe.add(owe); | |||
| datamap.put("otherOwe", owe); | |||
| datamap.put("depositOwe", owe); | |||
| } else { | |||
| datamap.put("otherOwe", 0); | |||
| datamap.put("depositOwe", 0); | |||
| } | |||
| payinfo = wxBillDepositMapper.queryOweInfoAll(params); | |||
| billTypeList = new ArrayList<>(); | |||
| billTypeList.add(EnumBillTypeStr.D.getCode()); | |||
| billTypeList.add(EnumBillTypeStr.W.getCode()); | |||
| billTypeList.add(EnumBillTypeStr.K.getCode()); | |||
| billTypeList.add(EnumBillTypeStr.O.getCode()); | |||
| payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); | |||
| if (payinfo != null) { | |||
| BigDecimal owe = (BigDecimal) payinfo.get("owe"); | |||
| totalOwe = totalOwe.add(owe); | |||
| datamap.put("totalOwe", owe); | |||
| datamap.put("otherOwe", owe); | |||
| } else { | |||
| datamap.put("totalOwe", 0); | |||
| datamap.put("otherOwe", 0); | |||
| } | |||
| datamap.put("totalOwe", totalOwe); | |||
| datamap.put("totalOwe", totalOwe); | |||
| return new ResultData(datamap); | |||
| } | |||
| @@ -98,7 +98,7 @@ | |||
| </select> | |||
| <select id="queryPayInfoAllTotal" resultType="hashmap" parameterType="hashmap"> | |||
| select sum(res.receivepay) receivepay,sum(res.pay) pay,res.tenant_id from | |||
| select round(sum(res.receivepay)/100,2),round(sum(res.pay)/100,2) pay,res.tenant_id from | |||
| ( | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_deposit | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||
| @@ -115,13 +115,13 @@ | |||
| select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from | |||
| ( | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent_deposit | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||
| union all | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property_deposit | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||
| union all | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_other_deposit | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||
| ) res | |||
| </select> | |||
| @@ -111,8 +111,14 @@ | |||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(round(sum(owe)/100,2),0) owe,tenant_id from wx_bill_other | |||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||
| select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from | |||
| ( | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_daily | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and status = 1 | |||
| union all | |||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_daily | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and status = 1 | |||
| ) res | |||
| </select> | |||
| </mapper> | |||
| @@ -122,7 +122,7 @@ | |||
| <select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property | |||
| select round(sum(receive_pay)/100,2) receivepay,round(sum(pay)/100,2) pay,tenant_id from wx_bill_property | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||
| </select> | |||
| @@ -125,7 +125,7 @@ | |||
| </select> | |||
| <select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent | |||
| select round(sum(receive_pay)/100,2) receivepay,round(sum(pay)/100,2) pay,tenant_id from wx_bill_rent | |||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||
| </select> | |||