From 61af0f37a8ebdaeaa7ad9b41b341ad124c800eaf Mon Sep 17 00:00:00 2001 From: winter Date: Mon, 5 Aug 2024 12:12:34 +0800 Subject: [PATCH] fix --- .../controller/rent/WxAllBillController.java | 42 ++++++- .../db/migration/V202408000000001.sql | 104 ++++++++++++++++++ .../iformall/domain/po/WxFinanceReceive.java | 3 + .../com/iformall/enums/EnumBillAllType.java | 28 ++--- .../service/helper/WxBillAllHelper.java | 31 +----- .../service/impl/WxAllBillServiceImpl.java | 17 +-- .../service/impl/WxFinanceServiceImpl.java | 13 +++ .../mapper/WxFinanceReceiveMapper.xml | 6 +- 8 files changed, 185 insertions(+), 59 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java index 6723af84c..2c2875fb6 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java @@ -225,9 +225,7 @@ public class WxAllBillController extends BillBaseController { public ResultData billTypes() { Map tmap = new HashMap(); for (EnumBillAllType t : EnumBillAllType.values()) { - if (t.isShow()) { - tmap.put(t.getCode(), t.getMessage()); - } + tmap.put(t.getCode(), t.getMessage()); } return new ResultData(tmap); } @@ -612,6 +610,44 @@ public class WxAllBillController extends BillBaseController { return new ResultData(list); } + //待支付给商户的账单 + @GetMapping("toPaymerchantBills") + public ResultData toPaymerchantBills(@ModelAttribute WxMerchant wxMerchant) { + if (null == wxMerchant.getId()) { + return new ResultData(Result.ERROR,"请选择商户"); + } + wxMerchant.updateTenantInfo(getTenantInfo()); + wxMerchant.setNeedPayPreDays(getNearBillBeforeDays()); + List list = billAllHelper.getMerchantBillList(wxMerchant); + if (null != list && list.size() > 0 ) { + List merchnatIds = new ArrayList(); + merchnatIds.add(wxMerchant.getId()); + Map msMap = wxShopSerivce.getMerchantShopNumberMap(wxMerchant, merchnatIds, EnumYesOrNo.NO.getCode()); + String shopNumber = ""; + if (null != msMap) { + shopNumber = msMap.get(wxMerchant.getId()); + } + WxMerchant m = wxMerchantService.selectById(wxMerchant.getId()); + WxEnergyFees fq = new WxEnergyFees(); + fq.updateTenantInfo(m); + Map feesMap = wxEnergyService.getFeesMap(fq); + for (int i = 0 ; i < list.size(); i++) { + WxAllBill be = list.get(i); + if (StringUtils.isBlank(be.getShopNumber())) { + be.setShopNumber(shopNumber); + } + if (null != feesMap) { + WxEnergyFees fees = feesMap.get(be.getEnergyFeesId()); + if (null != fees) { + be.setEnergyFeesName(fees.getName()); + } + } + be.setMerchantName(m.getName()); + } + } + return new ResultData(list); + } + @ApiOperation("分页列表接口") @GetMapping("list") @ApiImplicitParams({ diff --git a/mallinkAdmin/src/main/resources/db/migration/V202408000000001.sql b/mallinkAdmin/src/main/resources/db/migration/V202408000000001.sql index 4406004e4..40d4c1404 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202408000000001.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202408000000001.sql @@ -672,3 +672,107 @@ alter table wx_finance_receive_payway_97 add column pay varchar(30) comment alter table wx_finance_receive_payway_98 add column pay varchar(30) comment '支付给商户金额'; alter table wx_finance_receive_payway_99 add column pay varchar(30) comment '支付给商户金额'; + +alter table wx_finance_receive_0 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_1 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_2 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_3 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_4 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_5 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_6 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_7 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_8 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_9 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_10 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_11 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_12 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_13 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_14 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_15 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_16 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_17 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_18 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_19 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_20 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_21 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_22 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_23 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_24 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_25 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_26 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_27 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_28 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_29 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_30 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_31 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_32 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_33 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_34 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_35 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_36 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_37 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_38 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_39 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_40 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_41 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_42 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_43 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_44 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_45 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_46 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_47 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_48 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_49 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_50 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_51 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_52 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_53 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_54 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_55 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_56 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_57 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_58 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_59 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_60 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_61 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_62 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_63 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_64 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_65 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_66 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_67 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_68 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_69 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_70 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_71 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_72 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_73 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_74 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_75 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_76 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_77 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_78 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_79 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_80 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_81 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_82 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_83 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_84 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_85 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_86 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_87 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_88 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_89 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_90 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_91 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_92 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_93 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_94 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_95 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_96 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_97 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_98 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; +alter table wx_finance_receive_99 add column rent_shop_type int(1) not null comment '店铺多经'; comment '支付给商户金额'; + + + diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java b/mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java index b2ea625f2..0ba950744 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java @@ -132,6 +132,9 @@ public class WxFinanceReceive extends TenantEntity { @TableField(exist = false) private List merchantIdList; + @io.swagger.annotations.ApiModelProperty(value = "店铺/多径EnumRentShopType", name = "rentShopType") + private Integer rentShopType; + @io.swagger.annotations.ApiModelProperty(value = "remark", name = "remark") private String remark; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumBillAllType.java b/mallinkService/src/main/java/com/iformall/enums/EnumBillAllType.java index 2c994115f..83b282bef 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumBillAllType.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumBillAllType.java @@ -5,16 +5,16 @@ import java.util.List; public enum EnumBillAllType { - RENT(1,"租金",1L,false,true), - RENT_BUSSINESS_MANAGE(11,"商业管理费",2L,false,true), - RENT_OPERATION_MANAGE(12,"运营管理费",3L,false,true), - RENT_DEPOSIT(13,"租赁押金",null,true,true), - PROPERTY(2,"物业",5L,false,true), - PROPERTY_DEPOSIT(21,"物业押金",6L,true,true), - DAILY(3, "能耗(水电空调)费",null,false,true), - OTHER(4, "其他费用",null,false,true), - OTHER_DEPOSIT(5, "其他押金",null,true,true), - ADVANCE(6,"预收",null,true,false)//没有形成真正的账单 + RENT(1,"租金",1L,false), + RENT_BUSSINESS_MANAGE(11,"商业管理费",2L,false), + RENT_OPERATION_MANAGE(12,"运营管理费",3L,false), + RENT_DEPOSIT(13,"租赁押金",null,true), + PROPERTY(2,"物业",5L,false), + PROPERTY_DEPOSIT(21,"物业押金",6L,true), + DAILY(3, "能耗(水电空调)费",null,false), + OTHER(4, "其他费用",null,false), + OTHER_DEPOSIT(5, "其他押金",null,true), + ADVANCE(6,"预收",null,true)//没有形成真正的账单 ; public static EnumBillAllType getEnum(Integer code) { @@ -30,14 +30,12 @@ public enum EnumBillAllType { private String message; private Long energyFeesId;//wx_energy_fees(费用科目)里的id,不可配置的有这个 private boolean isFixedPrice;//是否强制为一次性费用 - private boolean isShow;//是否显示为查询条件 - EnumBillAllType(Integer code, String message,Long energyFeesId,boolean isFixedPrice,boolean isShow) { + EnumBillAllType(Integer code, String message,Long energyFeesId,boolean isFixedPrice) { this.code = code; this.message = message; this.energyFeesId = energyFeesId; this.isFixedPrice = isFixedPrice; - this.isShow = isShow; } public Integer getCode() { @@ -56,10 +54,6 @@ public enum EnumBillAllType { return isFixedPrice; } - public boolean isShow() { - return isShow; - } - public static EnumBillAllType[] getSystemTypes() { EnumBillAllType[] ret = new EnumBillAllType[] {RENT,RENT_BUSSINESS_MANAGE,RENT_OPERATION_MANAGE, PROPERTY,PROPERTY_DEPOSIT}; diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java index 8d2d205a8..223328678 100644 --- a/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java @@ -63,33 +63,6 @@ public class WxBillAllHelper { @Autowired private WxAllBillService wxAllBillService; -// @Autowired -// private WxBillRentService wxBillRentService; -// -// @Autowired -// private WxBillRentManageService wxBillRentManageService; -// -// @Autowired -// private WxBillDepositService wxBillRentDepositService; -// -// @Autowired -// private WxBillPropertyService wxBillPropertyService; -// -// @Autowired -// private WxBillPropertyDepositService wxBillPropertyDepositService; -// -// @Autowired -// private WxBillDailyService wxBillDailyService; -// -// @Autowired -// private WxBillOtherService wxBillOtherService; -// -// @Autowired -// private WxBillOtherDepositService wxBillOtherDepositService; -// -// @Autowired -// private WxBillAdvanceService wxBillAdvanceService; - @Autowired private WxShopService wxShopService; @@ -505,4 +478,8 @@ public class WxBillAllHelper { wxAllBillService.stopMerchantBills(wxMerchant, user); } + public void saveOrUpdateBill(WxAllBill bill,MallUserInfo user) { + wxAllBillService.saveOrUpdate(bill, user); + } + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java index 227029b8f..e3046f5a4 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java @@ -552,15 +552,8 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill @Override public ResultData saveOrUpdate(WxAllBill record, MallUserInfo user) { - //String receivepay = StringUtils.isBlank(record.getRealReceivePay()) ? "0" : record.getRealReceivePay(); - String receivepay = StringUtils.isBlank(record.getReceivePay()) ? "0" : record.getReceivePay(); - String pay = StringUtils.isBlank(record.getPay()) ? "0" : record.getPay(); - if(new BigDecimal(pay).compareTo(new BigDecimal(receivepay)) > 0 ){ - return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收总金额"); - } Date date = new Date(); if (record.getId() == null) { - logger.info("新增租赁账单"); final IdWorker idWorker = IdWorker.get(); record.setId(idWorker.nextId()); record.setCreatetime(date); @@ -570,17 +563,19 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill record.setCreateBy(user.getId()); record.setCreateByName(user.getName()); record.updateTenantInfo(user); - //record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); - //record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); try { wxAllBillMapper.insert(record); } catch (Exception e) { logger.error("保存租赁账单失败,e:" + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } - return new ResultData(Result.SUCCESS, "保存租赁账单成功"); + return new ResultData(Result.SUCCESS, "保存账单成功"); } else { - return new ResultData(); + record.setUpdatetime(date); + record.setUpdateBy(user.getId()); + record.setUpdateByName(user.getName()); + wxAllBillMapper.updateById(record); + return new ResultData(Result.SUCCESS, "保存账单成功"); } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java index 902e79de2..9757d53bc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java @@ -650,6 +650,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { addreceive.setReceiveMoney(receiveMoney); addreceive.setPayMoney(payMoney); addreceive.setMerchantId(merchantId); + WxMerchant merchant = wxMerchantService.getById(merchantId); + addreceive.setRentShopType(merchant.getType()); addreceive.setCreateTime(new Date()); addreceive.setCreateBy(user.getId()); addreceive.setCreateByName(user.getName()); @@ -818,6 +820,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { return wxFinanceReceiveMapper.selectById(id, tenantEntity.getTenantId()); } + @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Override public void createAdvance(WxFinanceReceive record,MallUserInfo user) { //创建预收主单 @@ -827,6 +830,16 @@ public class WxFinanceServiceImpl implements WxFinanceService { record.getMerchantId(), record.getFeesId(), record.getRemark()); wxFinanceReceiveMapper.insert(addreceive); //创建预收账单? WxBillAdvance + //WxAllBill advance = generateBillByReceive(record); + //wxBillAllHelper.saveOrUpdateBill(advance, user); + } + + public WxAllBill generateBillByReceive(WxFinanceReceive record) { + WxAllBill advanceBill = new WxAllBill(); + advanceBill.updateTenantInfo(record); + advanceBill.setMerchantId(record.getMerchantId()); + //advanceBill.setRentShopType(); + return null; } @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) diff --git a/mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml b/mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml index 19cdce1b9..c21ab8415 100644 --- a/mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml @@ -20,6 +20,7 @@ + @@ -27,7 +28,8 @@ `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`receive_money`,`pay_money`,`set_off_money`,`use_money`,`status`,`type`, - `receive_type`,`money_detail`,`create_by`,`create_by_name`,`update_by`,`update_by_name`,`merchant_id`,`remark`,`fees_id`,`is_print` + `receive_type`,`money_detail`,`create_by`,`create_by_name`,`update_by`,`update_by_name`,`merchant_id`,`rent_shop_type`,`remark`, + `fees_id`,`is_print` @@ -43,9 +45,11 @@ and `type` = #{type} and `receive_type` = #{receiveType} and `merchant_id` = #{merchantId} + and `rent_shop_type` = #{rentShopType} and `create_time` >= #{createTimeBegin} and `create_time` <= #{createTimeEnd} and `fees_id` = #{feesId} + and `rent_shop_type` = #{rentShopType} and `is_print` = #{isPrint} and `status` in (1,4)