Przeglądaj źródła

fix

release_toaliyun_real
winter 2 lat temu
rodzic
commit
6b775219d4
59 zmienionych plików z 922 dodań i 454 usunięć
  1. +161
    -37
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java
  2. +2
    -2
      mallinkSchedule/src/main/java/com/iformall/schedule/LatePayBillActionSchedule.java
  3. +2
    -1
      mallinkService/src/main/java/com/iformall/common/SysConfigConstant.java
  4. +0
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java
  5. +0
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java
  6. +0
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java
  7. +0
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java
  8. +0
    -4
      mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java
  9. +0
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java
  10. +0
    -4
      mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java
  11. +0
    -4
      mallinkService/src/main/java/com/iformall/domain/po/WxBillRentManage.java
  12. +9
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
  13. +18
    -2
      mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java
  14. +0
    -2
      mallinkService/src/main/java/com/iformall/domain/vo/WxBillHotNotify.java
  15. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxBillSum.java
  16. +0
    -41
      mallinkService/src/main/java/com/iformall/enums/EnumBillDailyStatus.java
  17. +4
    -4
      mallinkService/src/main/java/com/iformall/enums/EnumBillStatus.java
  18. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBillDailyMapper.java
  19. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBillDepositMapper.java
  20. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBillOtherDepositMapper.java
  21. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBillOtherMapper.java
  22. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyDepositMapper.java
  23. +4
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyMapper.java
  24. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxBillRentManageMapper.java
  25. +4
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxBillRentMapper.java
  26. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillDailyService.java
  27. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillDepositService.java
  28. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillOtherDepositService.java
  29. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillOtherService.java
  30. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillPropertyDepositService.java
  31. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillPropertyService.java
  32. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillRentManageService.java
  33. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillRentService.java
  34. +146
    -9
      mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java
  35. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java
  36. +38
    -38
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  37. +26
    -19
      mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java
  38. +18
    -11
      mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java
  39. +23
    -16
      mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java
  40. +21
    -14
      mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java
  41. +17
    -12
      mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java
  42. +22
    -15
      mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java
  43. +22
    -15
      mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java
  44. +23
    -16
      mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java
  45. +55
    -50
      mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java
  46. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  47. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  48. +11
    -11
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  49. +18
    -18
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  50. +1
    -0
      mallinkService/src/main/java/com/iformall/utils/Constant.java
  51. BIN
      mallinkService/src/main/resources/contract-word-template/bill_near_one.docx
  52. +24
    -7
      mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml
  53. +27
    -10
      mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml
  54. +25
    -7
      mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml
  55. +26
    -9
      mallinkService/src/main/resources/mapper/WxBillOtherMapper.xml
  56. +24
    -7
      mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml
  57. +36
    -20
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  58. +26
    -9
      mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml
  59. +37
    -20
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml

+ 161
- 37
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java Wyświetl plik

@@ -6,7 +6,9 @@ import com.github.pagehelper.PageInfo;
import com.iformall.annotation.SystemControllerLog;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.common.SysConfigConstant;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.SysConfig;
import com.iformall.domain.po.WxBillDaily;
import com.iformall.domain.po.WxBillDeposit;
import com.iformall.domain.po.WxBillOther;
@@ -23,6 +25,7 @@ import com.iformall.domain.po.base.WxBillBaseEntity;
import com.iformall.domain.vo.WxBillAll;
import com.iformall.domain.vo.WxBillAllVo;
import com.iformall.domain.vo.WxBillExcelTemplate;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.domain.vo.WxMerchantBillVo;
import com.iformall.domain.vo.WxMerchantMicroPayVo;
@@ -32,6 +35,7 @@ import com.iformall.enums.EnumBillType;
import com.iformall.enums.EnumRentContractManageFeeType;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.service.ExcelService;
import com.iformall.service.SysConfigService;
import com.iformall.service.WxBillAllService;
import com.iformall.service.WxBillDailyService;
import com.iformall.service.WxBillDepositService;
@@ -45,6 +49,7 @@ import com.iformall.service.WxMerchantService;
import com.iformall.service.WxPayAccountBillService;
import com.iformall.service.WxShopService;
import com.iformall.service.helper.WxBillAllHelper;
import com.iformall.utils.Constant;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -89,6 +94,9 @@ public class WxBillAllController extends BaseController {
@Autowired
ExcelService excelService;
@Autowired
SysConfigService sysConfigService;
/**
* 商户账单汇总计费列表
* @param wxMerchant
@@ -116,6 +124,12 @@ public class WxBillAllController extends BaseController {
wxMerchant.setStarttime(null);
wxMerchant.setEndtime(null);
if (null != wxMerchant.getOnlyOwe() && EnumYesOrNo.YES.getCode().intValue() == wxMerchant.getOnlyOwe().intValue()) {
SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo());
Integer oweBillBeforeDays = 0 ;
if (null != config) {
oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue());
}
wxMerchant.setOweBillBeforeDays(oweBillBeforeDays);
List<Long> mids = billAllHelper.getOwdMerchantIds(wxMerchant, starttime, enttime);
if (null != mids && mids.size() > 0 ) {
wxMerchant.setIds(mids);;
@@ -254,23 +268,39 @@ public class WxBillAllController extends BaseController {
* @param pageSize
* @return
*/
// @GetMapping("oweBillHot")
// public ResultData oweBillHot() {
// wxMerchant.updateTenantInfo(getTenantInfo());
// WxUserDataRule dataRule = this.getCurrentDataFloors();
// if (null != dataRule) {
// wxMerchant.setFloorForRule(dataRule.getFloorIds());
// wxMerchant.setBusinessForRule(dataRule.getBussinessIds());
// }
// wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode());
// EnumBillAllType btype = EnumBillAllType.getEnum(billType);
// if (null == btype) {
// return new ResultData(Result.ERROR,"分类非法");
// }
// Date starttime = wxMerchant.getStarttime();
// Date enttime = wxMerchant.getEndtime();
// return new ResultData(billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime));
// }
@GetMapping("oweBillHot")
public ResultData oweBillHot() {
return new ResultData(getHots(null));
}
//临期
@GetMapping("nearBillHot")
public ResultData nearBillHot() {
SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo());
Integer nearBillBeforeDays = Constant.bill_near_default_days ;
if (null != lqconfig) {
nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue());
}
return new ResultData(getHots(nearBillBeforeDays));
}
private List<WxBillHotNotify> getHots(Integer nearBillBeforeDays) {
WxMerchant wxMerchant = new WxMerchant();
wxMerchant.updateTenantInfo(getTenantInfo());
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxMerchant.setFloorForRule(dataRule.getFloorIds());
wxMerchant.setBusinessForRule(dataRule.getBussinessIds());
}
SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo());
Integer oweBillBeforeDays = 0 ;
if (null != config) {
oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue());
}
wxMerchant.setOweBillBeforeDays(oweBillBeforeDays);
wxMerchant.setNearBillBeforeDays(nearBillBeforeDays);
return billAllHelper.getHotNotify(wxMerchant);
}
/**
* 欠缴账单统计
@@ -284,20 +314,48 @@ public class WxBillAllController extends BaseController {
if (null == billType) {
return new ResultData(Result.ERROR,"请选择分类");
}
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return new ResultData(Result.ERROR,"分类非法");
}
return new ResultData(getBillSum(wxMerchant, btype, null));
}
//临期账单金额
@GetMapping("nearBillSum")
public ResultData nearBillSum(@ModelAttribute WxMerchant wxMerchant,Integer billType) {
if (null == billType) {
return new ResultData(Result.ERROR,"请选择分类");
}
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return new ResultData(Result.ERROR,"分类非法");
}
SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo());
Integer nearBillBeforeDays = Constant.bill_near_default_days ;
if (null != lqconfig) {
nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue());
}
return new ResultData(getBillSum(wxMerchant, btype, nearBillBeforeDays));
}
private WxBillSum getBillSum(WxMerchant wxMerchant,EnumBillAllType btype,Integer nearBillBeforeDays) {
wxMerchant.updateTenantInfo(getTenantInfo());
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxMerchant.setFloorForRule(dataRule.getFloorIds());
wxMerchant.setBusinessForRule(dataRule.getBussinessIds());
}
wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode());
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return new ResultData(Result.ERROR,"分类非法");
SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo());
Integer oweBillBeforeDays = 0 ;
if (null != config) {
oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue());
}
wxMerchant.setOweBillBeforeDays(oweBillBeforeDays);
wxMerchant.setNearBillBeforeDays(nearBillBeforeDays);
Date starttime = wxMerchant.getStarttime();
Date enttime = wxMerchant.getEndtime();
return new ResultData(billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime));
return billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime);
}
/**
@@ -315,18 +373,49 @@ public class WxBillAllController extends BaseController {
if (null == billType) {
return new ResultData(Result.ERROR,"请选择分类");
}
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return new ResultData(Result.ERROR,"分类非法");
}
return new ResultData(getBillList(wxMerchant, btype, null, pageNum, pageSize));
}
@GetMapping("nearBillList")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData nearBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, Integer pageNum, Integer pageSize) {
if (null == billType) {
return new ResultData(Result.ERROR,"请选择分类");
}
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return new ResultData(Result.ERROR,"分类非法");
}
SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo());
Integer nearBillBeforeDays = Constant.bill_near_default_days ;
if (null != lqconfig) {
nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue());
}
return new ResultData(getBillList(wxMerchant, btype, nearBillBeforeDays, pageNum, pageSize));
}
private PageInfo getBillList(WxMerchant wxMerchant,EnumBillAllType btype,Integer nearBillBeforeDays, Integer pageNum, Integer pageSize) {
wxMerchant.updateTenantInfo(getTenantInfo());
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxMerchant.setFloorForRule(dataRule.getFloorIds());
wxMerchant.setBusinessForRule(dataRule.getBussinessIds());
}
wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode());
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return new ResultData(Result.ERROR,"分类非法");
SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo());
Integer oweBillBeforeDays = 0 ;
if (null != config) {
oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue());
}
return new ResultData(billAllHelper.getBillList(btype, wxMerchant,pageNum,pageSize));
wxMerchant.setOweBillBeforeDays(oweBillBeforeDays);
wxMerchant.setNearBillBeforeDays(nearBillBeforeDays);
return billAllHelper.getBillList(btype, wxMerchant,pageNum,pageSize);
}
/**
@@ -341,19 +430,37 @@ public class WxBillAllController extends BaseController {
if (null == billType) {
return ;
}
wxMerchant.updateTenantInfo(getTenantInfo());
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxMerchant.setFloorForRule(dataRule.getFloorIds());
wxMerchant.setBusinessForRule(dataRule.getBussinessIds());
}
wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode());
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return ;
}
PageInfo page = billAllHelper.getBillList(btype, wxMerchant,1,10000);
excelService.exportExcel(page.getList(), null, "商户账单总览数据", WxBillBaseEntity.class, "商户欠缴账单_"+btype.getMessage()+".xlsx", response, false);
PageInfo page = getBillList(wxMerchant, btype, null, 1, 10000);
if (null == page) {
return;
}
excelService.exportExcel(page.getList(), null, "逾期账单列表", WxBillBaseEntity.class, "商户欠缴账单_"+btype.getMessage()+".xlsx", response, false);
}
//临期
@GetMapping("exportNearBillList")
public void exportNearBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, HttpServletRequest request, HttpServletResponse response) {
if (null == billType) {
return ;
}
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return ;
}
SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo());
Integer nearBillBeforeDays = Constant.bill_near_default_days ;
if (null != lqconfig) {
nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue());
}
PageInfo page = getBillList(wxMerchant, btype, nearBillBeforeDays, 1, 10000);
if (null == page) {
return;
}
excelService.exportExcel(page.getList(), null, "临期账单列表", WxBillBaseEntity.class, "商户临期账单_"+btype.getMessage()+".xlsx", response, false);
}
/**
@@ -376,7 +483,24 @@ public class WxBillAllController extends BaseController {
if (null == bill) {
return;
}
billAllHelper.exportOneBillOweWord(bill, request, response);
billAllHelper.exportOneBillOweWord(true,bill, request, response);
}
//临期
@GetMapping("exportOneNearBill")
public void exportOneNearBill(Long id,Integer billType, HttpServletRequest request, HttpServletResponse response) {
if (null == billType) {
return ;
}
EnumBillAllType btype = EnumBillAllType.getEnum(billType);
if (null == btype) {
return ;
}
WxBillBaseEntity bill = billAllHelper.getOneBill(getTenantInfo(), btype, id);
if (null == bill) {
return;
}
billAllHelper.exportOneBillOweWord(false,bill, request, response);
}
//###################################### 老代码 ######################################


+ 2
- 2
mallinkSchedule/src/main/java/com/iformall/schedule/LatePayBillActionSchedule.java Wyświetl plik

@@ -34,8 +34,8 @@ public class LatePayBillActionSchedule {
wxBillPropertyMapper.autoAddLatePayPrice();

//修改欠缴
wxBillRentMapper.updateOwe();
wxBillPropertyMapper.updateOwe();
//wxBillRentMapper.updateOwe();
//wxBillPropertyMapper.updateOwe();

logger.info("账单滞纳金更新结束");
}catch (Exception e){


+ 2
- 1
mallinkService/src/main/java/com/iformall/common/SysConfigConstant.java Wyświetl plik

@@ -10,5 +10,6 @@ public class SysConfigConstant {
public static final String member_seconds_key="memberSeconds";
public static final String merchant_credit_locked="merchantCreditLocked";
public static final String merchant_Login_CheckPhone = "merchantLoginCheckPhone";

public static final String bill_before_days = "billBeforeDays";
public static final String bill_near_days = "billNearDays";
}

+ 0
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java Wyświetl plik

@@ -48,8 +48,6 @@ public class WxBillDaily extends WxBillBaseEntity {
@io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay")
private Long expiredDay;

@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus")
private Integer applyStatus;
@io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg")


+ 0
- 3
mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java Wyświetl plik

@@ -34,9 +34,6 @@ public class WxBillDeposit extends WxBillBaseEntity {
private Date createtime;
@io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay")
private Long expiredDay;

@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期5已退还", name = "status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus")
private Integer applyStatus;
@io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg")


+ 0
- 3
mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java Wyświetl plik

@@ -52,9 +52,6 @@ public class WxBillOther extends WxBillBaseEntity {
@io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay")
private Long expiredDay;

@Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "9")
@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus")
private Integer applyStatus;
@io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg")


+ 0
- 3
mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java Wyświetl plik

@@ -45,9 +45,6 @@ public class WxBillOtherDeposit extends WxBillBaseEntity {
@io.swagger.annotations.ApiModelProperty(value = "逾期天数", name = "expiredDay")
private Long expiredDay;

@Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "8")
@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期5已退还", name = "status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus")
private Integer applyStatus;
@io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg")


+ 0
- 4
mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java Wyświetl plik

@@ -48,10 +48,6 @@ public class WxBillProperty extends WxBillBaseEntity {
@Excel(name = "逾期(天) ", width = 20, orderNum = "13")
@io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay")
private Long expiredDay;

@Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "8")
@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus")
private Integer applyStatus;
@io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg")


+ 0
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java Wyświetl plik

@@ -34,8 +34,6 @@ public class WxBillPropertyDeposit extends WxBillBaseEntity {
private Date createtime;
@io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay")
private Long expiredDay;
@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期5已退还", name = "status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus")
private Integer applyStatus;
@io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg")


+ 0
- 4
mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java Wyświetl plik

@@ -48,10 +48,6 @@ public class WxBillRent extends WxBillBaseEntity {
@io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay")
private Long expiredDay;

@Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "10")
@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期EnumBillRentStatus", name = "status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus")
private Integer applyStatus;
@io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg")


+ 0
- 4
mallinkService/src/main/java/com/iformall/domain/po/WxBillRentManage.java Wyświetl plik

@@ -49,10 +49,6 @@ public class WxBillRentManage extends WxBillBaseEntity {
@io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay")
private Long expiredDay;

@Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "10")
@io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status")
private Integer status;
@io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus")
private Integer applyStatus;
@io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg")


+ 9
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java Wyświetl plik

@@ -444,8 +444,17 @@ public class WxMerchant extends TenantEntity {
@TableField(exist = false)
private String initLog;

@TableField(exist = false)
private Integer onlyOwe;
//账单逾期计算提前天数
@TableField(exist = false)
private Integer oweBillBeforeDays;
//临期计算提前天数
@TableField(exist = false)
private Integer nearBillBeforeDays;
}

+ 18
- 2
mallinkService/src/main/java/com/iformall/domain/po/base/WxBillBaseEntity.java Wyświetl plik

@@ -57,8 +57,16 @@ public class WxBillBaseEntity extends TenantEntity {
protected Date endtimeEnd;

@Excel(name = "欠缴金额(元)", width = 20, orderNum = "11")
@io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe")
@TableField(exist = false)
protected String owe;
public String getOwe() {
return new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString();
}
@Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "10")
@io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status")
protected Integer status;

//@Excel(name = "实际应收总金额(元)", width = 20, orderNum = "8")
@io.swagger.annotations.ApiModelProperty(value="实际应收金额(加上了滞纳金服务费等费用)",name="realReceivePay")
@@ -87,7 +95,15 @@ public class WxBillBaseEntity extends TenantEntity {
@TableField(exist = false)
protected String month;
// @TableField(exist = false)
// protected Integer onlyOwe;
//账单逾期计算提前天数
@TableField(exist = false)
private Integer oweBillBeforeDays;
//临期计算提前天数
@TableField(exist = false)
protected Integer onlyOwe;
private Integer nearBillBeforeDays;

}

+ 0
- 2
mallinkService/src/main/java/com/iformall/domain/vo/WxBillHotNotify.java Wyświetl plik

@@ -13,8 +13,6 @@ public class WxBillHotNotify implements Serializable {

private static final long serialVersionUID = 1L;

//EnumBillAllType;
private Integer billType;
private String billTypeName;
private Integer totalCount = 0;
private String totalMoney = "0";


+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxBillSum.java Wyświetl plik

@@ -22,6 +22,7 @@ public class WxBillSum implements Serializable {
@TableField(exist = false)
private BigDecimal paidNumber;
//欠款
@TableField(exist = false)
private String owe = "0";
@TableField(exist = false)
private BigDecimal oweNumber;
@@ -44,7 +45,11 @@ public class WxBillSum implements Serializable {
return paidNumber;
}
public String getOwe() {
return new BigDecimal(needPay).subtract(new BigDecimal(paid)).toPlainString();
}
public BigDecimal getOweNumber() {
this.owe = getOwe();
if (StringUtils.isNotBlank(owe)) {
this.oweNumber = new BigDecimal(owe).setScale(2, RoundingMode.HALF_UP);
}else {


+ 0
- 41
mallinkService/src/main/java/com/iformall/enums/EnumBillDailyStatus.java Wyświetl plik

@@ -1,41 +0,0 @@
package com.iformall.enums;


/**
* @author gongbiao
*/

public enum EnumBillDailyStatus {

NOT_PAID(1, "欠缴"),
WAIT_PAY(2,"待缴"),
PAID(3, "已结清"),
NOT_EXPIRED(4,"未到期"),
RETURN(5, "退还"),
;

public static EnumBillDailyStatus getEnum(Integer code) {
for (EnumBillDailyStatus value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumBillDailyStatus(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

mallinkService/src/main/java/com/iformall/enums/EnumBillRentStatus.java → mallinkService/src/main/java/com/iformall/enums/EnumBillStatus.java Wyświetl plik

@@ -5,7 +5,7 @@ package com.iformall.enums;
* @author gongbiao
*/

public enum EnumBillRentStatus {
public enum EnumBillStatus {
NOT_PAID(1, "欠缴"),
WAIT_PAY(2,"待缴"),
PAID(3, "已结清"),
@@ -14,8 +14,8 @@ public enum EnumBillRentStatus {
INVALID(6, "失效"),
;

public static EnumBillRentStatus getEnum(Integer code) {
for (EnumBillRentStatus value : values()) {
public static EnumBillStatus getEnum(Integer code) {
for (EnumBillStatus value : values()) {
if (value.getCode().equals(code)) {
return value;
}
@@ -26,7 +26,7 @@ public enum EnumBillRentStatus {
private Integer code;
private String message;

EnumBillRentStatus(Integer code, String message) {
EnumBillStatus(Integer code, String message) {
this.code = code;
this.message = message;
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBillDailyMapper.java Wyświetl plik

@@ -3,6 +3,7 @@ package com.iformall.mapper;
import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxBillDaily;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -24,5 +25,7 @@ public interface WxBillDailyMapper extends CommonMapper<WxBillDaily, Long> {
WxBillSum getBillMonthSum(WxBillDaily record);
List<Long> getMerchantIdList(WxBillDaily record);
WxBillHotNotify getBillHotNotify(WxBillDaily record);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBillDepositMapper.java Wyświetl plik

@@ -5,6 +5,7 @@ import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxBillDeposit;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -36,4 +37,6 @@ public interface WxBillDepositMapper extends CommonMapper<WxBillDeposit, Long> {
List<Long> getMerchantIdList(WxBillDeposit wxBillDeposit);
WxBillHotNotify getBillHotNotify(WxBillDeposit wxBillDeposit);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBillOtherDepositMapper.java Wyświetl plik

@@ -3,6 +3,7 @@ package com.iformall.mapper;
import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxBillOtherDeposit;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -24,5 +25,7 @@ public interface WxBillOtherDepositMapper extends CommonMapper<WxBillOtherDeposi
WxBillSum getBillMonthSum(WxBillOtherDeposit record);
List<Long> getMerchantIdList(WxBillOtherDeposit record);
WxBillHotNotify getBillHotNotify(WxBillOtherDeposit record);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBillOtherMapper.java Wyświetl plik

@@ -3,6 +3,7 @@ package com.iformall.mapper;
import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxBillOther;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -28,4 +29,6 @@ public interface WxBillOtherMapper extends CommonMapper<WxBillOther, Long> {
WxBillSum getBillMonthSum(WxBillOther record);
List<Long> getMerchantIdList(WxBillOther record);
WxBillHotNotify getBillHotNotify(WxBillOther record);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyDepositMapper.java Wyświetl plik

@@ -4,6 +4,7 @@ import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxBillPropertyDeposit;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -31,4 +32,6 @@ public interface WxBillPropertyDepositMapper extends CommonMapper<WxBillProperty
WxBillSum getBillMonthSum(WxBillPropertyDeposit wxBillPropertyDeposit);
List<Long> getMerchantIdList(WxBillPropertyDeposit wxBillPropertyDeposit);
WxBillHotNotify getBillHotNotify(WxBillPropertyDeposit wxBillPropertyDeposit);
}

+ 4
- 1
mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyMapper.java Wyświetl plik

@@ -6,6 +6,7 @@ import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -62,11 +63,13 @@ public interface WxBillPropertyMapper extends CommonMapper<WxBillProperty, Long>

void updateServiceCharge(WxPayAccountBill tenantId);

void updateOwe();
//void updateOwe();
WxBillSum getBillMonthSum(WxBillProperty propertyQuery);
List<Long> getMerchantIdList(WxBillProperty propertyQuery);
WxBillHotNotify getBillHotNotify(WxBillProperty propertyQuery);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxBillRentManageMapper.java Wyświetl plik

@@ -3,6 +3,7 @@ package com.iformall.mapper;
import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxBillRentManage;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import org.apache.ibatis.annotations.Param;
@@ -35,5 +36,7 @@ public interface WxBillRentManageMapper extends CommonMapper<WxBillRentManage, L
WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage);
List<Long> getMerchantIdList(WxBillRentManage wxBillRentManage);
WxBillHotNotify getBillHotNotify(WxBillRentManage wxBillRentManage);
}

+ 4
- 1
mallinkService/src/main/java/com/iformall/mapper/WxBillRentMapper.java Wyświetl plik

@@ -4,6 +4,7 @@ import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import org.apache.ibatis.annotations.Param;
@@ -59,10 +60,12 @@ public interface WxBillRentMapper extends CommonMapper<WxBillRent, Long> {

void updateServiceCharge(WxPayAccountBill record);

void updateOwe();
//void updateOwe();
WxBillSum getBillMonthSum(WxBillRent wxBillRent);
List<Long> getMerchantIdList(WxBillRent wxBillRent);
WxBillHotNotify getBillHotNotify(WxBillRent wxBillRent);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBillDailyService.java Wyświetl plik

@@ -7,6 +7,7 @@ import com.iformall.domain.po.WxBillDaily;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillDailyVo;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -66,5 +67,7 @@ public interface WxBillDailyService {
WxBillSum getBillMonthSum(WxBillDaily wxBillDaily);
List<Long> getMerchantIds(WxBillDaily wxBillDaily);
WxBillHotNotify getBillHotNotify(WxBillDaily wxBillDaily);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBillDepositService.java Wyświetl plik

@@ -8,6 +8,7 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillDeposit;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

public interface WxBillDepositService {
@@ -59,5 +60,7 @@ public interface WxBillDepositService {
WxBillSum getBillMonthSum(WxBillDeposit wxBillDeposit);
List<Long> getMerchantIds(WxBillDeposit wxBillDeposit);
WxBillHotNotify getBillHotNotify(WxBillDeposit wxBillDeposit);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBillOtherDepositService.java Wyświetl plik

@@ -6,6 +6,7 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillOtherDeposit;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -65,5 +66,7 @@ public interface WxBillOtherDepositService {
WxBillSum getBillMonthSum(WxBillOtherDeposit wxBillDeposit);
List<Long> getMerchantIds(WxBillOtherDeposit wxBillDeposit);
WxBillHotNotify getBillHotNotify(WxBillOtherDeposit wxBillDeposit);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBillOtherService.java Wyświetl plik

@@ -6,6 +6,7 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillOther;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -61,5 +62,7 @@ public interface WxBillOtherService {
WxBillSum getBillMonthSum(WxBillOther wxBillOther);
List<Long> getMerchantIds(WxBillOther wxBillOther);
WxBillHotNotify getBillHotNotify(WxBillOther wxBillOther);

}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBillPropertyDepositService.java Wyświetl plik

@@ -8,6 +8,7 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillPropertyDeposit;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

/**
@@ -62,4 +63,6 @@ public interface WxBillPropertyDepositService {
WxBillSum getBillMonthSum(WxBillPropertyDeposit deposit);
List<Long> getMerchantIds(WxBillPropertyDeposit deposit);
WxBillHotNotify getBillHotNotify(WxBillPropertyDeposit deposit);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBillPropertyService.java Wyświetl plik

@@ -6,6 +6,7 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -76,4 +77,6 @@ public interface WxBillPropertyService {
WxBillSum getBillMonthSum(WxBillProperty wxBillProperty);
List<Long> getMerchantIds(WxBillProperty wxBillProperty);
WxBillHotNotify getBillHotNotify(WxBillProperty wxBillProperty);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBillRentManageService.java Wyświetl plik

@@ -7,6 +7,7 @@ import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxBillRentManage;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -73,4 +74,6 @@ public interface WxBillRentManageService {
WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage);

List<Long> getMerchantIds(WxBillRentManage wxBillRentManage);
WxBillHotNotify getBillHotNotify(WxBillRentManage wxBillRentManage);
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxBillRentService.java Wyświetl plik

@@ -5,6 +5,7 @@ import com.iformall.common.ResultData;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;

import java.util.List;
@@ -77,5 +78,7 @@ public interface WxBillRentService {
List<Long> getMerchantIds(WxBillRent wxBillRent);
WxBillHotNotify getBillHotNotify(WxBillRent wxBillRent);
}

+ 146
- 9
mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java Wyświetl plik

@@ -101,10 +101,11 @@ public class WxBillAllHelper {
bill.setFloor(wxMerchant.getFloor());
bill.setMerchantName(wxMerchant.getName());
bill.setMerchantId(wxMerchant.getId());
bill.setOnlyOwe(wxMerchant.getOnlyOwe());
bill.setStarttime(starttime);
bill.setEndtime(enttime);
bill.setRentShopType(wxMerchant.getType());
bill.setOweBillBeforeDays(wxMerchant.getOweBillBeforeDays());
bill.setNearBillBeforeDays(wxMerchant.getNearBillBeforeDays());
}
public WxBillSum getBillRentSum(WxMerchant wxMerchant,Date starttime, Date enttime) {
@@ -124,10 +125,16 @@ public class WxBillAllHelper {
return wxBillRentService.getMerchantIds(br);
}
// public WxBillHotNotify getBillRentHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
// WxBillRent br = new WxBillRent();
// updateQueryParm(wxMerchant, br,starttime,enttime);
// }
public WxBillHotNotify getBillRentHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillRent br = new WxBillRent();
updateQueryParm(wxMerchant, br,starttime,enttime);
WxBillHotNotify notify = wxBillRentService.getBillHotNotify(br);
if (null == notify) {
notify = new WxBillHotNotify();
}
notify.setBillTypeName(EnumBillAllType.RENT.getMessage());
return notify;
}
public WxBillSum getBillRentManageSum(WxMerchant wxMerchant,Date starttime, Date enttime,EnumRentContractManageFeeType manageFeeType) {
WxBillRentManage brm = new WxBillRentManage();
@@ -156,6 +163,21 @@ public class WxBillAllHelper {
return wxBillRentManageService.getMerchantIds(brm);
}
public WxBillHotNotify getBillRentManageHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime,EnumRentContractManageFeeType manageFeeType) {
WxBillRentManage brm = new WxBillRentManage();
updateQueryParm(wxMerchant, brm,starttime,enttime);
WxBillHotNotify notify = wxBillRentManageService.getBillHotNotify(brm);
if (null == notify) {
notify = new WxBillHotNotify();
}
if (null != manageFeeType) {
notify.setBillTypeName(manageFeeType.getMessage());
}else {
notify.setBillTypeName("商业&运营管理费");
}
return notify;
}
public WxBillSum getBillDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillDeposit bd = new WxBillDeposit();
updateQueryParm(wxMerchant, bd,starttime,enttime);
@@ -173,6 +195,17 @@ public class WxBillAllHelper {
return wxBillRentDepositService.getMerchantIds(bd);
}
public WxBillHotNotify getBillDepositHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillDeposit bd = new WxBillDeposit();
updateQueryParm(wxMerchant, bd,starttime,enttime);
WxBillHotNotify notify = wxBillRentDepositService.getBillHotNotify(bd);
if (null == notify) {
notify = new WxBillHotNotify();
}
notify.setBillTypeName(EnumBillAllType.RENT_DEPOSIT.getMessage());
return notify;
}
public WxBillSum getBillPropertySum(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillProperty bp = new WxBillProperty();
updateQueryParm(wxMerchant, bp,starttime,enttime);
@@ -190,6 +223,17 @@ public class WxBillAllHelper {
return wxBillPropertyService.getMerchantIds(bp);
}
public WxBillHotNotify getBillPropertyHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillProperty bp = new WxBillProperty();
updateQueryParm(wxMerchant, bp,starttime,enttime);
WxBillHotNotify notify = wxBillPropertyService.getBillHotNotify(bp);
if (null == notify) {
notify = new WxBillHotNotify();
}
notify.setBillTypeName(EnumBillAllType.PROPERTY.getMessage());
return notify;
}
public WxBillSum getBillPropertyDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillPropertyDeposit pd = new WxBillPropertyDeposit();
updateQueryParm(wxMerchant, pd,starttime,enttime);
@@ -207,6 +251,17 @@ public class WxBillAllHelper {
return wxBillPropertyDepositService.getMerchantIds(pd);
}
public WxBillHotNotify getBillPropertyDepositHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillPropertyDeposit pd = new WxBillPropertyDeposit();
updateQueryParm(wxMerchant, pd,starttime,enttime);
WxBillHotNotify notify = wxBillPropertyDepositService.getBillHotNotify(pd);
if (null == notify) {
notify = new WxBillHotNotify();
}
notify.setBillTypeName(EnumBillAllType.PROPERTY_DEPOSIT.getMessage());
return notify;
}
public WxBillSum getBillDailySum(WxMerchant wxMerchant,Date starttime, Date enttime,EnumBillDailyType dailyType) {
WxBillDaily bdd = new WxBillDaily();
if (null != dailyType) {
@@ -234,6 +289,17 @@ public class WxBillAllHelper {
return wxBillDailyService.getMerchantIds(bdd);
}
public WxBillHotNotify getBillDailyHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillDaily bdd = new WxBillDaily();
updateQueryParm(wxMerchant, bdd,starttime,enttime);
WxBillHotNotify notify = wxBillDailyService.getBillHotNotify(bdd);
if (null == notify) {
notify = new WxBillHotNotify();
}
notify.setBillTypeName(EnumBillAllType.DAILY.getMessage());
return notify;
}
public WxBillSum getBillOtherSum(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillOther bo = new WxBillOther();
updateQueryParm(wxMerchant, bo,starttime,enttime);
@@ -251,6 +317,17 @@ public class WxBillAllHelper {
return wxBillOtherService.getMerchantIds(bo);
}
public WxBillHotNotify getBillOtherHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillOther bo = new WxBillOther();
updateQueryParm(wxMerchant, bo,starttime,enttime);
WxBillHotNotify notify = wxBillOtherService.getBillHotNotify(bo);
if (null == notify) {
notify = new WxBillHotNotify();
}
notify.setBillTypeName(EnumBillAllType.OTHER.getMessage());
return notify;
}
public WxBillSum getBillOtherDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillOtherDeposit bod = new WxBillOtherDeposit();
updateQueryParm(wxMerchant, bod,starttime,enttime);
@@ -268,6 +345,17 @@ public class WxBillAllHelper {
return wxBillOtherDepositService.getMerchantIds(bod);
}
public WxBillHotNotify getBillOtherDepositHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
WxBillOtherDeposit bod = new WxBillOtherDeposit();
updateQueryParm(wxMerchant, bod,starttime,enttime);
WxBillHotNotify notify = wxBillOtherDepositService.getBillHotNotify(bod);
if (null == notify) {
notify = new WxBillHotNotify();
}
notify.setBillTypeName(EnumBillAllType.OTHER_DEPOSIT.getMessage());
return notify;
}
public String calcuteSum(String... money) {
if (null != money) {
BigDecimal total = new BigDecimal(0);
@@ -412,8 +500,11 @@ public class WxBillAllHelper {
return null;
}
public void exportOneBillOweWord(WxBillBaseEntity bill,HttpServletRequest request, HttpServletResponse response) {
public void exportOneBillOweWord(boolean isOwe,WxBillBaseEntity bill,HttpServletRequest request, HttpServletResponse response) {
String templatePath = "contract-word-template/bill_owe_one.docx";
if (!isOwe) {
templatePath = "contract-word-template/bill_near_one.docx";
}
String filepath = fmUploadDir;
String filename = UUID.randomUUID() + ".docx";
String exportFileName = "催缴单";
@@ -442,7 +533,53 @@ public class WxBillAllHelper {
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, null);
}
// public WxBillHotNotify getHotNotify() {
//
// }
public List<WxBillHotNotify> getHotNotify(WxMerchant wxMerchant) {
List<WxBillHotNotify> retList = new ArrayList<WxBillHotNotify>();
WxBillHotNotify rentNotify = this.getBillRentHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime());
if (null != rentNotify) {
retList.add(rentNotify);
}
WxBillHotNotify rentBussinessManageNotify = this.getBillRentManageHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime(),EnumRentContractManageFeeType.RENT_BUSSINESS_MANAGE_FEE);
if (null != rentBussinessManageNotify) {
retList.add(rentBussinessManageNotify);
}
WxBillHotNotify rentOperationManageNotify = this.getBillRentManageHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime(),EnumRentContractManageFeeType.RENT_OPERATING_MANAGE_FEE);
if (null != rentOperationManageNotify) {
retList.add(rentOperationManageNotify);
}
WxBillHotNotify rentDepositNotify = this.getBillDepositHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime());
if (null != rentDepositNotify) {
retList.add(rentDepositNotify);
}
WxBillHotNotify propertyNotify = this.getBillPropertyHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime());
if (null != propertyNotify) {
retList.add(propertyNotify);
}
WxBillHotNotify propertyDepositNotify = this.getBillPropertyDepositHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime());
if (null != propertyDepositNotify) {
retList.add(propertyDepositNotify);
}
WxBillHotNotify dailyNotify = this.getBillDailyHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime());
if (null != dailyNotify) {
retList.add(dailyNotify);
}
WxBillHotNotify otherNotify = this.getBillOtherHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime());
if (null != otherNotify) {
retList.add(otherNotify);
}
WxBillHotNotify otherDepositNotify = this.getBillOtherDepositHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime());
if (null != otherDepositNotify) {
retList.add(otherDepositNotify);
}
return retList;
}
}

+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java Wyświetl plik

@@ -324,9 +324,9 @@ public class DataTowerServiceImpl implements DataTowerService {
String enddate = DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss");
record.setStarttime(startdate);
record.setEndtime(enddate);
record.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
record.setStatus(EnumBillStatus.NOT_PAID.getCode());
Map<String, Object> oweInfo = wxBillAllMapper.queryOweInfo(record);
record.setStatus(EnumBillRentStatus.PAID.getCode());
record.setStatus(EnumBillStatus.PAID.getCode());
Map<String, Object> paidInfo = wxBillAllMapper.queryPaidInfo(record);

billMap.putAll(oweInfo);


+ 38
- 38
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Wyświetl plik

@@ -277,8 +277,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode()) &&
!e.getStatus().equals(EnumBillRentStatus.WAIT_PAY.getCode())) {
if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode()) &&
!e.getStatus().equals(EnumBillStatus.WAIT_PAY.getCode())) {
e.setOwe(0L);
} else {
e.setOwe(realReceivePay - e.getPay());
@@ -421,55 +421,55 @@ public class WxBillAllServiceImpl implements WxBillAllService {
if (billTypeValue == EnumBillTypeParam.RENT.getCode().intValue()) {
logger.info("更新租金账单");
WxBillRent billRent = wxBillRentMapper.selectById((Long) bill.get("id"));
if (billRent != null && !billRent.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (billRent != null && !billRent.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillRent(bill);
}
} else if (billTypeValue == EnumBillTypeParam.RENT_DEPOSIT.getCode().intValue()) {
logger.info("更新租金押金账单");
WxBillDeposit billDeposit = wxBillDepositMapper.selectById((Long) bill.get("id"));
if (billDeposit != null && !billDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (billDeposit != null && !billDeposit.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillRentDeposit(bill);
}
} else if (billTypeValue == EnumBillTypeParam.PROPERTY.getCode().intValue()) {
logger.info("更新物业账单");
WxBillProperty property = wxBillPropertyMapper.selectById((Long) bill.get("id"));
if (property != null && !property.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (property != null && !property.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillProperty(bill);
}
} else if (billTypeValue == EnumBillTypeParam.PROPERTY_DEPOSIT.getCode().intValue()) {
logger.info("更新物业押金账单");
WxBillPropertyDeposit wxBillPropertyDeposit = wxBillPropertyDepositMapper.selectById((Long) bill.get("id"));
if (wxBillPropertyDeposit != null && !wxBillPropertyDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (wxBillPropertyDeposit != null && !wxBillPropertyDeposit.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillPropertyDeposit(bill);
}
} else if (billTypeValue == EnumBillTypeParam.WATER.getCode().intValue()) {
logger.info("更新水费账单");
WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id"));
if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillDaily(bill);
}
} else if (billTypeValue == EnumBillTypeParam.POWER.getCode().intValue()) {
logger.info("更新电费账单");
WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id"));
if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillDaily(bill);
}
} else if (billTypeValue == EnumBillTypeParam.AIR_CONDITIONING.getCode().intValue()) {
logger.info("更新空调费账单");
WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id"));
if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillDaily(bill);
}
} else if (billTypeValue == EnumBillTypeParam.ROUTINE.getCode().intValue()) {
logger.info("更新其他账单");
WxBillOther wxBillOther = wxBillOtherMapper.selectById((Long) bill.get("id"));
if (wxBillOther != null && !wxBillOther.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (wxBillOther != null && !wxBillOther.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillOther(bill);
}
} else if (billTypeValue == EnumBillTypeParam.ATHER_DEPOSIT.getCode().intValue()) {
logger.info("更新其他押金账单");
WxBillOtherDeposit wxBillOtherDeposit = wxBillOtherDepositMapper.selectById((Long) bill.get("id"));
if (wxBillOtherDeposit != null && !wxBillOtherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (wxBillOtherDeposit != null && !wxBillOtherDeposit.getStatus().equals(EnumBillStatus.PAID.getCode())) {
updateBillOtherDeposit(bill);
}
} else if (billTypeValue == EnumBillTypeParam.SETTLE.getCode().intValue()) {
@@ -532,7 +532,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillAllVo.setRentEndTime(DateUtils.format(wxBillAllVo.getEndtime()));

//status不是欠缴,都展示0,与前端保持一致
if (!EnumBillRentStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) {
if (!EnumBillStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) {
wxBillAllVo.setOwe(0L);
wxBillAllVo.setOweStr("0");
}
@@ -558,8 +558,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillOtherDeposit.setPayDate(date);
Long owe = (Long) bill.get("owe");
wxBillOtherDeposit.setPay(wxBillOtherDeposit.getPay() + owe);
wxBillOtherDeposit.setOwe("0");
wxBillOtherDeposit.setStatus(EnumBillDailyStatus.PAID.getCode());
//wxBillOtherDeposit.setOwe("0");
wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode());
wxBillOtherDeposit.setPayDate(date);
wxBillOtherDeposit.setUpdatetime(date);
wxBillOtherDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode());
@@ -602,8 +602,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillOther.setPayDate(date);
Long owe = (Long) bill.get("owe");
wxBillOther.setPay(wxBillOther.getPay() + owe);
wxBillOther.setOwe("0");
wxBillOther.setStatus(EnumBillDailyStatus.PAID.getCode());
//wxBillOther.setOwe("0");
wxBillOther.setStatus(EnumBillStatus.PAID.getCode());
wxBillOther.setPayDate(date);
wxBillOther.setUpdatetime(date);
wxBillOther.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode());
@@ -646,8 +646,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillDaily.setPayDate(date);
Long owe = (Long) bill.get("owe");
wxBillDaily.setPay(wxBillDaily.getPay() + owe);
wxBillDaily.setOwe("0");
wxBillDaily.setStatus(EnumBillDailyStatus.PAID.getCode());
//wxBillDaily.setOwe("0");
wxBillDaily.setStatus(EnumBillStatus.PAID.getCode());
wxBillDaily.setPayDate(date);
wxBillDaily.setUpdatetime(date);
wxBillDaily.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode());
@@ -691,8 +691,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillPropertyDeposit.setPayDate(date);
String owe = (String) bill.get("owe");
wxBillPropertyDeposit.setPay(new BigDecimal(wxBillPropertyDeposit.getPay()).add(new BigDecimal(owe)).toPlainString());
wxBillPropertyDeposit.setOwe("0");
wxBillPropertyDeposit.setStatus(EnumBillDailyStatus.PAID.getCode());
//wxBillPropertyDeposit.setOwe("0");
wxBillPropertyDeposit.setStatus(EnumBillStatus.PAID.getCode());
wxBillPropertyDeposit.setPayDate(date);
wxBillPropertyDeposit.setUpdatetime(date);
wxBillPropertyDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode());
@@ -736,8 +736,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
property.setPayDate(date);
String owe = (String) bill.get("owe");
property.setPay(new BigDecimal(property.getPay()).add(new BigDecimal(owe)).toPlainString());
property.setOwe("0");
property.setStatus(EnumBillDailyStatus.PAID.getCode());
//property.setOwe("0");
property.setStatus(EnumBillStatus.PAID.getCode());
property.setPayDate(date);
property.setUpdatetime(date);
property.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode());
@@ -781,8 +781,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillDeposit.setPayDate(date);
Long owe = (Long) bill.get("owe");
wxBillDeposit.setPay(wxBillDeposit.getPay() + owe);
wxBillDeposit.setOwe("0");
wxBillDeposit.setStatus(EnumBillDailyStatus.PAID.getCode());
//wxBillDeposit.setOwe("0");
wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode());
wxBillDeposit.setPayDate(date);
wxBillDeposit.setUpdatetime(date);
wxBillDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode());
@@ -826,8 +826,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillRent.setPayDate(date);
Long owe = (Long) bill.get("owe");
wxBillRent.setPay(wxBillRent.getPay() + owe);
wxBillRent.setOwe("0");
wxBillRent.setStatus(EnumBillDailyStatus.PAID.getCode());
//wxBillRent.setOwe("0");
wxBillRent.setStatus(EnumBillStatus.PAID.getCode());
wxBillRent.setPayDate(date);
wxBillRent.setUpdatetime(date);
wxBillRent.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode());
@@ -930,9 +930,9 @@ public class WxBillAllServiceImpl implements WxBillAllService {
Integer status = wxBillAll.getStatus();
if (status == null) {
List<Integer> statusList = new ArrayList<>();
statusList.add(EnumBillRentStatus.NOT_PAID.getCode());
statusList.add(EnumBillRentStatus.WAIT_PAY.getCode());
statusList.add(EnumBillRentStatus.NOT_EXPIRED.getCode());
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());
@@ -1744,7 +1744,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
WxBillRent rent = new WxBillRent();
rent.setExpiredDay(0L);
if (owe <= pay) {
rent.setStatus(EnumBillRentStatus.PAID.getCode());
rent.setStatus(EnumBillStatus.PAID.getCode());
int expiredDay = DateUtils.daysBetween(startDate, endDate);
int timePeriod = 0;
if (expiredDay > timePeriod) {
@@ -1756,7 +1756,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
int day = DateUtils.daysBetween(startDate, now);
int timePeriod = 0;
if (day > timePeriod) {
rent.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
rent.setStatus(EnumBillStatus.NOT_PAID.getCode());
rent.setExpiredDay((long) day);
return rent;
}
@@ -1764,12 +1764,12 @@ public class WxBillAllServiceImpl implements WxBillAllService {
timePeriod = 30;
long expiredDay = Long.valueOf(Math.abs(day));
if (expiredDay > timePeriod) {
rent.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode());
rent.setStatus(EnumBillStatus.NOT_EXPIRED.getCode());
} else {
rent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
rent.setStatus(EnumBillStatus.WAIT_PAY.getCode());
}
} else {
rent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
rent.setStatus(EnumBillStatus.WAIT_PAY.getCode());
}
return rent;
}
@@ -1856,14 +1856,14 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillDaily.setId(businessId);
if (forcePaid) {
wxBillDaily.setReceivePay(dbBill.getPay());
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDaily.setOwe("0");
wxBillDaily.setStatus(EnumBillStatus.PAID.getCode());
//wxBillDaily.setOwe("0");
}else {
wxBillDaily.setReceivePay(newPrice);
//wxBillDaily.setOwe(new BigDecimal(newPrice).add(new BigDecimal(dbBill.getServiceChargePay())).subtract(new BigDecimal(dbBill.getPay())).toPlainString());
wxBillDaily.setOwe(new BigDecimal(newPrice).subtract(new BigDecimal(dbBill.getPay())).toPlainString());
//wxBillDaily.setOwe(new BigDecimal(newPrice).subtract(new BigDecimal(dbBill.getPay())).toPlainString());
if (newPrice.equals(dbBill.getPay())) {
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDaily.setStatus(EnumBillStatus.PAID.getCode());
}
}
wxBillDaily.setUpdatetime(updateDate);


+ 26
- 19
mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java Wyświetl plik

@@ -12,6 +12,7 @@ import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillDailyExportVo;
import com.iformall.domain.vo.WxBillDailyVo;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
@@ -150,11 +151,11 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
BigDecimal realReceivePay = servicePay.add(new BigDecimal(e.getReceivePay()));
e.setRealReceivePay(realReceivePay.toPlainString());
e.setServiceChargePay(servicePay.toPlainString());
if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) {
e.setOwe("0");
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());
//e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString());
}
}
}
@@ -176,8 +177,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
if (StringUtils.isNotBlank(record.getParentTenantId())) {
params.put("parentTenantId", record.getParentTenantId());
}
params.put("waitPay", EnumBillDailyStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillDailyMapper.updateWaitPayStatus(params);
} catch (Exception e) {
@@ -194,8 +195,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
if (StringUtils.isNotBlank(record.getParentTenantId())) {
params.put("parentTenantId", record.getParentTenantId());
}
params.put("notPaid", EnumBillDailyStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("notPaid", EnumBillStatus.NOT_PAID.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillDailyMapper.updateNotPaidStatus(params);
} catch (Exception e) {
@@ -212,7 +213,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
record.updateTenantInfo(tenantEntity);
WxBillDaily wxBillDaily = getBillRentPropertyList(1, 1, record, wxPayAccountBill).getList().get(0);
//wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getRealReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString());
wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString());
//wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString());
wxBillDaily.setMerchant(wxMerchantMapper.selectById(wxBillDaily.getMerchantId()));
// if (wxBillDaily.getShopId() != null) {
// WxShop shop = new WxShop();
@@ -248,12 +249,12 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
}
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
record.setStatus(record.getReceiveDate().after(date)?EnumBillDailyStatus.WAIT_PAY.getCode():EnumBillDailyStatus.NOT_PAID.getCode());
record.setStatus(record.getReceiveDate().after(date)?EnumBillStatus.WAIT_PAY.getCode():EnumBillStatus.NOT_PAID.getCode());
record.setCreatetime(date);
record.setUpdatetime(date);
record.setExpiredDay(0L);
//record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try {
wxBillDailyMapper.insert(record);
@@ -275,16 +276,16 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
wxBillDaily.setServiceChargePay(record.getServiceChargePayUpdate());
//wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).add(new BigDecimal(wxBillDaily.getServiceChargePay()))
// .subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString());
wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString());
//wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString());
}else{
String addpay = wxBillDaily.getPay();
wxBillDaily.setPayDate(record.getPayDate());
wxBillDaily.setPay(record.getPay());
wxBillDaily.setReceivePay(record.getReceivePay());
//wxBillDaily.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
wxBillDaily.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//wxBillDaily.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
if (record.getPay().equals(record.getRealReceivePay())) {
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDaily.setStatus(EnumBillStatus.PAID.getCode());
Date payDate = record.getPayDate();
Date receiveDate = wxBillDaily.getReceiveDate();
wxBillDaily.setExpiredDay(0L);
@@ -343,7 +344,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
if(wxBillDaily==null){
return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND);
}
wxBillDaily.setStatus(EnumBillDailyStatus.PAID.getCode());
wxBillDaily.setStatus(EnumBillStatus.PAID.getCode());
Date d =new Date();
wxBillDaily.setPayDate(d);
wxBillDaily.setUpdatetime(d);
@@ -393,7 +394,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
wxBillDaily.setReceivePay(receivePay);
String pay = billDaily.getPay();
wxBillDaily.setPay(pay);
wxBillDaily.setOwe(new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString());
//wxBillDaily.setOwe(new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString());
wxBillDaily.setType(type);
Date receiveDate = billDaily.getReceiveDate();
wxBillDaily.setReceiveDate(receiveDate);
@@ -404,13 +405,13 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
int expiredDay = DateUtils.daysBetween(receiveDate, date);
wxBillDaily.setExpiredDay(0L);
if (expiredDay > 0) {
wxBillDaily.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillDaily.setStatus(EnumBillStatus.NOT_PAID.getCode());
wxBillDaily.setExpiredDay((long) expiredDay);
} else {
wxBillDaily.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillDaily.setStatus(EnumBillStatus.WAIT_PAY.getCode());
}
if (receivePay.equals(pay)) {
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDaily.setStatus(EnumBillStatus.PAID.getCode());
}

wxBillDaily.setUserId(user.getId());
@@ -451,7 +452,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
wxBillDailyExportVo.setMerchantName(b.getMerchantName());
wxBillDailyExportVo.setReceivePay(b.getRealReceivePay());
wxBillDailyExportVo.setPay(b.getPay());
wxBillDailyExportVo.setOwe(b.getOwe());
//wxBillDailyExportVo.setOwe(b.getOwe());
wxBillDailyExportVo.setReceiveDate(b.getReceiveDate());
wxBillDailyExportVo.setPayDate(b.getPayDate());
wxBillDailyExportVo.setExpiredDay(b.getExpiredDay());
@@ -475,5 +476,11 @@ public class WxBillDailyServiceImpl implements WxBillDailyService {
updateQueryParam(record);
return wxBillDailyMapper.getMerchantIdList(record);
}
@Override
public WxBillHotNotify getBillHotNotify(WxBillDaily record) {
updateQueryParam(record);
return wxBillDailyMapper.getBillHotNotify(record);
}

}

+ 18
- 11
mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java Wyświetl plik

@@ -15,10 +15,11 @@ import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.EnumBillAction;
import com.iformall.enums.EnumBillPayWay;
import com.iformall.enums.EnumBillRentStatus;
import com.iformall.enums.EnumBillStatus;
import com.iformall.enums.EnumDelStatus;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBillDepositMapper;
@@ -176,8 +177,8 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
public void updateWaidPayStatus(WxBillDeposit record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());

try {
wxBillDepositMapper.updateWaitPayStatus(params);
@@ -192,8 +193,8 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
public void updateNotPaidStatus(WxBillDeposit record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("notPaid", EnumBillStatus.NOT_PAID.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillDepositMapper.updateNotPaidStatus(params);
} catch (Exception e) {
@@ -223,7 +224,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
record.setId(idWorker.nextId());
record.setCreatetime(date);
record.setUpdatetime(date);
record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
//record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try {
wxBillDepositMapper.insert(record);
@@ -241,9 +242,9 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
String addpay = wxBillDeposit.getPay();
wxBillDeposit.setPay(record.getPay());
wxBillDeposit.setReceivePay(record.getReceivePay());
wxBillDeposit.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
//wxBillDeposit.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
if (record.getPay().equals(record.getReceivePay())) {
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode());
Date receiveDate = wxBillDeposit.getReceiveDate();
wxBillDeposit.setExpiredDay(0L);
if (date.after(receiveDate)) {
@@ -294,7 +295,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
if(wxBillDeposit==null){
return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND);
}
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode());
Date d =new Date();
wxBillDeposit.setPayDate(d);
wxBillDeposit.setUpdatetime(d);
@@ -317,7 +318,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
}
wxBillDeposit.setPayWay(record.getPayWay());
wxBillDeposit.setReturnPrice(record.getReturnPrice());
wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode());
wxBillDeposit.setStatus(EnumBillStatus.RETURN.getCode());
wxBillDeposit.setUpdatetime(new Date());
try {
wxBillDepositMapper.updateById(wxBillDeposit);
@@ -353,7 +354,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND);
}
wxBillDeposit.setReceivePay(record.getReceivePay());
wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
wxBillDeposit.setUpdatetime(new Date());
try {
wxBillDepositMapper.updateById(wxBillDeposit);
@@ -375,6 +376,12 @@ public class WxBillDepositServiceImpl implements WxBillDepositService {
setQueryParam(wxBillDeposit);
return wxBillDepositMapper.getMerchantIdList(wxBillDeposit);
}
@Override
public WxBillHotNotify getBillHotNotify(WxBillDeposit wxBillDeposit) {
setQueryParam(wxBillDeposit);
return wxBillDepositMapper.getBillHotNotify(wxBillDeposit);
}


}

+ 23
- 16
mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java Wyświetl plik

@@ -15,6 +15,7 @@ import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
@@ -153,11 +154,11 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
}
e.setRealReceivePay(servicePay.add(new BigDecimal(e.getReceivePay())).toPlainString());
e.setServiceChargePay(servicePay.toPlainString());
if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) {
e.setOwe("0");
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());
//e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString());
}
}
}
@@ -176,8 +177,8 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
public void updateWaidPayStatus(WxBillOtherDeposit record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("waitPay", EnumBillDailyStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillOtherDepositMapper.updateWaitPayStatus(params);
} catch (Exception e) {
@@ -191,8 +192,8 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
public void updateNotPaidStatus(WxBillOtherDeposit record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("notPaid", EnumBillDailyStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("notPaid", EnumBillStatus.NOT_PAID.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillOtherDepositMapper.updateNotPaidStatus(params);
} catch (Exception e) {
@@ -209,7 +210,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
record.updateTenantInfo(tenantEntity);
WxBillOtherDeposit wxBillOther = getBillRentPropertyList(1, 10000, record, wxPayAccountBill).getList().get(0);
//wxBillOther.setOwe(new BigDecimal(wxBillOther.getRealReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
//wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
wxBillOther.setMerchant(wxMerchantMapper.selectById(wxBillOther.getMerchantId()));
// if (wxBillOther.getShopId() != null) {
// WxShop shop = new WxShop();
@@ -252,12 +253,12 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService

final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
record.setStatus(EnumBillDailyStatus.WAIT_PAY.getCode());
record.setStatus(EnumBillStatus.WAIT_PAY.getCode());
record.setCreatetime(date);
record.setUpdatetime(date);
record.setExpiredDay(0L);
//record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try {
wxBillOtherDepositMapper.insert(record);
@@ -277,16 +278,16 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
if(record.getServiceChargePayUpdate() != null){
wxBillOtherDeposit.setServiceChargePay(record.getServiceChargePayUpdate());
//wxBillOtherDeposit.setOwe(new BigDecimal(wxBillOtherDeposit.getReceivePay()).add(new BigDecimal(wxBillOtherDeposit.getServiceChargePay())).subtract(new BigDecimal(wxBillOtherDeposit.getPay())).toPlainString());
wxBillOtherDeposit.setOwe(new BigDecimal(wxBillOtherDeposit.getReceivePay()).subtract(new BigDecimal(wxBillOtherDeposit.getPay())).toPlainString());
//wxBillOtherDeposit.setOwe(new BigDecimal(wxBillOtherDeposit.getReceivePay()).subtract(new BigDecimal(wxBillOtherDeposit.getPay())).toPlainString());
}else{
String addpay = wxBillOtherDeposit.getPay();
wxBillOtherDeposit.setPayDate(record.getPayDate());
wxBillOtherDeposit.setPay(record.getPay());
wxBillOtherDeposit.setReceivePay(record.getReceivePay());
//wxBillOtherDeposit.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
wxBillOtherDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//wxBillOtherDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
if (record.getPay().equals(record.getRealReceivePay())) {
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode());
Date payDate = record.getPayDate();
Date receiveDate = wxBillOtherDeposit.getReceiveDate();
wxBillOtherDeposit.setExpiredDay(0L);
@@ -347,7 +348,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
if (wxBillOtherDeposit == null) {
return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND);
}
wxBillOtherDeposit.setStatus(EnumBillDailyStatus.PAID.getCode());
wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode());
Date d = new Date();
wxBillOtherDeposit.setPayDate(d);
wxBillOtherDeposit.setUpdatetime(d);
@@ -368,7 +369,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND);
}
wxBillDeposit.setReturnPrice(record.getReturnPrice());
wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode());
wxBillDeposit.setStatus(EnumBillStatus.RETURN.getCode());
wxBillDeposit.setUpdatetime(new Date());
try {
wxBillOtherDepositMapper.updateById(wxBillDeposit);
@@ -406,7 +407,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND);
}
wxBillDeposit.setReceivePay(record.getReceivePay());
wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
wxBillDeposit.setUpdatetime(new Date());
try {
wxBillOtherDepositMapper.updateById(wxBillDeposit);
@@ -441,5 +442,11 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService
updateQueryParam(wxBillDeposit);
return wxBillOtherDepositMapper.getMerchantIdList(wxBillDeposit);
}
@Override
public WxBillHotNotify getBillHotNotify(WxBillOtherDeposit wxBillDeposit) {
updateQueryParam(wxBillDeposit);
return wxBillOtherDepositMapper.getBillHotNotify(wxBillDeposit);
}

}

+ 21
- 14
mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java Wyświetl plik

@@ -15,6 +15,7 @@ import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
@@ -153,11 +154,11 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
}
e.setRealReceivePay(servicePay.add(new BigDecimal(e.getReceivePay())).toPlainString());
e.setServiceChargePay(servicePay.toPlainString());
if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) {
e.setOwe("0");
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());
//e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString());
}
}
}
@@ -176,8 +177,8 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
public void updateWaidPayStatus(WxBillOther record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("waitPay", EnumBillDailyStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillOtherMapper.updateWaitPayStatus(params);
} catch (Exception e) {
@@ -191,8 +192,8 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
public void updateNotPaidStatus(WxBillOther record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("notPaid", EnumBillDailyStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("notPaid", EnumBillStatus.NOT_PAID.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillOtherMapper.updateNotPaidStatus(params);
} catch (Exception e) {
@@ -209,7 +210,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
record.updateTenantInfo(tenantEntity);
WxBillOther wxBillOther = getBillOtherPropertyList(1, 1, record, wxPayAccountBill).getList().get(0);
//wxBillOther.setOwe(new BigDecimal(wxBillOther.getRealReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
//wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
wxBillOther.setMerchant(wxMerchantMapper.selectById(wxBillOther.getMerchantId()));
// if (wxBillOther.getShopId() != null) {
// WxShop shop = new WxShop();
@@ -251,12 +252,12 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
}
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
record.setStatus(record.getReceiveDate().after(date)?EnumBillDailyStatus.WAIT_PAY.getCode():EnumBillDailyStatus.NOT_PAID.getCode());
record.setStatus(record.getReceiveDate().after(date)?EnumBillStatus.WAIT_PAY.getCode():EnumBillStatus.NOT_PAID.getCode());
record.setCreatetime(date);
record.setUpdatetime(date);
record.setExpiredDay(0L);
//record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try {
wxBillOtherMapper.insert(record);
@@ -277,16 +278,16 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
if(record.getServiceChargePayUpdate() != null){
wxBillOther.setServiceChargePay(record.getServiceChargePayUpdate());
//wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).add(new BigDecimal(wxBillOther.getServiceChargePay())).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
//wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString());
}else{
String addpay = wxBillOther.getPay();
wxBillOther.setPayDate(record.getPayDate());
wxBillOther.setPay(record.getPay());
wxBillOther.setReceivePay(record.getReceivePay());
//wxBillOther.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
wxBillOther.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//wxBillOther.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
if (record.getPay().equals(record.getRealReceivePay())) {
wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillOther.setStatus(EnumBillStatus.PAID.getCode());
Date payDate = record.getPayDate();
Date receiveDate = wxBillOther.getReceiveDate();
wxBillOther.setExpiredDay(0L);
@@ -348,7 +349,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
if(wxBillOther==null){
return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND);
}
wxBillOther.setStatus(EnumBillDailyStatus.PAID.getCode());
wxBillOther.setStatus(EnumBillStatus.PAID.getCode());
Date d =new Date();
wxBillOther.setPayDate(d);
wxBillOther.setUpdatetime(d);
@@ -385,4 +386,10 @@ public class WxBillOtherServiceImpl implements WxBillOtherService {
updateQueryParam(wxBillOther);
return wxBillOtherMapper.getMerchantIdList(wxBillOther);
}
@Override
public WxBillHotNotify getBillHotNotify(WxBillOther wxBillOther) {
updateQueryParam(wxBillOther);
return wxBillOtherMapper.getBillHotNotify(wxBillOther);
}
}

+ 17
- 12
mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java Wyświetl plik

@@ -15,10 +15,11 @@ import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.EnumBillAction;
import com.iformall.enums.EnumBillPayWay;
import com.iformall.enums.EnumBillRentStatus;
import com.iformall.enums.EnumBillStatus;
import com.iformall.enums.EnumDelStatus;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBillPropertyDepositMapper;
@@ -174,8 +175,8 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
public void updateWaidPayStatus(WxBillPropertyDeposit record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());

try {
wxBillPropertyDepositMapper.updateWaitPayStatus(params);
@@ -190,8 +191,8 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
public void updateNotPaidStatus(WxBillPropertyDeposit record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("notPaid", EnumBillStatus.NOT_PAID.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillPropertyDepositMapper.updateNotPaidStatus(params);
} catch (Exception e) {
@@ -221,7 +222,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
record.setId(idWorker.nextId());
record.setCreatetime(date);
record.setUpdatetime(date);
record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
//record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try {
wxBillPropertyDepositMapper.insert(record);
@@ -239,9 +240,9 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
String addpay = wxBillDeposit.getPay();
wxBillDeposit.setPay(record.getPay());
wxBillDeposit.setReceivePay(record.getReceivePay());
wxBillDeposit.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
//wxBillDeposit.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
if (record.getPay().equals(record.getReceivePay())) {
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode());
Date receiveDate = wxBillDeposit.getReceiveDate();
wxBillDeposit.setExpiredDay(0L);
if (date.after(receiveDate)) {
@@ -292,7 +293,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
if(wxBillDeposit==null){
return new ResultData(ErrorCode.BILL_PROPERTY_DEPOSIT_IS_NOT_FOUND);
}
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode());
Date d =new Date();
wxBillDeposit.setPayDate(d);
wxBillDeposit.setUpdatetime(d);
@@ -314,7 +315,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
}
wxBillDeposit.setPayWay(record.getPayWay());
wxBillDeposit.setReturnPrice(record.getReturnPrice());
wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode());
wxBillDeposit.setStatus(EnumBillStatus.RETURN.getCode());
wxBillDeposit.setUpdatetime(new Date());
try {
wxBillPropertyDepositMapper.updateById(wxBillDeposit);
@@ -351,7 +352,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND);
}
wxBillDeposit.setReceivePay(record.getReceivePay());
wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
wxBillDeposit.setUpdatetime(new Date());
try {
wxBillPropertyDepositMapper.updateById(wxBillDeposit);
@@ -374,5 +375,9 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe
return wxBillPropertyDepositMapper.getMerchantIdList(deposit);
}


@Override
public WxBillHotNotify getBillHotNotify(WxBillPropertyDeposit deposit) {
updateQueryParam(deposit);
return wxBillPropertyDepositMapper.getBillHotNotify(deposit);
}
}

+ 22
- 15
mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java Wyświetl plik

@@ -10,6 +10,7 @@ import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.BaseEntity;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
@@ -221,11 +222,11 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
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(EnumBillRentStatus.NOT_PAID.getCode())) {
e.setOwe("0");
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());
//e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString());
}
}
}
@@ -244,8 +245,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
public void updateWaidPayStatus(WxBillProperty record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());

try {
wxBillPropertyMapper.updateWaitPayStatus(params);
@@ -260,8 +261,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
public void updateNotPaidStatus(WxBillProperty record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("notPaid", EnumBillStatus.NOT_PAID.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillPropertyMapper.updateNotPaidStatus(params);
} catch (Exception e) {
@@ -280,7 +281,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
PageInfo<WxBillProperty> page = getBillPropertyList(1, 10000, wxPayAccountBill, record);
WxBillProperty property = page.getList().get(0);
//property.setOwe(new BigDecimal(property.getRealReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString());
property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString());
//property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString());
return property;
}

@@ -300,7 +301,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
record.setCreatetime(date);
record.setUpdatetime(date);
//record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try {
wxBillPropertyMapper.insert(record);
@@ -323,7 +324,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
String latePayPrice = StringUtils.isBlank(property.getLatePayPrice()) ? "0" : property.getLatePayPrice();
//property.setOwe(new BigDecimal(property.getReceivePay()).add(new BigDecimal(latePayPrice))
// .add(new BigDecimal(property.getServiceChargePay())).subtract(new BigDecimal(property.getPay())).toPlainString());
property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString());
//property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString());
} else {
String addpay = property.getPay();
property.setRevenue(record.getRevenue());
@@ -334,9 +335,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
property.setPay(record.getPay());
property.setReceivePay(record.getReceivePay());
//property.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
property.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//property.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
if (record.getPay().equals(record.getRealReceivePay())) {
property.setStatus(EnumBillRentStatus.PAID.getCode());
property.setStatus(EnumBillStatus.PAID.getCode());
Date payDate = record.getPayDate();
Date receiveDate = property.getReceiveDate();
property.setExpiredDay(0L);
@@ -410,7 +411,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
if (record == null) {
return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND);
}
record.setStatus(EnumBillRentStatus.PAID.getCode());
record.setStatus(EnumBillStatus.PAID.getCode());
Date d = new Date();
record.setPayDate(d);
record.setUpdatetime(d);
@@ -446,7 +447,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {

@Override
public ResultData updateLatePayStatus(WxBillProperty record) {
record.setLatePayStatus(EnumBillDailyStatus.PAID.getCode());
record.setLatePayStatus(EnumBillStatus.PAID.getCode());
record.setUpdatetime(new Date());
try {
wxBillPropertyMapper.updateById(record);
@@ -502,7 +503,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
property.setLatePayPrice(record.getLatePayMoneyUpdate());
//property.setOwe(new BigDecimal(property.getReceivePay()).add(new BigDecimal(property.getLatePayPrice()))
// .add(new BigDecimal(property.getServiceChargePay())).subtract(new BigDecimal(property.getPay())).toPlainString());
property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString());
//property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString());
final IdWorker idWorker = IdWorker.get();
WxBillAction billAction = new WxBillAction();
billAction.setId(idWorker.nextId());
@@ -529,4 +530,10 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
updateQueryParam(wxBillProperty);
return wxBillPropertyMapper.getMerchantIdList(wxBillProperty);
}
@Override
public WxBillHotNotify getBillHotNotify(WxBillProperty wxBillProperty) {
updateQueryParam(wxBillProperty);
return wxBillPropertyMapper.getBillHotNotify(wxBillProperty);
}
}

+ 22
- 15
mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java Wyświetl plik

@@ -16,6 +16,7 @@ import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
@@ -174,7 +175,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
record.setId(idWorker.nextId());
record.setCreatetime(date);
record.setUpdatetime(date);
record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
//record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try {
wxBillRentManageMapper.insert(record);
@@ -197,7 +198,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice();
//wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice)).add(new BigDecimal(wxBillRent.getServiceChargePay()))
// .subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
//wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
}else{
String addpay = wxBillRent.getPay();
wxBillRent.setLatePayRatio(record.getLatePayRatio());
@@ -205,9 +206,9 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
wxBillRent.setLatePayStatus(record.getLatePayStatus());
wxBillRent.setPay(record.getPay());
wxBillRent.setReceivePay(record.getReceivePay());
wxBillRent.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
//wxBillRent.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
if (record.getPay().equals(record.getRealReceivePay())) {
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillRent.setStatus(EnumBillStatus.PAID.getCode());
Date payDate = record.getPayDate();
Date receiveDate = wxBillRent.getReceiveDate();
wxBillRent.setExpiredDay(0L);
@@ -263,7 +264,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
PageInfo<WxBillRentManage> page = getBillRentManageList(1, 1, record, wxPayAccountBill);
WxBillRentManage rentManage = page.getList().get(0);
//rentManage.setOwe(new BigDecimal(rentManage.getRealReceivePay()).subtract(new BigDecimal(rentManage.getPay())).toPlainString());
rentManage.setOwe(new BigDecimal(rentManage.getReceivePay()).subtract(new BigDecimal(rentManage.getPay())).toPlainString());
//rentManage.setOwe(new BigDecimal(rentManage.getReceivePay()).subtract(new BigDecimal(rentManage.getPay())).toPlainString());
return rentManage;
}
@@ -288,11 +289,11 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
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(EnumBillRentStatus.NOT_PAID.getCode())) {
rent.setOwe("0");
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());
//rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
}
}
}
@@ -303,7 +304,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
if(record.getLatePayMoneyUpdate() != null) {
rent.setLatePayPrice(record.getLatePayMoneyUpdate());
//rent.setOwe(new BigDecimal(rent.getReceivePay()).add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getServiceChargePay())).subtract(new BigDecimal(rent.getPay())).toPlainString());
rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
//rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
final IdWorker idWorker = IdWorker.get();
WxBillAction billAction = new WxBillAction();
billAction.setId(idWorker.nextId());
@@ -333,8 +334,8 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
public void updateWaidPayStatus(WxBillRentManage record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());

try {
wxBillRentManageMapper.updateWaitPayStatus(params);
@@ -349,8 +350,8 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
public void updateNotPaidStatus(WxBillRentManage record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("notPaid", EnumBillStatus.NOT_PAID.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillRentManageMapper.updateNotPaidStatus(params);
} catch (Exception e) {
@@ -371,7 +372,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
if(wxBillDeposit==null){
return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND);
}
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode());
Date d =new Date();
wxBillDeposit.setPayDate(d);
wxBillDeposit.setUpdatetime(d);
@@ -386,7 +387,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
@Override
public ResultData updateLatePayStatus(WxBillRentManage record) {
record.setLatePayStatus(EnumBillDailyStatus.PAID.getCode());
record.setLatePayStatus(EnumBillStatus.PAID.getCode());
record.setUpdatetime(new Date());
try {
wxBillRentManageMapper.updateById(record);
@@ -444,5 +445,11 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService {
updateQueryParam(wxBillRentManage);
return wxBillRentManageMapper.getMerchantIdList(wxBillRentManage);
}
@Override
public WxBillHotNotify getBillHotNotify(WxBillRentManage wxBillRentManage) {
updateQueryParam(wxBillRentManage);
return wxBillRentManageMapper.getBillHotNotify(wxBillRentManage);
}

}

+ 23
- 16
mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java Wyświetl plik

@@ -10,6 +10,7 @@ import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.RatioVo;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
@@ -91,11 +92,11 @@ public class WxBillRentServiceImpl implements WxBillRentService {
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(EnumBillRentStatus.NOT_PAID.getCode())) {
rent.setOwe("0");
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());
//rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
}
}
}
@@ -114,8 +115,8 @@ public class WxBillRentServiceImpl implements WxBillRentService {
public void updateWaidPayStatus(WxBillRent record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());

try {
wxBillRentMapper.updateWaitPayStatus(params);
@@ -130,8 +131,8 @@ public class WxBillRentServiceImpl implements WxBillRentService {
public void updateNotPaidStatus(WxBillRent record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode());
params.put("paid", EnumBillRentStatus.PAID.getCode());
params.put("notPaid", EnumBillStatus.NOT_PAID.getCode());
params.put("paid", EnumBillStatus.PAID.getCode());
try {
wxBillRentMapper.updateNotPaidStatus(params);
} catch (Exception e) {
@@ -151,7 +152,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
//手续费 = 合同应收+手续费+滞纳金
//computeTotalMoney(wxPayAccountBill, rent);
//rent.setOwe(new BigDecimal(rent.getRealReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
//rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
return rent;
}

@@ -170,7 +171,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
record.setId(idWorker.nextId());
record.setCreatetime(date);
record.setUpdatetime(date);
record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
//record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString());
record.setIsDel(EnumDelStatus.NOT_DEL.getCode());
try {
wxBillRentMapper.insert(record);
@@ -193,7 +194,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice();
//wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice))
// .add(new BigDecimal(wxBillRent.getServiceChargePay())).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
//wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
}else{
String addpay = wxBillRent.getPay();
wxBillRent.setRevenue(record.getRevenue());
@@ -203,9 +204,9 @@ public class WxBillRentServiceImpl implements WxBillRentService {
wxBillRent.setPay(record.getPay());
wxBillRent.setReceivePay(record.getReceivePay());
//wxBillRent.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
wxBillRent.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
//wxBillRent.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString());
if (record.getPay().equals(record.getRealReceivePay())) {
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillRent.setStatus(EnumBillStatus.PAID.getCode());
Date payDate = record.getPayDate();
Date receiveDate = wxBillRent.getReceiveDate();
wxBillRent.setExpiredDay(0L);
@@ -270,7 +271,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
if(wxBillRent==null){
return new ResultData(ErrorCode.BILL_RENT_IS_NOT_FOUND);
}
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillRent.setStatus(EnumBillStatus.PAID.getCode());
Date d =new Date();
wxBillRent.setPayDate(d);
wxBillRent.setUpdatetime(d);
@@ -395,7 +396,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
wxBillRent.setUpdatetime(new Date());
String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice();
//wxBillRent.setOwe(new BigDecimal(newPrice).add(new BigDecimal(wxBillRent.getServiceChargePay())).add(new BigDecimal(latePayPrice)).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
wxBillRent.setOwe(new BigDecimal(newPrice).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
//wxBillRent.setOwe(new BigDecimal(newPrice).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString());
wxBillRentMapper.updateById(wxBillRent);

if (!oldPrice.equals(newPrice)) {
@@ -422,7 +423,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {

@Override
public ResultData updateLatePayStatus(WxBillRent record) {
record.setLatePayStatus(EnumBillDailyStatus.PAID.getCode());
record.setLatePayStatus(EnumBillStatus.PAID.getCode());
record.setUpdatetime(new Date());
try {
wxBillRentMapper.updateById(record);
@@ -588,7 +589,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
if(record.getLatePayMoneyUpdate() != null) {
rent.setLatePayPrice(record.getLatePayMoneyUpdate());
//rent.setOwe(new BigDecimal(rent.getReceivePay()).add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getServiceChargePay())).subtract(new BigDecimal(rent.getPay())).toPlainString());
rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
//rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString());
final IdWorker idWorker = IdWorker.get();
WxBillAction billAction = new WxBillAction();
billAction.setId(idWorker.nextId());
@@ -615,4 +616,10 @@ public class WxBillRentServiceImpl implements WxBillRentService {
updateQueryParam(wxBillRent);
return wxBillRentMapper.getMerchantIdList(wxBillRent);
}

@Override
public WxBillHotNotify getBillHotNotify(WxBillRent wxBillRent) {
updateQueryParam(wxBillRent);
return wxBillRentMapper.getBillHotNotify(wxBillRent);
}
}

+ 55
- 50
mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java Wyświetl plik

@@ -181,15 +181,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillRent.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillRent.setPayDate(new Date());
WxBillRent dbBill = wxBillRentMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0");
if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
//if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
//wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).toPlainString());
wxBillRent.setPayDate(new Date());
addBillAction(bill.getBillId(), dbBill.getOwe());
//addBillAction(bill.getBillId(), dbBill.getOwe());
}
}
wxBillRentMapper.updateById(wxBillRent);
@@ -207,7 +208,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillRent.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillRent.setPayDate(new Date());
WxBillDeposit dbBill = wxBillDepositMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
@@ -216,11 +217,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); //押金是ReceivePay
wxBillRent.setPayDate(new Date());
if(EnumSettleBillType.R.getCode().equals(bill.getType())){
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillRent.setStatus(EnumBillStatus.PAID.getCode());
}else{
wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode());
wxBillRent.setStatus(EnumBillStatus.RETURN.getCode());
}
addBillAction(bill.getBillId(), dbBill.getOwe());
//addBillAction(bill.getBillId(), dbBill.getOwe());
}
}
wxBillDepositMapper.updateById(wxBillRent);
@@ -238,7 +239,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillOtherDeposit.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillOtherDeposit.setPayDate(new Date());
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
@@ -247,11 +248,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
wxBillOtherDeposit.setPay(dbBill.getPay()+ dbBill.getReceivePay());
wxBillOtherDeposit.setPayDate(new Date());
if(EnumSettleBillType.R.getCode().equals(bill.getType())){
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode());
}else{
wxBillOtherDeposit.setStatus(EnumBillRentStatus.RETURN.getCode());
wxBillOtherDeposit.setStatus(EnumBillStatus.RETURN.getCode());
}
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillOtherDepositMapper.updateById(wxBillOtherDeposit);
@@ -269,7 +270,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
propertyDeposit.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
propertyDeposit.setPayDate(new Date());
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
@@ -278,11 +279,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
propertyDeposit.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString());
propertyDeposit.setPayDate(new Date());
if(EnumSettleBillType.R.getCode().equals(bill.getType())){
propertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
propertyDeposit.setStatus(EnumBillStatus.PAID.getCode());
}else{
propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode());
propertyDeposit.setStatus(EnumBillStatus.RETURN.getCode());
}
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillPropertyDepositMapper.updateById(propertyDeposit);
@@ -301,15 +302,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillRent.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillRent.setPayDate(new Date());
WxBillProperty dbBill = wxBillPropertyMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0");
if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
//if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
//wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).toPlainString());
wxBillRent.setPayDate(new Date());
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillPropertyMapper.updateById(wxBillRent);
@@ -327,7 +329,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
propertyDeposit.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
propertyDeposit.setPayDate(new Date());
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
@@ -336,11 +338,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
propertyDeposit.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString());
propertyDeposit.setPayDate(new Date());
if(EnumSettleBillType.R.getCode().equals(bill.getType())){
propertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
propertyDeposit.setStatus(EnumBillStatus.PAID.getCode());
}else{
propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode());
propertyDeposit.setStatus(EnumBillStatus.RETURN.getCode());
}
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillPropertyDepositMapper.updateById(propertyDeposit);
@@ -358,15 +360,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillRent.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillRent.setPayDate(new Date());
WxBillOther dbBill = wxBillOtherMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0");
if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
//if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
//wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).toPlainString());
wxBillRent.setPayDate(new Date());
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillOtherMapper.updateById(wxBillRent);
@@ -384,7 +387,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillRent.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillRent.setPayDate(new Date());
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
@@ -393,11 +396,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString());
wxBillRent.setPayDate(new Date());
if(EnumSettleBillType.R.getCode().equals(bill.getType())){
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillRent.setStatus(EnumBillStatus.PAID.getCode());
}else{
wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode());
wxBillRent.setStatus(EnumBillStatus.RETURN.getCode());
}
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillOtherDepositMapper.updateById(wxBillRent);
@@ -423,7 +426,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillRent.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillRent.setPayDate(new Date());
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
@@ -432,11 +435,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString());
wxBillRent.setPayDate(new Date());
if(EnumSettleBillType.R.getCode().equals(bill.getType())){
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode());
wxBillRent.setStatus(EnumBillStatus.PAID.getCode());
}else{
wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode());
wxBillRent.setStatus(EnumBillStatus.RETURN.getCode());
}
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillOtherDepositMapper.updateById(wxBillRent);
@@ -454,15 +457,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillDaily.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillDaily.setPayDate(new Date());
WxBillDaily dbBill = wxBillDailyMapper.selectById(wxBillDaily.getId());
if(dbBill!=null) {
if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0");
if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
wxBillDaily.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
//if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
//wxBillDaily.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
wxBillDaily.setPay(new BigDecimal(dbBill.getPay()).toPlainString());
wxBillDaily.setPayDate(new Date());
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillDailyMapper.updateById(wxBillDaily);
@@ -480,15 +484,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
wxBillRent.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
wxBillRent.setPayDate(new Date());
WxBillOther dbBill = wxBillOtherMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0");
if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
//if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0");
//wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString());
wxBillRent.setPay(new BigDecimal(dbBill.getPay()).toPlainString());
wxBillRent.setPayDate(new Date());
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillOtherMapper.updateById(wxBillRent);
@@ -506,18 +511,18 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if(status != null){
propertyDeposit.setStatus(status);
}
if(EnumBillRentStatus.PAID.getCode().equals(status)){
if(EnumBillStatus.PAID.getCode().equals(status)){
propertyDeposit.setPayDate(new Date());
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId());
if(dbBill!=null) {
propertyDeposit.setPay(dbBill.getPay()+dbBill.getReceivePay());
propertyDeposit.setPayDate(new Date());
if(EnumSettleBillType.R.getCode().equals(bill.getType())){
propertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
propertyDeposit.setStatus(EnumBillStatus.PAID.getCode());
}else{
propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode());
propertyDeposit.setStatus(EnumBillStatus.RETURN.getCode());
}
addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
//addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe()));
}
}
wxBillPropertyDepositMapper.updateById(propertyDeposit);
@@ -568,8 +573,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService {
if (record.getFlowParams() == null || record.getFlowParams().size() == 0) {
record.setStatus(EnumSettleStatus.NOT_FINISH.getCode());
//选择的账单改为已结清
updateFreezeOrStatus(record.getReceiveBillIds(), null,EnumBillRentStatus.PAID.getCode(),null);
updateFreezeOrStatus(record.getPayBillIds(), null,EnumBillRentStatus.PAID.getCode(),null);
updateFreezeOrStatus(record.getReceiveBillIds(), null,EnumBillStatus.PAID.getCode(),null);
updateFreezeOrStatus(record.getPayBillIds(), null,EnumBillStatus.PAID.getCode(),null);

//刚好结清
if(record.getReceiveMoney().equals(record.getPayMoney())){


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java Wyświetl plik

@@ -3057,7 +3057,7 @@ public class WxChartServiceImpl implements WxChartDataService {
WxBillAll wxBillAll = new WxBillAll();
wxBillAll.updateTenantInfo(tenantEntity);
wxBillAll.setMonth(new SimpleDateFormat("yyyy-MM").format(startDate));
wxBillAll.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillAll.setStatus(EnumBillStatus.NOT_PAID.getCode());
List<Integer> billTypeList = new ArrayList<>();
billTypeList.add(EnumBillTypeStr.RENT.getCode());
wxBillAll.setBillTypeList(billTypeList);


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java Wyświetl plik

@@ -454,8 +454,8 @@ public class WxFlowServiceImpl implements WxFlowService {
WxBillSettle settle = wxBillSettleService.getById(Long.parseLong(businessId), EnumFilterSettle.NO.getCode());
if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
wxBillSettle.setStatus(EnumSettleStatus.NOT_FINISH.getCode());
wxBillSettleService.updateFreezeOrStatus(settle.getReceiveBillIds(), EnumFreezeType.DEF.getCode(),EnumBillRentStatus.PAID.getCode(),null);
wxBillSettleService.updateFreezeOrStatus(settle.getPayBillIds(),EnumFreezeType.DEF.getCode(),EnumBillRentStatus.PAID.getCode(),null);
wxBillSettleService.updateFreezeOrStatus(settle.getReceiveBillIds(), EnumFreezeType.DEF.getCode(),EnumBillStatus.PAID.getCode(),null);
wxBillSettleService.updateFreezeOrStatus(settle.getPayBillIds(),EnumFreezeType.DEF.getCode(),EnumBillStatus.PAID.getCode(),null);

//刚好结清
if(settle.getReceiveMoney().equals(settle.getPayMoney())){


+ 11
- 11
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java Wyświetl plik

@@ -255,7 +255,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
bill.setPropertyContractId(record.getId());
bill.setCreatetime(date);
bill.updateTenantInfo(wxPayAccountBill);
bill.setOwe(bill.getReceivePay());
//bill.setOwe(bill.getReceivePay());
bill.setNeedPay(bill.getNeedPay());
bill.setUpdatetime(date);
bill.setRentShopType(record.getRentShopType());
@@ -269,14 +269,14 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
//bill.setShopId(record.getShopId());
bill.setExpiredDay(0L);
setExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod());
if (bill.getReceivePay().equals(0L)) {
bill.setStatus(EnumBillRentStatus.PAID.getCode());
if (bill.getReceivePay().equals("0")) {
bill.setStatus(EnumBillStatus.PAID.getCode());
bill.setPayDate(date);
}
BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(100), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP);
bill.setServiceChargePay(servicePay.toPlainString());
//bill.setOwe(new BigDecimal(bill.getReceivePay()).add(new BigDecimal(bill.getServiceChargePay())).toPlainString());
bill.setOwe(new BigDecimal(bill.getReceivePay()).toPlainString());
//bill.setOwe(new BigDecimal(bill.getReceivePay()).toPlainString());
count++;
}
wxBillPropertyMapper.insertBills(record.getPreviewBillRentList());
@@ -499,7 +499,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
String needpay = wxPropertyContract.getDeposit();
wxBillDeposit.setNeedPay(needpay);
wxBillDeposit.setReceivePay(needpay);
wxBillDeposit.setOwe(needpay);
//wxBillDeposit.setOwe(needpay);
Date date = new Date();
Calendar instance = Calendar.getInstance();
instance.setTime(wxPropertyContract.getRentalStartDate());
@@ -516,7 +516,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
instance.setTime(wxBillDeposit.getReceiveDate());
instance.add(dayType, wxPropertyContract.getLease());
wxBillDeposit.setEndtime(instance.getTime());
wxBillDeposit.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillDeposit.setStatus(EnumBillStatus.WAIT_PAY.getCode());
wxBillDeposit.setExpiredDay(0L);
wxBillDeposit.updateTenantInfo(wxPropertyContract);
wxBillDeposit.setIsDel(0);
@@ -710,7 +710,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxBillProperty.setReceiveDate(billTimeVo.getReceiveDate());

wxBillProperty.setNeedPay(needpay);
wxBillProperty.setOwe(needpay);
//wxBillProperty.setOwe(needpay);
wxBillProperty.setReceivePay(needpay);

//截止收租日在当前时间之前
@@ -735,7 +735,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
BigDecimal servicePay = new BigDecimal(wxBillProperty.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(100), wxPropertyContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP);
wxBillProperty.setServiceChargePay(servicePay.toPlainString());
//wxBillProperty.setOwe(new BigDecimal(wxBillProperty.getReceivePay()).add(new BigDecimal(wxBillProperty.getServiceChargePay())).toPlainString());
wxBillProperty.setOwe(new BigDecimal(wxBillProperty.getReceivePay()).toPlainString());
//wxBillProperty.setOwe(new BigDecimal(wxBillProperty.getReceivePay()).toPlainString());
resultList.add(wxBillProperty);
}
//批量生成预账单
@@ -819,7 +819,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxBillProperty.setExpiredDay(0L);
if (wxBillProperty.getReceiveDate().before(date)) {
long day = (date.getTime() - wxBillProperty.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000);
wxBillProperty.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillProperty.setStatus(EnumBillStatus.NOT_PAID.getCode());
if (day > 0) {
wxBillProperty.setExpiredDay(day);
}
@@ -829,9 +829,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
Date currenttime = now.getTime();
//当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴
if (currenttime.before(wxBillProperty.getReceiveDate())) {
wxBillProperty.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode());
wxBillProperty.setStatus(EnumBillStatus.NOT_EXPIRED.getCode());
} else {
wxBillProperty.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillProperty.setStatus(EnumBillStatus.WAIT_PAY.getCode());
}
}
}


+ 18
- 18
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Wyświetl plik

@@ -676,14 +676,14 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
setExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod());
if (bill.getReceivePay().equals("0")) {
bill.setStatus(EnumBillRentStatus.PAID.getCode());
bill.setStatus(EnumBillStatus.PAID.getCode());
bill.setPayDate(date);
}
//计算手续费
BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP);
bill.setServiceChargePay(servicePay.toPlainString());
//bill.setOwe(bill.getReceivePay() + bill.getServiceChargePay());
bill.setOwe(bill.getReceivePay());
//bill.setOwe(bill.getReceivePay());
count++;
}
wxBillRentMapper.insertBills(record.getPreviewBillRentList());
@@ -742,14 +742,14 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
setManageExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod());
if (bill.getReceivePay().equals("0")) {
bill.setStatus(EnumBillRentStatus.PAID.getCode());
bill.setStatus(EnumBillStatus.PAID.getCode());
bill.setPayDate(date);
}
//计算手续费
BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP);
bill.setServiceChargePay(servicePay.toPlainString());
//bill.setOwe(bill.getReceivePay() + bill.getServiceChargePay());
bill.setOwe(bill.getReceivePay());
//bill.setOwe(bill.getReceivePay());
count++;
billList.add(bill);
}
@@ -906,7 +906,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
String needpay = wxRentContract.getDeposit();
wxBillDeposit.setReceivePay(needpay);
wxBillDeposit.setNeedPay(needpay);
wxBillDeposit.setOwe(needpay);
//wxBillDeposit.setOwe(needpay);
//找到计租方式
int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH;

@@ -927,7 +927,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
instance.setTime(wxBillDeposit.getReceiveDate());
instance.add(dayType, wxRentContract.getLease());
wxBillDeposit.setEndtime(instance.getTime());
wxBillDeposit.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillDeposit.setStatus(EnumBillStatus.WAIT_PAY.getCode());
wxBillDeposit.setExpiredDay(0L);
wxBillDeposit.setReceiveDate(time);
wxBillDeposit.updateTenantInfo(wxRentContract);
@@ -1579,7 +1579,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
wxBillRent.setContractNeedPay(needpay);
wxBillRent.setRentPriceInfo(getRentPriceInfo(wxRentContract,new BigDecimal(needpay)));
wxBillRent.setNeedPay(needpay);
wxBillRent.setOwe(needpay);
//wxBillRent.setOwe(needpay);
wxBillRent.setReceivePay(needpay);
//商业管理费
wxBillRent.setBussinessManageFeeNeedPay(bussinessManageFeeNeedpay);
@@ -1608,7 +1608,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
.divide(new BigDecimal(10000), wxRentContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP);
wxBillRent.setServiceChargePay(servicePay.toPlainString());
//wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(wxBillRent.getServiceChargePay())).toPlainString());
wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).toPlainString());
//wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).toPlainString());
resultList.add(wxBillRent);
@@ -1643,13 +1643,13 @@ public class WxRentContractServiceImpl implements WxRentContractService {
manage.setManageFeeType(feeType.getCode());
manage.setNeedPay(needPay);
manage.setReceivePay(needPay);
manage.setOwe(needPay);
//manage.setOwe(needPay);
setManageExpiredDay(manage,dayType,receivePeriod);
//计算手续费
BigDecimal servicePay = new BigDecimal(needPay).multiply(new BigDecimal(serviceChargeRate)).divide(new BigDecimal(10000), decimalSize, BigDecimal.ROUND_HALF_UP);
manage.setServiceChargePay(servicePay.toPlainString());
//manage.setOwe(new BigDecimal(needPay).add(new BigDecimal(manage.getServiceChargePay())).toPlainString());
manage.setOwe(new BigDecimal(needPay).toPlainString());
//manage.setOwe(new BigDecimal(needPay).toPlainString());
return manage;
}

@@ -1659,7 +1659,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
wxBillRent.setExpiredDay(0L);
if (wxBillRent.getReceiveDate().before(date)) {
long day = (date.getTime() - wxBillRent.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000);
wxBillRent.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillRent.setStatus(EnumBillStatus.NOT_PAID.getCode());
if (day > 0) {
wxBillRent.setExpiredDay(day);
}
@@ -1669,9 +1669,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
Date currenttime = now.getTime();
//当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴
if (currenttime.before(wxBillRent.getReceiveDate())) {
wxBillRent.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode());
wxBillRent.setStatus(EnumBillStatus.NOT_EXPIRED.getCode());
} else {
wxBillRent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillRent.setStatus(EnumBillStatus.WAIT_PAY.getCode());
}
}
}
@@ -1682,7 +1682,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
wxBillRentManage.setExpiredDay(0L);
if (wxBillRentManage.getReceiveDate().before(date)) {
long day = (date.getTime() - wxBillRentManage.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000);
wxBillRentManage.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillRentManage.setStatus(EnumBillStatus.NOT_PAID.getCode());
if (day > 0) {
wxBillRentManage.setExpiredDay(day);
}
@@ -1692,9 +1692,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
Date currenttime = now.getTime();
//当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴
if (currenttime.before(wxBillRentManage.getReceiveDate())) {
wxBillRentManage.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode());
wxBillRentManage.setStatus(EnumBillStatus.NOT_EXPIRED.getCode());
} else {
wxBillRentManage.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillRentManage.setStatus(EnumBillStatus.WAIT_PAY.getCode());
}
}
}
@@ -3307,13 +3307,13 @@ public class WxRentContractServiceImpl implements WxRentContractService {
String oldNeedPay = br.getNeedPay();
if (needPay.compareTo(new BigDecimal(br.getNeedPay())) > 0) {
br.setNeedPay(needPay.toPlainString());
br.setOwe(needPay.toPlainString());
//br.setOwe(needPay.toPlainString());
br.setReceivePay(needPay.toPlainString());
br.setUpdatetime(new Date());
BigDecimal servicePay = new BigDecimal(br.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), wxRentContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP);
br.setServiceChargePay(servicePay.toPlainString());
//br.setOwe(new BigDecimal(br.getReceivePay()).add(new BigDecimal(br.getServiceChargePay())).toPlainString());
br.setOwe(new BigDecimal(br.getReceivePay()).toPlainString());
//br.setOwe(new BigDecimal(br.getReceivePay()).toPlainString());
br.setComments("原金额["+oldNeedPay+"(分)]小于解单金额["+needPay+"(分)],系统自动更新");
wxBillRentMapper.updateById(br);
}


+ 1
- 0
mallinkService/src/main/java/com/iformall/utils/Constant.java Wyświetl plik

@@ -136,5 +136,6 @@ public class Constant {
public static final String cache_aliyun_msg ="aliyunMsg:";
public static final Integer default_long_decimal_size = 10;
public static final Integer bill_near_default_days = 5;

}

BIN
mallinkService/src/main/resources/contract-word-template/bill_near_one.docx Wyświetl plik


+ 24
- 7
mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml Wyświetl plik

@@ -11,7 +11,6 @@
<result column="expired_day" jdbcType="INTEGER" property="expiredDay" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status" />
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
@@ -38,7 +37,7 @@
<sql id="allColumns">
`id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`tenant_id`,`parent_tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`type`,
`tenant_id`,`parent_tenant_id`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`type`,
`rent_shop_type`,`pay_way`,`price_detail`,`starttime`,`endtime`,freeze,build_way,service_charge_pay,`bill_remark`,
case type when 1 then '水费' when 2 then '电费' when 3 then '空调费' else '日常费用' end bill_type_name
</sql>
@@ -58,7 +57,6 @@
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != owe "> and `owe` = #{owe} </if>
<if test=" null != status "> and `status` = #{status} </if>
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != isDel "> and `is_del` = #{isDel} </if>
@@ -104,7 +102,17 @@
<if test=" null != month and '' != month">
and date_format(br.starttime,'%Y-%m') &lt;= #{month} and date_format(br.endtime,'%Y-%m') &gt;= #{month}
</if>
<if test=" 1 == onlyOwe">and br.`owe` &gt; 0</if>
<if test=" null == nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.`receive_pay` - br.`pay` &gt; 0 and br.status not in (3,6)
)
</if>
<if test=" null != nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
and br.`starttime` &lt; DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.status not in (3,6)
)
</if>
<if test=" null != buildWay ">and br.`build_way` = #{buildWay}</if>
<if test=" null != merchantIds ">
and br.`merchant_id` in
@@ -118,7 +126,7 @@
<select id="queryBillDailyList" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day` ,
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`updatetime`,br.`merchant_id`,br.shop_id,
br.`status`,br.`updatetime`,br.`merchant_id`,br.shop_id,
br.shop_name,br.type,br.`rent_shop_type`,br.pay_way,br.price_detail,br.`starttime`,br.`endtime`,br.`build_way`,
br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.`bill_remark`,
case type when 1 then '水费' when 2 then '电费' when 3 then '空调费' else '日常费用' end bill_type_name
@@ -131,10 +139,9 @@
<resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
<result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
<result column="paid" jdbcType="VARCHAR" property="paid" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
</resultMap>
<select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="SumBaseResultMap">
select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_daily br
select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_daily br
<include refid="queryBillDailyListConditions"/>
</select>
@@ -143,6 +150,16 @@
<include refid="queryBillDailyListConditions"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
<result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
</resultMap>
<select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="HotNotifyBaseResultMap">
select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_daily br
<include refid="queryBillDailyListConditions"/>
</select>
<update id="updateNotPaidStatus" parameterType="hashmap">
update wx_bill_daily set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date)
where status!=#{paid}


+ 27
- 10
mallinkService/src/main/resources/mapper/WxBillDepositMapper.xml Wyświetl plik

@@ -12,7 +12,6 @@
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
<result column="expired_day" jdbcType="BIGINT" property="expiredDay" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status" />
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
@@ -37,7 +36,7 @@

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,
`expired_day`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`expired_day`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`rent_shop_type`,`return_price`,`pay_way`,service_charge_pay,'租赁押金' bill_type_name,'' bill_remark
</sql>

@@ -57,7 +56,6 @@
<if test=" null != payDate "> and `pay_date` = #{payDate} </if>
<if test=" null != createtime "> and `createtime` = #{createtime} </if>
<if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if>
<if test=" null != owe "> and `owe` = #{owe} </if>
<if test=" null != status "> and `status` = #{status} </if>
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != isDel "> and `is_del` = #{isDel} </if>
@@ -96,7 +94,7 @@
<select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,
br.`owe`,br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,
br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,
br.`rent_shop_type`,br.`return_price`, br.pay_way,br.shop_info ,br.freeze,br.service_charge_pay,'租赁押金' bill_type_name,'' bill_remark
from wx_bill_rent_deposit br
<include refid="queryBillRentListCondition"/>
@@ -125,7 +123,17 @@
<if test=" null != month and '' != month">
and date_format(br.starttime,'%Y-%m') &lt;= #{month} and date_format(br.endtime,'%Y-%m') &gt;= #{month}
</if>
<if test=" 1 == onlyOwe">and br.`owe` &gt; 0</if>
<if test=" null == nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.`receive_pay` - br.`pay` &gt; 0 and br.status not in (3,6)
)
</if>
<if test=" null != nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
and br.`starttime` &lt; DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.status not in (3,6)
)
</if>
<if test=" null != merchantIds ">
and br.`merchant_id` in
<foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")">
@@ -139,10 +147,9 @@
<resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
<result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
<result column="paid" jdbcType="VARCHAR" property="paid" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
</resultMap>
<select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="SumBaseResultMap">
select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_rent_deposit br
select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_rent_deposit br
<include refid="queryBillRentListCondition"/>
</select>
@@ -150,6 +157,16 @@
select distinct merchant_id from wx_bill_rent_deposit br
<include refid="queryBillRentListCondition"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
<result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
</resultMap>
<select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="HotNotifyBaseResultMap">
select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_rent_deposit br
<include refid="queryBillRentListCondition"/>
</select>

<select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id,parent_tenant_id from wx_bill_rent_deposit
@@ -202,7 +219,7 @@
<select id="queryOweInfoAll" resultType="hashmap" parameterType="hashmap">
select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from
(
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent_deposit
select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_rent_deposit
where status = 1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -212,7 +229,7 @@
</if>
and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property_deposit
select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_property_deposit
where status = 1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -222,7 +239,7 @@
</if>
and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_other_deposit
select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_other_deposit
where status = 1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}


+ 25
- 7
mallinkService/src/main/resources/mapper/WxBillOtherDepositMapper.xml Wyświetl plik

@@ -11,7 +11,6 @@
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/>
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="expired_day" jdbcType="INTEGER" property="expiredDay"/>
<result column="owe" jdbcType="VARCHAR" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
@@ -40,7 +39,7 @@
<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,
`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`rent_shop_type`,`return_price`,`pay_way`,`starttime`,`endtime`,freeze,service_charge_pay,'其他押金' bill_type_name,CONCAT(`name`,',',`comments`) bill_remark
</sql>
@@ -59,7 +58,6 @@
<if test=" null != payDate ">and `pay_date` = #{payDate}</if>
<if test=" null != createtime ">and `createtime` = #{createtime}</if>
<if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if>
<if test=" null != owe ">and `owe` = #{owe}</if>
<if test=" null != status ">and `status` = #{status}</if>
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != isDel ">and `is_del` = #{isDel}</if>
@@ -109,7 +107,17 @@
<if test=" null != month and '' != month">
and date_format(br.starttime,'%Y-%m') &lt;= #{month} and date_format(br.endtime,'%Y-%m') &gt;= #{month}
</if>
<if test=" 1 == onlyOwe">and br.`owe` &gt; 0</if>
<if test=" null == nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.`receive_pay` - br.`pay` &gt; 0 and br.status not in (3,6)
)
</if>
<if test=" null != nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
and br.`starttime` &lt; DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.status not in (3,6)
)
</if>
<if test=" null != merchantIds ">
and br.`merchant_id` in
<foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")">
@@ -122,7 +130,7 @@
<select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,
br.`owe`,br.`status`,br.shop_name,br.`updatetime`,br.`return_price`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,
br.`status`,br.shop_name,br.`updatetime`,br.`return_price`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,
br.shop_id,br.name,br.comments,br.`rent_shop_type`,br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay,'其他押金' bill_type_name,CONCAT(`name`,',',`comments`) bill_remark
from wx_bill_other_deposit br
<include refid="queryBillListConditions"/>
@@ -133,10 +141,9 @@
<resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
<result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
<result column="paid" jdbcType="VARCHAR" property="paid" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
</resultMap>
<select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="SumBaseResultMap">
select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_other_deposit br
select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_other_deposit br
<include refid="queryBillListConditions"/>
</select>
@@ -145,6 +152,17 @@
<include refid="queryBillListConditions"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
<result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
</resultMap>
<select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="HotNotifyBaseResultMap">
select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_other_deposit br
<include refid="queryBillListConditions"/>
</select>
<update id="updateNotPaidStatus" parameterType="hashmap">
update wx_bill_other_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date)
where status!=#{paid}


+ 26
- 9
mallinkService/src/main/resources/mapper/WxBillOtherMapper.xml Wyświetl plik

@@ -11,7 +11,6 @@
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
<result column="expired_day" jdbcType="INTEGER" property="expiredDay" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status" />
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
@@ -40,7 +39,7 @@

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,
`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`,
`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`,
`rent_shop_type`,`pay_way`,`starttime`,`endtime`,endtime,service_charge_pay,`apply_status`,`apply_pay_img`,`apply_update_time`,
'其他费用' bill_type_name, CONCAT(`name`,',',`comments`) bill_remark
</sql>
@@ -60,7 +59,6 @@
<if test=" null != payDate "> and `pay_date` = #{payDate} </if>
<if test=" null != createtime "> and `createtime` = #{createtime} </if>
<if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if>
<if test=" null != owe "> and `owe` = #{owe} </if>
<if test=" null != status "> and `status` = #{status} </if>
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != isDel "> and `is_del` = #{isDel} </if>
@@ -105,7 +103,17 @@
<if test=" null != month and '' != month">
and date_format(br.starttime,'%Y-%m') &lt;= #{month} and date_format(br.endtime,'%Y-%m') &gt;= #{month}
</if>
<if test=" 1 == onlyOwe">and br.`owe` &gt; 0</if>
<if test=" null == nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.`receive_pay` - br.`pay` &gt; 0 and br.status not in (3,6)
)
</if>
<if test=" null != nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
and br.`starttime` &lt; DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.status not in (3,6)
)
</if>
<if test=" null != merchantIds ">
and br.`merchant_id` in
<foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")">
@@ -118,7 +126,7 @@
<select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOther" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`, br.`pay_date`,br.`createtime`,br.`expired_day`,
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.shop_name,br.`updatetime`,br.`apply_status`,
br.`status`,br.shop_name,br.`updatetime`,br.`apply_status`,
br.`apply_pay_img`,br.`apply_update_time`,br.`merchant_id`,br.shop_id,br.name,br.comments,br.`rent_shop_type`,
br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay,'其他费用' bill_type_name, CONCAT(br.`name`,',',br.`comments`) bill_remark
from wx_bill_other br
@@ -130,10 +138,9 @@
<resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
<result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
<result column="paid" jdbcType="VARCHAR" property="paid" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
</resultMap>
<select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillOther" resultMap="SumBaseResultMap">
select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_other br
select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_other br
<include refid="queryBillListConditions"/>
</select>
@@ -141,6 +148,16 @@
select distinct merchant_id from wx_bill_other br
<include refid="queryBillListConditions"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
<result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
</resultMap>
<select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillOther" resultMap="HotNotifyBaseResultMap">
select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_other br
<include refid="queryBillListConditions"/>
</select>

<update id="updateNotPaidStatus" parameterType="hashmap">
update wx_bill_other set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date)
@@ -195,7 +212,7 @@
<select id="queryOweInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from
(
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_daily
select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_daily
where status = 1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -205,7 +222,7 @@
</if>
and receive_date between #{startdate} and #{enddate}
union all
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_daily
select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_daily
where status = 1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}


+ 24
- 7
mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml Wyświetl plik

@@ -12,7 +12,6 @@
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
<result column="expired_day" jdbcType="INTEGER" property="expiredDay" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status" />
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
@@ -37,7 +36,7 @@
<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,
`pay_date`,`createtime`,`expired_day`,`owe`,`status`,`is_del`,`need_pay`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`pay_date`,`createtime`,`expired_day`,`status`,`is_del`,`need_pay`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`return_price`,`shop_info`,`pay_way`,freeze,service_charge_pay,
'物业押金' bill_type_name,'' bill_remark
</sql>
@@ -58,7 +57,6 @@
<if test=" null != payDate "> and `pay_date` = #{payDate} </if>
<if test=" null != createtime "> and `createtime` = #{createtime} </if>
<if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if>
<if test=" null != owe "> and `owe` = #{owe} </if>
<if test=" null != status "> and `status` = #{status} </if>
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != isDel "> and `is_del` = #{isDel} </if>
@@ -116,7 +114,17 @@
<if test=" null != month and '' != month">
and date_format(br.starttime,'%Y-%m') &lt;= #{month} and date_format(br.endtime,'%Y-%m') &gt;= #{month}
</if>
<if test=" 1 == onlyOwe">and br.`owe` &gt; 0</if>
<if test=" null == nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.`receive_pay` - br.`pay` &gt; 0 and br.status not in (3,6)
)
</if>
<if test=" null != nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
and br.`starttime` &lt; DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.status not in (3,6)
)
</if>
<if test=" null != merchantIds ">
and br.`merchant_id` in
<foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")">
@@ -127,7 +135,7 @@
</sql>
<select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,br.`owe`,br.`status`,
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,br.`status`,
br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`return_price`,br.`shop_info`,br.pay_way,
br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,'物业押金' bill_type_name,'' bill_remark
from wx_bill_property_deposit br
@@ -138,10 +146,9 @@
<resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
<result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
<result column="paid" jdbcType="VARCHAR" property="paid" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
</resultMap>
<select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="SumBaseResultMap">
select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_property_deposit br
select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_property_deposit br
<include refid="queryBillDepositListConditions"/>
</select>
@@ -150,6 +157,16 @@
<include refid="queryBillDepositListConditions"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
<result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
</resultMap>
<select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="HotNotifyBaseResultMap">
select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_property_deposit br
<include refid="queryBillDepositListConditions"/>
</select>
<select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL((sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property_deposit
where date_format(receive_date,'%Y-%m')=#{receiveDate}


+ 36
- 20
mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml Wyświetl plik

@@ -12,7 +12,6 @@
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/>
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="expired_day" jdbcType="INTEGER" property="expiredDay"/>
<result column="owe" jdbcType="VARCHAR" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
@@ -52,7 +51,7 @@

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,
`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,
`createtime`,`expired_day`,`tenant_id`,`status`,`is_del`,`need_pay`,
`merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`,
`pay_way`,`late_pay_status`,`comments`,starttime,endtime,freeze,service_charge_pay,'物业费' bill_type_name,'' bill_remark
@@ -74,7 +73,6 @@
<if test=" null != payDate ">and `pay_date` = #{payDate}</if>
<if test=" null != createtime ">and `createtime` = #{createtime}</if>
<if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if>
<if test=" null != owe ">and `owe` = #{owe}</if>
<if test=" null != status ">and `status` = #{status}</if>
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != isDel ">and `is_del` = #{isDel}</if>
@@ -136,7 +134,17 @@
<if test=" null != month and '' != month">
and date_format(br.starttime,'%Y-%m') &lt;= #{month} and date_format(br.endtime,'%Y-%m') &gt;= #{month}
</if>
<if test=" 1 == onlyOwe">and br.`owe` &gt; 0</if>
<if test=" null == nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.`receive_pay` - br.`pay` &gt; 0 and br.status not in (3,6)
)
</if>
<if test=" null != nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
and br.`starttime` &lt; DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.status not in (3,6)
)
</if>
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
<if test=" null != propertyContractId ">and br.`property_contract_id` = #{propertyContractId}</if>
<if test=" null != payWay ">and br.`pay_way` = #{payWay}</if>
@@ -161,7 +169,7 @@

<select id="queryBillPropertyList" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`period`,
br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`period`,
br.`revenue`,br.`late_pay_time`,br.`property_contract_id`,br.late_pay_price,br.`shop_info`,br.pay_way,br.late_pay_status,
br.`comments`,br.starttime,br.endtime,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.freeze,br.service_charge_pay,
br.`late_pay_ratio`,'物业费' bill_type_name,'' bill_remark
@@ -179,10 +187,9 @@
<resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
<result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
<result column="paid" jdbcType="VARCHAR" property="paid" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
</resultMap>
<select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="SumBaseResultMap">
select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_property br
select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_property br
<include refid="queryBillPropertyListConditions"/>
</select>
@@ -190,6 +197,16 @@
select distinct merchant_id from wx_bill_property br
<include refid="queryBillPropertyListConditions"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
<result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
</resultMap>
<select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="HotNotifyBaseResultMap">
select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_property br
<include refid="queryBillPropertyListConditions"/>
</select>

<select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property
@@ -219,7 +236,7 @@


<select id="queryOweInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property
select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_property
where status = 1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -279,7 +296,7 @@

<update id="updateForReceivePay" parameterType="com.iformall.domain.po.WxBillProperty">
update wx_bill_property set updatetime = now()
<if test=" null != receivePay ">,receive_pay = #{receivePay},owe=#{receivePay}</if>
<if test=" null != receivePay ">,receive_pay = #{receivePay}</if>
<if test=" null != comments ">,comments = #{comments}</if>
<if test=" null != receiveDate ">,receive_date = #{receiveDate}</if>
<if test="0 == receivePay or 0l == receivePay">,status = 3,pay_date=now()</if>
@@ -287,8 +304,7 @@
</update>

<update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxBillProperty">
update wx_bill_property set is_preview = #{isPreview},merchant_id = #{merchantId},need_pay = receive_pay,
owe=receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay
update wx_bill_property set is_preview = #{isPreview},merchant_id = #{merchantId},need_pay = receive_pay
where property_contract_id = #{propertyContractId}
</update>

@@ -301,7 +317,7 @@
<insert id="insertBills" parameterType="java.util.List">
INSERT INTO wx_bill_property (id,property_contract_id, receive_pay, pay, receive_date, pay_date, createtime,
expired_day,
tenant_id, parent_tenant_id, owe, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime,
tenant_id, parent_tenant_id, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime,
endtime,
rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info,
pay_way, late_pay_status, comments,service_charge_pay)
@@ -310,7 +326,7 @@
(
#{item.id},#{item.propertyContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime},
#{item.expiredDay},#{item.tenantId},#{item.parentTenantId},
#{item.owe},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId},
#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId},
#{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue},
#{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo},
#{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay}
@@ -346,11 +362,11 @@
CONCAT('系统计入',
if(b.late_pay_price is null,
round(
b.owe * c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000
c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000
,2)
,
round(
b.owe * (c.late_pay_ratio) /10000
(c.late_pay_ratio) /10000
,2)
)
,'元') details,b.tenant_id,b.parent_tenant_id
@@ -364,13 +380,13 @@
update wx_bill_property b set b.late_pay_price =
if(b.late_pay_price is null,
round(
b.owe * (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`)
(select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`)
* DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day)) /100
,2)
,
b.late_pay_price +
round(
b.owe * (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) /100
(select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) /100
,2)
)
where b.status!=3 and b.status!=6
@@ -380,7 +396,7 @@

<update id="updateServiceCharge" parameterType="com.iformall.domain.po.WxPayAccountBill">
update wx_bill_property
set service_charge_pay=round(receive_pay*#{serviceChargeRate}/10000),owe=receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay
set service_charge_pay=round(receive_pay*#{serviceChargeRate}/10000)
where service_charge_pay=0 and status in(1,2,4)
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -390,11 +406,11 @@
</if>
</update>

<update id="updateOwe">
<!-- <update id="updateOwe">
update wx_bill_property
set owe = receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay
where status in (1,2,4)
</update>
</update> -->

</mapper>


+ 26
- 9
mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml Wyświetl plik

@@ -12,7 +12,6 @@
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/>
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="expired_day" jdbcType="INTEGER" property="expiredDay"/>
<result column="owe" jdbcType="VARCHAR" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
@@ -45,7 +44,7 @@

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,
`createtime`,`expired_day`,`owe`,`status`,`apply_status`,`apply_pay_img`,`apply_update_time`,`is_del`,`need_pay`,
`createtime`,`expired_day`,`status`,`apply_status`,`apply_pay_img`,`apply_update_time`,`is_del`,`need_pay`,
`merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,
`period`,`shop_info`,`pay_way`,`late_pay_status`,starttime,endtime,freeze,service_charge_pay,manage_fee_type,
case manage_fee_type when 1 then '商业管理费' when 2 then '运营管理费' else '管理费' end bill_type_name,'' bill_remark
@@ -67,7 +66,6 @@
<if test=" null != payDate ">and `pay_date` = #{payDate}</if>
<if test=" null != createtime ">and `createtime` = #{createtime}</if>
<if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if>
<if test=" null != owe ">and `owe` = #{owe}</if>
<if test=" null != status ">and `status` = #{status}</if>
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != isDel ">and `is_del` = #{isDel}</if>
@@ -124,7 +122,17 @@
<if test=" null != month and '' != month">
and date_format(br.starttime,'%Y-%m') &lt;= #{month} and date_format(br.endtime,'%Y-%m') &gt;= #{month}
</if>
<if test=" 1 == onlyOwe">and br.`owe` &gt; 0</if>
<if test=" null == nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.`receive_pay` - br.`pay` &gt; 0 and br.status not in (3,6)
)
</if>
<if test=" null != nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
and br.`starttime` &lt; DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.status not in (3,6)
)
</if>
<if test=" null != manageFeeType ">and br.`manage_fee_type` = #{manageFeeType}</if>
<if test=" null != hasMerchant ">and br.`merchant_id` is not null</if>
@@ -139,7 +147,7 @@

<select id="queryBillManageList" parameterType="com.iformall.domain.po.WxBillRentManage" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`,
br.`status`,br.`need_pay`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`,
br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,
br.late_pay_price,br.shop_info,br.pay_way,br.late_pay_status,br.starttime,br.endtime,
br.freeze,br.service_charge_pay,br.manage_fee_type,br.`late_pay_ratio`,
@@ -155,10 +163,9 @@
<resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
<result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
<result column="paid" jdbcType="VARCHAR" property="paid" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
</resultMap>
<select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillRentManage" resultMap="SumBaseResultMap">
select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_rent_manage br
select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_rent_manage br
<include refid="queryBillManageListConditions"/>
</select>
@@ -171,6 +178,16 @@
select distinct br.`rent_contract_id` from wx_bill_rent_manage br
<include refid="queryBillManageListConditions"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
<result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
</resultMap>
<select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillRentManage" resultMap="HotNotifyBaseResultMap">
select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_rent_manage br
<include refid="queryBillManageListConditions"/>
</select>

<select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_manage
@@ -229,7 +246,7 @@
<insert id="insertBills" parameterType="java.util.List">
INSERT INTO wx_bill_rent_manage (id,tenant_id,parent_tenant_id,
rent_contract_id, receive_pay, pay, receive_date, pay_date, createtime, expired_day,
owe, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime,
status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime,
rent_shop_type, late_pay_ratio, late_pay_time, late_pay_price, period, shop_info,
pay_way, late_pay_status, service_charge_pay,manage_fee_type)
VALUES
@@ -237,7 +254,7 @@
(
#{item.id},#{item.tenantId},#{item.parentTenantId},
#{item.rentContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime},
#{item.expiredDay},#{item.owe},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId},
#{item.expiredDay},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId},
#{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},
#{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.shopInfo},
#{item.payWay},#{item.latePayStatus},#{item.serviceChargePay},#{item.manageFeeType}


+ 37
- 20
mallinkService/src/main/resources/mapper/WxBillRentMapper.xml Wyświetl plik

@@ -12,7 +12,6 @@
<result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/>
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="expired_day" jdbcType="INTEGER" property="expiredDay"/>
<result column="owe" jdbcType="VARCHAR" property="owe"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/>
@@ -61,7 +60,7 @@

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,
`createtime`,`expired_day`,`owe`,`status`,`is_del`,`contract_need_pay`,`rent_price_info`,`need_pay`,`bussiness_manage_fee_need_pay`,`operating_manage_fee_need_pay`,
`createtime`,`expired_day`,`status`,`is_del`,`contract_need_pay`,`rent_price_info`,`need_pay`,`bussiness_manage_fee_need_pay`,`operating_manage_fee_need_pay`,
`merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`apply_status`,`apply_pay_img`,`apply_update_time`,
`revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`,
`pay_way`,`late_pay_status`,`comments`,starttime,endtime,bus_discount_ratio,freeze,join_rent_price,service_charge_pay,'租金' bill_type_name,'' bill_remark
@@ -83,7 +82,6 @@
<if test=" null != payDate ">and `pay_date` = #{payDate}</if>
<if test=" null != createtime ">and `createtime` = #{createtime}</if>
<if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if>
<if test=" null != owe ">and `owe` = #{owe}</if>
<if test=" null != status ">and `status` = #{status}</if>
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != isDel ">and `is_del` = #{isDel}</if>
@@ -141,7 +139,17 @@
<if test=" null != month and '' != month">
and date_format(br.starttime,'%Y-%m') &lt;= #{month} and date_format(br.endtime,'%Y-%m') &gt;= #{month}
</if>
<if test=" 1 == onlyOwe">and br.`owe` &gt; 0</if>
<if test=" null == nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.`receive_pay` - br.`pay` &gt; 0 and br.status not in (3,6)
)
</if>
<if test=" null != nearBillBeforeDays and null != oweBillBeforeDays">
and (br.`starttime` &gt;= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY)
and br.`starttime` &lt; DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY)
and br.status not in (3,6)
)
</if>
<if test=" null != rentContractIdList ">
and br.`rent_contract_id` in
<foreach collection="rentContractIdList" index="index" item="ridItem" open="(" separator="," close=")">
@@ -159,7 +167,7 @@

<select id="queryBillRentList" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap">
select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,
case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`contract_need_pay`,br.`rent_price_info`,br.`need_pay`,br.`bussiness_manage_fee_need_pay`,br.`operating_manage_fee_need_pay`,
br.`status`,br.`contract_need_pay`,br.`rent_price_info`,br.`need_pay`,br.`bussiness_manage_fee_need_pay`,br.`operating_manage_fee_need_pay`,
br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.`revenue`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`,
br.late_pay_price,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime,br.bus_discount_ratio,br.freeze,br.join_rent_price,br.service_charge_pay,
'租金' bill_type_name,'' bill_remark
@@ -179,10 +187,9 @@
<resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum">
<result column="receive_pay" jdbcType="VARCHAR" property="needPay"/>
<result column="paid" jdbcType="VARCHAR" property="paid" />
<result column="owe" jdbcType="VARCHAR" property="owe"/>
</resultMap>
<select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillRent" resultMap="SumBaseResultMap">
select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_rent br
select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_rent br
<include refid="queryBillRentListCondition"/>
</select>
@@ -191,6 +198,16 @@
<include refid="queryBillRentListCondition"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
<result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/>
</resultMap>
<select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillRent" resultMap="HotNotifyBaseResultMap">
select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_rent br
<include refid="queryBillRentListCondition"/>
</select>
<select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent
where is_preview = 0
@@ -229,7 +246,7 @@


<select id="queryOweInfo" resultType="hashmap" parameterType="hashmap">
select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent
select IFNULL(sum(receive_pay-pay),0) owe,tenant_id from wx_bill_rent
where status = 1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -289,8 +306,7 @@
</update>

<update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxBillRent">
update wx_bill_rent set is_preview = #{isPreview},merchant_id = #{merchantId},need_pay = receive_pay,
owe=receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay
update wx_bill_rent set is_preview = #{isPreview},merchant_id = #{merchantId},need_pay = receive_pay
where rent_contract_id = #{rentContractId}
</update>

@@ -302,7 +318,7 @@
<insert id="insertBills" parameterType="java.util.List">
INSERT INTO wx_bill_rent (id,tenant_id,parent_tenant_id,
rent_contract_id, receive_pay, pay, receive_date, pay_date, createtime, expired_day,
owe, status, is_del, contract_need_pay,rent_price_info,need_pay,bussiness_manage_fee_need_pay,operating_manage_fee_need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime,
status, is_del, contract_need_pay,rent_price_info,need_pay,bussiness_manage_fee_need_pay,operating_manage_fee_need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime,
rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info,
pay_way, late_pay_status, comments,service_charge_pay)
VALUES
@@ -310,7 +326,7 @@
(
#{item.id},#{item.tenantId},#{item.parentTenantId},
#{item.rentContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime},
#{item.expiredDay},#{item.owe},#{item.status},#{item.isDel},#{item.contractNeedPay},#{item.rentPriceInfo},#{item.needPay},#{item.bussinessManageFeeNeedPay},#{item.operatingManageFeeNeedPay},#{item.merchantId},
#{item.expiredDay},#{item.status},#{item.isDel},#{item.contractNeedPay},#{item.rentPriceInfo},#{item.needPay},#{item.bussinessManageFeeNeedPay},#{item.operatingManageFeeNeedPay},#{item.merchantId},
#{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue},
#{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo},
#{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay}
@@ -346,11 +362,11 @@
CONCAT('系统计入',
if(b.late_pay_price is null,
round(
b.owe * c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000
c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000
,2)
,
round(
b.owe * (c.late_pay_ratio) /10000
(c.late_pay_ratio) /10000
,2)
)
,'元') details,b.tenant_id,b.parent_tenant_id
@@ -364,13 +380,13 @@
update wx_bill_rent b set b.late_pay_price =
if(b.late_pay_price is null,
round(
b.owe * (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`)
(select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`)
* DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`rent_contract_id`) day)) /100
,2)
,
b.late_pay_price +
round(
b.owe * (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) /100
(select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) /100
,2)
)
where b.status!=3 and b.status!=6
@@ -379,7 +395,7 @@
</update>
<update id="updateServiceCharge" parameterType="com.iformall.domain.po.WxPayAccountBill">
update wx_bill_rent set service_charge_pay=round(receive_pay*#{serviceChargeRate}/10000),owe=receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay
update wx_bill_rent set service_charge_pay=round(receive_pay*#{serviceChargeRate}/10000)
where service_charge_pay=0
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -390,10 +406,11 @@
and status in(1,2,4)
</update>
<update id="updateOwe">
<!-- <update id="updateOwe">
update wx_bill_rent set owe = receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay where status in (1,2,4)
</update>

</update> -->

</mapper>


Ładowanie…
Anuluj
Zapisz