| @@ -20,7 +20,7 @@ public interface WxBillDepositMapper extends CommonMapper<WxBillDeposit, Long> { | |||||
| Map<String,Object> queryOweInfoAll(Map<String,Object> params); | Map<String,Object> queryOweInfoAll(Map<String,Object> params); | ||||
| Map<String,Object> queryPayInfoAll(Map<String,Object> params); | |||||
| Map<String,Object> queryPayInfoAllTotal(Map<String,Object> params); | |||||
| void updateNotPaidStatus(Map<String,Object> params); | void updateNotPaidStatus(Map<String,Object> params); | ||||
| @@ -19,7 +19,7 @@ public interface WxBillOtherMapper extends CommonMapper<WxBillOther, Long> { | |||||
| List<Map<String,Object>> queryBillList(WxBillOther record); | List<Map<String,Object>> queryBillList(WxBillOther record); | ||||
| Map<String,Object> queryPayInfo(Map<String,Object> params); | |||||
| Map<String,Object> queryPayInfoTotal(Map<String,Object> params); | |||||
| Map<String,Object> queryOweInfo(Map<String,Object> params); | Map<String,Object> queryOweInfo(Map<String,Object> params); | ||||
| } | } | ||||
| @@ -20,6 +20,8 @@ public interface WxBillPropertyMapper extends CommonMapper<WxBillProperty, Long> | |||||
| Map<String,Object> queryPayInfo(Map<String,Object> params); | Map<String,Object> queryPayInfo(Map<String,Object> params); | ||||
| Map<String,Object> queryPayInfoTotal(Map<String,Object> params); | |||||
| Map<String,Object> queryOweInfo(Map<String,Object> params); | Map<String,Object> queryOweInfo(Map<String,Object> params); | ||||
| void updateNotPaidStatus(Map<String,Object> params); | void updateNotPaidStatus(Map<String,Object> params); | ||||
| @@ -18,6 +18,8 @@ public interface WxBillRentMapper extends CommonMapper<WxBillRent, Long> { | |||||
| Map<String,Object> queryPayInfo(Map<String,Object> params); | Map<String,Object> queryPayInfo(Map<String,Object> params); | ||||
| Map<String,Object> queryPayInfoTotal(Map<String,Object> params); | |||||
| Map<String,Object> queryOweInfo(Map<String,Object> params); | Map<String,Object> queryOweInfo(Map<String,Object> params); | ||||
| void updateNotPaidStatus(Map<String,Object> params); | void updateNotPaidStatus(Map<String,Object> params); | ||||
| @@ -2294,6 +2294,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| return new ResultData(datamap); | return new ResultData(datamap); | ||||
| } | } | ||||
| public static void main(String[] args) { | |||||
| double a = 0.0; | |||||
| System.out.println(a==0.0); | |||||
| System.out.println(); | |||||
| } | |||||
| /** | /** | ||||
| * 费用收缴数据 | * 费用收缴数据 | ||||
| * @param tenantId | * @param tenantId | ||||
| @@ -2305,12 +2311,12 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| startDate = DateUtils.getFirstDayForCurrMonth(startDate); | startDate = DateUtils.getFirstDayForCurrMonth(startDate); | ||||
| Date endDate = DateUtils.getLastDayForMonth(startDate); | Date endDate = DateUtils.getLastDayForMonth(startDate); | ||||
| //租金收缴率 | |||||
| //租金收缴率 ysje 应收金额 ssje 实收金额 zjsjl收缴率 | |||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", tenantId); | params.put("tenantId", tenantId); | ||||
| params.put("startdate", DateUtils.date2String(startDate,"yyyy-MM-dd") + " 00:00:00"); | params.put("startdate", DateUtils.date2String(startDate,"yyyy-MM-dd") + " 00:00:00"); | ||||
| params.put("enddate", DateUtils.date2String(endDate,"yyyy-MM-dd") + " 23:59:59"); | params.put("enddate", DateUtils.date2String(endDate,"yyyy-MM-dd") + " 23:59:59"); | ||||
| Map<String, Object> payinfo = wxBillRentMapper.queryPayInfo(params); | |||||
| Map<String, Object> payinfo = wxBillRentMapper.queryPayInfoTotal(params); | |||||
| if (payinfo != null) { | if (payinfo != null) { | ||||
| BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | ||||
| BigDecimal pay = (BigDecimal) payinfo.get("pay"); | BigDecimal pay = (BigDecimal) payinfo.get("pay"); | ||||
| @@ -2332,7 +2338,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| } | } | ||||
| //物业费收缴率 | //物业费收缴率 | ||||
| payinfo = wxBillPropertyMapper.queryPayInfo(params); | |||||
| payinfo = wxBillPropertyMapper.queryPayInfoTotal(params); | |||||
| if (payinfo != null) { | if (payinfo != null) { | ||||
| BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | ||||
| BigDecimal pay = (BigDecimal) payinfo.get("pay"); | BigDecimal pay = (BigDecimal) payinfo.get("pay"); | ||||
| @@ -2354,7 +2360,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| } | } | ||||
| //押金收缴率 | //押金收缴率 | ||||
| payinfo = wxBillDepositMapper.queryPayInfoAll(params); | |||||
| payinfo = wxBillDepositMapper.queryPayInfoAllTotal(params); | |||||
| if (payinfo != null) { | if (payinfo != null) { | ||||
| BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | ||||
| BigDecimal pay = (BigDecimal) payinfo.get("pay"); | BigDecimal pay = (BigDecimal) payinfo.get("pay"); | ||||
| @@ -2376,7 +2382,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| } | } | ||||
| //其他费用收缴率 | //其他费用收缴率 | ||||
| payinfo = wxBillOtherMapper.queryPayInfo(params); | |||||
| payinfo = wxBillOtherMapper.queryPayInfoTotal(params); | |||||
| if (payinfo != null) { | if (payinfo != null) { | ||||
| BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | ||||
| BigDecimal pay = (BigDecimal) payinfo.get("pay"); | BigDecimal pay = (BigDecimal) payinfo.get("pay"); | ||||
| @@ -114,6 +114,8 @@ public class WxTopicServiceImpl implements WxTopicService { | |||||
| String[] couponArray = couponId.split("-"); | String[] couponArray = couponId.split("-"); | ||||
| //保存coupon_channel | //保存coupon_channel | ||||
| WxCoupon wxCoupon = wxCouponMapper.selectByPrimaryKey(Long.parseLong(couponArray[1])); | WxCoupon wxCoupon = wxCouponMapper.selectByPrimaryKey(Long.parseLong(couponArray[1])); | ||||
| if(wxCoupon == null) | |||||
| System.out.println("------------"+couponArray[1]); | |||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | WxCouponChannel wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.setId(idWorker.nextId()); | wxCouponChannel.setId(idWorker.nextId()); | ||||
| wxCouponChannel.setBeginTime(record.getBeginTime()); | wxCouponChannel.setBeginTime(record.getBeginTime()); | ||||
| @@ -546,5 +546,6 @@ | |||||
| left join wx_merchant_shop ms on ms.`merchant_id` = m.id | left join wx_merchant_shop ms on ms.`merchant_id` = m.id | ||||
| left join wx_shop ws on ms.`shop_id` = ws.id | left join wx_shop ws on ms.`shop_id` = ws.id | ||||
| where m.status=1 and m.tenant_id = #{tenantId} | where m.status=1 and m.tenant_id = #{tenantId} | ||||
| order by totalOwe desc | |||||
| </select> | </select> | ||||
| </mapper> | </mapper> | ||||
| @@ -97,19 +97,18 @@ | |||||
| group by tenant_id | group by tenant_id | ||||
| </select> | </select> | ||||
| <select id="queryPayInfoAll" resultType="hashmap" parameterType="hashmap"> | |||||
| <select id="queryPayInfoAllTotal" resultType="hashmap" parameterType="hashmap"> | |||||
| select sum(res.receivepay) receivepay,sum(res.pay) pay,res.tenant_id from | select sum(res.receivepay) receivepay,sum(res.pay) pay,res.tenant_id from | ||||
| ( | ( | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_deposit | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_deposit | ||||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||||
| union all | union all | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property_deposit | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property_deposit | ||||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||||
| union all | union all | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_other_deposit | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_other_deposit | ||||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||||
| ) res | ) res | ||||
| group by res.tenant_id | |||||
| </select> | </select> | ||||
| <select id="queryOweInfoAll" resultType="hashmap" parameterType="hashmap"> | <select id="queryOweInfoAll" resultType="hashmap" parameterType="hashmap"> | ||||
| @@ -98,10 +98,17 @@ | |||||
| </update> | </update> | ||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_other | |||||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||||
| <select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap"> | |||||
| select sum(t.receivepay),receivepay,sum(t.pay) pay from | |||||
| ( | |||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_other | |||||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||||
| group by tenant_id | group by tenant_id | ||||
| union | |||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_daily | |||||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} | |||||
| group by tenant_id | |||||
| ) t | |||||
| </select> | </select> | ||||
| @@ -116,10 +116,17 @@ | |||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property | ||||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} and is_preview = 0 | |||||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||||
| group by tenant_id | group by tenant_id | ||||
| </select> | </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_property | |||||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||||
| </select> | |||||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property | select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property | ||||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | ||||
| @@ -124,6 +124,12 @@ | |||||
| group by tenant_id | group by tenant_id | ||||
| </select> | </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 | |||||
| where tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | |||||
| </select> | |||||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent | select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent | ||||
| where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | where status = 1 and tenant_id=#{tenantId} and receive_date between #{startdate} and #{enddate} and is_preview = 0 | ||||