| @@ -172,9 +172,6 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | ||||
| Integer contractType = wxRentPropertyContractService.getContractType(wxRentContract.getRentShopType(), wxRentContract.getOperationType(), EnumContractType.RENT.getCode()); | Integer contractType = wxRentPropertyContractService.getContractType(wxRentContract.getRentShopType(), wxRentContract.getOperationType(), EnumContractType.RENT.getCode()); | ||||
| wxRentContract.setContractType(contractType); | wxRentContract.setContractType(contractType); | ||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| //WxMerchant wxMerchant = new WxMerchant(); | //WxMerchant wxMerchant = new WxMerchant(); | ||||
| //wxMerchant.setName(wxRentContract.getMerchantName()); | //wxMerchant.setName(wxRentContract.getMerchantName()); | ||||
| //wxMerchant.setId(wxRentContract.getMerchantId()); | //wxMerchant.setId(wxRentContract.getMerchantId()); | ||||
| @@ -209,9 +206,6 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| @PostMapping("updateMoney") | @PostMapping("updateMoney") | ||||
| public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { | public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney"); | ||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| if (null != wxRentContract.getDecimalSize() && wxRentContract.getDecimalSize() <= 0 ) { | if (null != wxRentContract.getDecimalSize() && wxRentContract.getDecimalSize() <= 0 ) { | ||||
| wxRentContract.setDecimalSize(Constant.default_short_decimal_size); | wxRentContract.setDecimalSize(Constant.default_short_decimal_size); | ||||
| } | } | ||||
| @@ -243,9 +237,6 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| @PostMapping("updateFile") | @PostMapping("updateFile") | ||||
| public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile"); | ||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxRentContract.updateTenantInfo(user); | wxRentContract.updateTenantInfo(user); | ||||
| //wxRentContract.setAdjustPeriodHandle(); | //wxRentContract.setAdjustPeriodHandle(); | ||||
| @@ -292,9 +283,6 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| (cure.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue() | (cure.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue() | ||||
| && (cure.getApplyStatus().intValue()== EnumRentContractAppStatus.REJECT.getCode().intValue() || | && (cure.getApplyStatus().intValue()== EnumRentContractAppStatus.REJECT.getCode().intValue() || | ||||
| cure.getApplyStatus().intValue()== EnumRentContractAppStatus.SETBACK.getCode().intValue()))) { | cure.getApplyStatus().intValue()== EnumRentContractAppStatus.SETBACK.getCode().intValue()))) { | ||||
| if(StringUtils.isBlank(rentContract.getBusDiscountRatio())){ | |||||
| rentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| rentContract.updateTenantInfo(user); | rentContract.updateTenantInfo(user); | ||||
| rentContract.setAdjustPeriodHandle(); | rentContract.setAdjustPeriodHandle(); | ||||
| @@ -2,3 +2,5 @@ ALTER TABLE wx_rent_contract ADD COLUMN day_price_calcute INT(1) NOT NULL DEFAUL | |||||
| ALTER TABLE wx_rent_contract ADD COLUMN month_average_days INT(2) COMMENT '每月平均天数'; | ALTER TABLE wx_rent_contract ADD COLUMN month_average_days INT(2) COMMENT '每月平均天数'; | ||||
| ALTER TABLE wx_property_contract ADD COLUMN day_price_calcute INT(1) NOT NULL DEFAULT 1 COMMENT '每天价格计算规则'; | ALTER TABLE wx_property_contract ADD COLUMN day_price_calcute INT(1) NOT NULL DEFAULT 1 COMMENT '每天价格计算规则'; | ||||
| ALTER TABLE wx_property_contract ADD COLUMN month_average_days INT(2) COMMENT '每月平均天数'; | ALTER TABLE wx_property_contract ADD COLUMN month_average_days INT(2) COMMENT '每月平均天数'; | ||||
| ALTER TABLE wx_rent_contract ADD COLUMN revenue_fixed_rent_price INT(1) NOT NULL DEFAULT 0 COMMENT '联营扣点租金取高租金固定价格'; | |||||
| ALTER TABLE wx_rent_contract ADD COLUMN revenue_rent_price VARCHAR(30) COMMENT '联营扣点租金取高租金固定价格'; | |||||
| @@ -314,6 +314,11 @@ public class WxRentContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "保底营业额", name = "revenue") | @io.swagger.annotations.ApiModelProperty(value = "保底营业额", name = "revenue") | ||||
| private String revenue; | private String revenue; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点租金取高租金价格是否固定", name = "revenueFixedRentPrice") | |||||
| private Integer revenueFixedRentPrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点租金取高租金固定价格", name = "revenueRentPrice") | |||||
| private String revenueRentPrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否设置保底营业额", name = "revenueRatio") | @io.swagger.annotations.ApiModelProperty(value = "是否设置保底营业额", name = "revenueRatio") | ||||
| private Integer revenueRatio; | private Integer revenueRatio; | ||||
| @@ -414,8 +419,8 @@ public class WxRentContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点跳点设置", name = "busDiscountRatio") | @io.swagger.annotations.ApiModelProperty(value = "联营扣点跳点设置", name = "busDiscountRatio") | ||||
| private String busDiscountRatio; | private String busDiscountRatio; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点跳点-时间范围 1年2月3周期", name = "busDiscountTime") | |||||
| private Integer busDiscountTime; | |||||
| // @io.swagger.annotations.ApiModelProperty(value = "联营扣点跳点-时间范围 1年2月3周期", name = "busDiscountTime") | |||||
| // private Integer busDiscountTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "查询店铺", name = "queryShopId") | @io.swagger.annotations.ApiModelProperty(value = "查询店铺", name = "queryShopId") | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -121,15 +121,25 @@ public class WxRentContractHelper { | |||||
| return computeRatioByShop(Constant.default_long_decimal_size,rentInfoArray,wxRentContract.getAdjustRatioWay(),priceArr,"adjustRatio"); | return computeRatioByShop(Constant.default_long_decimal_size,rentInfoArray,wxRentContract.getAdjustRatioWay(),priceArr,"adjustRatio"); | ||||
| } | } | ||||
| //计算每年租金基数(合铺录入) | |||||
| //计算每年租金基数值(合铺录入),具体计算在合同创建时,会根据合同的PriceUnit来根据此基数来计算 | |||||
| private static String[] calcuteRentPriceByJoin(WxRentContract wxRentContract) { | private static String[] calcuteRentPriceByJoin(WxRentContract wxRentContract) { | ||||
| String adjustRatio = wxRentContract.getAdjustRatio(); | String adjustRatio = wxRentContract.getAdjustRatio(); | ||||
| List<Integer> integers = JSONArray.parseArray(adjustRatio, Integer.class); | List<Integer> integers = JSONArray.parseArray(adjustRatio, Integer.class); | ||||
| integers.add(0, 0); | integers.add(0, 0); | ||||
| int size = integers.size(); | int size = integers.size(); | ||||
| String[] priceArrs = new String[size]; | String[] priceArrs = new String[size]; | ||||
| priceArrs[0] = wxRentContract.getPrice(); | |||||
| BigDecimal priceD = new BigDecimal(wxRentContract.getPrice()); | |||||
| //如果是联营扣点租金取高,是固定租金 | |||||
| BigDecimal priceD = null; | |||||
| if (null != wxRentContract.getRevenueFixedRentPrice() && | |||||
| wxRentContract.getRevenueFixedRentPrice().intValue() == EnumYesOrNo.YES.getCode()) { | |||||
| priceArrs[0] = wxRentContract.getRevenueRentPrice(); | |||||
| priceD = new BigDecimal(wxRentContract.getRevenueRentPrice()); | |||||
| }else { | |||||
| priceArrs[0] = wxRentContract.getPrice(); | |||||
| priceD = new BigDecimal(wxRentContract.getPrice()); | |||||
| } | |||||
| //BigDecimal priceD = new BigDecimal(wxRentContract.getPrice()); | |||||
| //联营保底营业额。 | //联营保底营业额。 | ||||
| String revenueYear = wxRentContract.getRevenueYear(); | String revenueYear = wxRentContract.getRevenueYear(); | ||||
| @@ -157,18 +167,6 @@ public class WxRentContractHelper { | |||||
| } | } | ||||
| } else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ | } else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ | ||||
| for (int i = 1; i < size; i++) { | for (int i = 1; i < size; i++) { | ||||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||||
| if (EnumMissTimeType.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| priceArrs[i] = new BigDecimal(integers.get(i)).multiply(new BigDecimal(12)) | |||||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||||
| continue; | |||||
| } | |||||
| if (EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| priceArrs[i] = new BigDecimal(integers.get(i)).multiply(new BigDecimal(wxRentContract.getReceivePeriod())) | |||||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||||
| continue; | |||||
| } | |||||
| } | |||||
| priceArrs[i] = new BigDecimal(integers.get(i)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | priceArrs[i] = new BigDecimal(integers.get(i)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | ||||
| } | } | ||||
| }else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.FIX_RATIO.getCode())){ | }else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.FIX_RATIO.getCode())){ | ||||
| @@ -180,17 +178,6 @@ public class WxRentContractHelper { | |||||
| }else { | }else { | ||||
| _p = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000)); | _p = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000)); | ||||
| } | } | ||||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||||
| if (EnumMissTimeType.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| priceArrs[i] = _p.multiply(new BigDecimal(12)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||||
| continue; | |||||
| } | |||||
| if (EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| priceArrs[i] = _p.multiply(new BigDecimal(wxRentContract.getReceivePeriod())) | |||||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||||
| continue; | |||||
| } | |||||
| } | |||||
| priceArrs[i] = _p.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | priceArrs[i] = _p.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -244,18 +231,6 @@ public class WxRentContractHelper { | |||||
| } | } | ||||
| } else if (wxRentContract.getRevenueRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ | } else if (wxRentContract.getRevenueRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ | ||||
| for (int i = 1; i < size; i++) { | for (int i = 1; i < size; i++) { | ||||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||||
| if (EnumMissTimeType.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| revenuePriceArrs[i] = new BigDecimal(revenueRationSets.get(i)).multiply(new BigDecimal(12)) | |||||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||||
| continue; | |||||
| } | |||||
| if (EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| revenuePriceArrs[i] = new BigDecimal(revenueRationSets.get(i)).multiply(new BigDecimal(wxRentContract.getReceivePeriod())) | |||||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||||
| continue; | |||||
| } | |||||
| } | |||||
| revenuePriceArrs[i] = new BigDecimal(revenueRationSets.get(i)) | revenuePriceArrs[i] = new BigDecimal(revenueRationSets.get(i)) | ||||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | ||||
| } | } | ||||
| @@ -265,18 +240,6 @@ public class WxRentContractHelper { | |||||
| if (revenueYears.size() == size && revenueRationSets.size() == size) { | if (revenueYears.size() == size && revenueRationSets.size() == size) { | ||||
| _p = new BigDecimal(revenueRationSets.get(i)).multiply(new BigDecimal(revenueYears.get(i))).divide(new BigDecimal(10000)); | _p = new BigDecimal(revenueRationSets.get(i)).multiply(new BigDecimal(revenueYears.get(i))).divide(new BigDecimal(10000)); | ||||
| } | } | ||||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||||
| if (EnumMissTimeType.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| revenuePriceArrs[i] = _p.multiply(new BigDecimal(12)) | |||||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||||
| continue; | |||||
| } | |||||
| if (EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| revenuePriceArrs[i] = _p.multiply(new BigDecimal(wxRentContract.getReceivePeriod())) | |||||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||||
| continue; | |||||
| } | |||||
| } | |||||
| revenuePriceArrs[i] = _p.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | revenuePriceArrs[i] = _p.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -394,23 +357,11 @@ public class WxRentContractHelper { | |||||
| needpay = new BigDecimal(needpayD).setScale(wxRentContract.getDecimalSize(), RoundingMode.HALF_UP).toPlainString(); | needpay = new BigDecimal(needpayD).setScale(wxRentContract.getDecimalSize(), RoundingMode.HALF_UP).toPlainString(); | ||||
| }else{ | }else{ | ||||
| BigDecimal priceD = new BigDecimal(price); | BigDecimal priceD = new BigDecimal(price); | ||||
| if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType())) { | |||||
| //设置跳点率为年周期 price不变 | |||||
| if (EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| return priceD.toPlainString(); | |||||
| } | |||||
| //年或者设置跳点率为年周期 除12 | |||||
| if (EnumMissTimeType.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| priceD = new BigDecimal(price).divide(new BigDecimal(12),Constant.default_long_decimal_size,RoundingMode.HALF_UP).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP); | |||||
| } | |||||
| }else{ | |||||
| //年 除12 | |||||
| if(EnumPriceUnit.Y.getCode().equals(wxRentContract.getPriceUnit())){ | |||||
| priceD = new BigDecimal(price).divide(new BigDecimal(12),Constant.default_long_decimal_size,RoundingMode.HALF_UP).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP); | |||||
| } | |||||
| //年 除12 | |||||
| if(EnumPriceUnit.Y.getCode().equals(wxRentContract.getPriceUnit())){ | |||||
| priceD = new BigDecimal(price).divide(new BigDecimal(12),Constant.default_long_decimal_size,RoundingMode.HALF_UP).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP); | |||||
| } | } | ||||
| //生成金额直接计算 | //生成金额直接计算 | ||||
| if(!saveDb){ | if(!saveDb){ | ||||
| //needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,part)).longValue(); | //needpay = new Double(getMonthNeedPay(priceD, startDate, endDate,dayType,receivePeriod,part)).longValue(); | ||||
| @@ -349,29 +349,29 @@ public class WxBillRentServiceImpl extends WxBillBaseService implements WxBillRe | |||||
| ratio = wxRentContract.getPayRatio(); | ratio = wxRentContract.getPayRatio(); | ||||
| }else{ | }else{ | ||||
| if(StringUtils.isNotBlank(wxRentContract.getBusDiscountRatio())){ | if(StringUtils.isNotBlank(wxRentContract.getBusDiscountRatio())){ | ||||
| long dayCount = DateUtils.startToEnd(wxBillRent.getStarttime(),wxBillRent.getEndtime()) + 1; | |||||
| if(EnumBusRatioTime.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())){ | |||||
| if(startInt == endInt && months == 12){ | |||||
| //刚好1年 | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(), | |||||
| wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0,null); | |||||
| }else{ | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(), | |||||
| wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.YEAR.getCode(),dayCount,0,null); | |||||
| } | |||||
| }else if(EnumBusRatioTime.MONTH.getCode().equals(wxRentContract.getBusDiscountTime())){ | |||||
| if(startInt == endInt && months == 1){ | |||||
| //刚好1个月 | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(), | |||||
| wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0,null); | |||||
| }else{ | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(), | |||||
| wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.MONTH.getCode(),dayCount,0,null); | |||||
| } | |||||
| }else if(EnumBusRatioTime.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())){ | |||||
| ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(), | |||||
| EnumMissTimeType.PERIOD.getCode(),dayCount,wxRentContract.getReceivePeriod(),wxRentContract.getReceivePeriodUnit()); | |||||
| } | |||||
| // long dayCount = DateUtils.startToEnd(wxBillRent.getStarttime(),wxBillRent.getEndtime()) + 1; | |||||
| // if(EnumBusRatioTime.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())){ | |||||
| // if(startInt == endInt && months == 12){ | |||||
| // //刚好1年 | |||||
| // ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(), | |||||
| // wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0,null); | |||||
| // }else{ | |||||
| // ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(), | |||||
| // wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.YEAR.getCode(),dayCount,0,null); | |||||
| // } | |||||
| // }else if(EnumBusRatioTime.MONTH.getCode().equals(wxRentContract.getBusDiscountTime())){ | |||||
| // if(startInt == endInt && months == 1){ | |||||
| // //刚好1个月 | |||||
| // ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(), | |||||
| // wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0,null); | |||||
| // }else{ | |||||
| // ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(), | |||||
| // wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.MONTH.getCode(),dayCount,0,null); | |||||
| // } | |||||
| // }else if(EnumBusRatioTime.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())){ | |||||
| // ratioVo = WxRentContractServiceImpl.getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(), | |||||
| // EnumMissTimeType.PERIOD.getCode(),dayCount,wxRentContract.getReceivePeriod(),wxRentContract.getReceivePeriodUnit()); | |||||
| // } | |||||
| } | } | ||||
| } | } | ||||
| @@ -139,7 +139,7 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||||
| Integer priceUnit = dbRent.getPriceUnit(); | Integer priceUnit = dbRent.getPriceUnit(); | ||||
| Integer type = dbRent.getType(); | Integer type = dbRent.getType(); | ||||
| Integer period = dbRent.getReceivePeriod(); | Integer period = dbRent.getReceivePeriod(); | ||||
| Integer busDiscountTime = dbRent.getBusDiscountTime(); | |||||
| Integer busDiscountTime = 0; | |||||
| BigDecimal priceDecimal = getPriceDecimal(dbRent.getDecimalSize(),day, price, priceUnit, type, period, busDiscountTime); | BigDecimal priceDecimal = getPriceDecimal(dbRent.getDecimalSize(),day, price, priceUnit, type, period, busDiscountTime); | ||||
| businessSumMoney = businessSumMoney.add(priceDecimal); | businessSumMoney = businessSumMoney.add(priceDecimal); | ||||
| } | } | ||||
| @@ -457,7 +457,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| }else{ | }else{ | ||||
| int dayCount = record.getReceivePeriod() * 30; | int dayCount = record.getReceivePeriod() * 30; | ||||
| RatioVo ratioVo = getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(), | RatioVo ratioVo = getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.RENT.getCode(),record.getRevenue(),record.getBusDiscountRatio(), | ||||
| record.getBusDiscountTime(),dayCount,record.getReceivePeriod(),record.getReceivePeriodUnit()); | |||||
| 0,dayCount,record.getReceivePeriod(),record.getReceivePeriodUnit()); | |||||
| //record.setPayRatio(ratioVo.getRatio()); | //record.setPayRatio(ratioVo.getRatio()); | ||||
| record.setPrice(ratioVo.getPrice()); | record.setPrice(ratioVo.getPrice()); | ||||
| } | } | ||||
| @@ -810,7 +810,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if (wxRentContract == null) { | if (wxRentContract == null) { | ||||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxRentContract.setBusDiscountTime(record.getBusDiscountTime()); | |||||
| wxRentContract.setBusDiscountRatio(record.getBusDiscountRatio()); | wxRentContract.setBusDiscountRatio(record.getBusDiscountRatio()); | ||||
| wxRentContract.setPayRatio(record.getPayRatio()); | wxRentContract.setPayRatio(record.getPayRatio()); | ||||
| @@ -828,7 +827,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| }else{ | }else{ | ||||
| int dayCount = record.getReceivePeriod() * 30; | int dayCount = record.getReceivePeriod() * 30; | ||||
| RatioVo ratioVo = getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.RENT.getCode(),record.getRevenue(), | RatioVo ratioVo = getPayRatio(Constant.default_long_decimal_size,EnumGetRatioFrom.RENT.getCode(),record.getRevenue(), | ||||
| record.getBusDiscountRatio(),record.getBusDiscountTime(),dayCount,record.getReceivePeriod(),record.getReceivePeriodUnit()); | |||||
| record.getBusDiscountRatio(),0,dayCount,record.getReceivePeriod(),record.getReceivePeriodUnit()); | |||||
| //record.setPayRatio(ratioVo.getRatio()); | //record.setPayRatio(ratioVo.getRatio()); | ||||
| record.setPrice(ratioVo.getPrice()); | record.setPrice(ratioVo.getPrice()); | ||||
| } | } | ||||
| @@ -1209,7 +1208,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| Date startDate = wxRentContract.getStartDate(); | Date startDate = wxRentContract.getStartDate(); | ||||
| rentList = buildRentJinmao(user, wxRentContract, receivePeriod, lease, startDate, price, isPreview,saveDb); | rentList = buildRentJinmao(user, wxRentContract, receivePeriod, lease, startDate, price, isPreview,saveDb); | ||||
| }else{ | }else{ | ||||
| rentList = buildRentMonth(user, wxRentContract, receivePeriod, lease, rentalStartDate, price, isPreview,saveDb); | |||||
| rentList = buildRentMonth(user, wxRentContract, receivePeriod, lease, rentalStartDate, isPreview,saveDb); | |||||
| } | } | ||||
| } | } | ||||
| for (int i = 0; i < rentList.size(); i++) { | for (int i = 0; i < rentList.size(); i++) { | ||||
| @@ -1220,7 +1219,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| public List<WxBillRent> buildRentMonth(MallUserInfo user, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, String price, Integer isPreview, boolean saveDb) { | |||||
| public List<WxBillRent> buildRentMonth(MallUserInfo user, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate,Integer isPreview, boolean saveDb) { | |||||
| int years = 0; | int years = 0; | ||||
| //计算租金每年的计费基数 | //计算租金每年的计费基数 | ||||
| String[] priceArrs = WxRentContractHelper.calcuteRentPrice(wxRentContract); | String[] priceArrs = WxRentContractHelper.calcuteRentPrice(wxRentContract); | ||||
| @@ -1572,7 +1571,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| }else{ | }else{ | ||||
| if(billTimeVo.getStartDate().before(endDate)){ | if(billTimeVo.getStartDate().before(endDate)){ | ||||
| if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType()) && EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType()) && EnumMissTimeType.PERIOD.getCode().equals(0)) { | |||||
| //设置跳点率为年周期 price不变 | //设置跳点率为年周期 price不变 | ||||
| needpayFront = priceArrs[index - 1]; | needpayFront = priceArrs[index - 1]; | ||||
| if (null != bussinessManagerPriceArrs && bussinessManagerPriceArrs.length > 0) { | if (null != bussinessManagerPriceArrs && bussinessManagerPriceArrs.length > 0) { | ||||
| @@ -130,6 +130,8 @@ | |||||
| <result column="price_detail" jdbcType="VARCHAR" property="priceDetail"/> | <result column="price_detail" jdbcType="VARCHAR" property="priceDetail"/> | ||||
| <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_fixed_rent_price" jdbcType="INTEGER" property="revenueFixedRentPrice"/> | |||||
| <result column="revenue_rent_price" jdbcType="VARCHAR" property="revenueRentPrice"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| @@ -142,7 +144,7 @@ | |||||
| `deposit`,cashtype_content_lsit,cashtype_lsit,`pay_date`,`is_del`,`merchant_name`, | `deposit`,cashtype_content_lsit,cashtype_lsit,`pay_date`,`is_del`,`merchant_name`, | ||||
| `brand`,`business_id`,`shop_type`,`shop_type_str`,`updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`, | `brand`,`business_id`,`shop_type`,`shop_type_str`,`updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`, | ||||
| `pay_account`,`filename`,`lease`,`type`,`revenue`,`revenue_ratio`,`revenue_year`,`revenue_ratio_way`,`revenue_ratio_set`,`adjust_ratio`,`adjust_period`,`pay_ratio`, | `pay_account`,`filename`,`lease`,`type`,`revenue`,`revenue_ratio`,`revenue_year`,`revenue_ratio_way`,`revenue_ratio_set`,`adjust_ratio`,`adjust_period`,`pay_ratio`, | ||||
| `start_date`,`end_date`,`shop_name`,`from_id`,`end_contract_time`, | |||||
| `start_date`,`end_date`,`shop_name`,`from_id`,`end_contract_time`,`revenue_fixed_rent_price`,`revenue_rent_price`, | |||||
| `apply_status`,`bank_name`,`rent_shop_type`,`fix_start_date`,`fix_end_date`, | `apply_status`,`bank_name`,`rent_shop_type`,`fix_start_date`,`fix_end_date`, | ||||
| `business_type`,`rent_info`, `file_names`,price_unit,rent_price,other_rent_price_info,`subject_name`,rent_start_type, | `business_type`,`rent_info`, `file_names`,price_unit,rent_price,other_rent_price_info,`subject_name`,rent_start_type, | ||||
| `rent_input_way`,`adjust_ratio_way`,`operation_type`,late_pay_ratio,late_pay_day,bus_discount_ratio,bus_discount_time, | `rent_input_way`,`adjust_ratio_way`,`operation_type`,late_pay_ratio,late_pay_day,bus_discount_ratio,bus_discount_time, | ||||
| @@ -195,6 +197,7 @@ | |||||
| <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> | ||||
| <if test=" null != revenueFixedRentPrice ">and `revenue_fixed_rent_price` = #{revenueFixedRentPrice}</if> | |||||
| <if test=" null != shopNumber and shopNumber!=''"> | <if test=" null != shopNumber and shopNumber!=''"> | ||||
| and shop_name like concat('%',#{shopNumber},'%') | and shop_name like concat('%',#{shopNumber},'%') | ||||
| </if> | </if> | ||||
| @@ -378,12 +381,14 @@ | |||||
| <result column="bus_discount_ratio" property="busDiscountRatio"/> | <result column="bus_discount_ratio" property="busDiscountRatio"/> | ||||
| <result column="day_price_calcute" property="dayPriceCalcute"/> | <result column="day_price_calcute" property="dayPriceCalcute"/> | ||||
| <result column="month_average_days" property="monthAverageDays"/> | <result column="month_average_days" property="monthAverageDays"/> | ||||
| <result column="revenue_fixed_rent_price" jdbcType="INTEGER" property="revenueFixedRentPrice"/> | |||||
| <result column="revenue_rent_price" jdbcType="VARCHAR" property="revenueRentPrice"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap"> | <select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap"> | ||||
| select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.id as rent_id, pc.id as property_id, rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`, | select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.id as rent_id, pc.id as property_id, rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`, | ||||
| rc.price as rent_price,rc.contract_number,rc.shop_name,rc.type,rc.apply_status,rc.price_detail, | |||||
| rc.price as rent_price,rc.contract_number,rc.shop_name,rc.type,rc.apply_status,rc.price_detail,rc.revenue_fixed_rent_price,rc.revenue_rent_price, | |||||
| rc.rent_shop_type,rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status, | rc.rent_shop_type,rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status, | ||||
| rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,rc.day_price_calcute, | rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,rc.day_price_calcute, | ||||
| rc.business_type businessType,rc.bus_discount_ratio,rc.bus_discount_time,rc.month_average_days | rc.business_type businessType,rc.bus_discount_ratio,rc.bus_discount_time,rc.month_average_days | ||||