From 152c49f091c9ac13a3db15b21166e008cf5a126a Mon Sep 17 00:00:00 2001 From: winter <664946893@qq.com> Date: Sun, 25 May 2025 23:09:53 +0800 Subject: [PATCH] fix --- .../contract/WxAgileContractController.java | 165 ++++++++++++++++-- .../com/iformall/domain/po/WxAllBill.java | 11 -- .../WxRentContractAgileUnDepositMapper.java | 2 + .../service/WxAgileContractService.java | 7 + .../impl/WxAgileContractServiceImpl.java | 128 ++++++++++++-- .../main/resources/mapper/WxAllBillMapper.xml | 37 ++-- .../WxRentContractAgileRenevueItemMapper.xml | 2 +- .../WxRentContractAgileUnDepositMapper.xml | 4 + 8 files changed, 291 insertions(+), 65 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxAgileContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxAgileContractController.java index aa99bd574..26e7979d2 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxAgileContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxAgileContractController.java @@ -138,62 +138,140 @@ public class WxAgileContractController extends WxContractBaseController { public ResultData saveOrUpdate(@RequestBody WxRentContract wxRentContract) { MallUserInfo user = getUser(); wxRentContract.updateTenantInfo(user); - //wxRentContract.setAgileType(EnumRentAgileType.AGILE.getCode()); - if (null == wxRentContract.getDayPriceCalcute()) { - return new ResultData(Result.ERROR,"请选择日均单价计费规则"); + + //如果是修改,并且合同是生效的,则不允许 + if (null != wxRentContract.getId()) { + WxRentContract r = wxAgileContractService.selectById(wxRentContract.getId()); + if (r.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() || + r.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { + }else { + return new ResultData(Result.ERROR,"该状态不允许修改"); + } + } + + try { + handleSaveData(wxRentContract); + }catch(Exception e) { + return new ResultData(Result.ERROR,e.getMessage()); + } + + return wxAgileContractService.saveOrUpdate(wxRentContract, user); + } + + private void handleSaveData(WxRentContract wxRentContract) { + if (null == wxRentContract.getDayPriceCalcute()) { + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择日均单价计费规则"); } //以前合同必填的数据初始化 - wxRentContract.setDecimalSize(2); + //wxRentContract.setDecimalSize(2); if (null == wxRentContract.getRentalStartDate()) { - return new ResultData(Result.ERROR,"请选择合同开始日期"); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择合同开始日期"); } if (null == wxRentContract.getRentalEndDate()) { - return new ResultData(Result.ERROR,"请选择合同结束日期"); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择合同结束日期"); } int[] array = DateUtils.getDiff(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate()); wxRentContract.setLease(array[0]); if (null == wxRentContract.getSignDate()) { - return new ResultData(Result.ERROR,"请选择合同签约日期"); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择合同签约日期"); } String rentInfo = wxRentContract.getRentInfo(); if (StringUtils.isBlank(rentInfo)) { - return new ResultData(Result.ERROR,"请选择铺位"); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择铺位"); } JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); int size = rentInfoArray.size(); if (size == 0) { - return new ResultData(ErrorCode.SHOP_NOT_SELECTED); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择店铺"); } List shopList = Lists.newArrayList(); //查询rent_info 包括 shopId - String shopIdStr = ""; + //String shopIdStr = ""; BigDecimal rentAreaDecimal = new BigDecimal(0); for (int i = 0; i < size; i++) { JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); Long shopId = rentInfoObject.getLong("id"); - //wxRentContract.setShopId(shopId); - String shopNumber = rentInfoObject.getString("shopNumber"); + //String shopNumber = rentInfoObject.getString("shopNumber"); if (!shopList.contains(shopId)) { shopList.add(shopId); - shopIdStr = shopIdStr +","+ shopId; + //shopIdStr = shopIdStr +","+ shopId; } String rentArea = rentInfoObject.getString("operationArea"); if (StringUtils.isNotBlank(rentArea)) { rentAreaDecimal = rentAreaDecimal.add(new BigDecimal(rentArea)); } } + Collections.sort(shopList); wxRentContract.setRentArea(rentAreaDecimal.toPlainString()); - wxRentContract.setShopIdStr(shopIdStr); + wxRentContract.setShopIdStr(StringUtils.join(shopList,",")); try { rentContractValidShop(wxRentContract); } catch (Exception e) { - return new ResultData(Result.ERROR,e.getMessage()); + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); } + } + + /** + * 生效中合同修改 + * @param wxRentContract + * @return + */ + @PostMapping("updateValidContract") + public ResultData updateValidContract(@RequestBody WxRentContract wxRentContract) { + MallUserInfo user = getUser(); + wxRentContract.updateTenantInfo(user); + //只能改生效的合同 + WxRentContract r = wxAgileContractService.selectById(wxRentContract.getId()); + if (!isValidContract(r)) { + return new ResultData(Result.ERROR,"该状态不允许修改"); + } - return wxAgileContractService.saveOrUpdate(wxRentContract, user); + try { + handleSaveData(wxRentContract); + }catch(Exception e) { + return new ResultData(Result.ERROR,e.getMessage()); + } + + //更新合同信息 + ResultData result = wxAgileContractService.saveOrUpdate(wxRentContract, user); + if (result.code != Result.SUCCESS) { + return new ResultData(result.code,result.message); + } + + //如果更改了合同时间,店铺,类型,每天计价规则,每月平均天数,计租面积,则需要重置 + if (isNeedRebuildBill(wxRentContract,r)) { + try { + wxAgileContractService.reSetContract(wxRentContract, user); + return new ResultData(); + }catch(Exception e) { + return new ResultData(Result.ERROR,e.getMessage()); + } + } + return new ResultData(); + } + + private boolean isValidContract(WxRentContract r) { + if (r.getStatus().intValue() == EnumRentContractStatus.READY_FOR_PAING.getCode().intValue() || + r.getStatus().intValue() == EnumRentContractStatus.PAING.getCode().intValue()) { + return true; + } + return false; + } + + private boolean isNeedRebuildBill(WxRentContract wxRentContract,WxRentContract dbContract) { + if (!wxRentContract.getRentalStartDate().equals(dbContract.getRentalStartDate()) + || !wxRentContract.getRentalEndDate().equals(dbContract.getRentalEndDate()) + || !wxRentContract.getShopIdStr().equals(dbContract.getShopIdStr()) + || !wxRentContract.getRentArea().equals(dbContract.getRentArea()) + || wxRentContract.getType().intValue() != dbContract.getType().intValue() + || wxRentContract.getDayPriceCalcute().intValue() != dbContract.getDayPriceCalcute().intValue() + || wxRentContract.getMonthAverageDays().intValue() != dbContract.getMonthAverageDays().intValue()) { + return true; + } + return false; } /** @@ -248,6 +326,16 @@ public class WxAgileContractController extends WxContractBaseController { return new ResultData(Result.ERROR,"请至少增加一个"); } wxRentContract.updateTenantInfo(getTenantInfo()); + //如果是生效的合同变更,此时变更押金,则需要清空当前时间之后未处理的账单 + WxRentContract r = wxAgileContractService.selectById(wxRentContract.getId()); + if (isValidContract(r)) { + try { + wxAgileContractService.endContractDespoitBill(r,this.getUser()); + }catch(Exception e) { + return new ResultData(Result.ERROR,"保存信息失败:"+e.getMessage()); + } + } + try { wxAgileContractService.saveDeposit(wxRentContract,this.getUser()); }catch(Exception e) { @@ -342,6 +430,30 @@ public class WxAgileContractController extends WxContractBaseController { return new ResultData(wxAgileContractService.findUnDepositList(unDeposit)); } + /** + * 删除非押金 + * @param unDeposit + * @return + */ + @PostMapping("deleteUnDeposit") + public ResultData deleteUnDeposit(@RequestBody WxRentContractAgileUnDeposit unDeposit) { + unDeposit.updateTenantInfo(getTenantInfo()); + if (null == unDeposit.getItems() || unDeposit.getItems().size() <= 0 ) { + return new ResultData(Result.ERROR,"无细项"); + } + //如果是生效的合同删除 + WxRentContract r = wxAgileContractService.selectById(unDeposit.getRentContractId()); + if (isValidContract(r)) { + wxAgileContractService.endContractUnDespositBill(unDeposit,this.getUser()); + } + try { + wxAgileContractService.deleteUnDeposit(unDeposit); + }catch(Exception e) { + return new ResultData(Result.ERROR,"保存账单失败:"+e.getMessage()); + } + return new ResultData(); + } + /** * 设置联营扣点 */ @@ -359,6 +471,13 @@ public class WxAgileContractController extends WxContractBaseController { if (null != _ore) { renevue.setId(_ore.getId()); } + + //如果是生效的合同变更 + WxRentContract r = wxAgileContractService.selectById(renevue.getRentContractId()); + if (isValidContract(r)) { + wxAgileContractService.endContractRenevueBill(renevue); + } + try { wxAgileContractService.saveRenuvue(renevue); }catch(Exception e) { @@ -376,6 +495,14 @@ public class WxAgileContractController extends WxContractBaseController { if (null == contract.getRevenueJumps() || contract.getRevenueJumps().size() <= 0 ) { return new ResultData(Result.ERROR,"无配置项"); } + + //如果是生效的合同变更 + WxRentContract r = wxAgileContractService.selectById(contract.getId()); + if (isValidContract(r)) { + WxRentContractAgileRenevue renevue = wxAgileContractService.findRenevueByContract(contract.getId(), contract); + wxAgileContractService.endContractRenevueBill(renevue); + } + try { wxAgileContractService.saveRenuvueJumps(contract); }catch(Exception e) { @@ -407,6 +534,12 @@ public class WxAgileContractController extends WxContractBaseController { return new ResultData(Result.ERROR,"当前款项费用生成规则和扣点设置不一致。"); } + //如果是生效的合同变更 + WxRentContract r = wxAgileContractService.selectById(_ore.getRentContractId()); + if (isValidContract(r)) { + wxAgileContractService.endContractRenevueBill(_ore); + } + try { wxAgileContractService.setJoinRenevueUp(unDeposit); }catch(Exception e) { diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java b/mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java index d8f95ede7..058408051 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java @@ -217,14 +217,6 @@ public class WxAllBill extends TenantEntity { @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7", "退租待结算_8","预收待抵扣_9"}, width = 20, orderNum = "10") @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") public Integer status; -// @TableField(exist = false) -// private String statusName; -// public String getStatusName() { -// if (null != status) { -// return EnumBillStatus.getEnum(status).getMessage(); -// } -// return null; -// } @TableField(exist = false) public List statusList; @@ -273,9 +265,6 @@ public class WxAllBill extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="自定义合同费用类型EnumRentContractAgileFeesType",name="rentContractAgileFeesType") public Integer rentContractAgileFeesType; - @io.swagger.annotations.ApiModelProperty(value="物业合同ID",name="propertyContractId") - public Long propertyContractId; - @io.swagger.annotations.ApiModelProperty(value="主物账单ID(针对合同里面的自定义科目账单)",name="parentBillId") public Long parentBillId; diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractAgileUnDepositMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractAgileUnDepositMapper.java index 79ad361ab..9dfb859ee 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractAgileUnDepositMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractAgileUnDepositMapper.java @@ -19,5 +19,7 @@ public interface WxRentContractAgileUnDepositMapper extends CommonMapper findFeesIdList(WxRentContractAgileUnDeposit wxBillRent); void updateJoinRenevueUp(WxRentContractAgileUnDeposit wxBillRent); + + void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxAgileContractService.java b/mallinkService/src/main/java/com/iformall/service/WxAgileContractService.java index 3398314fd..7ae04b87c 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxAgileContractService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxAgileContractService.java @@ -42,6 +42,8 @@ public interface WxAgileContractService { List findUnDepositList(WxRentContractAgileUnDeposit unDeposit); + void deleteUnDeposit(WxRentContractAgileUnDeposit unDeposit); + List findUnDepositFeesIdList(WxRentContractAgileUnDeposit unDeposit); void createUnDepositBill(WxRentContractAgileUnDeposit unDeposit,MallUserInfo user); @@ -75,4 +77,9 @@ public interface WxAgileContractService { void transfer(WxRentContract wxRentContract,MallUserInfo user); List getRentContractYears(WxRentContract rentContract); + + void reSetContract(WxRentContract wxRentContract,MallUserInfo user); + void endContractDespoitBill(WxRentContract wxRentContract,MallUserInfo user); + void endContractUnDespositBill(WxRentContractAgileUnDeposit unDeposit,MallUserInfo user); + void endContractRenevueBill(WxRentContractAgileRenevue renevue); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java index 028f0f86c..e4e8d854d 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java @@ -558,6 +558,24 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { return list; } + @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) + @Override + public void deleteUnDeposit(WxRentContractAgileUnDeposit unDeposit) { + wxRentContractAgileUnDepositMapper.deleteById(unDeposit.getId(),unDeposit.getTenantId()); + WxRentContractAgileUnDepositItem itemdel = new WxRentContractAgileUnDepositItem(); + itemdel.updateTenantInfo(unDeposit); + itemdel.setUnDepositId(unDeposit.getId()); + wxRentContractAgileUnDepositItemMapper.deleteByUnDeposit(itemdel); + //删除账单 + WxAllBill wxBillDel = new WxAllBill(); + wxBillDel.updateTenantInfo(unDeposit); + wxBillDel.setRentContractId(unDeposit.getRentContractId()); + wxBillDel.setIsPreview(EnumYesOrNo.YES.getCode()); + wxBillDel.setRentContractAgileFeesType(EnumRentContractAgileFeesType.UN_DEPOSIT.getCode()); + wxBillDel.setEnergyFeesId(unDeposit.getFeesId()); + wxAllBillMapper.deletePreviewBill(wxBillDel); + } + @Override public List findUnDepositFeesIdList(WxRentContractAgileUnDeposit unDeposit) { return wxRentContractAgileUnDepositMapper.findFeesIdList(unDeposit); @@ -1107,16 +1125,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { } } if (null != renevueId) { - WxRentContractAgileRenevueItem ari = new WxRentContractAgileRenevueItem(); - ari.setRentContractId(newContractId); - ari.setRenevueId(renevueId); - ari.setBeginTime(rentContract.getRentalStartDate()); - ari.setBeginTime(rentContract.getRentalEndDate()); - ari.setRate("0"); - ari.setIsFree(EnumYesOrNo.NO.getCode()); - ari.setId(idWorker.nextId()); - ari.setCreatetime(new Date()); - ari.setUpdatetime(new Date()); + WxRentContractAgileRenevueItem ari = generateRenevueItem(idWorker, rentContract, newContractId, renevueId); wxRentContractAgileRenevueItemMapper.insert(ari); } WxRentContractAgileRenevueFees fq = new WxRentContractAgileRenevueFees(); @@ -1165,6 +1174,20 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { wxRentContractMapper.insert(rentContract); } + private WxRentContractAgileRenevueItem generateRenevueItem(IdWorker idWorker,WxRentContract rentContract,Long newContractId,Long renevueId) { + WxRentContractAgileRenevueItem ari = new WxRentContractAgileRenevueItem(); + ari.setRentContractId(newContractId); + ari.setRenevueId(renevueId); + ari.setBeginTime(rentContract.getRentalStartDate()); + ari.setBeginTime(rentContract.getRentalEndDate()); + ari.setRate("0"); + ari.setIsFree(EnumYesOrNo.NO.getCode()); + ari.setIsFather(EnumYesOrNo.YES.getCode()); + ari.setId(idWorker.nextId()); + ari.setCreatetime(new Date()); + ari.setUpdatetime(new Date()); + return ari; + } private WxRentContractAgileUnDepositItem generateUnDepositItem(IdWorker idWorker,WxRentContract rentContract,Long undepositId,Long feesId,Long shopId) { WxRentContractAgileUnDepositItem raudi = new WxRentContractAgileUnDepositItem(); @@ -1280,5 +1303,90 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { } return yearList; } + + @Transactional(rollbackFor = {Exception.class}) + @Override + public void reSetContract(WxRentContract wxRentContract, MallUserInfo user) { + //当前时间之后的未处理过的账单,全部删除,之前的账单,还有以后已经处理过的账单,不处理。需财务手工处理这些账单 + WxAllBill bq = new WxAllBill(); + bq.updateTenantInfo(wxRentContract); + bq.setRentContractId(wxRentContract.getId()); + bq.setShopEndtime(new Date()); + wxAllBillMapper.deleteNoNeedPayBill(bq); + //原来所有的非押金,扣点都默认设置为按合同,然后时间设置为合同开始时间和结束时间,单价为0 + WxRentContractAgileUnDeposit udq = new WxRentContractAgileUnDeposit(); + udq.updateTenantInfo(wxRentContract); + udq.setRentContractId(wxRentContract.getId()); + List udList = wxRentContractAgileUnDepositMapper.findList(udq); + final IdWorker idWorker = IdWorker.get(); + if (null != udList && udList.size() > 0 ) { + for (int i = 0 ; i < udList.size(); i++ ) { + WxRentContractAgileUnDeposit ud = udList.get(i); + WxRentContractAgileUnDepositItem udid = new WxRentContractAgileUnDepositItem(); + udid.updateTenantInfo(wxRentContract); + udid.setUnDepositId(ud.getId()); + wxRentContractAgileUnDepositItemMapper.deleteByUnDeposit(udid); + generateUnDepositItem(idWorker, wxRentContract, ud.getId(), ud.getFeesId(), null); + } + } + WxRentContractAgileRenevue arq = new WxRentContractAgileRenevue(); + arq.updateTenantInfo(wxRentContract); + arq.setRentContractId(wxRentContract.getId()); + List arList = wxRentContractAgileRenevueMapper.findList(arq); + if (null != arList && arList.size() > 0 ) { + for (int i = 0 ; i < arList.size(); i++ ) { + WxRentContractAgileRenevue ud = arList.get(i); + WxRentContractAgileRenevueItem arid = new WxRentContractAgileRenevueItem(); + arid.updateTenantInfo(wxRentContract); + arid.setRentContractId(wxRentContract.getId()); + arid.setRenevueId(ud.getId()); + wxRentContractAgileRenevueItemMapper.deleteByRenevue(arid); + generateRenevueItem(idWorker, wxRentContract, wxRentContract.getId(), ud.getId()); + } + } + } + + @Override + public void endContractDespoitBill(WxRentContract wxRentContract, MallUserInfo user) { + //当前时间之后的未处理过的账单,全部删除,之前的账单,还有以后已经处理过的账单,不处理。需财务手工处理这些账单 + WxAllBill bq = new WxAllBill(); + bq.updateTenantInfo(wxRentContract); + bq.setRentContractId(wxRentContract.getId()); + bq.setShopEndtime(new Date()); + List feesIds = new ArrayList(); + for (int i = 0 ; i < wxRentContract.getContractDepositList().size(); i++) { + WxRentContractAgileDeposit deposit = wxRentContract.getContractDepositList().get(i); + if (!feesIds.contains(deposit.getFeesId())) { + feesIds.add(deposit.getFeesId()); + } + } + bq.setEnergyFeesIds(feesIds); + bq.setRentContractAgileFeesType(EnumRentContractAgileFeesType.DEPOSIT.getCode()); + wxAllBillMapper.deleteNoNeedPayBill(bq); + } + + @Override + public void endContractUnDespositBill(WxRentContractAgileUnDeposit unDeposit, MallUserInfo user) { + WxAllBill bq = new WxAllBill(); + bq.updateTenantInfo(unDeposit); + bq.setRentContractId(unDeposit.getRentContractId()); + bq.setShopEndtime(new Date()); + bq.setEnergyFeesId(unDeposit.getFeesId()); + bq.setRentContractAgileFeesType(EnumRentContractAgileFeesType.UN_DEPOSIT.getCode()); + wxAllBillMapper.deleteNoNeedPayBill(bq); + } + + @Transactional(rollbackFor = {Exception.class}) + @Override + public void endContractRenevueBill(WxRentContractAgileRenevue renevue) { + WxAllBill bq = new WxAllBill(); + bq.updateTenantInfo(renevue); + bq.setRentContractId(renevue.getRentContractId()); + bq.setShopEndtime(new Date()); + bq.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_REVENUE_SALES.getCode()); + wxAllBillMapper.deleteNoNeedPayBill(bq); + bq.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_TIAODIAN_HUISUAN.getCode()); + wxAllBillMapper.deleteNoNeedPayBill(bq); + } } diff --git a/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml b/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml index 70807994d..8db8896f2 100644 --- a/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml @@ -36,7 +36,6 @@ - @@ -53,7 +52,7 @@ `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`createtime`,`create_by`,`create_by_name`,`updatetime`,`update_by`,`update_by_name`, `price_detail`,`need_pay`,`receive_pay`,`history_receive_pay`,`pay`,`pay_way`,`pay_date`,`set_off`,`use_money`,`starttime`,`endtime`,`status`,`energy_fees_id`, `return_pay`,`bill_remark`,`last_owe_call_time`,`last_owe_call_user`,`receive_date`,`period`, - `is_preview`,`shop_info`,`rent_contract_id`,`rent_contract_agile_fees_type`,`property_contract_id`,`parent_bill_id`,`virtual_compose_id`,`parent_virtual_compose_id`, + `is_preview`,`shop_info`,`rent_contract_id`,`rent_contract_agile_fees_type`,`parent_bill_id`,`virtual_compose_id`,`parent_virtual_compose_id`, `energy_reading_calcuteId`,`energy_reading_id`,`extra_create_from`,`rent_area`,`can_edit`,`cus_name`,`fees_type` @@ -70,7 +69,6 @@ and `energy_fees_id` = #{energyFeesId} and `rent_contract_id` = #{rentContractId} and `rent_contract_agile_fees_type` = #{rentContractAgileFeesType} - and `property_contract_id` = #{propertyContractId} and `parent_bill_id` = #{parentBillId} and `virtual_compose_id` = #{virtualComposeId} and `parent_virtual_compose_id` = #{parentVirtualComposeId} @@ -143,12 +141,6 @@ #{ridItem} - - and property_contract_id in - - #{pidItem} - - and `status` in @@ -323,9 +315,6 @@ and rent_contract_id = #{rentContractId} - - and property_contract_id = #{propertyContractId} - and rent_contract_agile_fees_type = #{rentContractAgileFeesType} @@ -340,8 +329,14 @@ and rent_contract_id = #{rentContractId} - - and property_contract_id = #{propertyContractId} + + and energy_fees_id = #{energyFeesId} + + + and `energy_fees_id` in + + #{eidItem} + @@ -364,9 +359,6 @@ and rent_contract_id = #{rentContractId} - - and property_contract_id = #{propertyContractId} - @@ -374,9 +366,6 @@ where rent_contract_id = #{rentContractId} - - where property_contract_id = #{propertyContractId} - @@ -391,7 +380,7 @@ #{item.needPay},#{item.receivePay},#{item.historyReceivePay},#{item.pay},#{item.payWay},#{item.payDate},#{item.setOff},#{item.useMoney}, #{item.starttime},#{item.endtime},#{item.status},#{item.energyFeesId},#{item.returnPay},#{item.billRemark}, #{item.lastOweCallTime},#{item.lastOweCallUser}, - #{item.receiveDate},#{item.period},#{item.isPreview},#{item.shopInfo},#{item.rentContractId},#{item.rentContractAgileFeesType},#{item.propertyContractId}, + #{item.receiveDate},#{item.period},#{item.isPreview},#{item.shopInfo},#{item.rentContractId},#{item.rentContractAgileFeesType}, #{item.parentBillId},#{item.virtualComposeId},#{item.parentVirtualComposeId},#{item.energyReadingCalcuteId}, #{item.energyReadingId},#{item.extraCreateFrom},#{item.rentArea},#{item.canEdit},#{item.cusName},#{item.feesType} ) @@ -417,18 +406,12 @@ and rent_contract_id = #{rentContractId} - - and property_contract_id = #{propertyContractId} - update wx_all_bill set cus_name = #{cusName} where tenant_id = #{tenantId} and rent_contract_id = #{rentContractId} - - - and property_contract_id = #{propertyContractId} and( diff --git a/mallinkService/src/main/resources/mapper/WxRentContractAgileRenevueItemMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractAgileRenevueItemMapper.xml index 783a0b685..780fcfe99 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractAgileRenevueItemMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractAgileRenevueItemMapper.xml @@ -64,7 +64,7 @@ - delete from wx_rent_contract_agile_renevue_item where `renevue_id` = #{unDepositId} + delete from wx_rent_contract_agile_renevue_item where `renevue_id` = #{renevueId} diff --git a/mallinkService/src/main/resources/mapper/WxRentContractAgileUnDepositMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractAgileUnDepositMapper.xml index c7ad60a4f..aa2b873dd 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractAgileUnDepositMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractAgileUnDepositMapper.xml @@ -72,5 +72,9 @@ update wx_rent_contract_agile_un_deposit set join_renevue_up = #{joinRenevueUp} where id = #{id} + + delete from wx_rent_contract_agile_un_deposit where id = #{id} and `tenant_id` = #{tenantId} + +