| @@ -466,6 +466,11 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| } | |||
| List<Long> shopIdList = wxRentContract.shopIdsByRentInfo(); | |||
| WxShopUsers suq = new WxShopUsers(); | |||
| suq.updateTenantInfo(wxRentContract); | |||
| suq.setShopIds(shopIdList); | |||
| suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); | |||
| Map<Long, WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq); | |||
| List<WxAllBill> insertList = new ArrayList<WxAllBill>(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| @@ -476,6 +481,11 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| Long sid = shopIdList.get(j); | |||
| BigDecimal shoprentArea = shopAreaRateMap.get(sid); | |||
| BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); | |||
| WxShopUsers su = shopUserMap.get(sid); | |||
| String cusName = ""; | |||
| if (null != su) { | |||
| cusName = su.getName(); | |||
| } | |||
| WxAllBill wxBillDeposit = new WxAllBill(); | |||
| wxBillDeposit.setId(idWorker.nextId()); | |||
| @@ -494,7 +504,8 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| wxBillDeposit.setPeriod(WxRentContractHelper.getPeriod(wxRentContract.getRentalStartDate())); | |||
| wxBillDeposit.updateTenantInfo(wxRentContract); | |||
| wxBillDeposit.setShopId(sid); | |||
| wxBillDeposit.setRentArea(wxRentContract.getRentArea()); | |||
| wxBillDeposit.setCusName(cusName); | |||
| wxBillDeposit.setRentArea(shoprentArea.toPlainString()); | |||
| wxBillDeposit.setCreatetime(new Date()); | |||
| wxBillDeposit.setCreateBy(user.getId()); | |||
| wxBillDeposit.setCreateByName(user.getName()); | |||
| @@ -591,10 +591,21 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"无店铺信息"); | |||
| } | |||
| WxShopUsers suq = new WxShopUsers(); | |||
| suq.updateTenantInfo(wxPropertyContract); | |||
| suq.setShopIds(shopIds); | |||
| suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); | |||
| Map<Long, WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq); | |||
| for (int i = 0 ; i < shopIds.size(); i++) { | |||
| Long shopId = shopIds.get(i); | |||
| BigDecimal shoprentArea = shopAreaRateMap.get(shopId); | |||
| BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxPropertyContract.getRentArea()),wxPropertyContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); | |||
| WxShopUsers su = shopUserMap.get(shopId); | |||
| String cusName = ""; | |||
| if (null != su) { | |||
| cusName = su.getName(); | |||
| } | |||
| WxAllBill wxBillDeposit = new WxAllBill(); | |||
| wxBillDeposit.setId(idWorker.nextId()); | |||
| @@ -628,6 +639,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| wxBillDeposit.setPeriod(WxRentContractHelper.getPeriod(record.getFirstBillReceiveDate())); | |||
| wxBillDeposit.updateTenantInfo(wxPropertyContract); | |||
| wxBillDeposit.setShopId(shopId); | |||
| wxBillDeposit.setCusName(cusName); | |||
| wxBillDeposit.setCreatetime(date); | |||
| //wxBillDeposit.setCreateBy(user.getId()); | |||
| //wxBillDeposit.setCreateByName(user.getName()); | |||
| @@ -635,7 +647,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| //wxBillDeposit.setUpdateBy(user.getId()); | |||
| //wxBillDeposit.setUpdateByName(user.getName()); | |||
| wxBillDeposit.setShopInfo(getShopInfoStr(wxPropertyContract)); | |||
| wxBillDeposit.setRentArea(wxPropertyContract.getRentArea()); | |||
| wxBillDeposit.setRentArea(shoprentArea.toPlainString()); | |||
| wxBillDeposit.setEnergyFeesId(EnumBillAllType.PROPERTY_DEPOSIT.getEnergyFeesId()); | |||
| try { | |||
| wxAllBillMapper.insert(wxBillDeposit); | |||
| @@ -907,6 +919,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| rs.setNeedPay(new BigDecimal(rb.getNeedPay()).multiply(shoprate).toPlainString()); | |||
| rs.setReceivePay(rs.getNeedPay()); | |||
| rs.setShopId(sid); | |||
| rs.setRentArea(shoprentArea.toPlainString()); | |||
| if (null != shopUserMap ) { | |||
| WxShopUsers wsu = shopUserMap.get(sid); | |||
| if (null != wsu) { | |||
| @@ -902,6 +902,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| List<Long> shopIdList = wxRentContract.shopIdsByRentInfo(); | |||
| WxShopUsers suq = new WxShopUsers(); | |||
| suq.updateTenantInfo(wxRentContract); | |||
| suq.setShopIds(shopIdList); | |||
| suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); | |||
| Map<Long, WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq); | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| fq.updateTenantInfo(tenantEntity); | |||
| fq.setBillType(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| @@ -925,6 +931,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| Long sid = shopIdList.get(i); | |||
| BigDecimal shoprentArea = shopAreaRateMap.get(sid); | |||
| BigDecimal shoprate = shoprentArea.divide(new BigDecimal(wxRentContract.getRentArea()),wxRentContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); | |||
| WxShopUsers su = shopUserMap.get(sid); | |||
| String cusName = ""; | |||
| if (null != su) { | |||
| cusName = su.getName(); | |||
| } | |||
| WxAllBill wxBillDeposit = new WxAllBill(); | |||
| wxBillDeposit.setId(idWorker.nextId()); | |||
| @@ -962,7 +973,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //wxBillDeposit.setUserId(user.getId()); | |||
| } | |||
| wxBillDeposit.setShopId(sid); | |||
| wxBillDeposit.setRentArea(wxRentContract.getRentArea()); | |||
| wxBillDeposit.setCusName(cusName); | |||
| wxBillDeposit.setRentArea(shoprentArea.toPlainString()); | |||
| wxBillDeposit.setCreatetime(date); | |||
| if (null != user) { | |||
| wxBillDeposit.setCreateBy(user.getId()); | |||
| @@ -1470,6 +1482,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| rs.setNeedPay(new BigDecimal(rb.getNeedPay()).multiply(shoprate).toPlainString()); | |||
| rs.setReceivePay(rs.getNeedPay()); | |||
| rs.setShopId(sid); | |||
| rs.setRentArea(shoprentArea.toPlainString()); | |||
| if (null != shopUserMap ) { | |||
| WxShopUsers wsu = shopUserMap.get(sid); | |||
| if (null != wsu) { | |||
| @@ -1503,6 +1516,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| rs.setNeedPay(new BigDecimal(rb.getNeedPay()).multiply(shoprate).toPlainString()); | |||
| rs.setReceivePay(rs.getNeedPay()); | |||
| rs.setShopId(sid); | |||
| rs.setRentArea(shoprentArea.toPlainString()); | |||
| if (null != shopUserMap ) { | |||
| WxShopUsers wsu = shopUserMap.get(sid); | |||
| if (null != wsu) { | |||
| @@ -540,7 +540,8 @@ public class WxShopServiceImpl implements WxShopService { | |||
| @Override | |||
| public ResultData hasShopNumber(WxShop wxShop) { | |||
| int count = wxShopMapper.hasShopNumber(wxShop); | |||
| //int count = wxShopMapper.hasShopNumber(wxShop); | |||
| int count = 0; | |||
| return new ResultData(ResultData.SUCCESS, "查询成功", count > 0 ? true : false); | |||
| } | |||