diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java index e3f141181..5fe60d385 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java @@ -814,7 +814,10 @@ public class WxRentContractController extends WxContractBaseController { if (null == rentContract) { return new ResultData(Result.ERROR, "编号["+wxRentContract.getId()+"]未找到租金合同"); } - return new ResultData(wxRentContractService.setRevenueSales(rentContract,wxRentContract.getSalesMoney(),wxRentContract.getBillId(),wxRentContract.getPropertyContractId())); + if (null == rentContract.getSalesStartTime() || null == rentContract.getSalesEndTime()) { + return new ResultData(Result.ERROR, "时间不能为空"); + } + return new ResultData(wxRentContractService.setRevenueSales(rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime(),wxRentContract.getPropertyContractId())); } //查询合同年限 diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java index 2c7d35d4d..8a1ccb581 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -573,5 +573,9 @@ public class WxRentContract extends TenantEntity { List contractDepositList; @TableField(exist = false) private Long queryShopId; + @TableField(exist = false) + private Date salesStartTime; + @TableField(exist = false) + private Date salesEndTime; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index ea07d1bb9..654b98e16 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -2995,12 +2995,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { } BigDecimal receivepay = new BigDecimal(0); + //查询合同租金所有应收的账单 //查询所有租金+营业管理费+商业管理费账单的信息,因为设置销售额会自动的创建或者更新对应的账单 WxAllBill rentBillq = new WxAllBill(); rentBillq.updateTenantInfo(rentcontract); rentBillq.setRentContractId(rentcontract.getId()); - //rentBillq.setBillType(EnumBillAllType.RENT.getCode()); - //rentBillq.setEnergyFeesId(EnumBillAllType.RENT.getEnergyFeesId()); List feesIdList = new ArrayList(); feesIdList.add(EnumBillAllType.RENT.getEnergyFeesId()); feesIdList.add(EnumBillAllType.RENT_BUSSINESS_MANAGE.getEnergyFeesId()); @@ -3014,36 +3013,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { receivepay = receivepay.add(rentBillSum.getNeedPayNumber()); } - //查询对应的物业账单 + //查询对应的物业账单,包括录入销售额自动生成的 if (null != rentcontract.getPropertyContractId()) { - /** - WxPropertyContract bq = new WxPropertyContract(); - bq.updateTenantInfo(rentcontract); - bq.setMerchantId(rentcontract.getMerchantId()); - bq.setRentContractId(rentcontract.getId()); - bq.setOperationType(EnumContractOperationType.WHOLE.getCode()); - List statusList = new ArrayList(); - //包括提前终止的,租金+物业合同是一对一的 - statusList.add(EnumRentContractStatus.PAING.getCode()); - statusList.add(EnumRentContractStatus.TERMINATE.getCode()); - bq.setStatuss(statusList); - //bq.setStatus(EnumRentContractStatus.PAING.getCode()); - List propertyList = wxPropertyContractService.findList(bq); - if (null != propertyList && propertyList.size() > 0 ) { - WxPropertyContract pc = propertyList.get(0); - WxAllBill propertyBillq = new WxAllBill(); - propertyBillq.updateTenantInfo(rentcontract); - propertyBillq.setPropertyContractId(pc.getId()); - propertyBillq.setBillType(EnumBillAllType.PROPERTY.getCode()); - propertyBillq.setEnergyFeesId(EnumBillAllType.PROPERTY.getEnergyFeesId()); - propertyBillq.setIsPreview(EnumYesOrNo.NO.getCode()); - propertyBillq.setStarttime(rentcontract.getYearsBegin()); - propertyBillq.setEndtime(rentcontract.getYearsEnd()); - WxBillSum propertyBillSum = wxAllBillMapper.getBillMonthSum(propertyBillq); - if (null != propertyBillSum) { - receivepay = receivepay.add(propertyBillSum.getNeedPayNumber()); - } - }*/ WxAllBill propertyBillq = new WxAllBill(); propertyBillq.updateTenantInfo(rentcontract); propertyBillq.setPropertyContractId(rentcontract.getPropertyContractId()); @@ -3052,30 +3023,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { propertyBillq.setIsPreview(EnumYesOrNo.NO.getCode()); propertyBillq.setStarttime(rentcontract.getYearsBegin()); propertyBillq.setEndtime(rentcontract.getYearsEnd()); + //prpoertyBillq.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_REVENUE_SALES.getCode()); WxBillSum propertyBillSum = wxAllBillMapper.getBillMonthSum(propertyBillq); if (null != propertyBillSum) { receivepay = receivepay.add(propertyBillSum.getNeedPayNumber()); } } - //查询设置销售额增加的物业账单 - if (null != rentcontract.getPropertyContractId()) { - WxAllBill prpoertyBillq = new WxAllBill(); - prpoertyBillq.updateTenantInfo(rentcontract); - prpoertyBillq.setRentContractId(rentcontract.getId()); - prpoertyBillq.setPropertyContractId(rentcontract.getPropertyContractId()); - prpoertyBillq.setBillType(EnumBillAllType.PROPERTY.getCode()); - prpoertyBillq.setEnergyFeesId(EnumBillAllType.PROPERTY.getEnergyFeesId()); - prpoertyBillq.setIsPreview(EnumYesOrNo.NO.getCode()); - prpoertyBillq.setStarttime(rentcontract.getYearsBegin()); - prpoertyBillq.setEndtime(rentcontract.getYearsEnd()); - prpoertyBillq.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_REVENUE_SALES.getCode()); - WxBillSum propertyBillSum = wxAllBillMapper.getBillMonthSum(prpoertyBillq); - if (null != propertyBillSum) { - receivepay = receivepay.add(propertyBillSum.getNeedPayNumber()); - } - } - WxRentContractYearsSumVo vo = new WxRentContractYearsSumVo(); vo.setTotalSales(sum.toPlainString()); vo.setTotalRevenue(jumpRevenuePay.toPlainString());