winter 1 год назад
Родитель
Сommit
ac63e8be79
3 измененных файлов: 48 добавлений и 32 удалений
  1. +0
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxAgileContractController.java
  2. +45
    -12
      mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java
  3. +3
    -18
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 0
- 2
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxAgileContractController.java Просмотреть файл

@@ -479,8 +479,6 @@ public class WxAgileContractController extends WxContractBaseController {
rentContract.setSignDate(wxRentContract.getSignDate()); rentContract.setSignDate(wxRentContract.getSignDate());
rentContract.setStartDate(wxRentContract.getStartDate()); rentContract.setStartDate(wxRentContract.getStartDate());
rentContract.setEndDate(wxRentContract.getStartDate()); rentContract.setEndDate(wxRentContract.getStartDate());
rentContract.setFixStartDate(wxRentContract.getFixStartDate());
rentContract.setFixEndDate(wxRentContract.getFixEndDate());
try { try {
rentContractValidShop(rentContract); rentContractValidShop(rentContract);


+ 45
- 12
mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java Просмотреть файл

@@ -1031,8 +1031,6 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
} }
} }
//WxContractCustomers ccq = new WxContractCustomers();
WxRentContractAgileDeposit cadq = new WxRentContractAgileDeposit(); WxRentContractAgileDeposit cadq = new WxRentContractAgileDeposit();
cadq.updateTenantInfo(rentContract); cadq.updateTenantInfo(rentContract);
cadq.setRentContractId(rentContract.getId()); cadq.setRentContractId(rentContract.getId());
@@ -1092,9 +1090,50 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
} }
} }
// WxRentContractRevenue
// WxRentContractRevenueItem
// WxRentContractRevenueFees
WxRentContractAgileRenevue rq = new WxRentContractAgileRenevue();
rq.updateTenantInfo(rentContract);
rq.setRentContractId(rentContract.getId());
List<WxRentContractAgileRenevue> renevueList = wxRentContractAgileRenevueMapper.findList(rq);
Long renevueId = null;
if (null != renevueList && renevueList.size() > 0 ) {
for (int i = 0 ; i < renevueList.size() ; i++) {
WxRentContractAgileRenevue ar = renevueList.get(i);
ar.setRentContractId(newContractId);
ar.setId(idWorker.nextId());
ar.setCreatetime(new Date());
ar.setUpdatetime(new Date());
wxRentContractAgileRenevueMapper.insert(ar);
renevueId = ar.getId();
}
}
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());
wxRentContractAgileRenevueItemMapper.insert(ari);
}
WxRentContractAgileRenevueFees fq = new WxRentContractAgileRenevueFees();
fq.updateTenantInfo(rentContract);
fq.setRentContractId(rentContract.getId());
List<WxRentContractAgileRenevueFees> renevueFeesList = wxRentContractAgileRenevueFeesMapper.findList(fq);
if (null != renevueFeesList && renevueFeesList.size() > 0 && null != renevueId ) {
for (int i = 0 ; i < renevueFeesList.size() ; i++) {
WxRentContractAgileRenevueFees arf = renevueFeesList.get(i);
arf.setRentContractId(newContractId);
arf.setAgileRenevueId(renevueId);
arf.setId(idWorker.nextId());
arf.setCreatetime(new Date());
arf.setUpdatetime(new Date());
wxRentContractAgileRenevueFeesMapper.insert(arf);
}
}
WxRentContractRevenueJump crjq = new WxRentContractRevenueJump(); WxRentContractRevenueJump crjq = new WxRentContractRevenueJump();
crjq.updateTenantInfo(rentContract); crjq.updateTenantInfo(rentContract);
@@ -1118,17 +1157,11 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
rentContract.setUpdatetime(new Date()); rentContract.setUpdatetime(new Date());
rentContract.setUpdateBy(user.getId()); rentContract.setUpdateBy(user.getId());
rentContract.setUpdateByName(user.getName()); rentContract.setUpdateByName(user.getName());
rentContract.setStatus(EnumRentContractStatus.DRAFT.getCode());
rentContract.setStatus(EnumRentContractStatus.UNWRITE.getCode());
rentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode()); rentContract.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
rentContract.setEndContractTime(null); rentContract.setEndContractTime(null);
//rentContract.setFirstBillDateStart(null);
//rentContract.setFirstBillDateEnd(null);
//rentContract.setFirstBillReceiveDate(null);
int[] array = DateUtils.getDiff(rentContract.getRentalStartDate(),rentContract.getRentalEndDate()); int[] array = DateUtils.getDiff(rentContract.getRentalStartDate(),rentContract.getRentalEndDate());
rentContract.setLease(array[0]); rentContract.setLease(array[0]);
//rentContract.setAdjustRatio();
//rentContract.setRevenueRatioSet();
//rentContract.set
wxRentContractMapper.insert(rentContract); wxRentContractMapper.insert(rentContract);
} }


+ 3
- 18
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -1111,7 +1111,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxRentContractAgileRenevueFees fee = fees.get(i); WxRentContractAgileRenevueFees fee = fees.get(i);
//更新账单费用 //更新账单费用
BigDecimal fneedpay = new BigDecimal(needpay).multiply(new BigDecimal(fee.getRate()).divide(new BigDecimal(100))).setScale(rentcontract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); BigDecimal fneedpay = new BigDecimal(needpay).multiply(new BigDecimal(fee.getRate()).divide(new BigDecimal(100))).setScale(rentcontract.getDecimalSize(),BigDecimal.ROUND_HALF_UP);
List<WxAllBill> renBill = generateRenevueBill(user,shopIdList,shopMap,shopUserMap,shopAreaRateMap,rentcontract,fneedpay,fee.getRate(),startDate,endDate,createFrom);
List<WxAllBill> renBill = generateRenevueBill(fee.getFeesId(),user,shopIdList,shopMap,shopUserMap,shopAreaRateMap,rentcontract,fneedpay,fee.getRate(),startDate,endDate,createFrom);
allbill.addAll(renBill); allbill.addAll(renBill);
} }
@@ -1121,22 +1121,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return vo; return vo;
} }
private void createBillAction(WxAllBill bill,String oldMoney,String newMoney,MallUserInfo user) {
WxBillAction wxBillAction = new WxBillAction();
wxBillAction.setBillId(bill.getId());
//wxBillAction.setBillType(bill.getBillType());
wxBillAction.setOldMoney(oldMoney);
wxBillAction.setNewMoney(newMoney);
wxBillAction.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldMoney, newMoney,null,null,null,null));
wxBillAction.setAction(EnumBillAction.UPDATE_BILL.getCode());
wxBillAction.setRemark(bill.getBillRemark());
wxBillAction.setUserType(EnumSystemUserType.ADMIN.getCode());
wxBillActionService.modifyBill(wxBillAction, user);
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public List<WxAllBill> generateRenevueBill(MallUserInfo user,List<Long> shopIds,Map<Long, WxShop> shopMap,Map<Long,WxShopUsers> shopUserMap,Map<Long, BigDecimal> shopAreaRateMap,WxRentContract rentcontract,
public List<WxAllBill> generateRenevueBill(Long feesId,MallUserInfo user,List<Long> shopIds,Map<Long, WxShop> shopMap,Map<Long,WxShopUsers> shopUserMap,Map<Long, BigDecimal> shopAreaRateMap,WxRentContract rentcontract,
BigDecimal moneyb,String rate,Date starttime,Date endtime,EnumBillExtraCreateFrom createFrom) { BigDecimal moneyb,String rate,Date starttime,Date endtime,EnumBillExtraCreateFrom createFrom) {
List<WxAllBill> billList = new ArrayList<WxAllBill>(); List<WxAllBill> billList = new ArrayList<WxAllBill>();
for (int i = 0 ; i < shopIds.size(); i++) { for (int i = 0 ; i < shopIds.size(); i++) {
@@ -1149,8 +1135,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
bmbill.setId(idWorker.nextId()); bmbill.setId(idWorker.nextId());
bmbill.updateTenantInfo(rentcontract); bmbill.updateTenantInfo(rentcontract);
//bmbill.setBillType(EnumBillAllType.RENT.getCode());
//bmbill.setEnergyFeesId(EnumBillAllType.RENT.getEnergyFeesId());
bmbill.setEnergyFeesId(feesId);
bmbill.setRentContractId(rentcontract.getId()); bmbill.setRentContractId(rentcontract.getId());
bmbill.setIsPreview(EnumYesOrNo.NO.getCode()); bmbill.setIsPreview(EnumYesOrNo.NO.getCode());
bmbill.setCanEdit(EnumYesOrNo.NO.getCode()); bmbill.setCanEdit(EnumYesOrNo.NO.getCode());


Загрузка…
Отмена
Сохранить