diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/BillStatusSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/BillStatusSchedule.java index 0d67b0507..304050212 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/BillStatusSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/BillStatusSchedule.java @@ -31,21 +31,21 @@ public class BillStatusSchedule { /** * 每天1点执行 */ - @Async - @Scheduled(cron = "0 0 1 * * ?") - public void updateBillStatus() { - logger.info("账单状态更新开始"); - - List wxMalls = wxMallMapper.findList(null); - for (WxMall wxMall : wxMalls) { - TenantEntity tenantEntity = wxMall.getTenantInfo(); - WxBillAll wxBillAll = new WxBillAll(); - wxBillAll.updateTenantInfo(tenantEntity); - wxBillAllService.updateBillStatus(wxBillAll); - } - - logger.info("账单状态更新结束"); - } +// @Async +// @Scheduled(cron = "0 0 1 * * ?") +// public void updateBillStatus() { +// logger.info("账单状态更新开始"); +// +// List wxMalls = wxMallMapper.findList(null); +// for (WxMall wxMall : wxMalls) { +// TenantEntity tenantEntity = wxMall.getTenantInfo(); +// WxBillAll wxBillAll = new WxBillAll(); +// wxBillAll.updateTenantInfo(tenantEntity); +// wxBillAllService.updateBillStatus(wxBillAll); +// } +// +// logger.info("账单状态更新结束"); +// } } \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumBillStatus.java b/mallinkService/src/main/java/com/iformall/enums/EnumBillStatus.java index 3f3cb316f..840910ff9 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumBillStatus.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumBillStatus.java @@ -6,11 +6,11 @@ package com.iformall.enums; */ public enum EnumBillStatus { - NOT_PAID(1, "欠缴"), + //NOT_PAID(1, "欠缴"), + //NOT_EXPIRED(4,"未到期"), + //RETURN(5, "已退还"), WAIT_PAY(2,"待缴"), PAID(3, "已结清"), - NOT_EXPIRED(4,"未到期"), - //RETURN(5, "已退还"), INVALID(6, "失效"), BAD(7, "坏账"), STOP_TO_SETTLE(8,"退租待结算") diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java index a757562c3..b7498e812 100644 --- a/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java @@ -1003,8 +1003,8 @@ public class WxBillAllHelper { action.setBillType(bill.getBillType()); String oldReceivePay = bill.getReceivePay(); if (!bill.getStarttime().before(endTime)) { - if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.NOT_PAID.getCode().intValue() || - bill.getStatus().intValue() == EnumBillStatus.NOT_EXPIRED.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.BAD.getCode().intValue()) { + if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() || + bill.getStatus().intValue() == EnumBillStatus.BAD.getCode().intValue()) { EnumBillStatus realBillStatus = EnumBillStatus.INVALID; String newReceivePay = bill.getReceivePay(); if (isPaid) { @@ -1041,8 +1041,8 @@ public class WxBillAllHelper { } action.setOldMoney(oldReceivePay); action.setNewMoney(newReceivePay); - if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.NOT_PAID.getCode().intValue() || - bill.getStatus().intValue() == EnumBillStatus.NOT_EXPIRED.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.BAD.getCode().intValue()) { + if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() + || bill.getStatus().intValue() == EnumBillStatus.BAD.getCode().intValue()) { bill.setReceivePay(newReceivePay); bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); action.setAction(EnumBillAction.UPDATE_BILL.getCode()); @@ -1060,8 +1060,7 @@ public class WxBillAllHelper { //do nothing } }else { - if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.NOT_PAID.getCode().intValue() || - bill.getStatus().intValue() == EnumBillStatus.NOT_EXPIRED.getCode().intValue()) { + if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue()) { if (isAllReturn) { if (isPaid) { bill.setReceivePay("0"); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java index 0d26c0662..661bc28ea 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java @@ -310,29 +310,29 @@ public class DataTowerServiceImpl implements DataTowerService { } //账单*********************************************** - private Map billRunning(TenantEntity tenantEntity) { - HashMap billMap = new HashMap<>(); - WxBillAll record = new WxBillAll(); - record.updateTenantInfo(tenantEntity); - Calendar instance = Calendar.getInstance(); - instance.set(Calendar.DAY_OF_YEAR, 1); - instance.set(Calendar.HOUR_OF_DAY, 0); - instance.set(Calendar.MINUTE, 0); - instance.set(Calendar.SECOND, 0); - String startdate = DateUtils.date2String(instance); - instance.clear(); - String enddate = DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss"); - record.setStarttime(startdate); - record.setEndtime(enddate); - record.setStatus(EnumBillStatus.NOT_PAID.getCode()); - Map oweInfo = wxBillAllMapper.queryOweInfo(record); - record.setStatus(EnumBillStatus.PAID.getCode()); - Map paidInfo = wxBillAllMapper.queryPaidInfo(record); - - billMap.putAll(oweInfo); - billMap.putAll(paidInfo); - return billMap; - } +// private Map billRunning(TenantEntity tenantEntity) { +// HashMap billMap = new HashMap<>(); +// WxBillAll record = new WxBillAll(); +// record.updateTenantInfo(tenantEntity); +// Calendar instance = Calendar.getInstance(); +// instance.set(Calendar.DAY_OF_YEAR, 1); +// instance.set(Calendar.HOUR_OF_DAY, 0); +// instance.set(Calendar.MINUTE, 0); +// instance.set(Calendar.SECOND, 0); +// String startdate = DateUtils.date2String(instance); +// instance.clear(); +// String enddate = DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss"); +// record.setStarttime(startdate); +// record.setEndtime(enddate); +// record.setStatus(EnumBillStatus.NOT_PAID.getCode()); +// Map oweInfo = wxBillAllMapper.queryOweInfo(record); +// record.setStatus(EnumBillStatus.PAID.getCode()); +// Map paidInfo = wxBillAllMapper.queryPaidInfo(record); +// +// billMap.putAll(oweInfo); +// billMap.putAll(paidInfo); +// return billMap; +// } //移动端首页 @Override diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index f0def32c6..7e217162b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -264,26 +264,26 @@ public class WxBillAllServiceImpl implements WxBillAllService { } public void cmputeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillAllVo e) { - if (e.getReceivePay() != null) { - if (e.getLatePayPrice() == null) { - e.setLatePayPrice(0L); - } - BigDecimal servicePay; - if (e.getServiceChargePay() != null) { - servicePay = new BigDecimal(e.getServiceChargePay()); - } else { - servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); - } - Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay(); - e.setRealReceivePay(realReceivePay); - e.setServiceChargePay(servicePay.intValue()); - if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode()) && - !e.getStatus().equals(EnumBillStatus.WAIT_PAY.getCode())) { - e.setOwe(0L); - } else { - e.setOwe(realReceivePay - e.getPay()); - } - } +// if (e.getReceivePay() != null) { +// if (e.getLatePayPrice() == null) { +// e.setLatePayPrice(0L); +// } +// BigDecimal servicePay; +// if (e.getServiceChargePay() != null) { +// servicePay = new BigDecimal(e.getServiceChargePay()); +// } else { +// servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); +// } +// Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay(); +// e.setRealReceivePay(realReceivePay); +// e.setServiceChargePay(servicePay.intValue()); +// if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode()) && +// !e.getStatus().equals(EnumBillStatus.WAIT_PAY.getCode())) { +// e.setOwe(0L); +// } else { +// e.setOwe(realReceivePay - e.getPay()); +// } +// } } // @Override @@ -506,45 +506,45 @@ public class WxBillAllServiceImpl implements WxBillAllService { @Override public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillAll wxBillAll) { - Map> collect = list(wxBillAll) - .stream().filter(b -> null != b.getMerchantId()) - .collect(Collectors.groupingBy(WxBillAllVo::getMerchantId)); - Set>> entries = collect.entrySet(); - List datalist = new ArrayList<>(); - for (Map.Entry> entry : entries) { - List list = entry.getValue(); - for (WxBillAllVo wxBillAllVo : list) { - String shopNumber = wxBillAllVo.getShopNumber(); - if (StringUtils.isEmpty(shopNumber)) { - String shopInfo = wxBillAllVo.getShopInfo(); - if (StringUtils.isNotEmpty(shopInfo) && !shopInfo.equals("[]")) { - JSONObject jsonObject = JSONObject.parseObject(shopInfo); - StringBuffer sb = new StringBuffer(); - Set> sets = jsonObject.entrySet(); - sets.forEach(x -> sb.append(x.getKey()).append(",")); - if(StringUtils.isNotBlank(sb)){ - wxBillAllVo.setShopNumber(sb.deleteCharAt(sb.length() - 1).toString()); - } - } - } - wxBillAllVo.setPayDateStr(DateUtils.format(wxBillAllVo.getPayDate())); - wxBillAllVo.setRentStartTime(DateUtils.format(wxBillAllVo.getStarttime())); - wxBillAllVo.setRentEndTime(DateUtils.format(wxBillAllVo.getEndtime())); - - //status不是欠缴,都展示0,与前端保持一致 - if (!EnumBillStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) { - wxBillAllVo.setOwe(0L); - wxBillAllVo.setOweStr("0"); - } - datalist.add(wxBillAllVo); - } - } - WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillAll); - datalist.stream().forEach(e -> { - //手续费 = 合同应收+手续费+滞纳金 - cmputeTotalMoney(wxPayAccountBill, e); - }); - excelService.exportExcel(datalist, null, "账单数据", WxBillAllVo.class, "账单数据.xlsx", response, false); +// Map> collect = list(wxBillAll) +// .stream().filter(b -> null != b.getMerchantId()) +// .collect(Collectors.groupingBy(WxBillAllVo::getMerchantId)); +// Set>> entries = collect.entrySet(); +// List datalist = new ArrayList<>(); +// for (Map.Entry> entry : entries) { +// List list = entry.getValue(); +// for (WxBillAllVo wxBillAllVo : list) { +// String shopNumber = wxBillAllVo.getShopNumber(); +// if (StringUtils.isEmpty(shopNumber)) { +// String shopInfo = wxBillAllVo.getShopInfo(); +// if (StringUtils.isNotEmpty(shopInfo) && !shopInfo.equals("[]")) { +// JSONObject jsonObject = JSONObject.parseObject(shopInfo); +// StringBuffer sb = new StringBuffer(); +// Set> sets = jsonObject.entrySet(); +// sets.forEach(x -> sb.append(x.getKey()).append(",")); +// if(StringUtils.isNotBlank(sb)){ +// wxBillAllVo.setShopNumber(sb.deleteCharAt(sb.length() - 1).toString()); +// } +// } +// } +// wxBillAllVo.setPayDateStr(DateUtils.format(wxBillAllVo.getPayDate())); +// wxBillAllVo.setRentStartTime(DateUtils.format(wxBillAllVo.getStarttime())); +// wxBillAllVo.setRentEndTime(DateUtils.format(wxBillAllVo.getEndtime())); +// +// //status不是欠缴,都展示0,与前端保持一致 +// if (!EnumBillStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) { +// wxBillAllVo.setOwe(0L); +// wxBillAllVo.setOweStr("0"); +// } +// datalist.add(wxBillAllVo); +// } +// } +// WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillAll); +// datalist.stream().forEach(e -> { +// //手续费 = 合同应收+手续费+滞纳金 +// cmputeTotalMoney(wxPayAccountBill, e); +// }); +// excelService.exportExcel(datalist, null, "账单数据", WxBillAllVo.class, "账单数据.xlsx", response, false); } private int updateBillOtherDeposit(Map bill) { @@ -908,183 +908,183 @@ public class WxBillAllServiceImpl implements WxBillAllService { @Override public void exportOweBill(WxBillAll wxBillAll, HttpServletRequest request, HttpServletResponse response) { - //商场名称 -// WxMall q = new WxMall(); -// q.setTenantInfo(wxBillAll); - WxMall wxMall = wxMallMapper.getByTenantInfo(wxBillAll); - //映射结果 - Map result = new HashMap<>(); - result.put("mall", wxMall.getName()); - - //付款方式 - WxPayAccountBill wxPayAccountBill = new WxPayAccountBill(); - wxPayAccountBill.updateTenantInfo(wxBillAll); - WxPayAccountBill payAccountBill = wxPayAccountBillMapper.selectOne(new QueryWrapper(wxPayAccountBill)); - if (payAccountBill != null) { - String bankCardId = payAccountBill.getBankCardId(); - String bankAccountName = payAccountBill.getBankAccountName(); - result.put("accountNumber", StringUtils.isNotEmpty(bankCardId) ? bankCardId : " "); - result.put("accountName", StringUtils.isNotEmpty(bankAccountName) ? bankAccountName : " "); - } else { - result.put("accountNumber", " "); - result.put("accountName", " "); - } - - //编号 - String number = "JF" + DateUtils.getSystemTime("yyyyMMddHHmmss"); - result.put("number", number); - //数据 - Integer status = wxBillAll.getStatus(); - if (status == null) { - List statusList = new ArrayList<>(); - statusList.add(EnumBillStatus.NOT_PAID.getCode()); - statusList.add(EnumBillStatus.WAIT_PAY.getCode()); - statusList.add(EnumBillStatus.NOT_EXPIRED.getCode()); - wxBillAll.setStatusList(statusList); - //账单时间段 - result.put("starttime", wxBillAll.getStarttime()); - result.put("endtime", wxBillAll.getEndtime().substring(0, 10)); - } else { - result.put("starttime", " "); - result.put("endtime", " "); - } - Integer filterHasPay = wxBillAll.getFilterHasPay(); - - //租金 - wxBillAll.setBillTypeValue(EnumBillQueryType.RENT.getCode()); - List rentList = this.list(wxBillAll); - Long rentSum = 0l; - if(!rentList.isEmpty()){ - rentSum = rentList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - } - //商业管理费 - wxBillAll.setBillTypeValue(EnumBillQueryType.RENT_BUSSINESS_MANAGE.getCode()); - List bmList = this.list(wxBillAll); - Long bussinessManageSum = 0L; - if(!bmList.isEmpty()){ - bussinessManageSum = bmList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - } - //营业管理费 - wxBillAll.setBillTypeValue(EnumBillQueryType.RENT_OPERATING_MANAGE.getCode()); - List omList = this.list(wxBillAll); - Long operatingManageSum = 0L; - if(!omList.isEmpty()){ - operatingManageSum = omList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - } - - wxBillAll.setManageFeeType(null); - //物业 - wxBillAll.setBillTypeValue(EnumBillQueryType.PROPERTY.getCode()); - List propertyList = this.list(wxBillAll); - Long propertySum = 0l; - if(!propertyList.isEmpty()){ - propertySum = propertyList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - } - //押金 - List depositList = new ArrayList<>(); - //租赁押金 - wxBillAll.setBillTypeValue(EnumBillQueryType.RENT_DEPOSIT.getCode()); - List rentDepositList = this.list(wxBillAll); - depositList.addAll(rentDepositList); - //物业押金 - wxBillAll.setBillTypeValue(EnumBillQueryType.PROPERTY_DEPOSIT.getCode()); - List propertyDepositList = this.list(wxBillAll); - depositList.addAll(propertyDepositList); - //其他押金 - wxBillAll.setBillTypeValue(EnumBillQueryType.OTHER_DEPOSIT.getCode()); - List otherDepositList = this.list(wxBillAll); - depositList.addAll(otherDepositList); - - Long depositSum = 0l; - StringBuffer depositDetail = new StringBuffer();//押金明细 - if(!depositList.isEmpty()){ - depositSum = depositList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - depositList.stream().forEach(b -> { - BigDecimal owe = new BigDecimal(status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - depositDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); - }); - } - //水电空调费 - wxBillAll.setBillTypeValue(EnumBillQueryType.WATER_POWER_AIR.getCode()); - List waterPowerAirList = this.list(wxBillAll); - Long waterSum = 0l, powerSum = 0l, airConditioningSum = 0l; - if (!waterPowerAirList.isEmpty()) { - waterSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - powerSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - airConditioningSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - } - //其他费用 - wxBillAll.setBillTypeValue(EnumBillQueryType.OTHER.getCode()); - List otherList = this.list(wxBillAll); - Long otherSum = 0l; - StringBuffer otherDetail = new StringBuffer();//其他费用明细 - if(!otherList.isEmpty()){ - otherSum = otherList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); - otherList.stream().forEach(b -> { - BigDecimal owe = new BigDecimal(status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - otherDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); - }); - } - //总计 - Long summarySum = rentSum + bussinessManageSum + operatingManageSum + propertySum + depositSum + waterSum + powerSum + airConditioningSum + otherSum; - BigDecimal rent = new BigDecimal(rentSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - BigDecimal bussinessManage = new BigDecimal(bussinessManageSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - BigDecimal operatingManage = new BigDecimal(operatingManageSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - - BigDecimal property = new BigDecimal(propertySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - BigDecimal deposit = new BigDecimal(depositSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - BigDecimal water = new BigDecimal(waterSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - BigDecimal power = new BigDecimal(powerSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - BigDecimal airConditioning = new BigDecimal(airConditioningSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - BigDecimal other = new BigDecimal(otherSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - BigDecimal summary = new BigDecimal(summarySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); - String summaryUpper = PriceUtil.number2CNMontrayUnit(summary); - - result.put("rent", rent.toPlainString()); - result.put("bussinessManage", bussinessManage.toPlainString()); - result.put("operatingManage", operatingManage.toPlainString()); - result.put("property", property.toPlainString()); - result.put("deposit", deposit.toPlainString()); - result.put("water", water.toPlainString()); - result.put("power", power.toPlainString()); - result.put("airConditioning", airConditioning.toPlainString()); - result.put("other", other.toPlainString()); - result.put("summary", summary.toPlainString()); - result.put("summaryUpper", summaryUpper); - - result.put("depositDetail", StringUtils.isNotEmpty(depositDetail.toString()) ? depositDetail.toString() : " "); - result.put("otherDetail", StringUtils.isNotEmpty(otherDetail.toString()) ? otherDetail.toString() : " "); - - WxMerchantDto wxMerchantDto = new WxMerchantDto(); - wxMerchantDto.setId(wxBillAll.getMerchantId()); - wxMerchantDto.updateTenantInfo(wxMall); - PageInfo pageInfo = wxMerchantService.listAsPageCVo(wxMerchantDto,1,1,true); - List listCVo = pageInfo.getList(); - WxMerchantVo wxMerchantVo = listCVo.get(0); - result.put("merchant", wxMerchantVo.getMerchantName()); - WxShopVo wxShopVo = wxMerchantVo.getShopVoList().stream() - .filter(s -> StringUtils.isNotEmpty(s.getLinkPhone()) || StringUtils.isNotEmpty(s.getLinkPerson())).findFirst().orElse(null); - if (wxShopVo != null) { - String linkPerson = wxShopVo.getLinkPerson(); - String linkPhone = wxShopVo.getLinkPhone(); - result.put("linkPerson", StringUtils.isNotEmpty(linkPerson) ? linkPerson : " "); - result.put("linkPhone", StringUtils.isNotEmpty(linkPhone) ? linkPhone : " "); - } else { - result.put("linkPerson", " "); - result.put("linkPhone", " "); - } - - String createtime = DateUtils.getSystemTime("yyyy-MM-dd"); - result.put("createtime", createtime); - - String templatePath = "contract-word-template/bill_owe.docx"; - String filepath = fmUploadDir; - String filename = UUID.randomUUID() + ".docx"; - String exportFileName = "催缴单.docx"; - WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, null); +// //商场名称 +//// WxMall q = new WxMall(); +//// q.setTenantInfo(wxBillAll); +// WxMall wxMall = wxMallMapper.getByTenantInfo(wxBillAll); +// //映射结果 +// Map result = new HashMap<>(); +// result.put("mall", wxMall.getName()); +// +// //付款方式 +// WxPayAccountBill wxPayAccountBill = new WxPayAccountBill(); +// wxPayAccountBill.updateTenantInfo(wxBillAll); +// WxPayAccountBill payAccountBill = wxPayAccountBillMapper.selectOne(new QueryWrapper(wxPayAccountBill)); +// if (payAccountBill != null) { +// String bankCardId = payAccountBill.getBankCardId(); +// String bankAccountName = payAccountBill.getBankAccountName(); +// result.put("accountNumber", StringUtils.isNotEmpty(bankCardId) ? bankCardId : " "); +// result.put("accountName", StringUtils.isNotEmpty(bankAccountName) ? bankAccountName : " "); +// } else { +// result.put("accountNumber", " "); +// result.put("accountName", " "); +// } +// +// //编号 +// String number = "JF" + DateUtils.getSystemTime("yyyyMMddHHmmss"); +// result.put("number", number); +// //数据 +// Integer status = wxBillAll.getStatus(); +// if (status == null) { +// List statusList = new ArrayList<>(); +// statusList.add(EnumBillStatus.NOT_PAID.getCode()); +// statusList.add(EnumBillStatus.WAIT_PAY.getCode()); +// statusList.add(EnumBillStatus.NOT_EXPIRED.getCode()); +// wxBillAll.setStatusList(statusList); +// //账单时间段 +// result.put("starttime", wxBillAll.getStarttime()); +// result.put("endtime", wxBillAll.getEndtime().substring(0, 10)); +// } else { +// result.put("starttime", " "); +// result.put("endtime", " "); +// } +// Integer filterHasPay = wxBillAll.getFilterHasPay(); +// +// //租金 +// wxBillAll.setBillTypeValue(EnumBillQueryType.RENT.getCode()); +// List rentList = this.list(wxBillAll); +// Long rentSum = 0l; +// if(!rentList.isEmpty()){ +// rentSum = rentList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// } +// //商业管理费 +// wxBillAll.setBillTypeValue(EnumBillQueryType.RENT_BUSSINESS_MANAGE.getCode()); +// List bmList = this.list(wxBillAll); +// Long bussinessManageSum = 0L; +// if(!bmList.isEmpty()){ +// bussinessManageSum = bmList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// } +// //营业管理费 +// wxBillAll.setBillTypeValue(EnumBillQueryType.RENT_OPERATING_MANAGE.getCode()); +// List omList = this.list(wxBillAll); +// Long operatingManageSum = 0L; +// if(!omList.isEmpty()){ +// operatingManageSum = omList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// } +// +// wxBillAll.setManageFeeType(null); +// //物业 +// wxBillAll.setBillTypeValue(EnumBillQueryType.PROPERTY.getCode()); +// List propertyList = this.list(wxBillAll); +// Long propertySum = 0l; +// if(!propertyList.isEmpty()){ +// propertySum = propertyList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// } +// //押金 +// List depositList = new ArrayList<>(); +// //租赁押金 +// wxBillAll.setBillTypeValue(EnumBillQueryType.RENT_DEPOSIT.getCode()); +// List rentDepositList = this.list(wxBillAll); +// depositList.addAll(rentDepositList); +// //物业押金 +// wxBillAll.setBillTypeValue(EnumBillQueryType.PROPERTY_DEPOSIT.getCode()); +// List propertyDepositList = this.list(wxBillAll); +// depositList.addAll(propertyDepositList); +// //其他押金 +// wxBillAll.setBillTypeValue(EnumBillQueryType.OTHER_DEPOSIT.getCode()); +// List otherDepositList = this.list(wxBillAll); +// depositList.addAll(otherDepositList); +// +// Long depositSum = 0l; +// StringBuffer depositDetail = new StringBuffer();//押金明细 +// if(!depositList.isEmpty()){ +// depositSum = depositList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// depositList.stream().forEach(b -> { +// BigDecimal owe = new BigDecimal(status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// depositDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); +// }); +// } +// //水电空调费 +// wxBillAll.setBillTypeValue(EnumBillQueryType.WATER_POWER_AIR.getCode()); +// List waterPowerAirList = this.list(wxBillAll); +// Long waterSum = 0l, powerSum = 0l, airConditioningSum = 0l; +// if (!waterPowerAirList.isEmpty()) { +// waterSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode())) +// .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// powerSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode())) +// .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// airConditioningSum = waterPowerAirList.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())) +// .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// } +// //其他费用 +// wxBillAll.setBillTypeValue(EnumBillQueryType.OTHER.getCode()); +// List otherList = this.list(wxBillAll); +// Long otherSum = 0l; +// StringBuffer otherDetail = new StringBuffer();//其他费用明细 +// if(!otherList.isEmpty()){ +// otherSum = otherList.stream().collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); +// otherList.stream().forEach(b -> { +// BigDecimal owe = new BigDecimal(status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// otherDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); +// }); +// } +// //总计 +// Long summarySum = rentSum + bussinessManageSum + operatingManageSum + propertySum + depositSum + waterSum + powerSum + airConditioningSum + otherSum; +// BigDecimal rent = new BigDecimal(rentSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// BigDecimal bussinessManage = new BigDecimal(bussinessManageSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// BigDecimal operatingManage = new BigDecimal(operatingManageSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// +// BigDecimal property = new BigDecimal(propertySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// BigDecimal deposit = new BigDecimal(depositSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// BigDecimal water = new BigDecimal(waterSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// BigDecimal power = new BigDecimal(powerSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// BigDecimal airConditioning = new BigDecimal(airConditioningSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// BigDecimal other = new BigDecimal(otherSum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// BigDecimal summary = new BigDecimal(summarySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); +// String summaryUpper = PriceUtil.number2CNMontrayUnit(summary); +// +// result.put("rent", rent.toPlainString()); +// result.put("bussinessManage", bussinessManage.toPlainString()); +// result.put("operatingManage", operatingManage.toPlainString()); +// result.put("property", property.toPlainString()); +// result.put("deposit", deposit.toPlainString()); +// result.put("water", water.toPlainString()); +// result.put("power", power.toPlainString()); +// result.put("airConditioning", airConditioning.toPlainString()); +// result.put("other", other.toPlainString()); +// result.put("summary", summary.toPlainString()); +// result.put("summaryUpper", summaryUpper); +// +// result.put("depositDetail", StringUtils.isNotEmpty(depositDetail.toString()) ? depositDetail.toString() : " "); +// result.put("otherDetail", StringUtils.isNotEmpty(otherDetail.toString()) ? otherDetail.toString() : " "); +// +// WxMerchantDto wxMerchantDto = new WxMerchantDto(); +// wxMerchantDto.setId(wxBillAll.getMerchantId()); +// wxMerchantDto.updateTenantInfo(wxMall); +// PageInfo pageInfo = wxMerchantService.listAsPageCVo(wxMerchantDto,1,1,true); +// List listCVo = pageInfo.getList(); +// WxMerchantVo wxMerchantVo = listCVo.get(0); +// result.put("merchant", wxMerchantVo.getMerchantName()); +// WxShopVo wxShopVo = wxMerchantVo.getShopVoList().stream() +// .filter(s -> StringUtils.isNotEmpty(s.getLinkPhone()) || StringUtils.isNotEmpty(s.getLinkPerson())).findFirst().orElse(null); +// if (wxShopVo != null) { +// String linkPerson = wxShopVo.getLinkPerson(); +// String linkPhone = wxShopVo.getLinkPhone(); +// result.put("linkPerson", StringUtils.isNotEmpty(linkPerson) ? linkPerson : " "); +// result.put("linkPhone", StringUtils.isNotEmpty(linkPhone) ? linkPhone : " "); +// } else { +// result.put("linkPerson", " "); +// result.put("linkPhone", " "); +// } +// +// String createtime = DateUtils.getSystemTime("yyyy-MM-dd"); +// result.put("createtime", createtime); +// +// String templatePath = "contract-word-template/bill_owe.docx"; +// String filepath = fmUploadDir; +// String filename = UUID.randomUUID() + ".docx"; +// String exportFileName = "催缴单.docx"; +// WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, null); } @@ -1747,39 +1747,39 @@ public class WxBillAllServiceImpl implements WxBillAllService { // stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS); } - public WxBillRent getExpiredDayAndStatus(Date startDate, Date endDate, Long owe, Long pay, boolean flag) { - WxBillRent rent = new WxBillRent(); - rent.setExpiredDay(0L); - if (owe <= pay) { - rent.setStatus(EnumBillStatus.PAID.getCode()); - int expiredDay = DateUtils.daysBetween(startDate, endDate); - int timePeriod = 0; - if (expiredDay > timePeriod) { - rent.setExpiredDay((long) expiredDay); - } - return rent; - } - Date now = new Date(); - int day = DateUtils.daysBetween(startDate, now); - int timePeriod = 0; - if (day > timePeriod) { - rent.setStatus(EnumBillStatus.NOT_PAID.getCode()); - rent.setExpiredDay((long) day); - return rent; - } - if (flag) { - timePeriod = 30; - long expiredDay = Long.valueOf(Math.abs(day)); - if (expiredDay > timePeriod) { - rent.setStatus(EnumBillStatus.NOT_EXPIRED.getCode()); - } else { - rent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); - } - } else { - rent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); - } - return rent; - } +// public WxBillRent getExpiredDayAndStatus(Date startDate, Date endDate, Long owe, Long pay, boolean flag) { +// WxBillRent rent = new WxBillRent(); +// rent.setExpiredDay(0L); +// if (owe <= pay) { +// rent.setStatus(EnumBillStatus.PAID.getCode()); +// int expiredDay = DateUtils.daysBetween(startDate, endDate); +// int timePeriod = 0; +// if (expiredDay > timePeriod) { +// rent.setExpiredDay((long) expiredDay); +// } +// return rent; +// } +// Date now = new Date(); +// int day = DateUtils.daysBetween(startDate, now); +// int timePeriod = 0; +// if (day > timePeriod) { +// rent.setStatus(EnumBillStatus.NOT_PAID.getCode()); +// rent.setExpiredDay((long) day); +// return rent; +// } +// if (flag) { +// timePeriod = 30; +// long expiredDay = Long.valueOf(Math.abs(day)); +// if (expiredDay > timePeriod) { +// rent.setStatus(EnumBillStatus.NOT_EXPIRED.getCode()); +// } else { +// rent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); +// } +// } else { +// rent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); +// } +// return rent; +// } @Override public void importBill(String importKey, WxBillExcelTemplate bill, MallUserInfo user) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java index 35437bb83..f9836a01e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java @@ -165,58 +165,58 @@ public class WxBillDailyServiceImpl extends WxBillBaseService implements WxBillD BigDecimal realReceivePay = servicePay.add(new BigDecimal(e.getReceivePay())); e.setRealReceivePay(realReceivePay.toPlainString()); e.setServiceChargePay(servicePay.toPlainString()); - if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { - //e.setOwe("0"); - } else { - //e.setOwe(realReceivePay.subtract(new BigDecimal(e.getPay())).toPlainString()); - //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); - } +// if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { +// //e.setOwe("0"); +// } else { +// //e.setOwe(realReceivePay.subtract(new BigDecimal(e.getPay())).toPlainString()); +// //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); +// } } } @Override public void updateBillStatus(WxBillDaily record) { - logger.info("更新日常账单状态开始..."); - //更新逾期天数及状态 - updateNotPaidStatus(record); - //更新待缴的状态 - updateWaidPayStatus(record); - logger.info("更新日常账单状态结束..."); +// logger.info("更新日常账单状态开始..."); +// //更新逾期天数及状态 +// updateNotPaidStatus(record); +// //更新待缴的状态 +// updateWaidPayStatus(record); +// logger.info("更新日常账单状态结束..."); } @Transactional(rollbackFor = {Exception.class}) public void updateWaidPayStatus(WxBillDaily record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - if (StringUtils.isNotBlank(record.getParentTenantId())) { - params.put("parentTenantId", record.getParentTenantId()); - } - params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillDailyMapper.updateWaitPayStatus(params); - } catch (Exception e) { - logger.error("更新日常待缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// if (StringUtils.isNotBlank(record.getParentTenantId())) { +// params.put("parentTenantId", record.getParentTenantId()); +// } +// params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillDailyMapper.updateWaitPayStatus(params); +// } catch (Exception e) { +// logger.error("更新日常待缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } } @Transactional(rollbackFor = {Exception.class}) public void updateNotPaidStatus(WxBillDaily record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - if (StringUtils.isNotBlank(record.getParentTenantId())) { - params.put("parentTenantId", record.getParentTenantId()); - } - params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillDailyMapper.updateNotPaidStatus(params); - } catch (Exception e) { - logger.error("更新日常欠缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// if (StringUtils.isNotBlank(record.getParentTenantId())) { +// params.put("parentTenantId", record.getParentTenantId()); +// } +// params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillDailyMapper.updateNotPaidStatus(params); +// } catch (Exception e) { +// logger.error("更新日常欠缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } } @Override @@ -363,55 +363,55 @@ public class WxBillDailyServiceImpl extends WxBillBaseService implements WxBillD @Override public void insertData(WxBillDailyVo billDaily, String importKey, MallUserInfo user) { - Integer type = billDaily.getType(); - WxBillDaily wxBillDaily = new WxBillDaily(); - String receivePay = billDaily.getReceivePay(); - wxBillDaily.setReceivePay(receivePay); - String pay = billDaily.getPay(); - wxBillDaily.setPay(pay); - //wxBillDaily.setOwe(new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString()); - wxBillDaily.setType(type); - Date receiveDate = billDaily.getReceiveDate(); - wxBillDaily.setReceiveDate(receiveDate); - Date date = new Date(); - if (new BigDecimal(pay).compareTo(new BigDecimal(0)) > 0) { - wxBillDaily.setPayDate(date); - } - int expiredDay = DateUtils.daysBetween(receiveDate, date); - wxBillDaily.setExpiredDay(0L); - if (expiredDay > 0) { - wxBillDaily.setStatus(EnumBillStatus.NOT_PAID.getCode()); - wxBillDaily.setExpiredDay((long) expiredDay); - } else { - wxBillDaily.setStatus(EnumBillStatus.WAIT_PAY.getCode()); - } - if (receivePay.equals(pay)) { - wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); - } - - wxBillDaily.setUserId(user.getId()); - wxBillDaily.setShopId(billDaily.getShopId()); - wxBillDaily.setRentShopType(billDaily.getRentShopType()); - - wxBillDaily.setPayWay(EnumBillPayWay.OTHER.getCode()); - wxBillDaily.setCreatetime(date); - wxBillDaily.setUpdatetime(date); - wxBillDaily.setIsDel(EnumDelStatus.NOT_DEL.getCode()); - wxBillDaily.updateTenantInfo(user); - //商户 - WxMerchantShop merchantShop = new WxMerchantShop(); - merchantShop.setShopId(billDaily.getShopId()); - merchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); - WxMerchantShop wxMerchantShop = wxMerchantShopMapper.selectOne(new QueryWrapper<>(merchantShop)); - wxBillDaily.setMerchantId(wxMerchantShop.getMerchantId()); - - final IdWorker idWorker = IdWorker.get(); - wxBillDaily.setId(idWorker.nextId()); - wxBillDailyMapper.insert(wxBillDaily); - - //记数 - stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); - stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS); +// Integer type = billDaily.getType(); +// WxBillDaily wxBillDaily = new WxBillDaily(); +// String receivePay = billDaily.getReceivePay(); +// wxBillDaily.setReceivePay(receivePay); +// String pay = billDaily.getPay(); +// wxBillDaily.setPay(pay); +// //wxBillDaily.setOwe(new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString()); +// wxBillDaily.setType(type); +// Date receiveDate = billDaily.getReceiveDate(); +// wxBillDaily.setReceiveDate(receiveDate); +// Date date = new Date(); +// if (new BigDecimal(pay).compareTo(new BigDecimal(0)) > 0) { +// wxBillDaily.setPayDate(date); +// } +// int expiredDay = DateUtils.daysBetween(receiveDate, date); +// wxBillDaily.setExpiredDay(0L); +// if (expiredDay > 0) { +// wxBillDaily.setStatus(EnumBillStatus.NOT_PAID.getCode()); +// wxBillDaily.setExpiredDay((long) expiredDay); +// } else { +// wxBillDaily.setStatus(EnumBillStatus.WAIT_PAY.getCode()); +// } +// if (receivePay.equals(pay)) { +// wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); +// } +// +// wxBillDaily.setUserId(user.getId()); +// wxBillDaily.setShopId(billDaily.getShopId()); +// wxBillDaily.setRentShopType(billDaily.getRentShopType()); +// +// wxBillDaily.setPayWay(EnumBillPayWay.OTHER.getCode()); +// wxBillDaily.setCreatetime(date); +// wxBillDaily.setUpdatetime(date); +// wxBillDaily.setIsDel(EnumDelStatus.NOT_DEL.getCode()); +// wxBillDaily.updateTenantInfo(user); +// //商户 +// WxMerchantShop merchantShop = new WxMerchantShop(); +// merchantShop.setShopId(billDaily.getShopId()); +// merchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); +// WxMerchantShop wxMerchantShop = wxMerchantShopMapper.selectOne(new QueryWrapper<>(merchantShop)); +// wxBillDaily.setMerchantId(wxMerchantShop.getMerchantId()); +// +// final IdWorker idWorker = IdWorker.get(); +// wxBillDaily.setId(idWorker.nextId()); +// wxBillDailyMapper.insert(wxBillDaily); +// +// //记数 +// stringRedisTemplate.opsForHash().increment(importKey, "processCount", 1); +// stringRedisTemplate.expire(importKey, 10, TimeUnit.SECONDS); } @Override diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java index 5e9af4b2e..cbbb7ac2a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java @@ -210,43 +210,43 @@ public class WxBillDepositServiceImpl extends WxBillBaseService implements WxBil @Override public void updateBillStatus(WxBillDeposit record) { - logger.info("更新租赁押金账单状态开始..."); - //更新逾期天数及状态 - updateNotPaidStatus(record); - //更新待缴的状态 - updateWaidPayStatus(record); - logger.info("更新租赁押金账单状态结束..."); +// logger.info("更新租赁押金账单状态开始..."); +// //更新逾期天数及状态 +// updateNotPaidStatus(record); +// //更新待缴的状态 +// updateWaidPayStatus(record); +// logger.info("更新租赁押金账单状态结束..."); } - @Transactional(rollbackFor = {Exception.class}) - public void updateWaidPayStatus(WxBillDeposit record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - - try { - wxBillDepositMapper.updateWaitPayStatus(params); - } catch (Exception e) { - logger.error("更新租赁押金待缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } - - - @Transactional(rollbackFor = {Exception.class}) - public void updateNotPaidStatus(WxBillDeposit record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillDepositMapper.updateNotPaidStatus(params); - } catch (Exception e) { - logger.error("更新租赁押金欠缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } +// @Transactional(rollbackFor = {Exception.class}) +// public void updateWaidPayStatus(WxBillDeposit record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// +// try { +// wxBillDepositMapper.updateWaitPayStatus(params); +// } catch (Exception e) { +// logger.error("更新租赁押金待缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } +// +// +// @Transactional(rollbackFor = {Exception.class}) +// public void updateNotPaidStatus(WxBillDeposit record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillDepositMapper.updateNotPaidStatus(params); +// } catch (Exception e) { +// logger.error("更新租赁押金欠缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } @Override public WxBillDeposit getById(TenantEntity tenantEntity,Long id) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java index 36e589224..999572cc1 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java @@ -169,53 +169,53 @@ public class WxBillOtherDepositServiceImpl extends WxBillBaseService implements } e.setRealReceivePay(servicePay.add(new BigDecimal(e.getReceivePay())).toPlainString()); e.setServiceChargePay(servicePay.toPlainString()); - if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { - //e.setOwe("0"); - } else { - //e.setOwe(servicePay.add(new BigDecimal(e.getReceivePay())).subtract(new BigDecimal(e.getPay())).toPlainString()); - //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); - } +// if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { +// //e.setOwe("0"); +// } else { +// //e.setOwe(servicePay.add(new BigDecimal(e.getReceivePay())).subtract(new BigDecimal(e.getPay())).toPlainString()); +// //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); +// } } } @Override public void updateBillStatus(WxBillOtherDeposit record) { - logger.info("更新其他押金账单状态开始..."); - //更新逾期天数及状态 - updateNotPaidStatus(record); - //更新待缴的状态 - updateWaidPayStatus(record); - logger.info("更新其他押金账单状态结束..."); - } - - @Transactional(rollbackFor = {Exception.class}) - public void updateWaidPayStatus(WxBillOtherDeposit record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillOtherDepositMapper.updateWaitPayStatus(params); - } catch (Exception e) { - logger.error("更新其他待缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } +// logger.info("更新其他押金账单状态开始..."); +// //更新逾期天数及状态 +// updateNotPaidStatus(record); +// //更新待缴的状态 +// updateWaidPayStatus(record); +// logger.info("更新其他押金账单状态结束..."); } - - @Transactional(rollbackFor = {Exception.class}) - public void updateNotPaidStatus(WxBillOtherDeposit record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillOtherDepositMapper.updateNotPaidStatus(params); - } catch (Exception e) { - logger.error("更新其他欠缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } +// @Transactional(rollbackFor = {Exception.class}) +// public void updateWaidPayStatus(WxBillOtherDeposit record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillOtherDepositMapper.updateWaitPayStatus(params); +// } catch (Exception e) { +// logger.error("更新其他待缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } +// +// +// @Transactional(rollbackFor = {Exception.class}) +// public void updateNotPaidStatus(WxBillOtherDeposit record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillOtherDepositMapper.updateNotPaidStatus(params); +// } catch (Exception e) { +// logger.error("更新其他欠缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } @Override public WxBillOtherDeposit getById(TenantEntity tenantEntity,Long id) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java index dd7225513..67547d43e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java @@ -168,53 +168,53 @@ public class WxBillOtherServiceImpl extends WxBillBaseService implements WxBillO } e.setRealReceivePay(servicePay.add(new BigDecimal(e.getReceivePay())).toPlainString()); e.setServiceChargePay(servicePay.toPlainString()); - if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { - //e.setOwe("0"); - } else { - //e.setOwe(servicePay.add(new BigDecimal(e.getReceivePay())).subtract(new BigDecimal(e.getPay())).toPlainString()); - //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); - } +// if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { +// //e.setOwe("0"); +// } else { +// //e.setOwe(servicePay.add(new BigDecimal(e.getReceivePay())).subtract(new BigDecimal(e.getPay())).toPlainString()); +// //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); +// } } } @Override public void updateBillStatus(WxBillOther record) { - logger.info("更新其他账单状态开始..."); - //更新逾期天数及状态 - updateNotPaidStatus(record); - //更新待缴的状态 - updateWaidPayStatus(record); - logger.info("更新其他账单状态结束..."); - } - - @Transactional(rollbackFor = {Exception.class}) - public void updateWaidPayStatus(WxBillOther record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillOtherMapper.updateWaitPayStatus(params); - } catch (Exception e) { - logger.error("更新其他待缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } +// logger.info("更新其他账单状态开始..."); +// //更新逾期天数及状态 +// updateNotPaidStatus(record); +// //更新待缴的状态 +// updateWaidPayStatus(record); +// logger.info("更新其他账单状态结束..."); } - - @Transactional(rollbackFor = {Exception.class}) - public void updateNotPaidStatus(WxBillOther record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillOtherMapper.updateNotPaidStatus(params); - } catch (Exception e) { - logger.error("更新其他欠缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } +// @Transactional(rollbackFor = {Exception.class}) +// public void updateWaidPayStatus(WxBillOther record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillOtherMapper.updateWaitPayStatus(params); +// } catch (Exception e) { +// logger.error("更新其他待缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } +// +// +// @Transactional(rollbackFor = {Exception.class}) +// public void updateNotPaidStatus(WxBillOther record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillOtherMapper.updateNotPaidStatus(params); +// } catch (Exception e) { +// logger.error("更新其他欠缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } @Override public WxBillOther getById(TenantEntity tenantEntity,Long id) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java index b14c0cf36..393b43192 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java @@ -193,44 +193,44 @@ public class WxBillPropertyDepositServiceImpl extends WxBillBaseService implemen @Override public void updateBillStatus(WxBillPropertyDeposit record) { - logger.info("更新物业押金账单状态开始..."); - //更新逾期天数及状态 - updateNotPaidStatus(record); - //更新待缴的状态 - updateWaidPayStatus(record); - logger.info("更新物业押金账单状态结束..."); +// logger.info("更新物业押金账单状态开始..."); +// //更新逾期天数及状态 +// updateNotPaidStatus(record); +// //更新待缴的状态 +// updateWaidPayStatus(record); +// logger.info("更新物业押金账单状态结束..."); } - @Transactional(rollbackFor = {Exception.class}) - public void updateWaidPayStatus(WxBillPropertyDeposit record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - - try { - wxBillPropertyDepositMapper.updateWaitPayStatus(params); - } catch (Exception e) { - logger.error("更新物业押金待缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } - - - @Transactional(rollbackFor = {Exception.class}) - public void updateNotPaidStatus(WxBillPropertyDeposit record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillPropertyDepositMapper.updateNotPaidStatus(params); - } catch (Exception e) { - logger.error("更新物业押金欠缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } +// @Transactional(rollbackFor = {Exception.class}) +// public void updateWaidPayStatus(WxBillPropertyDeposit record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// +// try { +// wxBillPropertyDepositMapper.updateWaitPayStatus(params); +// } catch (Exception e) { +// logger.error("更新物业押金待缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } +// +// +// @Transactional(rollbackFor = {Exception.class}) +// public void updateNotPaidStatus(WxBillPropertyDeposit record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillPropertyDepositMapper.updateNotPaidStatus(params); +// } catch (Exception e) { +// logger.error("更新物业押金欠缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } @Override public WxBillPropertyDeposit getById(TenantEntity tenantEntity ,Long id) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java index 0f37e509a..aa01c8abb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java @@ -237,12 +237,12 @@ public class WxBillPropertyServiceImpl extends WxBillBaseService implements WxBi BigDecimal realReceivePay = servicePay.add(new BigDecimal(e.getLatePayPrice())).add(new BigDecimal(e.getReceivePay())); e.setRealReceivePay(realReceivePay.toPlainString()); e.setServiceChargePay(servicePay.toPlainString()); - if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { - //e.setOwe("0"); - } else { - //e.setOwe(realReceivePay.subtract(new BigDecimal(e.getPay())).toPlainString()); - //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); - } +// if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { +// //e.setOwe("0"); +// } else { +// //e.setOwe(realReceivePay.subtract(new BigDecimal(e.getPay())).toPlainString()); +// //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); +// } } } @@ -256,35 +256,35 @@ public class WxBillPropertyServiceImpl extends WxBillBaseService implements WxBi logger.info("更新物业账单状态结束..."); } - @Transactional(rollbackFor = {Exception.class}) - public void updateWaidPayStatus(WxBillProperty record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - - try { - wxBillPropertyMapper.updateWaitPayStatus(params); - } catch (Exception e) { - logger.error("更新物业待缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } - - - @Transactional(rollbackFor = {Exception.class}) - public void updateNotPaidStatus(WxBillProperty record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillPropertyMapper.updateNotPaidStatus(params); - } catch (Exception e) { - logger.error("更新物业欠缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } +// @Transactional(rollbackFor = {Exception.class}) +// public void updateWaidPayStatus(WxBillProperty record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// +// try { +// wxBillPropertyMapper.updateWaitPayStatus(params); +// } catch (Exception e) { +// logger.error("更新物业待缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } +// +// +// @Transactional(rollbackFor = {Exception.class}) +// public void updateNotPaidStatus(WxBillProperty record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillPropertyMapper.updateNotPaidStatus(params); +// } catch (Exception e) { +// logger.error("更新物业欠缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } @Override public WxBillProperty getById(TenantEntity tenantEntity,Long id) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java index 6df8d9b4e..6ae20eb0b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java @@ -287,41 +287,41 @@ public class WxBillRentManageServiceImpl extends WxBillBaseService implements W public void updateBillStatus(WxBillRentManage record) { logger.info("更新租赁押金账单状态开始..."); //更新逾期天数及状态 - updateNotPaidStatus(record); + //updateNotPaidStatus(record); //更新待缴的状态 - updateWaidPayStatus(record); + //updateWaidPayStatus(record); logger.info("更新租赁押金账单状态结束..."); } - @Transactional(rollbackFor = {Exception.class}) - public void updateWaidPayStatus(WxBillRentManage record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - - try { - wxBillRentManageMapper.updateWaitPayStatus(params); - } catch (Exception e) { - logger.error("更新物业待缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } +// @Transactional(rollbackFor = {Exception.class}) +// public void updateWaidPayStatus(WxBillRentManage record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// +// try { +// wxBillRentManageMapper.updateWaitPayStatus(params); +// } catch (Exception e) { +// logger.error("更新物业待缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } - @Transactional(rollbackFor = {Exception.class}) - public void updateNotPaidStatus(WxBillRentManage record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillRentManageMapper.updateNotPaidStatus(params); - } catch (Exception e) { - logger.error("更新物业欠缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } +// @Transactional(rollbackFor = {Exception.class}) +// public void updateNotPaidStatus(WxBillRentManage record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillRentManageMapper.updateNotPaidStatus(params); +// } catch (Exception e) { +// logger.error("更新物业欠缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } @Override public void deleteById(TenantEntity tenantEntity,Long id) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java index 593336c99..3e0e3a83f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -106,54 +106,54 @@ public class WxBillRentServiceImpl extends WxBillBaseService implements WxBillRe BigDecimal realReceivePay = servicePay.add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getReceivePay())); rent.setRealReceivePay(realReceivePay.toPlainString()); rent.setServiceChargePay(servicePay.toPlainString()); - if (!rent.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { - //rent.setOwe("0"); - } else { - //rent.setOwe(realReceivePay.subtract(new BigDecimal(rent.getPay())).toPlainString()); - //rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); - } +// if (!rent.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { +// //rent.setOwe("0"); +// } else { +// //rent.setOwe(realReceivePay.subtract(new BigDecimal(rent.getPay())).toPlainString()); +// //rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); +// } } } @Override public void updateBillStatus(WxBillRent record) { - logger.info("更新租赁账单状态开始..."); - //更新逾期天数及状态 - updateNotPaidStatus(record); - //更新待缴的状态 - updateWaidPayStatus(record); - logger.info("更新租赁账单状态结束..."); - } - - @Transactional(rollbackFor = {Exception.class}) - public void updateWaidPayStatus(WxBillRent record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - - try { - wxBillRentMapper.updateWaitPayStatus(params); - } catch (Exception e) { - logger.error("更新物业待缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } +// logger.info("更新租赁账单状态开始..."); +// //更新逾期天数及状态 +// updateNotPaidStatus(record); +// //更新待缴的状态 +// updateWaidPayStatus(record); +// logger.info("更新租赁账单状态结束..."); } - - @Transactional(rollbackFor = {Exception.class}) - public void updateNotPaidStatus(WxBillRent record) { - Map params = new HashMap<>(); - params.put("tenantId", record.getTenantId()); - params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); - params.put("paid", EnumBillStatus.PAID.getCode()); - try { - wxBillRentMapper.updateNotPaidStatus(params); - } catch (Exception e) { - logger.error("更新物业欠缴账单状态失败,e:" + e.getMessage()); - throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); - } - } +// @Transactional(rollbackFor = {Exception.class}) +// public void updateWaidPayStatus(WxBillRent record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// +// try { +// wxBillRentMapper.updateWaitPayStatus(params); +// } catch (Exception e) { +// logger.error("更新物业待缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } +// +// +// @Transactional(rollbackFor = {Exception.class}) +// public void updateNotPaidStatus(WxBillRent record) { +// Map params = new HashMap<>(); +// params.put("tenantId", record.getTenantId()); +// params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); +// params.put("paid", EnumBillStatus.PAID.getCode()); +// try { +// wxBillRentMapper.updateNotPaidStatus(params); +// } catch (Exception e) { +// logger.error("更新物业欠缴账单状态失败,e:" + e.getMessage()); +// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); +// } +// } @Override public WxBillRent getById(TenantEntity tenantEntity,Long id) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java index b9cb5ceb0..54fdc8239 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java @@ -3046,65 +3046,70 @@ public class WxChartServiceImpl implements WxChartDataService { } //==========欠缴数据========= - BigDecimal totalOwe = new BigDecimal(0); - WxBillAll wxBillAll = new WxBillAll(); - wxBillAll.updateTenantInfo(tenantEntity); - wxBillAll.setMonth(new SimpleDateFormat("yyyy-MM").format(startDate)); - wxBillAll.setStatus(EnumBillStatus.NOT_PAID.getCode()); - List billTypeList = new ArrayList<>(); - billTypeList.add(EnumBillTypeStr.RENT.getCode()); - wxBillAll.setBillTypeList(billTypeList); - payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); - if (payinfo != null) { - BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100)); - totalOwe = totalOwe.add(owe); - datamap.put("rentOwe", owe); - } else { - datamap.put("rentOwe", 0); - } - - billTypeList = new ArrayList<>(); - billTypeList.add(EnumBillTypeStr.PROPERTY.getCode()); - wxBillAll.setBillTypeList(billTypeList); - payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); - if (payinfo != null) { - BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100)); - totalOwe = totalOwe.add(owe); - datamap.put("propertyOwe", owe); - } else { - datamap.put("propertyOwe", 0); - } - - 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")).divide(new BigDecimal(100)); - totalOwe = totalOwe.add(owe); - datamap.put("depositOwe", owe); - } else { - datamap.put("depositOwe", 0); - } - - billTypeList = new ArrayList<>(); - billTypeList.add(EnumBillTypeStr.D.getCode()); - billTypeList.add(EnumBillTypeStr.W.getCode()); - billTypeList.add(EnumBillTypeStr.K.getCode()); - billTypeList.add(EnumBillTypeStr.O.getCode()); - wxBillAll.setBillTypeList(billTypeList); - payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); - if (payinfo != null) { - BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100)); - totalOwe = totalOwe.add(owe); - datamap.put("otherOwe", owe); - } else { - datamap.put("otherOwe", 0); - } +// BigDecimal totalOwe = new BigDecimal(0); +// WxBillAll wxBillAll = new WxBillAll(); +// wxBillAll.updateTenantInfo(tenantEntity); +// wxBillAll.setMonth(new SimpleDateFormat("yyyy-MM").format(startDate)); +// wxBillAll.setStatus(EnumBillStatus.NOT_PAID.getCode()); +// List billTypeList = new ArrayList<>(); +// billTypeList.add(EnumBillTypeStr.RENT.getCode()); +// wxBillAll.setBillTypeList(billTypeList); +// payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); +// if (payinfo != null) { +// BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100)); +// totalOwe = totalOwe.add(owe); +// datamap.put("rentOwe", owe); +// } else { +// datamap.put("rentOwe", 0); +// } + datamap.put("rentOwe", 0); + +// billTypeList = new ArrayList<>(); +// billTypeList.add(EnumBillTypeStr.PROPERTY.getCode()); +// wxBillAll.setBillTypeList(billTypeList); +// payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); +// if (payinfo != null) { +// BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100)); +// totalOwe = totalOwe.add(owe); +// datamap.put("propertyOwe", owe); +// } else { +// datamap.put("propertyOwe", 0); +// } + datamap.put("propertyOwe", 0); + +// 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")).divide(new BigDecimal(100)); +// totalOwe = totalOwe.add(owe); +// datamap.put("depositOwe", owe); +// } else { +// datamap.put("depositOwe", 0); +// } + datamap.put("depositOwe", 0); + +// billTypeList = new ArrayList<>(); +// billTypeList.add(EnumBillTypeStr.D.getCode()); +// billTypeList.add(EnumBillTypeStr.W.getCode()); +// billTypeList.add(EnumBillTypeStr.K.getCode()); +// billTypeList.add(EnumBillTypeStr.O.getCode()); +// wxBillAll.setBillTypeList(billTypeList); +// payinfo = wxBillAllMapper.queryOweInfo(wxBillAll); +// if (payinfo != null) { +// BigDecimal owe = ((BigDecimal) payinfo.get("owe")).divide(new BigDecimal(100)); +// totalOwe = totalOwe.add(owe); +// datamap.put("otherOwe", owe); +// } else { +// datamap.put("otherOwe", 0); +// } + datamap.put("otherOwe", 0); - datamap.put("totalOwe", totalOwe); +// datamap.put("totalOwe", totalOwe); + datamap.put("totalOwe", 0); return new ResultData(datamap); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index b056cd01f..b01fe8443 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -693,6 +693,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { bill.setLatePayRatio(0); bill.setPay("0"); bill.setIsDel(EnumDelStatus.NOT_DEL.getCode()); + bill.setStatus(EnumBillStatus.WAIT_PAY.getCode()); bill.setMerchantId(record.getMerchantId()); if (null != shopIds && shopIds.size() == 1) { bill.setShopId(shopIds.get(0)); @@ -763,6 +764,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { bill.setLatePayRatio(0); bill.setPay("0"); bill.setIsDel(EnumDelStatus.NOT_DEL.getCode()); + bill.setStatus(EnumBillStatus.WAIT_PAY.getCode()); bill.setMerchantId(record.getMerchantId()); if (null != shopIds && shopIds.size() == 1) { bill.setShopId(shopIds.get(0));