diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillSettleController.java b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillSettleController.java index fb796aa26..11f93695c 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillSettleController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillSettleController.java @@ -60,7 +60,7 @@ public class WxBillSettleController extends BaseController { @SystemControllerLog(description = "账单管理-结算单-id查找") public ResultData findById(Long id) { logger.debug("[" + getIpAddr() + "] WxBillSettleController::findById"); - return new ResultData(Result.SUCCESS, "查询成功", wxBillSettleService.getById(id, EnumFilterSettle.NO.getCode())); + return new ResultData(Result.SUCCESS, "查询成功", wxBillSettleService.getById(id, EnumFilterSettle.YES.getCode())); } @PostMapping("addOrUpdate") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java index bc9d228e6..0c99f26b8 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java @@ -170,9 +170,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillRent dbBill = wxBillRentMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); @@ -187,9 +187,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillDeposit dbBill = wxBillDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillDepositMapper.updateByPrimaryKeySelective(wxBillRent); @@ -204,9 +204,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - wxBillOtherDeposit.setPay(dbBill.getOwe()); + wxBillOtherDeposit.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillOtherDeposit); @@ -221,9 +221,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - propertyDeposit.setPay(dbBill.getOwe()); + propertyDeposit.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillPropertyDepositMapper.updateByPrimaryKeySelective(propertyDeposit); @@ -239,9 +239,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillProperty dbBill = wxBillPropertyMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillRent); @@ -256,9 +256,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - propertyDeposit.setPay(dbBill.getOwe()); + propertyDeposit.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillPropertyDepositMapper.updateByPrimaryKeySelective(propertyDeposit); @@ -273,9 +273,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOther dbBill = wxBillOtherMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillOtherMapper.updateByPrimaryKeySelective(wxBillRent); @@ -290,9 +290,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillRent); @@ -315,9 +315,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillRent); @@ -332,9 +332,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillDaily dbBill = wxBillDailyMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { - wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPay(dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); - addBillAction(bill.getBillId(), dbBill.getOwe()); + addBillAction(bill.getBillId(), dbBill.getReceivePay()); } } wxBillDailyMapper.updateByPrimaryKeySelective(wxBillRent); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java index da383b1e8..0fce5b60d 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBusinessServiceImpl.java @@ -132,7 +132,7 @@ public class WxBusinessServiceImpl implements WxBusinessService { e.put("rent",0); }else { BigDecimal area = new BigDecimal(e.get("area").toString()); - if (area.longValue() > 0) { + if (area.doubleValue() > 0) { BigDecimal areaRatio = businessSumMoney.divide(area, 2, BigDecimal.ROUND_HALF_UP).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); e.put("rent", areaRatio.toBigInteger()); } diff --git a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml index e50cf0103..b2137e784 100644 --- a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml @@ -86,13 +86,13 @@ round( (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) from wx_merchant m - left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) + left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and STR_TO_DATE(mtd.report_date,'%Y-%m-%d') between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) /100,2) volume, round( (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) from wx_merchant m - left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) + left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and STR_TO_DATE(mtd.report_date,'%Y-%m-%d') between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) / (select if(sum(ws.operation_area) is null,0,sum(ws.operation_area)) from wx_merchant m @@ -105,15 +105,15 @@ from wx_merchant m left join wx_merchant_shop mtd on mtd.merchant_id = m.id left join wx_shop ws on(mtd.shop_id = ws.id) - where m.business_id = b.id and m.tenant_id=456 and m.status = 1 and m.is_del = 0 )area, + where m.business_id = b.id and m.tenant_id=#{tenantId} and m.status = 1 and m.is_del = 0 )area, round( (select if(sum(mtd.trade_amt) is null,0,sum(mtd.trade_amt)) from wx_merchant m - left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) / + left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and STR_TO_DATE(mtd.report_date,'%Y-%m-%d') between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) / (select sum(mtd.trade_count) from wx_merchant m - left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.report_date between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) + left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and STR_TO_DATE(mtd.report_date,'%Y-%m-%d') between #{startdate} and #{enddate} and m.status = 1 and m.is_del = 0 ) /100,2) comPrice from wx_business b