diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java index 9227507ba..14c542042 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java @@ -5,7 +5,6 @@ import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; import com.iformall.domain.vo.WxBillAll; import com.iformall.service.WxBillAllService; -import com.iformall.utils.DateUtils; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -17,10 +16,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.Map; /** @@ -96,11 +94,6 @@ public class WxBillAllController extends BaseController { if(StringUtils.isNotBlank(wxBillAll.getEndtime())){ wxBillAll.setEndtime(wxBillAll.getEndtime()+" 23:59:59"); } - if(StringUtils.isBlank(wxBillAll.getEndtime()) && StringUtils.isBlank(wxBillAll.getStarttime())){ - SimpleDateFormat sb = new SimpleDateFormat("yyyy-MM-dd"); - wxBillAll.setStarttime(sb.format(DateUtils.getFirstDayForCurrMonth(new Date()))); - wxBillAll.setEndtime(sb.format(new Date())+" 23:59:59"); - } wxBillAll.setTenantId(getTenantId()); Map result = wxBillAllService.getOweBillAsPage(wxBillAll, pageNum, pageSize); return new ResultData(result); @@ -119,11 +112,6 @@ public class WxBillAllController extends BaseController { if(StringUtils.isNotBlank(wxBillAll.getEndtime())){ wxBillAll.setEndtime(wxBillAll.getEndtime()+" 23:59:59"); } - if(StringUtils.isBlank(wxBillAll.getEndtime()) && StringUtils.isBlank(wxBillAll.getStarttime())){ - SimpleDateFormat sb = new SimpleDateFormat("yyyy-MM-dd"); - wxBillAll.setStarttime(sb.format(DateUtils.getFirstDayForCurrMonth(new Date()))); - wxBillAll.setEndtime(sb.format(new Date())+" 23:59:59"); - } wxBillAll.setTenantId(getTenantId()); wxBillAllService.exportOweMerchant(wxBillAll, request, response); } @@ -140,11 +128,6 @@ public class WxBillAllController extends BaseController { if(StringUtils.isNotBlank(wxBillAll.getEndtime())){ wxBillAll.setEndtime(wxBillAll.getEndtime()+" 23:59:59"); } - if(StringUtils.isBlank(wxBillAll.getEndtime()) && StringUtils.isBlank(wxBillAll.getStarttime())){ - SimpleDateFormat sb = new SimpleDateFormat("yyyy-MM-dd"); - wxBillAll.setStarttime(sb.format(DateUtils.getFirstDayForCurrMonth(new Date()))); - wxBillAll.setEndtime(sb.format(new Date())+" 23:59:59"); - } wxBillAll.setTenantId(getTenantId()); wxBillAllService.exportWaitMerchant(wxBillAll, request, response); } @@ -161,11 +144,6 @@ public class WxBillAllController extends BaseController { if (StringUtils.isNotBlank(wxBillAll.getEndtime())) { wxBillAll.setEndtime(wxBillAll.getEndtime() + " 23:59:59"); } - if (StringUtils.isBlank(wxBillAll.getEndtime()) && StringUtils.isBlank(wxBillAll.getStarttime())) { - SimpleDateFormat sb = new SimpleDateFormat("yyyy-MM-dd"); - wxBillAll.setStarttime(sb.format(DateUtils.getFirstDayForCurrMonth(new Date()))); - wxBillAll.setEndtime(sb.format(new Date()) + " 23:59:59"); - } wxBillAll.setTenantId(getTenantId()); wxBillAllService.exportOweBill(wxBillAll, request, response); } 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 7c945831d..8ea2a4acd 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -620,30 +620,38 @@ public class WxBillAllServiceImpl implements WxBillAllService { String number = "JF" + DateUtils.getSystemTime("yyyyMMddHHmmss"); result.put("number", number); //数据 + if (wxBillAll.getStatus() == null) { + List statusList = new ArrayList<>(); + statusList.add(EnumBillRentStatus.NOT_PAID.getCode()); + statusList.add(EnumBillRentStatus.WAIT_PAY.getCode()); + statusList.add(EnumBillRentStatus.NOT_EXPIRED.getCode()); + wxBillAll.setStatusList(statusList); + } + Integer filterHasPay = wxBillAll.getFilterHasPay(); List list = wxBillAllMapper.list(wxBillAll); if (!list.isEmpty()) { //租金总额 - Long rentSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT.getCode())).collect(Collectors.summingLong(b -> b.getOwe())); + Long rentSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay())); //物业总额 - Long propertySum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY.getCode())).collect(Collectors.summingLong(b -> b.getOwe())); + Long propertySum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay())); //押金总额 Long depositSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode())) - .collect(Collectors.summingLong(b -> b.getOwe())); + .collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay())); //水费 - Long waterSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode())).collect(Collectors.summingLong(b -> b.getOwe())); + Long waterSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay())); //电费 - Long powerSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode())).collect(Collectors.summingLong(b -> b.getOwe())); + Long powerSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay())); //空调费 - Long airConditioningSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())).collect(Collectors.summingLong(b -> b.getOwe())); + Long airConditioningSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay())); //其他费用 - Long otherSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode())).collect(Collectors.summingLong(b -> b.getOwe())); + Long otherSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay())); //押金明细 StringBuffer depositDetail = new StringBuffer(); list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode())) .forEach(b -> { - BigDecimal owe = new BigDecimal(b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); + BigDecimal owe = new BigDecimal(filterHasPay != null ? b.getOwe() : b.getReceivePay()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); depositDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); }); @@ -651,7 +659,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { StringBuffer otherDetail = new StringBuffer(); list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode())) .forEach(b -> { - BigDecimal owe = new BigDecimal(b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); + BigDecimal owe = new BigDecimal(filterHasPay != null ? b.getOwe() : b.getReceivePay()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN); otherDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); }); //总计