| @@ -109,7 +109,6 @@ public class WxRentContractController extends WxContractBaseController { | |||
| */ | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | |||
| //WxMerchant wxMerchant = new WxMerchant(); | |||
| //wxMerchant.setName(wxRentContract.getMerchantName()); | |||
| //wxMerchant.setId(wxRentContract.getMerchantId()); | |||
| @@ -120,9 +119,10 @@ public class WxRentContractController extends WxContractBaseController { | |||
| wxRentContract.updateTenantInfo(user); | |||
| wxRentContract.setAdjustPeriodHandle(); | |||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||
| if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| } | |||
| wxRentContract.setRentStartType(EnumRentStartType.RENTTIME.getCode()); | |||
| // if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| // wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| // } | |||
| try { | |||
| validShop(wxRentContract); | |||
| } catch (Exception e) { | |||
| @@ -197,6 +197,21 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return wxRentContractService.update(wxRentContract, user,user.getName(),EnumFromType.OTHER.getCode(),oldDate,false,true); | |||
| } | |||
| //切换生成账单方式 | |||
| @PostMapping("updateRentStartTime") | |||
| public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) { | |||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||
| Date oldDate = rentContract.getRentalStartDate(); | |||
| if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| rentContract.setRentalStartDate(rentContract.getStartDate()); | |||
| } | |||
| MallUserInfo user = getUser(); | |||
| rentContract.updateTenantInfo(user); | |||
| rentContract.setAdjustPeriodHandle(); | |||
| rentContract.setRentStartType(wxRentContract.getRentStartType()); | |||
| return wxRentContractService.update(rentContract, user,user.getName(), EnumFromType.SWITCH.getCode(),oldDate,false,false); | |||
| } | |||
| /** | |||
| * 新增第三步 | |||
| * @param wxRentContract | |||
| @@ -209,13 +224,13 @@ public class WxRentContractController extends WxContractBaseController { | |||
| wxRentContract.updateTenantInfo(user); | |||
| //wxRentContract.setAdjustPeriodHandle(); | |||
| //wxRentContract.setRentPriceHandle(); | |||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||
| if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| } | |||
| // Date oldDate = wxRentContract.getRentalStartDate(); | |||
| // if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| // wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); | |||
| // } | |||
| //wxRentContract.setRentShopType(null); | |||
| //wxRentContract.setOperationType(null); | |||
| return wxRentContractService.updateFile(wxRentContract, user,user.getName(),oldDate,true); | |||
| return wxRentContractService.updateFile(wxRentContract, user,user.getName(),true); | |||
| } | |||
| @GetMapping("/findById") | |||
| @@ -632,40 +647,6 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxMerchantService.getMerchantList(wxMerchant)); | |||
| } | |||
| // /** | |||
| // * 预览账单展示,编辑账期,后端生成账单金额 | |||
| // * @param wxRentContract | |||
| // * @return | |||
| // */ | |||
| // @PostMapping("buildBillPriceList") | |||
| // public ResultData buildBillPriceList(@RequestBody WxRentContract wxRentContract) throws Exception{ | |||
| // logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | |||
| // WxRentContract dbRent = wxRentContractMapper.selectById(wxRentContract.getId()); | |||
| // dbRent.setPreviewBillRentList(wxRentContract.getPreviewBillRentList()); | |||
| // | |||
| // if(dbRent.getRentStartType()!=null && dbRent.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| // dbRent.setRentalStartDate(dbRent.getStartDate()); | |||
| // } | |||
| // List<WxAllBill> result = wxRentContractService.buildRent(getUser(),dbRent, EnumIsPreview.YES.getCode(), false); | |||
| // return new ResultData(result); | |||
| // } | |||
| @PostMapping("updateRentStartTime") | |||
| public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentStartTime"); | |||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||
| rentContract.setRentalStartDate(wxRentContract.getRentalStartDate()); | |||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||
| if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| rentContract.setRentalStartDate(rentContract.getStartDate()); | |||
| } | |||
| MallUserInfo user = getUser(); | |||
| rentContract.updateTenantInfo(user); | |||
| rentContract.setAdjustPeriodHandle(); | |||
| rentContract.setRentStartType(wxRentContract.getRentStartType()); | |||
| return wxRentContractService.update(rentContract, user,user.getName(), EnumFromType.SWITCH.getCode(),oldDate,false,false); | |||
| } | |||
| @PostMapping("savePayAccountInfo") | |||
| public ResultData savePayAccountInfo(@RequestBody WxPayAccountBill payAccountBill) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::savePayAccountInfo"); | |||
| @@ -52,62 +52,33 @@ public class WxRentContract extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private String customerLegalPerson; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同编号", name = "contractNumber") | |||
| private String contractNumber; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同签约时间", name = "signDate") | |||
| private Date signDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "祖赁开始时间", name = "rentalStartDate") | |||
| private Date rentalStartDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "祖赁截止时间", name = "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") | |||
| 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") | |||
| private Integer lease; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单生成方式EnumRentContractAdjustPeriod", name = "adjustPeriod") | |||
| private Integer adjustPeriod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "来源ID,针对续签,从哪个合同续签", name = "fromId") | |||
| private Long fromId; | |||
| @TableField(exist = false) | |||
| private String building; | |||
| @TableField(exist = false) | |||
| private String floor; | |||
| @TableField(exist = false) | |||
| private String floorName; | |||
| @TableField(exist = false) | |||
| private String buildingName; | |||
| @TableField(exist = false) | |||
| private String brandName; | |||
| @TableField(exist = false) | |||
| private String buildArea; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "allPeriod") | |||
| private Integer allPeriod; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "period") | |||
| private Integer period; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "needPay") | |||
| private Integer needPay; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "receivePay") | |||
| private Integer receivePay; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "owe") | |||
| private Integer owe; | |||
| @TableField(exist = false) | |||
| private String receiveDate; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "latePayPrice") | |||
| private Integer latePayPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否同时终止物业", name = "endProperty") | |||
| @TableField(exist = false) | |||
| private Integer endProperty; | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同编号", name = "contractNumber") | |||
| private String contractNumber; | |||
| //地址 | |||
| private String linkAddress; | |||
| @@ -129,12 +100,7 @@ public class WxRentContract extends TenantEntity { | |||
| private String price; | |||
| @TableField(exist = false) | |||
| private String priceTwoDecimal;//2位小数 | |||
| @io.swagger.annotations.ApiModelProperty(value = "起租开始时间", name = "rentalStartDate") | |||
| private Date rentalStartDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "rentalEndDate") | |||
| private Date rentalEndDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "签定合同时间", name = "signDate") | |||
| private Date signDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "计费周期", name = "receivePeriod") | |||
| private Integer receivePeriod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "付款周期(计费周期的倍数)", name = "receivePeriod") | |||
| @@ -185,9 +151,6 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "filename") | |||
| private String filename; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租期(月)", name = "lease") | |||
| private Integer lease; | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumRentContractType", name = "type") | |||
| private Integer type; | |||
| @TableField(exist = false) | |||
| @@ -206,9 +169,6 @@ public class WxRentContract extends TenantEntity { | |||
| return revenueRatioSet; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "计租周期 1日2月3自然月EnumRentContractAdjustPeriod", name = "adjustPeriod") | |||
| private Integer adjustPeriod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点比率", name = "payRatio") | |||
| private String payRatio; | |||
| @@ -223,12 +183,6 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否设置保底营业额", name = "revenueRatio") | |||
| private Integer revenueRatio; | |||
| @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 = "审核状态, 0未审核 1审核中 2审核通过 3驳回", name = "applyStatus") | |||
| private Integer applyStatus; | |||
| @@ -245,12 +199,6 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||
| private Map<String, Object> flowParams; | |||
| @io.swagger.annotations.ApiModelProperty(value = "装修期开始时间", name = "fixStartDate") | |||
| private Date fixStartDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "装修期结束时间", name = "fixEndDate") | |||
| private Date fixEndDate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁合同预账单列表", name = "previewBillRentList") | |||
| private List<WxAllBill> previewBillRentList; | |||
| @@ -350,9 +298,6 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "到期提醒手机号", name = "outDateNotifyPhone") | |||
| private String outDateNotifyPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value = "设计文件", name = "outDateNotifyPhone") | |||
| private String designFile; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单开始时间", name = "firstBillDateStart") | |||
| private Date firstBillDateStart; | |||
| @@ -551,6 +496,41 @@ public class WxRentContract extends TenantEntity { | |||
| this.setFreePeriods(voList); | |||
| } | |||
| } | |||
| @TableField(exist = false) | |||
| private String building; | |||
| @TableField(exist = false) | |||
| private String floor; | |||
| @TableField(exist = false) | |||
| private String floorName; | |||
| @TableField(exist = false) | |||
| private String buildingName; | |||
| @TableField(exist = false) | |||
| private String brandName; | |||
| @TableField(exist = false) | |||
| private String buildArea; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "allPeriod") | |||
| private Integer allPeriod; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "period") | |||
| private Integer period; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "needPay") | |||
| private Integer needPay; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "receivePay") | |||
| private Integer receivePay; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "owe") | |||
| private Integer owe; | |||
| @TableField(exist = false) | |||
| private String receiveDate; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "latePayPrice") | |||
| private Integer latePayPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否同时终止物业", name = "endProperty") | |||
| @TableField(exist = false) | |||
| private Integer endProperty; | |||
| @TableField(exist = false) | |||
| private String salesMoney; | |||
| @@ -78,7 +78,7 @@ public interface WxRentContractService { | |||
| //void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId); | |||
| ResultData updateFile(WxRentContract wxRentContract, MallUserInfo user,String userName,Date oldRentStartDate,boolean writeComplate); | |||
| ResultData updateFile(WxRentContract wxRentContract, MallUserInfo user,String userName,boolean writeComplate); | |||
| ResultData updateRentContractStatus(Long id,boolean buildPropertyBill); | |||
| @@ -806,7 +806,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| BigDecimal allHandleMoney = receiveTotal.add(new BigDecimal(0)); | |||
| if (null != calcuteDto.getTotalSetoff()) { | |||
| addreceive.setSetOffMoney(calcuteDto.getTotalSetoff().toPlainString()); | |||
| allHandleMoney.add(calcuteDto.getTotalSetoff()); | |||
| allHandleMoney = allHandleMoney.add(calcuteDto.getTotalSetoff()); | |||
| } | |||
| //校验金额+冲抵是不是超过了应收费用 | |||
| @@ -1795,24 +1795,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| @Override | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public ResultData updateFile(WxRentContract record, MallUserInfo user,String userName,Date oldRentStartDate,boolean writeComplate) { | |||
| public ResultData updateFile(WxRentContract record, MallUserInfo user,String userName,boolean writeComplate) { | |||
| WxRentContract wxRentContract = wxRentContractMapper.selectById(record.getId()); | |||
| if (null == wxRentContract) { | |||
| return new ResultData(Result.ERROR,"id查询不到合同"); | |||
| } | |||
| // // 保存调整金额(预账单调整) | |||
| // if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){ | |||
| // wxRentContract.setPreviewBillRentList(record.getPreviewBillRentList()); | |||
| // savePreviewBill(wxRentContract,user); | |||
| // //保存商业管理费账单 | |||
| // savePreviewManageFeeBill(wxRentContract,user,EnumRentContractManageFeeType.RENT_BUSSINESS_MANAGE_FEE); | |||
| // //保存营业管理费账单 | |||
| // savePreviewManageFeeBill(wxRentContract,user,EnumRentContractManageFeeType.RENT_OPERATING_MANAGE_FEE); | |||
| // } | |||
| WxRentContract rc = new WxRentContract(); | |||
| rc.setId(record.getId()); | |||
| rc.setRentalStartDate(oldRentStartDate); | |||
| rc.setDecimalSize(wxRentContract.getDecimalSize()); | |||
| if (writeComplate) { | |||
| rc.setStatus(EnumRentContractStatus.DRAFT.getCode()); | |||