| @@ -84,6 +84,7 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| } | } | ||||
| PageInfo<WxRentContract> page = wxAgileContractService.getRentContractList(wxRentContract, pageNum, pageSize); | PageInfo<WxRentContract> page = wxAgileContractService.getRentContractList(wxRentContract, pageNum, pageSize); | ||||
| Integer hasFlow = null; | Integer hasFlow = null; | ||||
| Integer hasFlowValidEdit = null; | |||||
| if (null != page && null != page.getList()) { | if (null != page && null != page.getList()) { | ||||
| for (WxRentContract wrc: page.getList()) { | for (WxRentContract wrc: page.getList()) { | ||||
| if (null == hasFlow) { | if (null == hasFlow) { | ||||
| @@ -94,9 +95,17 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| } | } | ||||
| } | } | ||||
| wrc.setFlowHas(hasFlow); | wrc.setFlowHas(hasFlow); | ||||
| if (null == hasFlowValidEdit) { | |||||
| if(rentContractHasEditValidWorkFlow(wrc)) { | |||||
| hasFlowValidEdit = 1; | |||||
| }else { | |||||
| hasFlowValidEdit = 0; | |||||
| } | |||||
| } | |||||
| wrc.setFlowHasValidEdit(hasFlowValidEdit); | |||||
| } | } | ||||
| } | } | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -138,64 +147,140 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| public ResultData saveOrUpdate(@RequestBody WxRentContract wxRentContract) { | public ResultData saveOrUpdate(@RequestBody WxRentContract wxRentContract) { | ||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxRentContract.updateTenantInfo(user); | wxRentContract.updateTenantInfo(user); | ||||
| //wxRentContract.setAgileType(EnumRentAgileType.AGILE.getCode()); | |||||
| if (null == wxRentContract.getDayPriceCalcute()) { | |||||
| return new ResultData(Result.ERROR,"请选择日均单价计费规则"); | |||||
| //如果是修改,并且合同是生效的,则不允许 | |||||
| if (null != wxRentContract.getId()) { | |||||
| WxRentContract r = wxAgileContractService.selectById(wxRentContract.getId()); | |||||
| if (r.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() || | |||||
| r.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { | |||||
| }else { | |||||
| return new ResultData(Result.ERROR,"该状态不允许修改"); | |||||
| } | |||||
| } | |||||
| try { | |||||
| handleSaveData(wxRentContract); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| return wxAgileContractService.saveOrUpdate(wxRentContract, user); | |||||
| } | |||||
| private void handleSaveData(WxRentContract wxRentContract) { | |||||
| if (null == wxRentContract.getDayPriceCalcute()) { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择日均单价计费规则"); | |||||
| } | } | ||||
| //以前合同必填的数据初始化 | //以前合同必填的数据初始化 | ||||
| wxRentContract.setDecimalSize(2); | |||||
| //wxRentContract.setDecimalSize(2); | |||||
| if (null == wxRentContract.getRentalStartDate()) { | if (null == wxRentContract.getRentalStartDate()) { | ||||
| return new ResultData(Result.ERROR,"请选择合同开始日期"); | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择合同开始日期"); | |||||
| } | } | ||||
| if (null == wxRentContract.getRentalEndDate()) { | if (null == wxRentContract.getRentalEndDate()) { | ||||
| return new ResultData(Result.ERROR,"请选择合同结束日期"); | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择合同结束日期"); | |||||
| } | } | ||||
| int[] array = DateUtils.getDiff(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate()); | int[] array = DateUtils.getDiff(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate()); | ||||
| wxRentContract.setLease(array[0]); | wxRentContract.setLease(array[0]); | ||||
| if (null == wxRentContract.getSignDate()) { | if (null == wxRentContract.getSignDate()) { | ||||
| return new ResultData(Result.ERROR,"请选择合同签约日期"); | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择合同签约日期"); | |||||
| } | } | ||||
| wxRentContract.setStartDate(wxRentContract.getRentalStartDate()); | |||||
| wxRentContract.setEndDate(wxRentContract.getRentalEndDate()); | |||||
| String rentInfo = wxRentContract.getRentInfo(); | String rentInfo = wxRentContract.getRentInfo(); | ||||
| if (StringUtils.isBlank(rentInfo)) { | if (StringUtils.isBlank(rentInfo)) { | ||||
| return new ResultData(Result.ERROR,"请选择铺位"); | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择铺位"); | |||||
| } | } | ||||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | ||||
| int size = rentInfoArray.size(); | int size = rentInfoArray.size(); | ||||
| if (size == 0) { | if (size == 0) { | ||||
| return new ResultData(ErrorCode.SHOP_NOT_SELECTED); | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"请选择店铺"); | |||||
| } | } | ||||
| List<Long> shopList = Lists.newArrayList(); | List<Long> shopList = Lists.newArrayList(); | ||||
| //查询rent_info 包括 shopId | //查询rent_info 包括 shopId | ||||
| String shopIdStr = ""; | |||||
| //String shopIdStr = ""; | |||||
| BigDecimal rentAreaDecimal = new BigDecimal(0); | BigDecimal rentAreaDecimal = new BigDecimal(0); | ||||
| for (int i = 0; i < size; i++) { | for (int i = 0; i < size; i++) { | ||||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | ||||
| Long shopId = rentInfoObject.getLong("id"); | Long shopId = rentInfoObject.getLong("id"); | ||||
| //wxRentContract.setShopId(shopId); | |||||
| String shopNumber = rentInfoObject.getString("shopNumber"); | |||||
| //String shopNumber = rentInfoObject.getString("shopNumber"); | |||||
| if (!shopList.contains(shopId)) { | if (!shopList.contains(shopId)) { | ||||
| shopList.add(shopId); | shopList.add(shopId); | ||||
| shopIdStr = shopIdStr +","+ shopId; | |||||
| //shopIdStr = shopIdStr +","+ shopId; | |||||
| } | } | ||||
| String rentArea = rentInfoObject.getString("operationArea"); | String rentArea = rentInfoObject.getString("operationArea"); | ||||
| if (StringUtils.isNotBlank(rentArea)) { | if (StringUtils.isNotBlank(rentArea)) { | ||||
| rentAreaDecimal = rentAreaDecimal.add(new BigDecimal(rentArea)); | rentAreaDecimal = rentAreaDecimal.add(new BigDecimal(rentArea)); | ||||
| } | } | ||||
| } | } | ||||
| Collections.sort(shopList); | |||||
| wxRentContract.setRentArea(rentAreaDecimal.toPlainString()); | wxRentContract.setRentArea(rentAreaDecimal.toPlainString()); | ||||
| wxRentContract.setShopIdStr(shopIdStr); | |||||
| wxRentContract.setShopIdStr(StringUtils.join(shopList,",")); | |||||
| try { | try { | ||||
| rentContractValidShop(wxRentContract); | rentContractValidShop(wxRentContract); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||||
| } | } | ||||
| } | |||||
| /** | |||||
| * 生效中合同修改 | |||||
| * @param wxRentContract | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("updateValidContract") | |||||
| public ResultData updateValidContract(@RequestBody WxRentContract wxRentContract) { | |||||
| MallUserInfo user = getUser(); | |||||
| wxRentContract.updateTenantInfo(user); | |||||
| //只能改生效的合同 | |||||
| WxRentContract r = wxAgileContractService.selectById(wxRentContract.getId()); | |||||
| if (!isValidContract(r)) { | |||||
| return new ResultData(Result.ERROR,"该状态不允许修改"); | |||||
| } | |||||
| return wxAgileContractService.saveOrUpdate(wxRentContract, user); | |||||
| try { | |||||
| handleSaveData(wxRentContract); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| //更新合同信息 | |||||
| ResultData result = wxAgileContractService.saveOrUpdate(wxRentContract, user); | |||||
| if (result.code != Result.SUCCESS) { | |||||
| return new ResultData(result.code,result.message); | |||||
| } | |||||
| //如果更改了合同时间,店铺,类型,每天计价规则,每月平均天数,计租面积,则需要重置 | |||||
| if (isNeedRebuildBill(wxRentContract,r)) { | |||||
| try { | |||||
| wxAgileContractService.reSetContract(wxRentContract, user); | |||||
| return new ResultData(); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| private boolean isValidContract(WxRentContract r) { | |||||
| if (r.getStatus().intValue() == EnumRentContractStatus.READY_FOR_PAING.getCode().intValue() || | |||||
| r.getStatus().intValue() == EnumRentContractStatus.PAING.getCode().intValue()) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| private boolean isNeedRebuildBill(WxRentContract wxRentContract,WxRentContract dbContract) { | |||||
| if (!wxRentContract.getRentalStartDate().equals(dbContract.getRentalStartDate()) | |||||
| || !wxRentContract.getRentalEndDate().equals(dbContract.getRentalEndDate()) | |||||
| || !wxRentContract.getShopIdStr().equals(dbContract.getShopIdStr()) | |||||
| || !wxRentContract.getRentArea().equals(dbContract.getRentArea()) | |||||
| || wxRentContract.getType().intValue() != dbContract.getType().intValue() | |||||
| || wxRentContract.getDayPriceCalcute().intValue() != dbContract.getDayPriceCalcute().intValue() | |||||
| || wxRentContract.getMonthAverageDays().intValue() != dbContract.getMonthAverageDays().intValue()) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -250,6 +335,16 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| return new ResultData(Result.ERROR,"请至少增加一个"); | return new ResultData(Result.ERROR,"请至少增加一个"); | ||||
| } | } | ||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | wxRentContract.updateTenantInfo(getTenantInfo()); | ||||
| //如果是生效的合同变更,此时变更押金,则需要清空当前时间之后未处理的账单 | |||||
| WxRentContract r = wxAgileContractService.selectById(wxRentContract.getId()); | |||||
| if (isValidContract(r)) { | |||||
| try { | |||||
| wxAgileContractService.endContractDespoitBill(r,this.getUser()); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,"保存信息失败:"+e.getMessage()); | |||||
| } | |||||
| } | |||||
| try { | try { | ||||
| wxAgileContractService.saveDeposit(wxRentContract,this.getUser()); | wxAgileContractService.saveDeposit(wxRentContract,this.getUser()); | ||||
| }catch(Exception e) { | }catch(Exception e) { | ||||
| @@ -344,6 +439,124 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| return new ResultData(wxAgileContractService.findUnDepositList(unDeposit)); | return new ResultData(wxAgileContractService.findUnDepositList(unDeposit)); | ||||
| } | } | ||||
| /** | |||||
| * 删除非押金 | |||||
| * @param unDeposit | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("deleteUnDeposit") | |||||
| public ResultData deleteUnDeposit(@RequestBody WxRentContractAgileUnDeposit unDeposit) { | |||||
| unDeposit.updateTenantInfo(getTenantInfo()); | |||||
| if (null == unDeposit.getItems() || unDeposit.getItems().size() <= 0 ) { | |||||
| return new ResultData(Result.ERROR,"无细项"); | |||||
| } | |||||
| //如果是生效的合同删除 | |||||
| WxRentContract r = wxAgileContractService.selectById(unDeposit.getRentContractId()); | |||||
| if (isValidContract(r)) { | |||||
| wxAgileContractService.endContractUnDespositBill(unDeposit,this.getUser()); | |||||
| } | |||||
| try { | |||||
| wxAgileContractService.deleteUnDeposit(unDeposit); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,"保存账单失败:"+e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| /** | |||||
| * 设置联营扣点 | |||||
| */ | |||||
| @PostMapping("setRenevue") | |||||
| public ResultData setRenevue(@RequestBody WxRentContractAgileRenevue renevue) { | |||||
| renevue.updateTenantInfo(getTenantInfo()); | |||||
| if (null == renevue.getItems() || renevue.getItems().size() <= 0 ) { | |||||
| return new ResultData(Result.ERROR,"无细项"); | |||||
| } | |||||
| if (null == renevue.getFees() || renevue.getFees().size() <= 0 ) { | |||||
| return new ResultData(Result.ERROR,"请选择款项"); | |||||
| } | |||||
| //一个合同只能有一条记录 | |||||
| WxRentContractAgileRenevue _ore = wxAgileContractService.findRenevueByContract(renevue.getRentContractId(),renevue); | |||||
| if (null != _ore) { | |||||
| renevue.setId(_ore.getId()); | |||||
| } | |||||
| //如果是生效的合同变更 | |||||
| WxRentContract r = wxAgileContractService.selectById(renevue.getRentContractId()); | |||||
| if (isValidContract(r)) { | |||||
| wxAgileContractService.endContractRenevueBill(renevue); | |||||
| } | |||||
| try { | |||||
| wxAgileContractService.saveRenuvue(renevue); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,"保存信息失败:"+e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| /** | |||||
| * 设置联营扣点跳点 | |||||
| */ | |||||
| @PostMapping("setRenevueJump") | |||||
| public ResultData setRenevueJump(@RequestBody WxRentContract contract) { | |||||
| contract.updateTenantInfo(getTenantInfo()); | |||||
| if (null == contract.getRevenueJumps() || contract.getRevenueJumps().size() <= 0 ) { | |||||
| return new ResultData(Result.ERROR,"无配置项"); | |||||
| } | |||||
| //如果是生效的合同变更 | |||||
| WxRentContract r = wxAgileContractService.selectById(contract.getId()); | |||||
| if (isValidContract(r)) { | |||||
| WxRentContractAgileRenevue renevue = wxAgileContractService.findRenevueByContract(contract.getId(), contract); | |||||
| wxAgileContractService.endContractRenevueBill(renevue); | |||||
| } | |||||
| try { | |||||
| wxAgileContractService.saveRenuvueJumps(contract); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,"保存信息失败:"+e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| /** | |||||
| * 设置款项是否参与取高 | |||||
| */ | |||||
| @PostMapping("setFeesJoinRenevueUp") | |||||
| public ResultData setFeesJoinRenevueUp(@RequestBody WxRentContractAgileUnDeposit unDeposit) { | |||||
| unDeposit.updateTenantInfo(getTenantInfo()); | |||||
| WxRentContractAgileUnDeposit und = wxAgileContractService.getUnDepositById(unDeposit.getId(),unDeposit); | |||||
| //计算周期等需要和扣点设置一致 | |||||
| WxRentContractAgileRenevue _ore = wxAgileContractService.findRenevueByContract(unDeposit.getRentContractId(),unDeposit); | |||||
| if (null == _ore) { | |||||
| return new ResultData(Result.ERROR,"请先设置扣点信息"); | |||||
| } | |||||
| if (und.getTimePeriod().intValue() != _ore.getTimePeriod().intValue() || | |||||
| und.getTimeUnit().intValue() != _ore.getTimeUnit().intValue()) { | |||||
| return new ResultData(Result.ERROR,"当前款项计费周期和扣点设置不一致。"); | |||||
| } | |||||
| if (und.getFeesCreateRule().intValue() != _ore.getFeesCreateRule().intValue()) { | |||||
| return new ResultData(Result.ERROR,"当前款项费用生成规则和扣点设置不一致。"); | |||||
| } | |||||
| //如果是生效的合同变更 | |||||
| WxRentContract r = wxAgileContractService.selectById(_ore.getRentContractId()); | |||||
| if (isValidContract(r)) { | |||||
| wxAgileContractService.endContractRenevueBill(_ore); | |||||
| } | |||||
| try { | |||||
| wxAgileContractService.setJoinRenevueUp(unDeposit); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,"保存信息失败:"+e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("billList") | @GetMapping("billList") | ||||
| @@ -382,10 +595,6 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| return new ResultData(Result.ERROR, "请选择租赁开始日期和截止日期"); | return new ResultData(Result.ERROR, "请选择租赁开始日期和截止日期"); | ||||
| } | } | ||||
| if (null == wxRentContract.getStartDate()){ | |||||
| return new ResultData(Result.ERROR, "请选择计租日期"); | |||||
| } | |||||
| if (null == wxRentContract.getSignDate()){ | if (null == wxRentContract.getSignDate()){ | ||||
| return new ResultData(Result.ERROR, "请选择签约日期"); | return new ResultData(Result.ERROR, "请选择签约日期"); | ||||
| } | } | ||||
| @@ -404,10 +613,6 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| rentContract.setRentalStartDate(wxRentContract.getRentalStartDate()); | rentContract.setRentalStartDate(wxRentContract.getRentalStartDate()); | ||||
| rentContract.setRentalEndDate(wxRentContract.getRentalEndDate()); | rentContract.setRentalEndDate(wxRentContract.getRentalEndDate()); | ||||
| rentContract.setSignDate(wxRentContract.getSignDate()); | rentContract.setSignDate(wxRentContract.getSignDate()); | ||||
| rentContract.setStartDate(wxRentContract.getStartDate()); | |||||
| rentContract.setEndDate(wxRentContract.getStartDate()); | |||||
| rentContract.setFixStartDate(wxRentContract.getFixStartDate()); | |||||
| rentContract.setFixEndDate(wxRentContract.getFixEndDate()); | |||||
| try { | try { | ||||
| rentContractValidShop(rentContract); | rentContractValidShop(rentContract); | ||||
| @@ -89,18 +89,6 @@ public class WxContractBaseController extends BaseController{ | |||||
| } | } | ||||
| protected boolean rentPropertyHasWorkFlow(WxRentPropertyContractVo rpvo) { | |||||
| WxFlowModel wxFlowModel = new WxFlowModel(); | |||||
| wxFlowModel.setFlowType(EnumFlowKey.NNEW_RENT_CONTRACT.getCode()); | |||||
| wxFlowModel.updateTenantInfo(rpvo); | |||||
| List<WxFlowModel> flows = wxFlowService.getModelBybusiness(wxFlowModel); | |||||
| if (null != flows && flows.size() > 0) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| protected boolean rentContractHasWorkFlow(WxRentContract wxRentContract) { | protected boolean rentContractHasWorkFlow(WxRentContract wxRentContract) { | ||||
| WxFlowModel wxFlowModel = new WxFlowModel(); | WxFlowModel wxFlowModel = new WxFlowModel(); | ||||
| wxFlowModel.setFlowType(EnumFlowKey.NEW_RENT_CONTRACT.getCode()); | wxFlowModel.setFlowType(EnumFlowKey.NEW_RENT_CONTRACT.getCode()); | ||||
| @@ -112,6 +100,17 @@ public class WxContractBaseController extends BaseController{ | |||||
| return false; | return false; | ||||
| } | } | ||||
| protected boolean rentContractHasEditValidWorkFlow(WxRentContract wxRentContract) { | |||||
| WxFlowModel wxFlowModel = new WxFlowModel(); | |||||
| wxFlowModel.setFlowType(EnumFlowKey.NEW_EDIT_VALID_CONTRACT.getCode()); | |||||
| wxFlowModel.updateTenantInfo(wxRentContract); | |||||
| List<WxFlowModel> flows = wxFlowService.getModelBybusiness(wxFlowModel); | |||||
| if (null != flows && flows.size() > 0) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| public static boolean dateHasIntersection(Date startDate1, Date endDate1, Date startDate2, Date endDate2) { | public static boolean dateHasIntersection(Date startDate1, Date endDate1, Date startDate2, Date endDate2) { | ||||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||||
| if (startDate1.compareTo(endDate2) <= 0 && startDate2.compareTo(endDate1) <= 0) { | if (startDate1.compareTo(endDate2) <= 0 && startDate2.compareTo(endDate1) <= 0) { | ||||
| @@ -10,12 +10,14 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.BaseEntity.SortField; | import com.iformall.domain.po.base.BaseEntity.SortField; | ||||
| import com.iformall.domain.vo.BillTimeVo; | |||||
| import com.iformall.domain.vo.WxRentContractYearsVo; | import com.iformall.domain.vo.WxRentContractYearsVo; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | import com.iformall.service.helper.WxBillAllHelper; | ||||
| import com.iformall.service.helper.WxRentContractAgileHelper; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -75,16 +77,6 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } | } | ||||
| /** | |||||
| * 获取免租期 | |||||
| */ | |||||
| @GetMapping("getFreePeriod") | |||||
| public ResultData getFreePeriod(@ModelAttribute WxRentContract wxRentContract) { | |||||
| //查询 | |||||
| WxRentContract contract = wxRentContractService.selectById(wxRentContract.getId()); | |||||
| return new ResultData(wxRentContractService.getFreePeriods(contract)); | |||||
| } | |||||
| /** | /** | ||||
| * 作废 | * 作废 | ||||
| * @param wxRentContract | * @param wxRentContract | ||||
| @@ -258,6 +250,12 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData getRevenueContractList(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { | public ResultData getRevenueContractList(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxRentContract) wxRentContract = new WxRentContract(); | if (null == wxRentContract) wxRentContract = new WxRentContract(); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxRentContract.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxRentContract.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| wxRentContract.setShopTypeForRule(dataRule.getShopTypes()); | |||||
| } | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | wxRentContract.updateTenantInfo(getTenantInfo()); | ||||
| List<Integer> typeList = new ArrayList<Integer>(); | List<Integer> typeList = new ArrayList<Integer>(); | ||||
| typeList.add(EnumRentContractType.RENT_BY_JOINT.getCode()); | typeList.add(EnumRentContractType.RENT_BY_JOINT.getCode()); | ||||
| @@ -269,8 +267,7 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| //statusList.add(EnumRentContractStatus.READY_FOR_PAING.getCode()); | //statusList.add(EnumRentContractStatus.READY_FOR_PAING.getCode()); | ||||
| wxRentContract.setStatuss(statusList); | wxRentContract.setStatuss(statusList); | ||||
| wxRentContract.setSortColumns(SortField.Createtime_DESC); | wxRentContract.setSortColumns(SortField.Createtime_DESC); | ||||
| //return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | |||||
| return new ResultData(); | |||||
| return new ResultData(wxRentContractService.getRenevueContractList(wxRentContract, pageNum, pageSize)); | |||||
| } | } | ||||
| //查询联营扣点,联营取高的合同账单周期 | //查询联营扣点,联营取高的合同账单周期 | ||||
| @@ -292,40 +289,54 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| } | } | ||||
| } | } | ||||
| //查询所有时间区间,只查询租金的 | |||||
| WxAllBill bq = wxBillAllHelper.generateRentContractQueryBill(sales,sales.getRentContractId(),null,null); | |||||
| bq.setNoExtraCreateFrom(EnumYesOrNo.YES.getCode()); | |||||
| List<WxAllBill> billList = wxAllBillService.getContractSamePeriodBillSumList(bq); | |||||
| if (null == billList || billList.size() <= 0 ) { | |||||
| //查询所有时间区间 | |||||
| WxRentContractAgileRenevue renevue = wxAgileContractService.findRenevueByContract(sales.getRentContractId(), sales); | |||||
| if (null == renevue) { | |||||
| return new ResultData(); | |||||
| } | |||||
| List<WxRentContractAgileRenevueItem> renevueItems = wxAgileContractService.findRenevueItemListByContract(sales.getRentContractId(), sales); | |||||
| if (null == renevueItems || renevueItems.size() <= 0 ) { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| List<WxAllBill> validBillList = new ArrayList<WxAllBill>(); | List<WxAllBill> validBillList = new ArrayList<WxAllBill>(); | ||||
| for (int i = 0 ; i < billList.size() ; i ++) { | |||||
| WxAllBill bill = billList.get(i); | |||||
| WxAllBill nbill = new WxAllBill(); | |||||
| nbill.setStarttime(bill.getStarttime()); | |||||
| nbill.setEndtime(bill.getEndtime());; | |||||
| WxRentContractRevenueSales s = billSalesMap.get(bill.getStarttime()+"_"+bill.getEndtime()); | |||||
| if (null != s) { | |||||
| bill.setSales(s.getSaleMoney()); | |||||
| bill.setSalesTime(s.getUpdateTime()); | |||||
| //已锁定的不能再设置 | |||||
| if (s.getIsConfirm() == EnumYesOrNo.YES.getCode()) { | |||||
| // | |||||
| //TODO 年度已经汇算的不能再设置 | |||||
| //}else if() { | |||||
| }else { | |||||
| validBillList.add(nbill); | |||||
| } | |||||
| }else { | |||||
| validBillList.add(nbill); | |||||
| } | |||||
| EnumFeesShopTimeType creatRule = EnumFeesShopTimeType.getEnum(renevue.getFeesCreateRule()); | |||||
| EnumRentContractAgilTimeUnit timeUnit = EnumRentContractAgilTimeUnit.getEnum(renevue.getTimeUnit()); | |||||
| for (int i = 0 ; i < renevueItems.size(); i++) { | |||||
| WxRentContractAgileRenevueItem item = renevueItems.get(i); | |||||
| List<BillTimeVo> timeVoList = WxRentContractAgileHelper.initBillTimeList(null, item.getBeginTime(), item.getEndTime(), creatRule, timeUnit, renevue.getTimePeriod(), renevue.getCalcuteTime()); | |||||
| if (null != timeVoList && timeVoList.size() > 0 ) { | |||||
| for (int j = 0 ; j < timeVoList.size(); j++) { | |||||
| BillTimeVo tv = timeVoList.get(j); | |||||
| WxAllBill nbill = new WxAllBill(); | |||||
| nbill.setStarttime(tv.getStartDate()); | |||||
| nbill.setEndtime(tv.getEndDate()); | |||||
| WxRentContractRevenueSales s = billSalesMap.get(tv.getStartDate()+"_"+tv.getEndDate()); | |||||
| if (null != s) { | |||||
| nbill.setSales(s.getSaleMoney()); | |||||
| nbill.setSalesTime(s.getUpdateTime()); | |||||
| //已锁定的不能再设置 | |||||
| if (s.getIsConfirm() == EnumYesOrNo.YES.getCode()) { | |||||
| // | |||||
| //TODO 年度已经汇算的不能再设置 | |||||
| //}else if() { | |||||
| }else { | |||||
| validBillList.add(nbill); | |||||
| } | |||||
| }else { | |||||
| validBillList.add(nbill); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| return new ResultData(validBillList); | return new ResultData(validBillList); | ||||
| } | } | ||||
| //查询联营扣点,联营取高的合同账单周期 | |||||
| /** | |||||
| * 查询联营扣点,联营取高的合同某一个周期的根据销售额录入生成的账单列表 | |||||
| * @param sales | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("revenueBillTimesSaleBills") | @GetMapping("revenueBillTimesSaleBills") | ||||
| public ResultData revenueBillTimesSaleBills(@ModelAttribute WxRentContractRevenueSales sales) { | public ResultData revenueBillTimesSaleBills(@ModelAttribute WxRentContractRevenueSales sales) { | ||||
| if (null == sales) sales = new WxRentContractRevenueSales(); | if (null == sales) sales = new WxRentContractRevenueSales(); | ||||
| @@ -361,32 +372,39 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| return new ResultData(retMap); | return new ResultData(retMap); | ||||
| } | } | ||||
| // //查询商户计租合同列表 | |||||
| // @GetMapping("revenuePropertyContract") | |||||
| // public ResultData revenuePropertyContract(@ModelAttribute WxRentContract rentContract) { | |||||
| // if (null == rentContract) rentContract = new WxRentContract(); | |||||
| // rentContract.updateTenantInfo(getTenantInfo()); | |||||
| // WxRentContract contract = wxRentContractService.selectById(rentContract.getId()); | |||||
| // //纯联营扣点方式,不能加物业费一起算 | |||||
| // if (contract.getType().intValue() == EnumRentContractType.RENT_BY_JOINT.getCode()) { | |||||
| // return new ResultData(); | |||||
| // } | |||||
| // WxPropertyContract bq = new WxPropertyContract(); | |||||
| // bq.updateTenantInfo(rentContract); | |||||
| // bq.setRentContractId(rentContract.getId()); | |||||
| // bq.setOperationType(EnumContractOperationType.WHOLE.getCode()); | |||||
| // //包括提前终止的,租金+物业合同是一对一的 | |||||
| // List<Integer> statusList = new ArrayList<Integer>(); | |||||
| // statusList.add(EnumRentContractStatus.PAING.getCode()); | |||||
| // statusList.add(EnumRentContractStatus.TERMINATE.getCode()); | |||||
| // //bq.setStatus(EnumRentContractStatus.PAING.getCode()); | |||||
| // bq.setStatuss(statusList); | |||||
| // List<WxPropertyContract> propertyList = wxPropertyContractService.findList(bq); | |||||
| // if (null != propertyList && propertyList.size() > 0 ) { | |||||
| // return new ResultData(propertyList.get(0)); | |||||
| // } | |||||
| // return new ResultData(); | |||||
| // } | |||||
| /** | |||||
| * 查询取高合同里面参与取高款项的当期账单列表 | |||||
| * @param sales | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("revenueUpFeesBills") | |||||
| public ResultData revenueUpFeesBills(@ModelAttribute WxRentContractRevenueSales sales) { | |||||
| sales.updateTenantInfo(getTenantInfo()); | |||||
| WxRentContractAgileUnDeposit udq = new WxRentContractAgileUnDeposit(); | |||||
| udq.updateTenantInfo(sales); | |||||
| udq.setRentContractId(sales.getRentContractId()); | |||||
| udq.setJoinRenevueUp(EnumYesOrNo.YES.getCode()); | |||||
| List<WxRentContractAgileUnDeposit> udlist = wxAgileContractService.findUnDepositList(udq); | |||||
| if (null != udlist && udlist.size() > 0 ) { | |||||
| List<WxAllBill> billlist = new ArrayList<WxAllBill>(); | |||||
| for (int i = 0 ; i < udlist.size() ; i ++) { | |||||
| WxRentContractAgileUnDeposit ad = udlist.get(i); | |||||
| WxAllBill bq = new WxAllBill(); | |||||
| bq.updateTenantInfo(sales); | |||||
| bq.setRentContractId(sales.getRentContractId()); | |||||
| bq.setEnergyFeesId(ad.getFeesId()); | |||||
| bq.setIsPreview(EnumYesOrNo.NO.getCode()); | |||||
| bq.setStarttimeEqual(sales.getStarttime()); | |||||
| bq.setEndtimeEqual(sales.getEndtime()); | |||||
| PageInfo<WxAllBill> billPage = wxAllBillService.listAsPage(bq,1,100); | |||||
| if (null != billPage && null != billPage.getList() && billPage.getList().size() > 0 ) { | |||||
| billlist.addAll(billPage.getList()); | |||||
| } | |||||
| } | |||||
| return new ResultData(billlist); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| /** | /** | ||||
| * 扣点设置销售额重新计算 | * 扣点设置销售额重新计算 | ||||
| @@ -405,13 +423,13 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| return new ResultData(wxRentContractService.setRevenueSales(this.getUser(),rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime())); | return new ResultData(wxRentContractService.setRevenueSales(this.getUser(),rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime())); | ||||
| } | } | ||||
| // //查询合同年限 | |||||
| // @GetMapping("getContractYears") | |||||
| // public ResultData getContractYears(@ModelAttribute WxRentContract wxRentContract) { | |||||
| // if (null == wxRentContract) wxRentContract = new WxRentContract(); | |||||
| // WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| // return new ResultData(wxRentContractService.getRentContractYears(rentContract)); | |||||
| // } | |||||
| //查询合同年限 | |||||
| @GetMapping("getContractYears") | |||||
| public ResultData getContractYears(@ModelAttribute WxRentContract wxRentContract) { | |||||
| if (null == wxRentContract) wxRentContract = new WxRentContract(); | |||||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| return new ResultData(wxAgileContractService.getRentContractYears(rentContract)); | |||||
| } | |||||
| //查询合同年限已输入销售额情况 | //查询合同年限已输入销售额情况 | ||||
| @PostMapping("getContractYearsSales") | @PostMapping("getContractYearsSales") | ||||
| @@ -217,14 +217,6 @@ public class WxAllBill extends TenantEntity { | |||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7", "退租待结算_8","预收待抵扣_9"}, width = 20, orderNum = "10") | @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7", "退租待结算_8","预收待抵扣_9"}, width = 20, orderNum = "10") | ||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | ||||
| public Integer status; | public Integer status; | ||||
| // @TableField(exist = false) | |||||
| // private String statusName; | |||||
| // public String getStatusName() { | |||||
| // if (null != status) { | |||||
| // return EnumBillStatus.getEnum(status).getMessage(); | |||||
| // } | |||||
| // return null; | |||||
| // } | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| public List<Integer> statusList; | public List<Integer> statusList; | ||||
| @@ -273,9 +265,6 @@ public class WxAllBill extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="自定义合同费用类型EnumRentContractAgileFeesType",name="rentContractAgileFeesType") | @io.swagger.annotations.ApiModelProperty(value="自定义合同费用类型EnumRentContractAgileFeesType",name="rentContractAgileFeesType") | ||||
| public Integer rentContractAgileFeesType; | public Integer rentContractAgileFeesType; | ||||
| @io.swagger.annotations.ApiModelProperty(value="物业合同ID",name="propertyContractId") | |||||
| public Long propertyContractId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="主物账单ID(针对合同里面的自定义科目账单)",name="parentBillId") | @io.swagger.annotations.ApiModelProperty(value="主物账单ID(针对合同里面的自定义科目账单)",name="parentBillId") | ||||
| public Long parentBillId; | public Long parentBillId; | ||||
| @@ -214,6 +214,6 @@ public class WxCouponOrder extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long endCreateDateTimes; | private Long endCreateDateTimes; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Date createDateLike; | |||||
| private String createDateLike; | |||||
| } | } | ||||
| @@ -60,37 +60,18 @@ public class WxRentContract extends TenantEntity { | |||||
| private Date rentalStartDate; | private Date rentalStartDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "祖赁截止时间", name = "rentalEndDate") | @io.swagger.annotations.ApiModelProperty(value = "祖赁截止时间", name = "rentalEndDate") | ||||
| private Date rentalEndDate; | private Date rentalEndDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "计租开始日期", name = "startDate") | |||||
| private Date startDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "计租截止日期", name = "endDate") | |||||
| private Date endDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "施工图纸", name = "designFile") | @io.swagger.annotations.ApiModelProperty(value = "施工图纸", name = "designFile") | ||||
| private String designFile; | private String designFile; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "装修期开始时间", name = "fixStartDate") | |||||
| private Date fixStartDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "装修期结束时间", name = "fixEndDate") | |||||
| private Date fixEndDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租期总月数(月)", name = "lease") | @io.swagger.annotations.ApiModelProperty(value = "租期总月数(月)", name = "lease") | ||||
| private Integer lease; | private Integer lease; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "来源ID,针对续签,从哪个合同续签", name = "fromId") | @io.swagger.annotations.ApiModelProperty(value = "来源ID,针对续签,从哪个合同续签", name = "fromId") | ||||
| private Long fromId; | private Long fromId; | ||||
| //地址 | |||||
| //联系地址 | |||||
| private String linkAddress; | private String linkAddress; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "联系人", name = "linkPerson") | @io.swagger.annotations.ApiModelProperty(value = "联系人", name = "linkPerson") | ||||
| private String linkPerson; | private String linkPerson; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "联系电话", name = "linkPhone") | @io.swagger.annotations.ApiModelProperty(value = "联系电话", name = "linkPhone") | ||||
| private String linkPhone; | private String linkPhone; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款账号", name = "payAccount") | |||||
| private String payAccount; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "开户行", name = "bankName") | |||||
| private String bankName; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "金额小数点位数", name = "decimalSize") | @io.swagger.annotations.ApiModelProperty(value = "金额小数点位数", name = "decimalSize") | ||||
| private Integer decimalSize = Constant.default_short_decimal_size ; | private Integer decimalSize = Constant.default_short_decimal_size ; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -98,6 +79,8 @@ public class WxRentContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "合同文件路径", name = "filepath") | @io.swagger.annotations.ApiModelProperty(value = "合同文件路径", name = "filepath") | ||||
| private String filepath; | private String filepath; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "fileNames") | |||||
| private String fileNames; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "EnumRentContractStatus", name = "status") | @io.swagger.annotations.ApiModelProperty(value = "EnumRentContractStatus", name = "status") | ||||
| private Integer status; | private Integer status; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -113,7 +96,6 @@ public class WxRentContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "押金金额详细", name = "cashtypeContentLsit") | @io.swagger.annotations.ApiModelProperty(value = "押金金额详细", name = "cashtypeContentLsit") | ||||
| private String cashtypeContentLsit; | private String cashtypeContentLsit; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") | @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") | ||||
| private Integer isDel; | private Integer isDel; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updatetime") | @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updatetime") | ||||
| @@ -130,64 +112,22 @@ public class WxRentContract extends TenantEntity { | |||||
| private String createByName; | private String createByName; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "计租面积", name = "rentArea") | @io.swagger.annotations.ApiModelProperty(value = "计租面积", name = "rentArea") | ||||
| private String rentArea; | private String rentArea; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "店铺编号串", name = "shopIdStr") | @io.swagger.annotations.ApiModelProperty(value = "店铺编号串", name = "shopIdStr") | ||||
| private String shopIdStr; | private String shopIdStr; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumRentContractType", name = "type") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumAgileContractType", name = "type") | |||||
| private Integer type; | private Integer type; | ||||
| @TableField(exist = false) | |||||
| private String typeName; | |||||
| @TableField(exist = false) | |||||
| private List<Integer> typeList; | |||||
| // @io.swagger.annotations.ApiModelProperty(value = "取高时保底方式EnumRentRenevueMinimunMethod", name = "revenueMinimumMethod") | |||||
| // private Integer revenueMinimumMethod; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "审核状态, 0未审核 1审核中 2审核通过 3驳回", name = "applyStatus") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "审核状态, 0未审核 1审核中 2审核通过 3驳回EnumRentContractAppStatus", name = "applyStatus") | |||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "终止时间", name = "endContractTime") | @io.swagger.annotations.ApiModelProperty(value = "终止时间", name = "endContractTime") | ||||
| private Date endContractTime; | private Date endContractTime; | ||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||||
| private Map<String, Object> flowParams; | |||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租赁合同预账单列表", name = "previewBillRentList") | |||||
| private List<WxAllBill> previewBillRentList; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "审批说明", name = "remark") | @io.swagger.annotations.ApiModelProperty(value = "审批说明", name = "remark") | ||||
| private String remark; | private String remark; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "租金信息", name = "rentInfo") | @io.swagger.annotations.ApiModelProperty(value = "租金信息", name = "rentInfo") | ||||
| private String rentInfo; | private String rentInfo; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "fileNames") | |||||
| private String fileNames; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "每天价格计算规则EnumRentDayPriceCalcute", name = "dayPriceCalcute") | @io.swagger.annotations.ApiModelProperty(value = "每天价格计算规则EnumRentDayPriceCalcute", name = "dayPriceCalcute") | ||||
| private Integer dayPriceCalcute; | private Integer dayPriceCalcute; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "每月平均天数", name = "monthAverageDays") | @io.swagger.annotations.ApiModelProperty(value = "每月平均天数", name = "monthAverageDays") | ||||
| private Integer monthAverageDays; | private Integer monthAverageDays; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | |||||
| @TableField(exist = false) | |||||
| private Integer flowHas; | |||||
| //联营扣点跳点设置 | |||||
| @TableField(exist = false) | |||||
| private List<WxRentContractRevenueJump> revenueJumps; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "联营跳点设置说明", name = "revenueJumpsRemark") | |||||
| private String revenueJumpsRemark; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "免租期说明", name = "freePeriodRemark") | |||||
| private String freePeriodRemark; | |||||
| // @io.swagger.annotations.ApiModelProperty(value = "合同类型EnumRentAgileType", name = "agileType") | |||||
| // private Integer agileType = EnumRentAgileType.AGILE.getCode(); | |||||
| public List<Long> shopIdsByRentInfo() { | public List<Long> shopIdsByRentInfo() { | ||||
| List<Long> shopList = Lists.newArrayList(); | List<Long> shopList = Lists.newArrayList(); | ||||
| @@ -261,31 +201,6 @@ public class WxRentContract extends TenantEntity { | |||||
| return null; | return null; | ||||
| } | } | ||||
| // public Map<Long,WxEnergyFees> getDepositEnergyFees(Map<Long,WxEnergyFees> feesMap) { | |||||
| // String dsdstr = this.getCashtypeContentLsit(); | |||||
| // if (!StringUtils.isBlank(dsdstr)) { | |||||
| // Map<Long,WxEnergyFees> retMap = new HashMap<Long,WxEnergyFees>(); | |||||
| // JSONArray rentInfoArray = JSONArray.parseArray(dsdstr); | |||||
| // int size = rentInfoArray.size(); | |||||
| // for (int i = 0; i < size; i++) { | |||||
| // JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||||
| // String depositType = rentInfoObject.getString("value"); | |||||
| // String deposit = rentInfoObject.getString("deposit"); | |||||
| // Long dt = Long.parseLong(depositType); | |||||
| // WxEnergyFees fees = feesMap.get(dt); | |||||
| // WxEnergyFees nfees = new WxEnergyFees(); | |||||
| // nfees.setId(fees.getId()); | |||||
| // nfees.setName(fees.getName()); | |||||
| // nfees.setCalcuteUnit(fees.getCalcuteUnit()); | |||||
| // nfees.setPrice(deposit); | |||||
| // retMap.put(dt, nfees); | |||||
| // } | |||||
| // return retMap; | |||||
| // } | |||||
| // return null; | |||||
| // } | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<RentContractFreePeriodVo> freePeriods; | private List<RentContractFreePeriodVo> freePeriods; | ||||
| public void setFreeVo(List<WxRentContractFreePeriod> freePeriods) { | public void setFreeVo(List<WxRentContractFreePeriod> freePeriods) { | ||||
| @@ -309,6 +224,27 @@ public class WxRentContract extends TenantEntity { | |||||
| this.setFreePeriods(voList); | this.setFreePeriods(voList); | ||||
| } | } | ||||
| } | } | ||||
| //是否有工作流 1:有 0:无" | |||||
| @TableField(exist = false) | |||||
| private Integer flowHas; | |||||
| //是否有修改履约中工作流 1:有 0:无" | |||||
| @TableField(exist = false) | |||||
| private Integer flowHasValidEdit; | |||||
| //联营扣点跳点设置 | |||||
| @TableField(exist = false) | |||||
| private List<WxRentContractRevenueJump> revenueJumps; | |||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||||
| private Map<String, Object> flowParams; | |||||
| @TableField(exist = false) | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租赁合同预账单列表", name = "previewBillRentList") | |||||
| private List<WxAllBill> previewBillRentList; | |||||
| @TableField(exist = false) | |||||
| private String typeName; | |||||
| @TableField(exist = false) | |||||
| private List<Integer> typeList; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String building; | private String building; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -372,5 +308,7 @@ public class WxRentContract extends TenantEntity { | |||||
| private List<Long> calcuteShopIds; | private List<Long> calcuteShopIds; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer calcuteIsProperty; | private Integer calcuteIsProperty; | ||||
| @TableField(exist = false) | |||||
| private String shopNumber; | |||||
| } | } | ||||
| @@ -0,0 +1,75 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumFeesShopTimeType; | |||||
| import com.iformall.enums.EnumRentContractAgilPriceUnit; | |||||
| import com.iformall.enums.EnumRentContractAgilSettingMethod; | |||||
| import com.iformall.enums.EnumRentContractAgilTimeUnit; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| /** | |||||
| */ | |||||
| @TableName(value = "wx_rent_contract_agile_renevue") | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxRentContractAgileRenevue extends TenantEntity { | |||||
| private static final long serialVersionUID = 7009117540201976664L; | |||||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||||
| private Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value="合同编号",name="rentContractId") | |||||
| private Long rentContractId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="计费周期",name="timePeriod") | |||||
| private Integer timePeriod; | |||||
| @io.swagger.annotations.ApiModelProperty(value="计费周期单位EnumRentContractAgilTimeUnit",name="timeUnit") | |||||
| private Integer timeUnit; | |||||
| @TableField(exist = false) | |||||
| private String timeUnitName; | |||||
| public String getTimeUnitName() { | |||||
| if (null != timeUnit) { | |||||
| return EnumRentContractAgilTimeUnit.getEnum(timeUnit).getMessage(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value="收费周期",name="calcuteTime") | |||||
| private Integer calcuteTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="费用生成规则EnumFeesShopTimeType",name="feesCreateRule") | |||||
| private Integer feesCreateRule; | |||||
| @TableField(exist = false) | |||||
| private String feesCreateRuleName; | |||||
| public String getFeesCreateRuleName() { | |||||
| if (null != feesCreateRule) { | |||||
| return EnumFeesShopTimeType.getEnum(feesCreateRule).getMessage(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||||
| private Date createtime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||||
| private Date updatetime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="最低扣点销售额",name="limitRevenue") | |||||
| private String limitRevenue; | |||||
| @TableField(exist = false) | |||||
| private List<WxRentContractAgileRenevueItem> items; | |||||
| @TableField(exist = false) | |||||
| private List<WxRentContractAgileRenevueFees> fees; | |||||
| } | |||||
| @@ -0,0 +1,48 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumFeesShopTimeType; | |||||
| import com.iformall.enums.EnumRentContractAgilPriceUnit; | |||||
| import com.iformall.enums.EnumRentContractAgilSettingMethod; | |||||
| import com.iformall.enums.EnumRentContractAgilTimeUnit; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| /** | |||||
| */ | |||||
| @TableName(value = "wx_rent_contract_agile_renevue_fees") | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxRentContractAgileRenevueFees extends TenantEntity { | |||||
| private static final long serialVersionUID = 7009117540201976664L; | |||||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||||
| private Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value="合同编号",name="rentContractId") | |||||
| private Long rentContractId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="WxRentContractAgileRenevue编号",name="agileRenevueId") | |||||
| private Long agileRenevueId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||||
| private Date createtime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||||
| private Date updatetime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="款项编号",name="feesId") | |||||
| private Long feesId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="占比比率%,默认100",name="rate") | |||||
| private String rate; | |||||
| } | |||||
| @@ -0,0 +1,62 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumFeesShopTimeType; | |||||
| import com.iformall.enums.EnumRentContractAgilPriceUnit; | |||||
| import com.iformall.enums.EnumRentContractAgilSettingMethod; | |||||
| import com.iformall.enums.EnumRentContractAgilTimeUnit; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| /** | |||||
| */ | |||||
| @TableName(value = "wx_rent_contract_agile_renevue_item") | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxRentContractAgileRenevueItem extends TenantEntity { | |||||
| private static final long serialVersionUID = 7009117540201976664L; | |||||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||||
| private Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value="合同编号",name="rentContractId") | |||||
| private Long rentContractId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="费用编号",name="renevueId") | |||||
| private Long renevueId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="beginTime",name="beginTime") | |||||
| private Date beginTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="endTime",name="endTime") | |||||
| private Date endTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="抽成比率%",name="rate") | |||||
| private String rate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||||
| private Date createtime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||||
| private Date updatetime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否免租期",name="isFree") | |||||
| private Integer isFree; | |||||
| @io.swagger.annotations.ApiModelProperty(value="页面用的字段",name="isFree") | |||||
| private Integer isFather; | |||||
| @TableField(exist = false) | |||||
| private Date validBeginTime; | |||||
| @TableField(exist = false) | |||||
| private Date validEndTime; | |||||
| } | |||||
| @@ -46,20 +46,6 @@ public class WxRentContractAgileUnDeposit extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String feesName; | private String feesName; | ||||
| @io.swagger.annotations.ApiModelProperty(value="单价",name="price") | |||||
| private String price; | |||||
| @io.swagger.annotations.ApiModelProperty(value="单价单位EnumRentContractAgilPriceUnit",name="priceUnit") | |||||
| private Integer priceUnit; | |||||
| @TableField(exist = false) | |||||
| private String priceUnitName; | |||||
| public String getPriceUnitName() { | |||||
| if (null != priceUnit) { | |||||
| return EnumRentContractAgilPriceUnit.getEnum(priceUnit).getMessage(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value="计费周期",name="timePeriod") | @io.swagger.annotations.ApiModelProperty(value="计费周期",name="timePeriod") | ||||
| private Integer timePeriod; | private Integer timePeriod; | ||||
| @@ -94,6 +80,9 @@ public class WxRentContractAgileUnDeposit extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | ||||
| private Date updatetime; | private Date updatetime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="是否参与联营扣点取高EnumYesOrNo",name="joinRenevueUp") | |||||
| private Integer joinRenevueUp; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<WxRentContractAgileUnDepositItem> items; | private List<WxRentContractAgileUnDepositItem> items; | ||||
| @@ -27,12 +27,9 @@ public class WxRentContractRevenueSales extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | ||||
| private Date updateTime; | private Date updateTime; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "租金合同编号", name = "rentContractId") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "合同编号", name = "rentContractId") | |||||
| private Long rentContractId; | private Long rentContractId; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "物业合同编号", name = "propertyContractId") | |||||
| private Long propertyContractId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单开始日期", name = "starttime") | @io.swagger.annotations.ApiModelProperty(value = "账单开始日期", name = "starttime") | ||||
| private Date starttime; | private Date starttime; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -0,0 +1,38 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| */ | |||||
| public enum EnumAgileContractType { | |||||
| AREA(1, "面积"), | |||||
| RENEVUE(2, "联营扣点"), | |||||
| RENEVUE_UP(3, "面积与联营扣点取高") | |||||
| ; | |||||
| public static EnumAgileContractType getEnum(Integer code) { | |||||
| for (EnumAgileContractType value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumAgileContractType(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -9,10 +9,9 @@ public enum EnumFlowKey { | |||||
| BILL(2, "end_bill_flow"),//账单审批 | BILL(2, "end_bill_flow"),//账单审批 | ||||
| END_CONTRACT(3, "end_contract_flow"),//终止合同审批 | END_CONTRACT(3, "end_contract_flow"),//终止合同审批 | ||||
| NEW_RENT_CONTRACT(4, "租金合同签约"), | |||||
| //NEW_SHOP_CONTRACT(5, "多经点位租金合同签约"), | |||||
| NEW_RENT_END_CONTRACT(6, "租金合同终止"), | |||||
| //NEW_SHOP_END_CONTRACT(7, "多经点位租金合同终止"), | |||||
| NEW_RENT_CONTRACT(4, "合同签约"), | |||||
| NEW_EDIT_VALID_CONTRACT(5, "履约中合同修改"), | |||||
| NEW_RENT_END_CONTRACT(6, "合同终止"), | |||||
| NEW_BILL_CHANGE(8, "账单应收金额变更"), | NEW_BILL_CHANGE(8, "账单应收金额变更"), | ||||
| @@ -26,16 +25,6 @@ public enum EnumFlowKey { | |||||
| NEW_COUPON_DISTRIBUTION_UPLINE(25,"配送商品审批"), | NEW_COUPON_DISTRIBUTION_UPLINE(25,"配送商品审批"), | ||||
| NEW_COUPON_CREDIT_UPLINE(26,"积分券审批"), | NEW_COUPON_CREDIT_UPLINE(26,"积分券审批"), | ||||
| NEW_PRO_CONTRACT(13, "物业合同签约"), | |||||
| NEW_PRO_END(14, "物业合同终止"), | |||||
| //NEW_PRO_POINT_CONTRACT(15, "多经点位物业合同签约"), | |||||
| //NEW_PRO_POINT_CONTRACT_END(16, "多经点位物业合同终止"), | |||||
| NNEW_RENT_CONTRACT(17, "租金+物业合同签约"), | |||||
| NEW_RENT_END(18, "租金+物业合同合同终止"), | |||||
| //NEW_RENT_POINT_CONTRACT(19, "多经点位商铺租金+物业合同签约"), | |||||
| //NEW_RENT_POINT_CONTRACT_END(20, "多经点位商铺租金+物业合同终止"), | |||||
| SETTLE(21,"结算单审批"), | SETTLE(21,"结算单审批"), | ||||
| BILL_FINISH(30,"商户账单完结审批"), | BILL_FINISH(30,"商户账单完结审批"), | ||||
| @@ -55,5 +55,7 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> { | |||||
| void updateContractCusName(WxAllBill wxBillRent); | void updateContractCusName(WxAllBill wxBillRent); | ||||
| void transferCusName(WxAllBill wxBillRent); | void transferCusName(WxAllBill wxBillRent); | ||||
| BigDecimal getReceivePaySum(WxAllBill wxBillRent); | |||||
| } | } | ||||
| @@ -0,0 +1,22 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevue; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevueFees; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| import java.util.List; | |||||
| /** | |||||
| */ | |||||
| public interface WxRentContractAgileRenevueFeesMapper extends CommonMapper<WxRentContractAgileRenevueFees, Long> { | |||||
| List<WxRentContractAgileRenevueFees> findList(WxRentContractAgileRenevueFees wxBillRent); | |||||
| WxRentContractAgileRenevueFees selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| List<Long> findIdList(WxRentContractAgileRenevueFees wxBillRent); | |||||
| void deleteByRenevue(WxRentContractAgileRenevueFees wxBillRent); | |||||
| } | |||||
| @@ -0,0 +1,21 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevueItem; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| import java.util.List; | |||||
| /** | |||||
| */ | |||||
| public interface WxRentContractAgileRenevueItemMapper extends CommonMapper<WxRentContractAgileRenevueItem, Long> { | |||||
| List<WxRentContractAgileRenevueItem> findList(WxRentContractAgileRenevueItem wxBillRent); | |||||
| WxRentContractAgileRenevueItem selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| List<Long> findIdList(WxRentContractAgileRenevueItem wxBillRent); | |||||
| void deleteByRenevue(WxRentContractAgileRenevueItem wxBillRent); | |||||
| } | |||||
| @@ -0,0 +1,19 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevue; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| import java.util.List; | |||||
| /** | |||||
| */ | |||||
| public interface WxRentContractAgileRenevueMapper extends CommonMapper<WxRentContractAgileRenevue, Long> { | |||||
| List<WxRentContractAgileRenevue> findList(WxRentContractAgileRenevue wxBillRent); | |||||
| WxRentContractAgileRenevue selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| List<Long> findIdList(WxRentContractAgileRenevue wxBillRent); | |||||
| } | |||||
| @@ -15,5 +15,11 @@ public interface WxRentContractAgileUnDepositMapper extends CommonMapper<WxRentC | |||||
| WxRentContractAgileUnDeposit selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | WxRentContractAgileUnDeposit selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | ||||
| List<Long> findIdList(WxRentContractAgileUnDeposit wxBillRent); | List<Long> findIdList(WxRentContractAgileUnDeposit wxBillRent); | ||||
| List<Long> findFeesIdList(WxRentContractAgileUnDeposit wxBillRent); | |||||
| void updateJoinRenevueUp(WxRentContractAgileUnDeposit wxBillRent); | |||||
| void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| } | } | ||||
| @@ -6,8 +6,13 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxContractCustomers; | import com.iformall.domain.po.WxContractCustomers; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.po.WxRentContractAgileDeposit; | import com.iformall.domain.po.WxRentContractAgileDeposit; | ||||
| import com.iformall.domain.po.WxRentContractAgileRenevue; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevueFees; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevueItem; | |||||
| import com.iformall.domain.po.WxRentContractAgileUnDeposit; | import com.iformall.domain.po.WxRentContractAgileUnDeposit; | ||||
| import com.iformall.domain.po.WxRentContractRevenueSales; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxRentContractYearsVo; | |||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| @@ -33,10 +38,30 @@ public interface WxAgileContractService { | |||||
| WxRentContractAgileUnDeposit findUnDepositDetail(WxRentContractAgileUnDeposit unDeposit); | WxRentContractAgileUnDeposit findUnDepositDetail(WxRentContractAgileUnDeposit unDeposit); | ||||
| WxRentContractAgileUnDeposit getUnDepositById(Long id,TenantEntity tenantEntity); | |||||
| List<WxRentContractAgileUnDeposit> findUnDepositList(WxRentContractAgileUnDeposit unDeposit); | List<WxRentContractAgileUnDeposit> findUnDepositList(WxRentContractAgileUnDeposit unDeposit); | ||||
| void deleteUnDeposit(WxRentContractAgileUnDeposit unDeposit); | |||||
| List<Long> findUnDepositFeesIdList(WxRentContractAgileUnDeposit unDeposit); | |||||
| void createUnDepositBill(WxRentContractAgileUnDeposit unDeposit,MallUserInfo user); | void createUnDepositBill(WxRentContractAgileUnDeposit unDeposit,MallUserInfo user); | ||||
| WxRentContractAgileRenevue findRenevueByContract(Long rentContractId,TenantEntity tenantEntity); | |||||
| void saveRenuvue(WxRentContractAgileRenevue renevue); | |||||
| void saveRenuvueJumps(WxRentContract contract); | |||||
| void setJoinRenevueUp(WxRentContractAgileUnDeposit unDeposit); | |||||
| List<WxRentContractAgileRenevueItem> findRenevueItemListByContract(Long rentContractId,TenantEntity tenantEntity); | |||||
| List<WxRentContractAgileRenevueFees> findRenevueFeesListByContract(Long rentContractId,TenantEntity tenantEntity); | |||||
| WxRentContractAgileRenevueItem findOneRenevueItemByTime(Long rentContractId,TenantEntity tenantEntity,Date begin,Date end); | |||||
| List<Long> findBuildingFloorContractIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,List<Long> shopIds,Integer shopDel); | List<Long> findBuildingFloorContractIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,List<Long> shopIds,Integer shopDel); | ||||
| List<Long> findShopContractIds(TenantEntity tenantEntity,List<Long> shopIds); | List<Long> findShopContractIds(TenantEntity tenantEntity,List<Long> shopIds); | ||||
| @@ -50,4 +75,11 @@ public interface WxAgileContractService { | |||||
| void renewalAgile(WxRentContract wxRentContract,MallUserInfo user); | void renewalAgile(WxRentContract wxRentContract,MallUserInfo user); | ||||
| void transfer(WxRentContract wxRentContract,MallUserInfo user); | void transfer(WxRentContract wxRentContract,MallUserInfo user); | ||||
| List<WxRentContractYearsVo> getRentContractYears(WxRentContract rentContract); | |||||
| void reSetContract(WxRentContract wxRentContract,MallUserInfo user); | |||||
| void endContractDespoitBill(WxRentContract wxRentContract,MallUserInfo user); | |||||
| void endContractUnDespositBill(WxRentContractAgileUnDeposit unDeposit,MallUserInfo user); | |||||
| void endContractRenevueBill(WxRentContractAgileRenevue renevue); | |||||
| } | } | ||||
| @@ -51,21 +51,6 @@ public interface WxRentContractService { | |||||
| //Map<String, Object> getById(Long id,Integer noBillList); | //Map<String, Object> getById(Long id,Integer noBillList); | ||||
| WxRentContract selectById(Long id); | WxRentContract selectById(Long id); | ||||
| /** | |||||
| * 保存或更新实体 | |||||
| * @param record | |||||
| * @param userId | |||||
| * @param userName | |||||
| * @return | |||||
| */ | |||||
| //ResultData save(WxRentContract record,MallUserInfo user,String userName,Date oldRentStartDate); | |||||
| //ResultData update(WxRentContract record, MallUserInfo user,String userName,int from,Date oldRentStartDate,boolean writeComplate,boolean setRevenJumps); | |||||
| //ResultData updateOneStep(WxRentContract record, MallUserInfo user,String userName,int from,Date oldRentStartDate,boolean writeComplate); | |||||
| //ResultData updateRentStartTime(WxRentContract record, MallUserInfo user); | |||||
| /** | /** | ||||
| * 根据Id删除实体 | * 根据Id删除实体 | ||||
| * | * | ||||
| @@ -76,15 +61,9 @@ public interface WxRentContractService { | |||||
| void download(HttpServletRequest request, HttpServletResponse response); | void download(HttpServletRequest request, HttpServletResponse response); | ||||
| //Object getRentContractStatusInfo(WxRentContract record); | |||||
| ResultData updateRentContract(WxRentContract wxRentContract); | ResultData updateRentContract(WxRentContract wxRentContract); | ||||
| //PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize); | |||||
| //void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId); | |||||
| //ResultData updateFile(WxRentContract wxRentContract, MallUserInfo user,String userName,boolean writeComplate); | |||||
| PageInfo<WxRentContract> getRenevueContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize); | |||||
| ResultData updateRentContractStatus(Long id,boolean buildPropertyBill); | ResultData updateRentContractStatus(Long id,boolean buildPropertyBill); | ||||
| @@ -92,46 +71,18 @@ public interface WxRentContractService { | |||||
| void updateApplyStatus(WxRentContract wxRentContract); | void updateApplyStatus(WxRentContract wxRentContract); | ||||
| List<Date> getYearList(int years,int month,Date rentalStartDate,Date endContractTime ); | |||||
| //List<WxAllBill> buildRent(MallUserInfo user,WxRentContract rentContract,Integer isPreview,boolean saveDb); | |||||
| //void buildDeposit( TenantEntity tenantEntity,MallUserInfo user,Long rentContractId); | |||||
| //void updateInvalidContract(Long rentContractId); | |||||
| //ResultData hasRentStatus(WxRentContract wxRentContract); | |||||
| //ResultData hasContractNumber(WxRentContract wxRentContract); | |||||
| //Integer getShopType(WxRentContract wxRentContract); | |||||
| ResultData endContract(WxRentContract wxRentContract,MallUserInfo userInfo); | ResultData endContract(WxRentContract wxRentContract,MallUserInfo userInfo); | ||||
| //void updatePropertyPreviewBill(WxRentContract record); | |||||
| //Map<String, Object> updateStatus(WxRentContract record); | |||||
| WxRentContract getByBill(WxAllBill billRent); | WxRentContract getByBill(WxAllBill billRent); | ||||
| //Map<Long,WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp, TenantEntity tenantEntity); | |||||
| //int selectContractCountByShopId(WxRentContract wxRentContract); | |||||
| //ResultData getContractByContractNumber(WxRentContract wxRentContract); | |||||
| ResultData apply(WxRentContract wxRentContract,MallUserInfo user); | ResultData apply(WxRentContract wxRentContract,MallUserInfo user); | ||||
| void renewal(WxRentContract wxRentContract,MallUserInfo user); | |||||
| /** | /** | ||||
| * 合同正常到期 | * 合同正常到期 | ||||
| * @param | * @param | ||||
| */ | */ | ||||
| void outDateContract(WxMall wxMall); | void outDateContract(WxMall wxMall); | ||||
| //查询还有多少天到期的合同 | |||||
| //List<WxRentContract> findToOutDateContracts(TenantEntity tenantEntity); | |||||
| /** | /** | ||||
| * 已签约未计租 变为计租中 | * 已签约未计租 变为计租中 | ||||
| * @param wxMall | * @param wxMall | ||||
| @@ -146,14 +97,8 @@ public interface WxRentContractService { | |||||
| List<WxRentContract> findToEndContractList(WxRentContract record); | List<WxRentContract> findToEndContractList(WxRentContract record); | ||||
| void calcuteByTradeDaily(WxRentContract wxRentContract); | |||||
| void deletePrewBill(WxRentContract wxRentContract); | void deletePrewBill(WxRentContract wxRentContract); | ||||
| List<RentContractFreePeriodVo> getFreePeriods(WxRentContract wxRentContract); | |||||
| //void saveFreePeriods(WxRentContract wxRentContract); | |||||
| List<WxRentContractRevenueSales> getContractSales(WxRentContract wxRentContract); | List<WxRentContractRevenueSales> getContractSales(WxRentContract wxRentContract); | ||||
| WxRentContractRevenueSetSalesVo setRevenueSales(MallUserInfo user,WxRentContract rentcontract,String sales,Date startime, Date endtime); | WxRentContractRevenueSetSalesVo setRevenueSales(MallUserInfo user,WxRentContract rentcontract,String sales,Date startime, Date endtime); | ||||
| @@ -164,8 +109,4 @@ public interface WxRentContractService { | |||||
| List<WxRentContractRevenueJump> findJumpList(WxRentContractRevenueJump jump); | List<WxRentContractRevenueJump> findJumpList(WxRentContractRevenueJump jump); | ||||
| //List<WxRentContractYearsVo> getRentContractYears(WxRentContract rentContract); | |||||
| BigDecimal calcuteContractUsedShopArea(WxRentContract wxRentContract,Long shopId); | |||||
| } | } | ||||
| @@ -274,7 +274,7 @@ public class WxRentContractAgileHelper { | |||||
| * @param end | * @param end | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| private static String getMonthNeedPay(List<Date> freeDays,Integer decimalSize,BigDecimal price,Date start,Date end, | |||||
| public static String getMonthNeedPay(List<Date> freeDays,Integer decimalSize,BigDecimal price,Date start,Date end, | |||||
| EnumRentContractAgilTimeUnit timeUnit,int time,EnumRentDayPriceCalcute dayPriceRule,Integer monthAvageDays){ | EnumRentContractAgilTimeUnit timeUnit,int time,EnumRentDayPriceCalcute dayPriceRule,Integer monthAvageDays){ | ||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | ||||
| @@ -17,6 +17,9 @@ import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.po.WxRentContractAgileDeposit; | import com.iformall.domain.po.WxRentContractAgileDeposit; | ||||
| import com.iformall.domain.po.WxRentContractAgileDepositShop; | import com.iformall.domain.po.WxRentContractAgileDepositShop; | ||||
| import com.iformall.domain.po.WxRentContractAgileRenevue; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevueFees; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevueItem; | |||||
| import com.iformall.domain.po.WxRentContractAgileUnDeposit; | import com.iformall.domain.po.WxRentContractAgileUnDeposit; | ||||
| import com.iformall.domain.po.WxRentContractAgileUnDepositItem; | import com.iformall.domain.po.WxRentContractAgileUnDepositItem; | ||||
| import com.iformall.domain.po.WxRentContractRevenueJump; | import com.iformall.domain.po.WxRentContractRevenueJump; | ||||
| @@ -24,6 +27,7 @@ import com.iformall.domain.po.WxShop; | |||||
| import com.iformall.domain.po.WxShopUsers; | import com.iformall.domain.po.WxShopUsers; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.BillTimeVo; | import com.iformall.domain.vo.BillTimeVo; | ||||
| import com.iformall.domain.vo.WxRentContractYearsVo; | |||||
| import com.iformall.enums.EnumBillExtraCreateFrom; | import com.iformall.enums.EnumBillExtraCreateFrom; | ||||
| import com.iformall.enums.EnumContractCustomersStatus; | import com.iformall.enums.EnumContractCustomersStatus; | ||||
| import com.iformall.enums.EnumFeesShopTimeType; | import com.iformall.enums.EnumFeesShopTimeType; | ||||
| @@ -45,10 +49,14 @@ import com.iformall.mapper.WxContractShopMapper; | |||||
| import com.iformall.mapper.WxMerchantMapper; | import com.iformall.mapper.WxMerchantMapper; | ||||
| import com.iformall.mapper.WxRentContractAgileDepositMapper; | import com.iformall.mapper.WxRentContractAgileDepositMapper; | ||||
| import com.iformall.mapper.WxRentContractAgileDepositShopMapper; | import com.iformall.mapper.WxRentContractAgileDepositShopMapper; | ||||
| import com.iformall.mapper.WxRentContractAgileRenevueFeesMapper; | |||||
| import com.iformall.mapper.WxRentContractAgileRenevueItemMapper; | |||||
| import com.iformall.mapper.WxRentContractAgileRenevueMapper; | |||||
| import com.iformall.mapper.WxRentContractAgileUnDepositItemMapper; | import com.iformall.mapper.WxRentContractAgileUnDepositItemMapper; | ||||
| import com.iformall.mapper.WxRentContractAgileUnDepositMapper; | import com.iformall.mapper.WxRentContractAgileUnDepositMapper; | ||||
| import com.iformall.mapper.WxRentContractFreePeriodMapper; | import com.iformall.mapper.WxRentContractFreePeriodMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| import com.iformall.mapper.WxRentContractRevenueJumpMapper; | |||||
| import com.iformall.mapper.WxShopMapper; | import com.iformall.mapper.WxShopMapper; | ||||
| import com.iformall.service.SysConfigService; | import com.iformall.service.SysConfigService; | ||||
| import com.iformall.service.WxAgileContractService; | import com.iformall.service.WxAgileContractService; | ||||
| @@ -72,6 +80,7 @@ import org.springframework.transaction.annotation.Propagation; | |||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Calendar; | import java.util.Calendar; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| @@ -101,6 +110,18 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| @Autowired | @Autowired | ||||
| WxRentContractAgileUnDepositItemMapper wxRentContractAgileUnDepositItemMapper; | WxRentContractAgileUnDepositItemMapper wxRentContractAgileUnDepositItemMapper; | ||||
| @Autowired | |||||
| WxRentContractAgileRenevueMapper wxRentContractAgileRenevueMapper; | |||||
| @Autowired | |||||
| WxRentContractRevenueJumpMapper wxRentContractRevenueJumpMapper; | |||||
| @Autowired | |||||
| WxRentContractAgileRenevueFeesMapper wxRentContractAgileRenevueFeesMapper; | |||||
| @Autowired | |||||
| WxRentContractAgileRenevueItemMapper wxRentContractAgileRenevueItemMapper; | |||||
| @Autowired | @Autowired | ||||
| WxRentContractFreePeriodMapper wxRentContractFreePeriodMapper; | WxRentContractFreePeriodMapper wxRentContractFreePeriodMapper; | ||||
| @@ -511,6 +532,12 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| return ud; | return ud; | ||||
| } | } | ||||
| @Override | |||||
| public WxRentContractAgileUnDeposit getUnDepositById(Long id,TenantEntity tenantEntity) { | |||||
| return wxRentContractAgileUnDepositMapper.selectById(id, tenantEntity.getTenantId()); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<WxRentContractAgileUnDeposit> findUnDepositList(WxRentContractAgileUnDeposit unDeposit) { | public List<WxRentContractAgileUnDeposit> findUnDepositList(WxRentContractAgileUnDeposit unDeposit) { | ||||
| List<WxRentContractAgileUnDeposit> list = wxRentContractAgileUnDepositMapper.findList(unDeposit); | List<WxRentContractAgileUnDeposit> list = wxRentContractAgileUnDepositMapper.findList(unDeposit); | ||||
| @@ -530,6 +557,29 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| } | } | ||||
| return list; | return list; | ||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public void deleteUnDeposit(WxRentContractAgileUnDeposit unDeposit) { | |||||
| wxRentContractAgileUnDepositMapper.deleteById(unDeposit.getId(),unDeposit.getTenantId()); | |||||
| WxRentContractAgileUnDepositItem itemdel = new WxRentContractAgileUnDepositItem(); | |||||
| itemdel.updateTenantInfo(unDeposit); | |||||
| itemdel.setUnDepositId(unDeposit.getId()); | |||||
| wxRentContractAgileUnDepositItemMapper.deleteByUnDeposit(itemdel); | |||||
| //删除账单 | |||||
| WxAllBill wxBillDel = new WxAllBill(); | |||||
| wxBillDel.updateTenantInfo(unDeposit); | |||||
| wxBillDel.setRentContractId(unDeposit.getRentContractId()); | |||||
| wxBillDel.setIsPreview(EnumYesOrNo.YES.getCode()); | |||||
| wxBillDel.setRentContractAgileFeesType(EnumRentContractAgileFeesType.UN_DEPOSIT.getCode()); | |||||
| wxBillDel.setEnergyFeesId(unDeposit.getFeesId()); | |||||
| wxAllBillMapper.deletePreviewBill(wxBillDel); | |||||
| } | |||||
| @Override | |||||
| public List<Long> findUnDepositFeesIdList(WxRentContractAgileUnDeposit unDeposit) { | |||||
| return wxRentContractAgileUnDepositMapper.findFeesIdList(unDeposit); | |||||
| } | |||||
| @Override | @Override | ||||
| @@ -764,6 +814,158 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| return wxBillRent; | return wxBillRent; | ||||
| } | } | ||||
| @Override | |||||
| public WxRentContractAgileRenevue findRenevueByContract(Long rentContractId,TenantEntity tenantEntity) { | |||||
| WxRentContractAgileRenevue rq = new WxRentContractAgileRenevue(); | |||||
| rq.updateTenantInfo(tenantEntity); | |||||
| rq.setRentContractId(rentContractId);; | |||||
| List<WxRentContractAgileRenevue> list = wxRentContractAgileRenevueMapper.findList(rq); | |||||
| if (null == list || list.size() <= 0 ) { | |||||
| return null; | |||||
| } | |||||
| return list.get(0); | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public void saveRenuvue(WxRentContractAgileRenevue renevue) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| boolean isCreate = false; | |||||
| if (null == renevue.getId() ) { | |||||
| //保存租赁合同信息 | |||||
| renevue.setId(idWorker.nextId()); | |||||
| isCreate = true; | |||||
| renevue.setCreatetime(new Date()); | |||||
| } | |||||
| WxRentContract contract = wxRentContractMapper.selectById(renevue.getRentContractId()); | |||||
| renevue.setUpdatetime(new Date()); | |||||
| if (isCreate) { | |||||
| wxRentContractAgileRenevueMapper.insert(renevue); | |||||
| }else { | |||||
| wxRentContractAgileRenevueMapper.updateById(renevue); | |||||
| WxRentContractAgileRenevueItem itemdel = new WxRentContractAgileRenevueItem(); | |||||
| itemdel.updateTenantInfo(renevue); | |||||
| itemdel.setRenevueId(renevue.getId()); | |||||
| wxRentContractAgileRenevueItemMapper.deleteByRenevue(itemdel); | |||||
| WxRentContractAgileRenevueFees feesDel = new WxRentContractAgileRenevueFees(); | |||||
| feesDel.updateTenantInfo(renevue); | |||||
| feesDel.setAgileRenevueId(renevue.getId()); | |||||
| wxRentContractAgileRenevueFeesMapper.deleteByRenevue(feesDel); | |||||
| } | |||||
| validRenevueItem(renevue.getItems(), contract); | |||||
| for (int i = 0 ; i < renevue.getItems().size(); i++) { | |||||
| WxRentContractAgileRenevueItem item = renevue.getItems().get(i); | |||||
| item.setRentContractId(renevue.getRentContractId()); | |||||
| item.setRenevueId(renevue.getId()); | |||||
| item.setId(idWorker.nextId()); | |||||
| item.updateTenantInfo(contract); | |||||
| item.setCreatetime(new Date()); | |||||
| item.setUpdatetime(new Date()); | |||||
| wxRentContractAgileRenevueItemMapper.insert(item); | |||||
| } | |||||
| for (int i = 0 ; i < renevue.getFees().size(); i++) { | |||||
| WxRentContractAgileRenevueFees item = renevue.getFees().get(i); | |||||
| item.setRentContractId(renevue.getRentContractId()); | |||||
| item.setAgileRenevueId(renevue.getId()); | |||||
| item.setId(idWorker.nextId()); | |||||
| item.updateTenantInfo(contract); | |||||
| item.setCreatetime(new Date()); | |||||
| item.setUpdatetime(new Date()); | |||||
| wxRentContractAgileRenevueFeesMapper.insert(item); | |||||
| } | |||||
| } | |||||
| private void validRenevueItem(List<WxRentContractAgileRenevueItem> itemList,WxRentContract contract) { | |||||
| Date lastEndDate = null; | |||||
| for (int i = 0 ; i < itemList.size(); i++) { | |||||
| WxRentContractAgileRenevueItem item = itemList.get(i); | |||||
| //判断时间是不是连这的 | |||||
| if (i == 0) { | |||||
| lastEndDate = item.getEndTime(); | |||||
| if (!item.getBeginTime().equals(contract.getRentalStartDate())) { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"开始时间需要和合同开始时间一致"); | |||||
| } | |||||
| }else { | |||||
| Date _curr = DateUtils.getSecondsTimeAfter(1, lastEndDate); | |||||
| if (!_curr.equals(item.getBeginTime())) { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"时间区间需要严格连接"); | |||||
| } | |||||
| } | |||||
| if (i == itemList.size()-1) { | |||||
| if (!item.getEndTime().equals(contract.getRentalEndDate())) { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"结尾时间需要和合同结束时间一致"); | |||||
| } | |||||
| } | |||||
| lastEndDate = item.getEndTime(); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void saveRenuvueJumps(WxRentContract contract) { | |||||
| if (null != contract.getRevenueJumps()) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| List<WxRentContractRevenueJump> jlist = new ArrayList<WxRentContractRevenueJump>(); | |||||
| for (int i = 0 ; i < contract.getRevenueJumps().size(); i++) { | |||||
| WxRentContractRevenueJump jp = contract.getRevenueJumps().get(i); | |||||
| if (StringUtils.isNotBlank(jp.getMinMoney())) { | |||||
| jp.updateTenantInfo(contract); | |||||
| jp.setId(idWorker.nextId()); | |||||
| jp.setRentContractId(contract.getId()); | |||||
| jp.setCreateTime(new Date()); | |||||
| jp.setUpdateTime(new Date()); | |||||
| jlist.add(jp); | |||||
| } | |||||
| } | |||||
| if (jlist.size() > 0 ) { | |||||
| wxRentContractRevenueJumpMapper.inertJumps(contract.getTenantId(), jlist); | |||||
| } | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void setJoinRenevueUp(WxRentContractAgileUnDeposit unDeposit) { | |||||
| wxRentContractAgileUnDepositMapper.updateJoinRenevueUp(unDeposit); | |||||
| } | |||||
| @Override | |||||
| public List<WxRentContractAgileRenevueItem> findRenevueItemListByContract(Long rentContractId,TenantEntity tenantEntity) { | |||||
| WxRentContractAgileRenevueItem iq = new WxRentContractAgileRenevueItem(); | |||||
| iq.updateTenantInfo(tenantEntity); | |||||
| iq.setRentContractId(rentContractId); | |||||
| iq.setSortColumn("begin_time asc"); | |||||
| return wxRentContractAgileRenevueItemMapper.findList(iq); | |||||
| } | |||||
| @Override | |||||
| public List<WxRentContractAgileRenevueFees> findRenevueFeesListByContract(Long rentContractId,TenantEntity tenantEntity) { | |||||
| WxRentContractAgileRenevueFees iq = new WxRentContractAgileRenevueFees(); | |||||
| iq.updateTenantInfo(tenantEntity); | |||||
| iq.setRentContractId(rentContractId); | |||||
| return wxRentContractAgileRenevueFeesMapper.findList(iq); | |||||
| } | |||||
| @Override | |||||
| public WxRentContractAgileRenevueItem findOneRenevueItemByTime(Long rentContractId,TenantEntity tenantEntity,Date begin,Date end) { | |||||
| WxRentContractAgileRenevueItem iq = new WxRentContractAgileRenevueItem(); | |||||
| iq.updateTenantInfo(tenantEntity); | |||||
| iq.setRentContractId(rentContractId); | |||||
| iq.setValidBeginTime(begin); | |||||
| iq.setValidEndTime(end);; | |||||
| iq.setSortColumn("begin_time asc"); | |||||
| List<WxRentContractAgileRenevueItem> items = wxRentContractAgileRenevueItemMapper.findList(iq); | |||||
| if (null == items || items.size() <= 0 ) { | |||||
| return null; | |||||
| } | |||||
| return items.get(0); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<Long> findBuildingFloorContractIds(TenantEntity tenantEntity, String floorRule, Long building, | public List<Long> findBuildingFloorContractIds(TenantEntity tenantEntity, String floorRule, Long building, | ||||
| @@ -847,8 +1049,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()); | ||||
| @@ -908,6 +1108,57 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| } | } | ||||
| } | } | ||||
| 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 = generateRenevueItem(idWorker, rentContract, newContractId, renevueId); | |||||
| 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(); | |||||
| crjq.updateTenantInfo(rentContract); | |||||
| crjq.setRentContractId(rentContract.getId()); | |||||
| List<WxRentContractRevenueJump> jumpList = wxRentContractRevenueJumpMapper.findList(crjq); | |||||
| if ( null != jumpList && jumpList.size() > 0 ) { | |||||
| for (int i = 0 ; i < jumpList.size(); i++) { | |||||
| WxRentContractRevenueJump rj = jumpList.get(i); | |||||
| rj.setRentContractId(newContractId); | |||||
| rj.setId(idWorker.nextId()); | |||||
| rj.setCreateTime(new Date()); | |||||
| rj.setUpdateTime(new Date()); | |||||
| wxRentContractRevenueJumpMapper.insert(rj); | |||||
| } | |||||
| } | |||||
| rentContract.setId(newContractId); | rentContract.setId(newContractId); | ||||
| rentContract.setCreatetime(new Date()); | rentContract.setCreatetime(new Date()); | ||||
| rentContract.setCreateBy(user.getId()); | rentContract.setCreateBy(user.getId()); | ||||
| @@ -915,20 +1166,28 @@ 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); | ||||
| } | } | ||||
| private WxRentContractAgileRenevueItem generateRenevueItem(IdWorker idWorker,WxRentContract rentContract,Long newContractId,Long 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.setIsFather(EnumYesOrNo.YES.getCode()); | |||||
| ari.setId(idWorker.nextId()); | |||||
| ari.setCreatetime(new Date()); | |||||
| ari.setUpdatetime(new Date()); | |||||
| return ari; | |||||
| } | |||||
| private WxRentContractAgileUnDepositItem generateUnDepositItem(IdWorker idWorker,WxRentContract rentContract,Long undepositId,Long feesId,Long shopId) { | private WxRentContractAgileUnDepositItem generateUnDepositItem(IdWorker idWorker,WxRentContract rentContract,Long undepositId,Long feesId,Long shopId) { | ||||
| WxRentContractAgileUnDepositItem raudi = new WxRentContractAgileUnDepositItem(); | WxRentContractAgileUnDepositItem raudi = new WxRentContractAgileUnDepositItem(); | ||||
| @@ -967,5 +1226,167 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| wxAllBillMapper.transferCusName(bill); | wxAllBillMapper.transferCusName(bill); | ||||
| } | } | ||||
| @Override | |||||
| public List<WxRentContractYearsVo> getRentContractYears(WxRentContract rentContract) { | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| int [] diffs = DateUtils.getDiff(rentContract.getRentalStartDate(),rentContract.getRentalEndDate()); | |||||
| int months = diffs[0]; | |||||
| int days = diffs[1]; | |||||
| int ext = months % 12; | |||||
| int years = months/12; | |||||
| if (ext > 0 ) { | |||||
| years = years + 1; | |||||
| }else { | |||||
| if (days > 0 ) { | |||||
| years = years + 1; | |||||
| } | |||||
| } | |||||
| //如果有撤铺日 | |||||
| Date endcontract = rentContract.getEndContractTime(); | |||||
| if (null != endcontract) { | |||||
| endcontract = DateUtils.getDayEnd(endcontract); | |||||
| } | |||||
| List<Date> yearList = this.getYearList(years, 12, rentContract.getRentalStartDate(),endcontract); | |||||
| List<WxRentContractYearsVo> retList = new ArrayList<WxRentContractYearsVo>(); | |||||
| if (null != yearList && yearList.size() > 0) { | |||||
| if (yearList.size() == 1) { | |||||
| WxRentContractYearsVo vo = new WxRentContractYearsVo(); | |||||
| vo.setStart(yearList.get(0)); | |||||
| vo.setEnd(rentContract.getRentalEndDate()); | |||||
| vo.setRemark("第1年度"); | |||||
| vo.setYearIndex(1); | |||||
| retList.add(vo); | |||||
| }else { | |||||
| Date begin = null; | |||||
| for (int i = 0 ; i < yearList.size()-1 ; i ++) { | |||||
| int yearindex = i+1; | |||||
| begin = yearList.get(i); | |||||
| Date end = yearList.get(i+1); | |||||
| Date realEnd = DateUtils.getDaySet(end, Calendar.SECOND, -1); | |||||
| WxRentContractYearsVo vo = new WxRentContractYearsVo(); | |||||
| vo.setStart(begin); | |||||
| vo.setEnd(realEnd); | |||||
| vo.setRemark("第"+yearindex+"年度"); | |||||
| vo.setYearIndex(yearindex); | |||||
| retList.add(vo); | |||||
| begin = end; | |||||
| } | |||||
| WxRentContractYearsVo vo = new WxRentContractYearsVo(); | |||||
| vo.setStart(yearList.get(yearList.size()-1)); | |||||
| vo.setEnd(rentContract.getRentalEndDate()); | |||||
| vo.setRemark("第"+yearList.size()+"年度"); | |||||
| vo.setYearIndex(yearList.size()); | |||||
| retList.add(vo); | |||||
| } | |||||
| } | |||||
| if (retList.size() > 0 ) { | |||||
| return retList; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private List<Date> getYearList(int years,int month,Date rentalStartDate,Date endContractTime ) { | |||||
| List<Date> yearList = new ArrayList<Date>(); | |||||
| for (int i = 0; i < years; i++) { | |||||
| Calendar instance = Calendar.getInstance(); | |||||
| instance.setTime(rentalStartDate); | |||||
| instance.set(Calendar.MILLISECOND, 0); | |||||
| instance.add(Calendar.MONTH, month * i); | |||||
| Date startDate = instance.getTime(); | |||||
| if (null != endContractTime && endContractTime.before(startDate)) { | |||||
| yearList.add(endContractTime); | |||||
| break; | |||||
| }else { | |||||
| yearList.add(startDate); | |||||
| } | |||||
| } | |||||
| return yearList; | |||||
| } | |||||
| @Transactional(rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public void reSetContract(WxRentContract wxRentContract, MallUserInfo user) { | |||||
| //当前时间之后的未处理过的账单,全部删除,之前的账单,还有以后已经处理过的账单,不处理。需财务手工处理这些账单 | |||||
| WxAllBill bq = new WxAllBill(); | |||||
| bq.updateTenantInfo(wxRentContract); | |||||
| bq.setRentContractId(wxRentContract.getId()); | |||||
| bq.setShopEndtime(new Date()); | |||||
| wxAllBillMapper.deleteNoNeedPayBill(bq); | |||||
| //原来所有的非押金,扣点都默认设置为按合同,然后时间设置为合同开始时间和结束时间,单价为0 | |||||
| WxRentContractAgileUnDeposit udq = new WxRentContractAgileUnDeposit(); | |||||
| udq.updateTenantInfo(wxRentContract); | |||||
| udq.setRentContractId(wxRentContract.getId()); | |||||
| List<WxRentContractAgileUnDeposit> udList = wxRentContractAgileUnDepositMapper.findList(udq); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| if (null != udList && udList.size() > 0 ) { | |||||
| for (int i = 0 ; i < udList.size(); i++ ) { | |||||
| WxRentContractAgileUnDeposit ud = udList.get(i); | |||||
| WxRentContractAgileUnDepositItem udid = new WxRentContractAgileUnDepositItem(); | |||||
| udid.updateTenantInfo(wxRentContract); | |||||
| udid.setUnDepositId(ud.getId()); | |||||
| wxRentContractAgileUnDepositItemMapper.deleteByUnDeposit(udid); | |||||
| generateUnDepositItem(idWorker, wxRentContract, ud.getId(), ud.getFeesId(), null); | |||||
| } | |||||
| } | |||||
| WxRentContractAgileRenevue arq = new WxRentContractAgileRenevue(); | |||||
| arq.updateTenantInfo(wxRentContract); | |||||
| arq.setRentContractId(wxRentContract.getId()); | |||||
| List<WxRentContractAgileRenevue> arList = wxRentContractAgileRenevueMapper.findList(arq); | |||||
| if (null != arList && arList.size() > 0 ) { | |||||
| for (int i = 0 ; i < arList.size(); i++ ) { | |||||
| WxRentContractAgileRenevue ud = arList.get(i); | |||||
| WxRentContractAgileRenevueItem arid = new WxRentContractAgileRenevueItem(); | |||||
| arid.updateTenantInfo(wxRentContract); | |||||
| arid.setRentContractId(wxRentContract.getId()); | |||||
| arid.setRenevueId(ud.getId()); | |||||
| wxRentContractAgileRenevueItemMapper.deleteByRenevue(arid); | |||||
| generateRenevueItem(idWorker, wxRentContract, wxRentContract.getId(), ud.getId()); | |||||
| } | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void endContractDespoitBill(WxRentContract wxRentContract, MallUserInfo user) { | |||||
| //当前时间之后的未处理过的账单,全部删除,之前的账单,还有以后已经处理过的账单,不处理。需财务手工处理这些账单 | |||||
| WxAllBill bq = new WxAllBill(); | |||||
| bq.updateTenantInfo(wxRentContract); | |||||
| bq.setRentContractId(wxRentContract.getId()); | |||||
| bq.setShopEndtime(new Date()); | |||||
| List<Long> feesIds = new ArrayList<Long>(); | |||||
| for (int i = 0 ; i < wxRentContract.getContractDepositList().size(); i++) { | |||||
| WxRentContractAgileDeposit deposit = wxRentContract.getContractDepositList().get(i); | |||||
| if (!feesIds.contains(deposit.getFeesId())) { | |||||
| feesIds.add(deposit.getFeesId()); | |||||
| } | |||||
| } | |||||
| bq.setEnergyFeesIds(feesIds); | |||||
| bq.setRentContractAgileFeesType(EnumRentContractAgileFeesType.DEPOSIT.getCode()); | |||||
| wxAllBillMapper.deleteNoNeedPayBill(bq); | |||||
| } | |||||
| @Override | |||||
| public void endContractUnDespositBill(WxRentContractAgileUnDeposit unDeposit, MallUserInfo user) { | |||||
| WxAllBill bq = new WxAllBill(); | |||||
| bq.updateTenantInfo(unDeposit); | |||||
| bq.setRentContractId(unDeposit.getRentContractId()); | |||||
| bq.setShopEndtime(new Date()); | |||||
| bq.setEnergyFeesId(unDeposit.getFeesId()); | |||||
| bq.setRentContractAgileFeesType(EnumRentContractAgileFeesType.UN_DEPOSIT.getCode()); | |||||
| wxAllBillMapper.deleteNoNeedPayBill(bq); | |||||
| } | |||||
| @Transactional(rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public void endContractRenevueBill(WxRentContractAgileRenevue renevue) { | |||||
| WxAllBill bq = new WxAllBill(); | |||||
| bq.updateTenantInfo(renevue); | |||||
| bq.setRentContractId(renevue.getRentContractId()); | |||||
| bq.setShopEndtime(new Date()); | |||||
| bq.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_REVENUE_SALES.getCode()); | |||||
| wxAllBillMapper.deleteNoNeedPayBill(bq); | |||||
| bq.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_TIAODIAN_HUISUAN.getCode()); | |||||
| wxAllBillMapper.deleteNoNeedPayBill(bq); | |||||
| } | |||||
| } | } | ||||
| @@ -177,11 +177,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| contractType = Integer.parseInt(str); | contractType = Integer.parseInt(str); | ||||
| } | } | ||||
| if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || | |||||
| EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) || | |||||
| EnumFlowKey.NEW_PRO_CONTRACT.getCode().equals(flowType)|| | |||||
| EnumFlowKey.NNEW_RENT_CONTRACT.getCode().equals(flowType) | |||||
| ){ | |||||
| if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType)){ | |||||
| // 1租赁合同 2点位合同 3物业 4点位物业合同 5 合并合同-店铺 6 合并合同-多经点位 | // 1租赁合同 2点位合同 3物业 4点位物业合同 5 合并合同-店铺 6 合并合同-多经点位 | ||||
| if (EnumFlowContractType.RENT.getCode().equals(contractType) || | if (EnumFlowContractType.RENT.getCode().equals(contractType) || | ||||
| EnumFlowContractType.WHOLE_SHOP.getCode().equals(contractType)) { | EnumFlowContractType.WHOLE_SHOP.getCode().equals(contractType)) { | ||||
| @@ -239,11 +235,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType)){ | }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType)){ | ||||
| } | } | ||||
| }else if(EnumFlowKey.END_CONTRACT.getCode().equals(flowType) | |||||
| || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) | |||||
| || EnumFlowKey.NEW_PRO_END.getCode().equals(flowType) | |||||
| || EnumFlowKey.NEW_RENT_END.getCode().equals(flowType) | |||||
| ){ | |||||
| }else if(EnumFlowKey.END_CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType)){ | |||||
| if(EnumFlowContractType.RENT.getCode().equals(contractType) || | if(EnumFlowContractType.RENT.getCode().equals(contractType) || | ||||
| EnumFlowContractType.WHOLE_SHOP.getCode().equals(contractType)) { | EnumFlowContractType.WHOLE_SHOP.getCode().equals(contractType)) { | ||||
| WxRentContract rent = new WxRentContract(); | WxRentContract rent = new WxRentContract(); | ||||
| @@ -722,10 +714,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| ||EnumFlowKey.END_CONTRACT.getCode().equals(flowType) | ||EnumFlowKey.END_CONTRACT.getCode().equals(flowType) | ||||
| || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) | || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) | ||||
| || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) | || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) | ||||
| || EnumFlowKey.NEW_PRO_CONTRACT.getCode().equals(flowType) | |||||
| || EnumFlowKey.NEW_PRO_END.getCode().equals(flowType) | |||||
| || EnumFlowKey.NNEW_RENT_CONTRACT.getCode().equals(flowType) | |||||
| || EnumFlowKey.NEW_RENT_END.getCode().equals(flowType) | |||||
| ){ | ){ | ||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -806,7 +806,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| } | } | ||||
| //限购频次 | //限购频次 | ||||
| if (counpon.getUseLimitFrequency().intValue() == EnumCouponUseLimitFrequency.PERDAY.getCode().intValue()) { | if (counpon.getUseLimitFrequency().intValue() == EnumCouponUseLimitFrequency.PERDAY.getCode().intValue()) { | ||||
| couponOrderQ.setCreateDateLike(new Date()); | |||||
| couponOrderQ.setCreateDateLike(DateUtils.date2String(new Date(), DateUtils.DATE_PATTERN)); | |||||
| } | } | ||||
| return wxCouponOrderMapper.findProductCount(couponOrderQ)+couponNumber; | return wxCouponOrderMapper.findProductCount(couponOrderQ)+couponNumber; | ||||
| } catch(MallinkException e1) { | } catch(MallinkException e1) { | ||||
| @@ -36,7 +36,6 @@ | |||||
| <result column="shop_info" jdbcType="VARCHAR" property="shopInfo"/> | <result column="shop_info" jdbcType="VARCHAR" property="shopInfo"/> | ||||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | ||||
| <result column="rent_contract_agile_fees_type" jdbcType="INTEGER" property="rentContractAgileFeesType"/> | <result column="rent_contract_agile_fees_type" jdbcType="INTEGER" property="rentContractAgileFeesType"/> | ||||
| <result column="property_contract_id" jdbcType="BIGINT" property="propertyContractId"/> | |||||
| <result column="parent_bill_id" jdbcType="BIGINT" property="parentBillId"/> | <result column="parent_bill_id" jdbcType="BIGINT" property="parentBillId"/> | ||||
| <result column="virtual_compose_id" jdbcType="BIGINT" property="virtualComposeId"/> | <result column="virtual_compose_id" jdbcType="BIGINT" property="virtualComposeId"/> | ||||
| <result column="parent_virtual_compose_id" jdbcType="BIGINT" property="parentVirtualComposeId"/> | <result column="parent_virtual_compose_id" jdbcType="BIGINT" property="parentVirtualComposeId"/> | ||||
| @@ -53,7 +52,7 @@ | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`createtime`,`create_by`,`create_by_name`,`updatetime`,`update_by`,`update_by_name`, | `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`createtime`,`create_by`,`create_by_name`,`updatetime`,`update_by`,`update_by_name`, | ||||
| `price_detail`,`need_pay`,`receive_pay`,`history_receive_pay`,`pay`,`pay_way`,`pay_date`,`set_off`,`use_money`,`starttime`,`endtime`,`status`,`energy_fees_id`, | `price_detail`,`need_pay`,`receive_pay`,`history_receive_pay`,`pay`,`pay_way`,`pay_date`,`set_off`,`use_money`,`starttime`,`endtime`,`status`,`energy_fees_id`, | ||||
| `return_pay`,`bill_remark`,`last_owe_call_time`,`last_owe_call_user`,`receive_date`,`period`, | `return_pay`,`bill_remark`,`last_owe_call_time`,`last_owe_call_user`,`receive_date`,`period`, | ||||
| `is_preview`,`shop_info`,`rent_contract_id`,`rent_contract_agile_fees_type`,`property_contract_id`,`parent_bill_id`,`virtual_compose_id`,`parent_virtual_compose_id`, | |||||
| `is_preview`,`shop_info`,`rent_contract_id`,`rent_contract_agile_fees_type`,`parent_bill_id`,`virtual_compose_id`,`parent_virtual_compose_id`, | |||||
| `energy_reading_calcuteId`,`energy_reading_id`,`extra_create_from`,`rent_area`,`can_edit`,`cus_name`,`fees_type` | `energy_reading_calcuteId`,`energy_reading_id`,`extra_create_from`,`rent_area`,`can_edit`,`cus_name`,`fees_type` | ||||
| </sql> | </sql> | ||||
| @@ -70,7 +69,6 @@ | |||||
| <if test=" null != energyFeesId ">and `energy_fees_id` = #{energyFeesId}</if> | <if test=" null != energyFeesId ">and `energy_fees_id` = #{energyFeesId}</if> | ||||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | ||||
| <if test=" null != rentContractAgileFeesType ">and `rent_contract_agile_fees_type` = #{rentContractAgileFeesType}</if> | <if test=" null != rentContractAgileFeesType ">and `rent_contract_agile_fees_type` = #{rentContractAgileFeesType}</if> | ||||
| <if test=" null != propertyContractId ">and `property_contract_id` = #{propertyContractId}</if> | |||||
| <if test=" null != parentBillId ">and `parent_bill_id` = #{parentBillId}</if> | <if test=" null != parentBillId ">and `parent_bill_id` = #{parentBillId}</if> | ||||
| <if test=" null != virtualComposeId ">and `virtual_compose_id` = #{virtualComposeId}</if> | <if test=" null != virtualComposeId ">and `virtual_compose_id` = #{virtualComposeId}</if> | ||||
| <if test=" null != parentVirtualComposeId ">and `parent_virtual_compose_id` = #{parentVirtualComposeId}</if> | <if test=" null != parentVirtualComposeId ">and `parent_virtual_compose_id` = #{parentVirtualComposeId}</if> | ||||
| @@ -143,12 +141,6 @@ | |||||
| #{ridItem} | #{ridItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != propertyContractIds "> | |||||
| and property_contract_id in | |||||
| <foreach collection="propertyContractIds" index="index" item="pidItem" open="(" separator="," close=")"> | |||||
| #{pidItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != statusList "> | <if test=" null != statusList "> | ||||
| and `status` in | and `status` in | ||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | ||||
| @@ -323,9 +315,6 @@ | |||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| and rent_contract_id = #{rentContractId} | and rent_contract_id = #{rentContractId} | ||||
| </if> | </if> | ||||
| <if test=" null != propertyContractId"> | |||||
| and property_contract_id = #{propertyContractId} | |||||
| </if> | |||||
| <if test=" null != rentContractAgileFeesType"> | <if test=" null != rentContractAgileFeesType"> | ||||
| and rent_contract_agile_fees_type = #{rentContractAgileFeesType} | and rent_contract_agile_fees_type = #{rentContractAgileFeesType} | ||||
| </if> | </if> | ||||
| @@ -340,8 +329,14 @@ | |||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| and rent_contract_id = #{rentContractId} | and rent_contract_id = #{rentContractId} | ||||
| </if> | </if> | ||||
| <if test=" null != propertyContractId"> | |||||
| and property_contract_id = #{propertyContractId} | |||||
| <if test=" null != energyFeesId"> | |||||
| and energy_fees_id = #{energyFeesId} | |||||
| </if> | |||||
| <if test=" null != energyFeesIds "> | |||||
| and `energy_fees_id` in | |||||
| <foreach collection="energyFeesIds" index="index" item="eidItem" open="(" separator="," close=")"> | |||||
| #{eidItem} | |||||
| </foreach> | |||||
| </if> | </if> | ||||
| </delete> | </delete> | ||||
| @@ -364,9 +359,6 @@ | |||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| and rent_contract_id = #{rentContractId} | and rent_contract_id = #{rentContractId} | ||||
| </if> | </if> | ||||
| <if test=" null != propertyContractId"> | |||||
| and property_contract_id = #{propertyContractId} | |||||
| </if> | |||||
| </delete> | </delete> | ||||
| <update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxAllBill"> | <update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxAllBill"> | ||||
| @@ -374,9 +366,6 @@ | |||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| where rent_contract_id = #{rentContractId} | where rent_contract_id = #{rentContractId} | ||||
| </if> | </if> | ||||
| <if test=" null != propertyContractId"> | |||||
| where property_contract_id = #{propertyContractId} | |||||
| </if> | |||||
| </update> | </update> | ||||
| <insert id="insertBills" parameterType="HashMap"> | <insert id="insertBills" parameterType="HashMap"> | ||||
| @@ -391,7 +380,7 @@ | |||||
| #{item.needPay},#{item.receivePay},#{item.historyReceivePay},#{item.pay},#{item.payWay},#{item.payDate},#{item.setOff},#{item.useMoney}, | #{item.needPay},#{item.receivePay},#{item.historyReceivePay},#{item.pay},#{item.payWay},#{item.payDate},#{item.setOff},#{item.useMoney}, | ||||
| #{item.starttime},#{item.endtime},#{item.status},#{item.energyFeesId},#{item.returnPay},#{item.billRemark}, | #{item.starttime},#{item.endtime},#{item.status},#{item.energyFeesId},#{item.returnPay},#{item.billRemark}, | ||||
| #{item.lastOweCallTime},#{item.lastOweCallUser}, | #{item.lastOweCallTime},#{item.lastOweCallUser}, | ||||
| #{item.receiveDate},#{item.period},#{item.isPreview},#{item.shopInfo},#{item.rentContractId},#{item.rentContractAgileFeesType},#{item.propertyContractId}, | |||||
| #{item.receiveDate},#{item.period},#{item.isPreview},#{item.shopInfo},#{item.rentContractId},#{item.rentContractAgileFeesType}, | |||||
| #{item.parentBillId},#{item.virtualComposeId},#{item.parentVirtualComposeId},#{item.energyReadingCalcuteId}, | #{item.parentBillId},#{item.virtualComposeId},#{item.parentVirtualComposeId},#{item.energyReadingCalcuteId}, | ||||
| #{item.energyReadingId},#{item.extraCreateFrom},#{item.rentArea},#{item.canEdit},#{item.cusName},#{item.feesType} | #{item.energyReadingId},#{item.extraCreateFrom},#{item.rentArea},#{item.canEdit},#{item.cusName},#{item.feesType} | ||||
| ) | ) | ||||
| @@ -417,18 +406,12 @@ | |||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| and rent_contract_id = #{rentContractId} | and rent_contract_id = #{rentContractId} | ||||
| </if> | </if> | ||||
| <if test=" null != propertyContractId"> | |||||
| and property_contract_id = #{propertyContractId} | |||||
| </if> | |||||
| </update> | </update> | ||||
| <update id="transferCusName" parameterType="com.iformall.domain.po.WxAllBill"> | <update id="transferCusName" parameterType="com.iformall.domain.po.WxAllBill"> | ||||
| update wx_all_bill set cus_name = #{cusName} where tenant_id = #{tenantId} | update wx_all_bill set cus_name = #{cusName} where tenant_id = #{tenantId} | ||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| and rent_contract_id = #{rentContractId} | and rent_contract_id = #{rentContractId} | ||||
| </if> | |||||
| <if test=" null != propertyContractId"> | |||||
| and property_contract_id = #{propertyContractId} | |||||
| </if> | </if> | ||||
| and( | and( | ||||
| <!-- 应收 --> | <!-- 应收 --> | ||||
| @@ -449,5 +432,13 @@ | |||||
| </update> | </update> | ||||
| <select id="getReceivePaySum" parameterType="com.iformall.domain.po.WxAllBill" resultType="DECIMAL"> | |||||
| select sum(CAST(ifnull(receive_pay,'0') AS DECIMAL(20,2)) | |||||
| from wx_all_bill | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -128,14 +128,14 @@ | |||||
| <result column="business" jdbcType="VARCHAR" property="business" /> | <result column="business" jdbcType="VARCHAR" property="business" /> | ||||
| <result column="credit_price" jdbcType="INTEGER" property="creditPrice" /> | <result column="credit_price" jdbcType="INTEGER" property="creditPrice" /> | ||||
| <result column="content_type" jdbcType="INTEGER" property="contentType"/> | <result column="content_type" jdbcType="INTEGER" property="contentType"/> | ||||
| <result column="use_limit_frequency" jdbcType="INTEGER" property="useLimitFrequency"/> | |||||
| <result column="vendor_type" jdbcType="INTEGER" property="vendorType" /> | <result column="vendor_type" jdbcType="INTEGER" property="vendorType" /> | ||||
| <result column="vendor_params" jdbcType="VARCHAR" property="vendorParams" /> | <result column="vendor_params" jdbcType="VARCHAR" property="vendorParams" /> | ||||
| </resultMap> | </resultMap> | ||||
| <sql id="CouponCarColumns"> | <sql id="CouponCarColumns"> | ||||
| c.id,c.tenant_id,c.parent_tenant_id,c.type,c.cover_img,c.cover_picture,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_rule,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, | c.id,c.tenant_id,c.parent_tenant_id,c.type,c.cover_img,c.cover_picture,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_rule,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, | ||||
| car.vendor_type, car.vendor_params,c.credit_price, c.`auto_refund`, c.content_type | |||||
| car.vendor_type, car.vendor_params,c.credit_price, c.`auto_refund`, c.content_type,c.use_limit_frequency | |||||
| </sql> | </sql> | ||||
| <select id="findVoDetail" parameterType="java.lang.Long" resultMap="CouponCarMap"> | <select id="findVoDetail" parameterType="java.lang.Long" resultMap="CouponCarMap"> | ||||
| select | select | ||||
| @@ -0,0 +1,66 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.WxRentContractAgileRenevueFeesMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxRentContractAgileRenevueFees"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | |||||
| <result column="agile_renevue_id" jdbcType="BIGINT" property="agileRenevueId"/> | |||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | |||||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||||
| <result column="rate" jdbcType="VARCHAR" property="rate" /> | |||||
| <result column="fees_id" jdbcType="BIGINT" property="feesId" /> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`agile_renevue_id`, | |||||
| `createtime`,`updatetime`,`rate`,`fees_id` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1=1 | |||||
| <if test=" null != id ">and `id` = #{id}</if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||||
| <if test=" null != agileRenevueId ">and `agile_renevue_id` = #{agileRenevueId}</if> | |||||
| <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxRentContractAgileRenevueFees" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_rent_contract_agile_renevue_fees | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxRentContractAgileRenevueFees" resultType="Long"> | |||||
| select id | |||||
| from wx_rent_contract_agile_renevue_fees | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_rent_contract_agile_renevue_fees where id = #{id} and `tenant_id` = #{tenantId} | |||||
| </select> | |||||
| <delete id="deleteByRenevue" parameterType="com.iformall.domain.po.WxRentContractAgileRenevueFees"> | |||||
| delete from wx_rent_contract_agile_renevue_fees where agile_renevue_id = #{agileRenevueId} | |||||
| </delete> | |||||
| </mapper> | |||||
| @@ -0,0 +1,71 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.WxRentContractAgileRenevueItemMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxRentContractAgileRenevueItem"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | |||||
| <result column="renevue_id" jdbcType="BIGINT" property="renevueId"/> | |||||
| <result column="begin_time" jdbcType="TIMESTAMP" property="beginTime"/> | |||||
| <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/> | |||||
| <result column="rate" jdbcType="VARCHAR" property="rate"/> | |||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | |||||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||||
| <result column="is_free" jdbcType="INTEGER" property="isFree"/> | |||||
| <result column="is_father" jdbcType="INTEGER" property="isFather"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`renevue_id`,`begin_time`,`end_time`,`rate`, | |||||
| `createtime`,`updatetime`,`is_free`,`is_father` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1=1 | |||||
| <if test=" null != id ">and `id` = #{id}</if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||||
| <if test=" null != renevueId ">and `renevue_id` = #{renevueId}</if> | |||||
| <if test=" null != isFather ">and `is_father` = #{isFather}</if> | |||||
| <if test=" null != validBeginTime ">and `begin_time` <= #{validBeginTime}</if> | |||||
| <if test=" null != validEndTime ">and `end_time` >= #{validEndTime}</if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxRentContractAgileRenevueItem" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_rent_contract_agile_renevue_item | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxRentContractAgileRenevueItem" resultType="Long"> | |||||
| select id | |||||
| from wx_rent_contract_agile_renevue_item | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_rent_contract_agile_renevue_item where id = #{id} and `tenant_id` = #{tenantId} | |||||
| </select> | |||||
| <delete id="deleteByRenevue" parameterType="com.iformall.domain.po.WxRentContractAgileRenevueItem"> | |||||
| delete from wx_rent_contract_agile_renevue_item where `renevue_id` = #{renevueId} | |||||
| </delete> | |||||
| </mapper> | |||||
| @@ -0,0 +1,62 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.WxRentContractAgileRenevueMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxRentContractAgileRenevue"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | |||||
| <result column="time_period" jdbcType="INTEGER" property="timePeriod"/> | |||||
| <result column="time_unit" jdbcType="INTEGER" property="timeUnit"/> | |||||
| <result column="calcute_time" jdbcType="INTEGER" property="calcuteTime"/> | |||||
| <result column="fees_create_rule" jdbcType="INTEGER" property="feesCreateRule"/> | |||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | |||||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||||
| <result column="limit_revenue" jdbcType="VARCHAR" property="limitRevenue"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`, | |||||
| `time_period`,`time_unit`,`calcute_time`,`fees_create_rule`,`createtime`,`updatetime`,`limit_revenue` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1=1 | |||||
| <if test=" null != id ">and `id` = #{id}</if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxRentContractAgileRenevue" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_rent_contract_agile_renevue | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="findIdList" parameterType="com.iformall.domain.po.WxRentContractAgileRenevue" resultType="Long"> | |||||
| select id | |||||
| from wx_rent_contract_agile_renevue | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_rent_contract_agile_renevue where id = #{id} and `tenant_id` = #{tenantId} | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -14,11 +14,12 @@ | |||||
| <result column="fees_create_rule" jdbcType="INTEGER" property="feesCreateRule"/> | <result column="fees_create_rule" jdbcType="INTEGER" property="feesCreateRule"/> | ||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | ||||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | ||||
| <result column="join_renevue_up" jdbcType="INTEGER" property="joinRenevueUp"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`setting_method`,`fees_id`,`price`,`price_unit`, | |||||
| `time_period`,`time_unit`,`calcute_time`,`fees_create_rule`,`createtime`,`updatetime` | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`setting_method`,`fees_id`, | |||||
| `time_period`,`time_unit`,`calcute_time`,`fees_create_rule`,`createtime`,`updatetime`,`join_renevue_up` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -32,6 +33,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | ||||
| <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | ||||
| <if test=" null != joinRenevueUp ">and `join_renevue_up` = #{joinRenevueUp}</if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -54,11 +56,25 @@ | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxRentContractAgileUnDeposit" resultType="Long"> | |||||
| select distinct fees_id | |||||
| from wx_rent_contract_agile_un_deposit | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | ||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from wx_rent_contract_agile_un_deposit where id = #{id} and `tenant_id` = #{tenantId} | from wx_rent_contract_agile_un_deposit where id = #{id} and `tenant_id` = #{tenantId} | ||||
| </select> | </select> | ||||
| <update id = "updateJoinRenevueUp" parameterType="com.iformall.domain.po.WxRentContractAgileUnDeposit"> | |||||
| update wx_rent_contract_agile_un_deposit set join_renevue_up = #{joinRenevueUp} where id = #{id} | |||||
| </update> | |||||
| <delete id="deleteById" parameterType="HashMap"> | |||||
| delete from wx_rent_contract_agile_un_deposit where id = #{id} and `tenant_id` = #{tenantId} | |||||
| </delete> | |||||
| </mapper> | </mapper> | ||||
| @@ -23,16 +23,10 @@ | |||||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | <result column="is_del" jdbcType="INTEGER" property="isDel"/> | ||||
| <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/> | <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/> | ||||
| <result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/> | <result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/> | ||||
| <result column="pay_account" jdbcType="VARCHAR" property="payAccount"/> | |||||
| <result column="link_address" jdbcType="VARCHAR" property="linkAddress"/> | <result column="link_address" jdbcType="VARCHAR" property="linkAddress"/> | ||||
| <result column="lease" jdbcType="INTEGER" property="lease"/> | <result column="lease" jdbcType="INTEGER" property="lease"/> | ||||
| <result column="type" jdbcType="INTEGER" property="type"/> | <result column="type" jdbcType="INTEGER" property="type"/> | ||||
| <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/> | |||||
| <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/> | |||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="bank_name" jdbcType="VARCHAR" property="bankName"/> | |||||
| <result column="fix_start_date" property="fixStartDate"/> | |||||
| <result column="fix_end_date" property="fixEndDate"/> | |||||
| <result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/> | <result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/> | ||||
| <result column="file_names" jdbcType="VARCHAR" property="fileNames"/> | <result column="file_names" jdbcType="VARCHAR" property="fileNames"/> | ||||
| <result column="from_id" property="fromId"/> | <result column="from_id" property="fromId"/> | ||||
| @@ -40,8 +34,6 @@ | |||||
| <result column="design_file" jdbcType="VARCHAR" property="designFile"/> | <result column="design_file" jdbcType="VARCHAR" property="designFile"/> | ||||
| <result column="day_price_calcute" jdbcType="INTEGER" property="dayPriceCalcute"/> | <result column="day_price_calcute" jdbcType="INTEGER" property="dayPriceCalcute"/> | ||||
| <result column="month_average_days" jdbcType="INTEGER" property="monthAverageDays"/> | <result column="month_average_days" jdbcType="INTEGER" property="monthAverageDays"/> | ||||
| <result column="revenue_jumps_remark" jdbcType="VARCHAR" property="revenueJumpsRemark"/> | |||||
| <result column="free_period_remark" jdbcType="VARCHAR" property="freePeriodRemark"/> | |||||
| <result column="shop_id_str" jdbcType="VARCHAR" property="shopIdStr"/> | <result column="shop_id_str" jdbcType="VARCHAR" property="shopIdStr"/> | ||||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | <result column="remark" jdbcType="VARCHAR" property="remark"/> | ||||
| </resultMap> | </resultMap> | ||||
| @@ -50,12 +42,12 @@ | |||||
| `id`,`customers_id`,`tenant_id`,`parent_tenant_id`, | `id`,`customers_id`,`tenant_id`,`parent_tenant_id`, | ||||
| `decimal_size`,`rental_start_date`,`rental_end_date`,`sign_date`, | `decimal_size`,`rental_start_date`,`rental_end_date`,`sign_date`, | ||||
| `filepath`,`status`,`contract_number`,`create_by`,`update_by`, | `filepath`,`status`,`contract_number`,`create_by`,`update_by`, | ||||
| `day_price_calcute`,`month_average_days`,`free_period_remark`, | |||||
| cashtype_content_lsit,`is_del`,`revenue_jumps_remark`, | |||||
| `day_price_calcute`,`month_average_days`, | |||||
| cashtype_content_lsit,`is_del`, | |||||
| `updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`, | `updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`, | ||||
| `pay_account`,`lease`,`type`, | |||||
| `start_date`,`end_date`,`from_id`,`end_contract_time`, | |||||
| `apply_status`,`bank_name`,`fix_start_date`,`fix_end_date`,`create_by_name`,`update_by_name`, | |||||
| `lease`,`type`, | |||||
| `from_id`,`end_contract_time`, | |||||
| `apply_status`,`create_by_name`,`update_by_name`, | |||||
| `rent_info`, `file_names`, | `rent_info`, `file_names`, | ||||
| shop_id_str, | shop_id_str, | ||||
| design_file,remark | design_file,remark | ||||
| @@ -92,11 +84,8 @@ | |||||
| <if test=" null != createtime and '' != createtime">and `createtime` = #{createtime}</if> | <if test=" null != createtime and '' != createtime">and `createtime` = #{createtime}</if> | ||||
| <if test=" null != linkPerson and '' != linkPerson">and `link_person` = #{linkPerson}</if> | <if test=" null != linkPerson and '' != linkPerson">and `link_person` = #{linkPerson}</if> | ||||
| <if test=" null != linkPhone and '' != linkPhone">and `link_phone` = #{linkPhone}</if> | <if test=" null != linkPhone and '' != linkPhone">and `link_phone` = #{linkPhone}</if> | ||||
| <if test=" null != payAccount and '' != payAccount">and `pay_account` = #{payAccount}</if> | |||||
| <if test=" null != lease and '' != lease">and `lease` = #{lease}</if> | <if test=" null != lease and '' != lease">and `lease` = #{lease}</if> | ||||
| <if test=" null != type and '' != type">and `type` = #{type}</if> | <if test=" null != type and '' != type">and `type` = #{type}</if> | ||||
| <if test=" null != startDate and '' != startDate">and `start_date` = #{startDate}</if> | |||||
| <if test=" null != endDate and '' != endDate">and `end_date` = #{endDate}</if> | |||||
| <if test=" null != queryShopId and '' != queryShopId">and json_contains(json_extract(rent_info,'$[*].id'),concat('"',#{queryShopId},'"'))</if> | <if test=" null != queryShopId and '' != queryShopId">and json_contains(json_extract(rent_info,'$[*].id'),concat('"',#{queryShopId},'"'))</if> | ||||
| <if test=" null != dayPriceCalcute ">and `day_price_calcute` = #{dayPriceCalcute}</if> | <if test=" null != dayPriceCalcute ">and `day_price_calcute` = #{dayPriceCalcute}</if> | ||||
| <if test=" null != monthAverageDays ">and `month_average_days` = #{monthAverageDays}</if> | <if test=" null != monthAverageDays ">and `month_average_days` = #{monthAverageDays}</if> | ||||
| @@ -8,7 +8,6 @@ | |||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | ||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | ||||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | ||||
| <result column="property_contract_id" jdbcType="BIGINT" property="propertyContractId"/> | |||||
| <result column="starttime" jdbcType="TIMESTAMP" property="starttime"/> | <result column="starttime" jdbcType="TIMESTAMP" property="starttime"/> | ||||
| <result column="endtime" jdbcType="TIMESTAMP" property="endtime"/> | <result column="endtime" jdbcType="TIMESTAMP" property="endtime"/> | ||||
| <result column="sale_money" jdbcType="VARCHAR" property="saleMoney"/> | <result column="sale_money" jdbcType="VARCHAR" property="saleMoney"/> | ||||
| @@ -21,7 +20,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`rent_contract_id`,`property_contract_id`,`starttime`,`endtime`, | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`rent_contract_id`,`starttime`,`endtime`, | |||||
| `sale_money`,`sale_money_valid`,`calcute_money`,`remark`,`is_confirm`,`is_calcute` | `sale_money`,`sale_money_valid`,`calcute_money`,`remark`,`is_confirm`,`is_calcute` | ||||
| </sql> | </sql> | ||||
| @@ -35,7 +34,6 @@ | |||||
| and `parent_tenant_id` = #{parentTenantId} | and `parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | ||||
| <if test=" null != propertyContractId ">and `property_contract_id` = #{propertyContractId}</if> | |||||
| <if test=" null != starttime ">and `starttime` >= #{starttime}</if> | <if test=" null != starttime ">and `starttime` >= #{starttime}</if> | ||||
| <if test=" null != starttimeEqual ">and `starttime` = #{starttimeEqual}</if> | <if test=" null != starttimeEqual ">and `starttime` = #{starttimeEqual}</if> | ||||
| <if test=" null != endtime ">and `endtime` <= #{endtime}</if> | <if test=" null != endtime ">and `endtime` <= #{endtime}</if> | ||||