Browse Source

fix

release_toaliyun_real
winter 1 year ago
parent
commit
a612b8a6f9
3 changed files with 41 additions and 10 deletions
  1. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java
  2. +33
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  3. +6
    -0
      mallinkService/src/main/resources/mapper/WxAllBillMapper.xml

+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java View File

@@ -364,4 +364,6 @@ public class WxAllBill extends TenantEntity {
public Integer noExtraCreateFrom;
@TableField(exist = false)
private Integer needPayNoDays;
@TableField(exist = false)
public List<Long> energyFeesIds;
}

+ 33
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java View File

@@ -2570,11 +2570,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
billDel.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_REVENUE_SALES.getCode());
billDel.setStarttimeEqual(rentBill.getStarttime());
wxAllBillMapper.deleteByRentReveneuSales(billDel);
if (null != propertyContractId) {
billDel.setRentContractId(null);
billDel.setPropertyContractId(propertyContractId);
wxAllBillMapper.deleteByRentReveneuSales(billDel);
}
//加上物业
WxAllBill propertyBill = null;
@@ -2874,6 +2869,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
bmbill.updateTenantInfo(rentcontract);
bmbill.setBillType(EnumBillAllType.PROPERTY.getCode());
bmbill.setEnergyFeesId(EnumBillAllType.PROPERTY.getEnergyFeesId());
bmbill.setRentContractId(rentcontract.getId());
bmbill.setPropertyContractId(propertyContractId);
bmbill.setIsPreview(EnumYesOrNo.NO.getCode());
bmbill.setMerchantId(rentcontract.getMerchantId());
@@ -2946,7 +2942,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxAllBill billd = new WxAllBill();
billd.updateTenantInfo(rentcontract);
billd.setRentContractId(rentcontract.getId());
//删除这个时间的,因为可能之前有了账单。,然后撤铺,结束时间虽然不一样,开始时间是一致的。
//删除这个时间的,不设置结束时间,因为可能之前有了账单。,然后撤铺,结束时间虽然不一样,开始时间是一致的。
billd.setStarttimeEqual(rentcontract.getYearsBegin());
billd.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_TIAODIAN_HUISUAN.getCode());
wxAllBillMapper.deleteByRentHuiSuan(billd);
@@ -2968,12 +2964,17 @@ 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());
//rentBillq.setBillType(EnumBillAllType.RENT.getCode());
//rentBillq.setEnergyFeesId(EnumBillAllType.RENT.getEnergyFeesId());
List<Long> feesIdList = new ArrayList<Long>();
feesIdList.add(EnumBillAllType.RENT.getEnergyFeesId());
feesIdList.add(EnumBillAllType.RENT_BUSSINESS_MANAGE.getEnergyFeesId());
feesIdList.add(EnumBillAllType.RENT_OPERATION_MANAGE.getEnergyFeesId());
rentBillq.setEnergyFeesIds(feesIdList);
rentBillq.setIsPreview(EnumYesOrNo.NO.getCode());
rentBillq.setStarttime(rentcontract.getYearsBegin());
rentBillq.setEndtime(rentcontract.getYearsEnd());
@@ -2988,6 +2989,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
receivepay = receivepay.add(rentBillSum.getNeedPayNumber());
}
//查询对应的物业账单
WxPropertyContract bq = new WxPropertyContract();
bq.updateTenantInfo(rentcontract);
bq.setMerchantId(rentcontract.getMerchantId());
@@ -3005,12 +3007,33 @@ public class WxRentContractServiceImpl implements WxRentContractService {
propertyBillq.setIsPreview(EnumYesOrNo.NO.getCode());
propertyBillq.setStarttimeEqual(rentcontract.getYearsBegin());
propertyBillq.setEndtimeEqual(rentcontract.getYearsEnd());
WxBillSum propertyBillSum = wxAllBillMapper.getBillMonthSum(rentBillq);
WxBillSum propertyBillSum = wxAllBillMapper.getBillMonthSum(propertyBillq);
if (null != propertyBillSum) {
receivepay = receivepay.add(propertyBillSum.getNeedPayNumber());
}
}
//查询设置销售额增加的物业账单
WxAllBill prpoertyBillq = new WxAllBill();
prpoertyBillq.updateTenantInfo(rentcontract);
prpoertyBillq.setRentContractId(rentcontract.getId());
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());
List<Integer> propertyStatus = new ArrayList<Integer>();
propertyStatus.add(EnumBillStatus.WAIT_PAY.getCode());
propertyStatus.add(EnumBillStatus.PAID.getCode());
propertyStatus.add(EnumBillStatus.BAD.getCode());
propertyStatus.add(EnumBillStatus.STOP_TO_SETTLE.getCode());
prpoertyBillq.setStatusList(propertyStatus);
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());


+ 6
- 0
mallinkService/src/main/resources/mapper/WxAllBillMapper.xml View File

@@ -125,6 +125,12 @@
<if test=" 0 == hasParentBillId ">and `parent_bill_id` is null</if>
<if test=" null != energyReadingCalcuteId ">and `energy_reading_calcuteId` = #{energyReadingCalcuteId}</if>
<if test=" null != energyReadingId ">and `energy_reading_id` = #{energyReadingId}</if>
<if test=" null != energyFeesIds ">
and `energy_fees_id` in
<foreach collection="energyFeesIds" index="index" item="eidItem" open="(" separator="," close=")">
#{eidItem}
</foreach>
</if>
<if test=" null != rentContractIdList ">
and `rent_contract_id` in
<foreach collection="rentContractIdList" index="index" item="ridItem" open="(" separator="," close=")">


Loading…
Cancel
Save