| | |
| | | } |
| | | /** |
| | | * 退租提交 |
| | | * @param model |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public Integer backRent(YwContract model){ |
| | | isParamValidCreated(model); |
| | | public Integer backRent(YwContract param){ |
| | | isParamValidBackRent(param); |
| | | //处理 |
| | | dealBackRentBillBiz(param); |
| | | YwContract update = new YwContract(); |
| | | update.setEditDate(new Date()); |
| | | update.setEditor(param.getLoginUserInfo().getId()); |
| | | update.setBtActDate(update.getEditDate()); |
| | | update.setBtActUserId(update.getEditor()); |
| | | update.setStatus(Constants.THREE); |
| | | update.setBtInfo(param.getBtInfo()); |
| | | update.setBtDate(param.getBtDate()); |
| | | update.setBtType(param.getBtType()); |
| | | update.setBtUserId(param.getBtUserId()); |
| | | update.setBtFee(param.getBtFee()); |
| | | ywContractMapper.updateById(update); |
| | | dealLogBiz(param,Constants.YwLogType.CONTRACT_BACK,null,null); |
| | | return param.getId(); |
| | | } |
| | | |
| | | model.setCreator(model.getLoginUserInfo().getId()); |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setCreateDate(new Date()); |
| | | model.setStatus(Constants.ZERO); |
| | | model.setEditDate(model.getCreateDate()); |
| | | model.setEditor(model.getCreator()); |
| | | model.setStatus(Constants.ZERO);//待执行 |
| | | ywContractMapper.insert(model); |
| | | dealDetailListBiz(model);//处理条款信息 |
| | | dealMultifileBiz(model);//处理附件信息 |
| | | dealLogBiz(model,Constants.YwLogType.CONTRACT_CREATE,null,null);//记录新建日志 |
| | | return model.getId(); |
| | | private void dealBackRentBillBiz(YwContract param) { |
| | | } |
| | | |
| | | private void isParamValidBackRent(YwContract param) { |
| | | if(param.getId()==null |
| | | || param.getBtType() == null |
| | | || param.getBtDate() == null |
| | | || param.getBtUserId() == null |
| | | || param.getBtSignDate() == null |
| | | ||StringUtils.isBlank( param.getBtInfo())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | YwContract model = ywContractMapper.selectById(param.getId()); |
| | | if(model==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,合同信息不存在,请返回列表刷新重试!"); |
| | | } |
| | | |
| | | SystemUser user = systemUserMapper.selectById(param.getUserId()); |
| | | if(user ==null || (user.getDeleted()!=null&& user.getDeleted() )){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,经办人信息不存在!"); |
| | | } |
| | | if(param.getAddBillList()!=null && param.getAddBillList().size()>0){ |
| | | for(YwContractBill bill: param.getAddBillList()){ |
| | | if(bill.getCostType() == null |
| | | ||bill.getFeeType() == null |
| | | ||bill.getReceivableFee() == null |
| | | ||bill.getCompanyId() == null |
| | | ||bill.getPlanPayDate() == null |
| | | ||(Constants.equalsInteger(bill.getFeeType(),Constants.ZERO) |
| | | && (bill.getStartDate() ==null || bill.getEndDate() ==null) )){ |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void dealDetailListBiz(YwContract model) { |
| | |
| | | bill.setStatus(Constants.ZERO); |
| | | bill.setStartDate(model.getStartDate()); |
| | | bill.setEndDate(model.getEndDate()); |
| | | bill.setType(type); |
| | | bill.setType(Constants.ZERO); |
| | | bill.setCostType(type); |
| | | bill.setTotleFee(type==Constants.THREE?model.getZlDeposit():model.getWyDeposit());//押金费用 |
| | | bill.setSortnum(0); |
| | | bill.setTitle(type==Constants.THREE?"租赁押金":"物业押金" ); |
| | | return bill; |
| | | } |
| | | |
| | |
| | | bill.setContractId(model.getId()); |
| | | bill.setStatus(Constants.ZERO); |
| | | bill.setDetailId(d.getId()); |
| | | bill.setType(d.getType()); |
| | | bill.setCostType(d.getType()); |
| | | bill.setType(Constants.ZERO); |
| | | return bill; |
| | | } |
| | | |