| @@ -488,29 +488,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| Long shopId = rentInfoObject.getLong("id"); | |||
| //wxRentContract.setShopId(shopId); | |||
| String shopNumber = rentInfoObject.getString("shopNumber"); | |||
| // int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContract.getTenantId(),wxRentContract.getParentTenantId(),shopId,wxRentContract.getId()); | |||
| // if (count > 0) { | |||
| // return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); | |||
| // } | |||
| // if (record.getMerchantId() != null) { | |||
| // WxMerchantShop wxMerchantShop = new WxMerchantShop(); | |||
| // wxMerchantShop.setShopId(shopId); | |||
| // wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| // List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); | |||
| // long total = wxMerchantShopList.parallelStream(). | |||
| // filter(ms -> !ms.getMerchantId().equals(record.getMerchantId())).count(); | |||
| // if (total > 0) { | |||
| // return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); | |||
| // } | |||
| // } else { | |||
| // WxShop wxShop = wxShopMapper.selectById(shopId); | |||
| // if (wxShop == null) { | |||
| // return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 不存在"); | |||
| // } | |||
| // //if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | |||
| // // return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); | |||
| // //} | |||
| // } | |||
| if (!shopList.contains(shopId)) { | |||
| shopList.add(shopId); | |||
| shopName = shopName +","+ shopNumber; | |||
| @@ -578,7 +555,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //查询预账单用于展示 | |||
| WxAllBill wxBillRent = new WxAllBill(); | |||
| wxBillRent.setRentContractId(record.getId()); | |||
| wxBillRent.setSortColumns(BaseEntity.SortField.Period_ASC); | |||
| wxBillRent.setIsPreview(EnumIsPreview.YES.getCode()); | |||
| wxBillRent.updateTenantInfo(record); | |||
| List<WxAllBill> resultList = wxAllBillMapper.findList(wxBillRent); | |||
| @@ -866,49 +842,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); | |||
| } | |||
| wxRentContractQuery.setId(record.getId()); | |||
| //int count = wxRentContractMapper.selectRentContractCountByShopId(wxRentContractQuery.getTenantId(),wxRentContractQuery.getParentTenantId(),shopId,wxRentContractQuery.getId()); | |||
| //if (count > 0) { | |||
| // return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); | |||
| //} | |||
| // if (record.getMerchantId() != null) { | |||
| // WxMerchantShop wxMerchantShop = new WxMerchantShop(); | |||
| // wxMerchantShop.setShopId(shopId); | |||
| // wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| // List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); | |||
| // long total = wxMerchantShopList.parallelStream(). | |||
| // filter(ms -> !ms.getMerchantId().equals(record.getMerchantId())).count(); | |||
| // if (total > 0) { | |||
| // return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + shopNumber + " 已出租"); | |||
| // } | |||
| // } else { | |||
| // WxShop wxShop = wxShopMapper.selectById(shopId); | |||
| // if (wxShop == null) { | |||
| // return new ResultData(ErrorCode.SHOP_IS_NOT_FOUND.getCode(), "店铺 " + shopNumber + " 已删除"); | |||
| // } | |||
| //// if (wxShop.getStatus().equals(EnumShopStatus.RENT.getCode())) { | |||
| //// return new ResultData(ErrorCode.SHOP_IS_RENT.getCode(), "店铺 " + wxShop.getShopNumber() + " 已出租"); | |||
| //// } | |||
| // } | |||
| if (!shopList.contains(shopId)) { | |||
| shopList.add(shopId); | |||
| shopName = shopName +","+shopNumber; | |||
| } | |||
| } | |||
| // } else { | |||
| // WxRentContract wxRentContractQuery = new WxRentContract(); | |||
| // wxRentContractQuery.updateTenantInfo(record); | |||
| // wxRentContractQuery.setShopId(record.getShopId()); | |||
| //// long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream(). | |||
| //// filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) | |||
| //// || rc.get("status").equals(EnumRentContractStatus.PAING.getCode()) | |||
| //// || rc.get("status").equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count(); | |||
| // long count = wxRentContractMapper.queryRentContractData(wxRentContract).stream(). | |||
| // filter(rc -> rc.get("status").equals(EnumRentContractStatus.READY_FOR_PAING.getCode()) | |||
| // || rc.get("status").equals(EnumRentContractStatus.PAING.getCode())).count(); | |||
| // if (count > 0) { | |||
| // return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); | |||
| // } | |||
| // } | |||
| try { | |||
| Date tempDate = record.getRentalStartDate(); | |||
| @@ -1649,6 +1587,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxBillRent.setIsPreview(isPreview); | |||
| wxBillRent.setId(idWorker.nextId()); | |||
| wxBillRent.setRentContractId(wxRentContract.getId()); | |||
| wxBillRent.setRentShopType(wxRentContract.getRentShopType()); | |||
| wxBillRent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| wxBillRent.setBillType(EnumBillAllType.RENT.getCode()); | |||
| wxBillRent.setPay("0"); | |||
| wxBillRent.setStarttime(billTimeVo.getStartDate()); | |||
| @@ -1722,7 +1662,21 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| private WxAllBill setManageRent(Integer decimalSize,WxAllBill wxBillRent,EnumRentContractManageFeeType feeType,String needPay,Integer serviceChargeRate,int dayType,int receivePeriod) { | |||
| WxAllBill manage = new WxAllBill(); | |||
| //manage.initByBillRent(wxBillRent); | |||
| manage.setRentContractId(wxBillRent.getRentContractId()); | |||
| manage.setPay(wxBillRent.getPay()); | |||
| manage.setStarttime(wxBillRent.getStarttime()); | |||
| manage.setEndtime(wxBillRent.getEndtime()); | |||
| manage.updateTenantInfo(wxBillRent); | |||
| manage.setIsPreview(wxBillRent.getIsPreview()); | |||
| manage.setMerchantId(wxBillRent.getMerchantId()); | |||
| manage.setCreatetime(wxBillRent.getCreatetime()); | |||
| manage.setCreateBy(wxBillRent.getCreateBy()); | |||
| manage.setCreateByName(wxBillRent.getCreateByName()); | |||
| manage.setUpdateBy(wxBillRent.getUpdateBy()); | |||
| manage.setUpdatetime(wxBillRent.getUpdatetime()); | |||
| manage.setUpdateByName(wxBillRent.getUpdateByName()); | |||
| manage.setRentShopType(wxBillRent.getRentShopType()); | |||
| manage.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| if (feeType.getCode().intValue() == EnumRentContractManageFeeType.RENT_BUSSINESS_MANAGE_FEE.getCode().intValue()){ | |||
| manage.setEnergyFeesId(EnumBillAllType.RENT_BUSSINESS_MANAGE.getEnergyFeesId()); | |||
| manage.setBillType(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| @@ -1732,11 +1686,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxBillRent.setId(idWorker.nextId()); | |||
| //manage.setManageFeeType(feeType.getCode()); | |||
| manage.setNeedPay(needPay); | |||
| manage.setReceivePay(needPay); | |||
| //manage.setOwe(needPay); | |||
| //setManageExpiredDay(manage,dayType,receivePeriod); | |||
| //计算手续费 | |||
| //BigDecimal servicePay = new BigDecimal(needPay).multiply(new BigDecimal(serviceChargeRate)).divide(new BigDecimal(10000), decimalSize, BigDecimal.ROUND_HALF_UP); | |||
| //manage.setServiceChargePay(servicePay.toPlainString()); | |||