| @@ -0,0 +1,5 @@ | |||||
| ALTER TABLE `mallink`.`wx_rent_contract` | |||||
| ADD COLUMN `revenue_ratio` int(1) NOT NULL DEFAULT 1 COMMENT '是否设置保底营业额,1-设置 0-不设置' AFTER `revenue`; | |||||
| ALTER TABLE `mallink`.`wx_rent_contract` | |||||
| ADD COLUMN `revenue_year` JSON COMMENT '每年保底营业额' AFTER `revenue_ratio`; | |||||
| @@ -286,15 +286,21 @@ public class WxRentContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "调整比例", name = "adjustRatio") | @io.swagger.annotations.ApiModelProperty(value = "调整比例", name = "adjustRatio") | ||||
| private String adjustRatio; | private String adjustRatio; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "计租周期 1日2月", name = "adjustPeriod") | @io.swagger.annotations.ApiModelProperty(value = "计租周期 1日2月", name = "adjustPeriod") | ||||
| private Integer adjustPeriod; | private Integer adjustPeriod; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "支付比例", name = "payRatio") | @io.swagger.annotations.ApiModelProperty(value = "支付比例", name = "payRatio") | ||||
| private Integer payRatio; | private Integer payRatio; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "营业额", name = "revenue") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "保底营业额", name = "revenue") | |||||
| private Long revenue; | private Long revenue; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否设置保底营业额", name = "revenueRatio") | |||||
| private Integer revenueRatio; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "调整比例", name = "adjustRatio") | |||||
| private String revenueYear; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "计租开始时间", name = "startDate") | @io.swagger.annotations.ApiModelProperty(value = "计租开始时间", name = "startDate") | ||||
| private Date startDate; | private Date startDate; | ||||
| @@ -9,7 +9,8 @@ public enum EnumRentContractAdjustRatioWay { | |||||
| RATIO(1, "按比例"), | RATIO(1, "按比例"), | ||||
| MONEY(2, "按金额"), | MONEY(2, "按金额"), | ||||
| CUSTOM(3, "自定义"),; | |||||
| CUSTOM(3, "固定金额"), | |||||
| FIX_RATIO(4, "固定比率"); | |||||
| public static EnumRentContractAdjustRatioWay getEnum(Integer code) { | public static EnumRentContractAdjustRatioWay getEnum(Integer code) { | ||||
| for (EnumRentContractAdjustRatioWay value : values()) { | for (EnumRentContractAdjustRatioWay value : values()) { | ||||
| @@ -319,9 +319,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| if (null == record.getDeposit()) { | if (null == record.getDeposit()) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "押金不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "押金不能为空"); | ||||
| } | } | ||||
| if (record.getPrice().longValue() <= 0) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "物业费要大于0"); | |||||
| } | |||||
| // if (record.getPrice().longValue() <= 0) { | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "物业费要大于0"); | |||||
| // } | |||||
| // WxPropertyContract propertyContract = new WxPropertyContract(); | // WxPropertyContract propertyContract = new WxPropertyContract(); | ||||
| // propertyContract.updateTenantInfo(wxRentContract); | // propertyContract.updateTenantInfo(wxRentContract); | ||||
| @@ -573,7 +573,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if(CollectionUtils.isEmpty(record.getPreviewBillRentList())) { | if(CollectionUtils.isEmpty(record.getPreviewBillRentList())) { | ||||
| if (record.getReceivePeriod() != null && record.getLease() != null | if (record.getReceivePeriod() != null && record.getLease() != null | ||||
| && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0)) { | |||||
| && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getRevenueRatio().equals(0)) { | |||||
| //删除预账单,重新生成 | //删除预账单,重新生成 | ||||
| wxBillRentMapper.deletePreviewBill(record); | wxBillRentMapper.deletePreviewBill(record); | ||||
| resultList = buildRent(null, record, EnumIsPreview.YES.getCode(),true); | resultList = buildRent(null, record, EnumIsPreview.YES.getCode(),true); | ||||
| @@ -1110,9 +1110,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| priceArrs = new long[size]; | priceArrs = new long[size]; | ||||
| priceArrs[0] = price; | priceArrs[0] = price; | ||||
| BigDecimal priceD = new BigDecimal(price); | BigDecimal priceD = new BigDecimal(price); | ||||
| String revenueYear = wxRentContract.getRevenueYear(); | |||||
| List<Long> revenueYears = JSONArray.parseArray(revenueYear, Long.class); | |||||
| revenueYears.add(0,0L); | |||||
| if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { | if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { | ||||
| for (int i = 1; i < size; i++) { | for (int i = 1; i < size; i++) { | ||||
| BigDecimal divide = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000)); | |||||
| BigDecimal divide = new BigDecimal(revenueYears.get(i)).multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000)); | |||||
| priceD = priceD.add(divide); | priceD = priceD.add(divide); | ||||
| priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue(); | priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue(); | ||||
| } | } | ||||
| @@ -1121,7 +1126,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| priceD = priceD.add(new BigDecimal(integers.get(i))); | priceD = priceD.add(new BigDecimal(integers.get(i))); | ||||
| priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue(); | priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue(); | ||||
| } | } | ||||
| } else { | |||||
| } 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 (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | ||||
| if (EnumMissTimeType.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())) { | if (EnumMissTimeType.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())) { | ||||
| @@ -1135,6 +1140,20 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| priceArrs[i] = new BigDecimal(integers.get(i)).setScale(0, RoundingMode.HALF_EVEN).longValue(); | priceArrs[i] = new BigDecimal(integers.get(i)).setScale(0, RoundingMode.HALF_EVEN).longValue(); | ||||
| } | } | ||||
| }else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.FIX_RATIO.getCode())){ | |||||
| 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(revenueYears.get(i)).multiply(new BigDecimal(integers.get(i))).multiply(new BigDecimal(12)).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||||
| continue; | |||||
| } | |||||
| if (EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||||
| priceArrs[i] = new BigDecimal(revenueYears.get(i)).multiply(new BigDecimal(integers.get(i))).multiply(new BigDecimal(wxRentContract.getReceivePeriod())).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||||
| continue; | |||||
| } | |||||
| } | |||||
| priceArrs[i] = new BigDecimal(revenueYears.get(i)).multiply(new BigDecimal(integers.get(i))).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -60,6 +60,8 @@ | |||||
| <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="revenue" jdbcType="INTEGER" property="revenue"/> | <result column="revenue" jdbcType="INTEGER" property="revenue"/> | ||||
| <result column="revenue_ratio" jdbcType="INTEGER" property="revenueRatio"/> | |||||
| <result column="revenue_year" jdbcType="VARCHAR" property="revenueYear"/> | |||||
| <result column="adjust_ratio" jdbcType="VARCHAR" property="adjustRatio"/> | <result column="adjust_ratio" jdbcType="VARCHAR" property="adjustRatio"/> | ||||
| <result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/> | <result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/> | ||||
| <result column="pay_ratio" jdbcType="INTEGER" property="payRatio"/> | <result column="pay_ratio" jdbcType="INTEGER" property="payRatio"/> | ||||
| @@ -123,7 +125,7 @@ | |||||
| `property_name`,`property_fee`,`fee_cycle`,`water_fee`,`electricity_fees`, | `property_name`,`property_fee`,`fee_cycle`,`water_fee`,`electricity_fees`, | ||||
| `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`,`adjust_ratio`,`adjust_period`,`pay_ratio`, | |||||
| `pay_account`,`filename`,`lease`,`type`,`revenue`,`revenue_ratio`,`revenue_year`,`adjust_ratio`,`adjust_period`,`pay_ratio`, | |||||
| `start_date`,`end_date`,`shop_name`,`from_id`, | `start_date`,`end_date`,`shop_name`,`from_id`, | ||||
| `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, | ||||
| @@ -490,7 +492,7 @@ | |||||
| rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`, | rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`, | ||||
| rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`, | rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`, | ||||
| rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`, | rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`, | ||||
| rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`, | |||||
| rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`revenue_ratio`,rc.`revenue_year`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`, | |||||
| rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`, | rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`, | ||||
| rc.`apply_status`,rc.`bank_name`,rc.`rent_shop_type`,rc.`fix_start_date`,rc.`fix_end_date`, | rc.`apply_status`,rc.`bank_name`,rc.`rent_shop_type`,rc.`fix_start_date`,rc.`fix_end_date`, | ||||
| rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type, | rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type, | ||||
| @@ -515,7 +517,7 @@ | |||||
| rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`, | rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`, | ||||
| rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`, | rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`, | ||||
| rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`, | rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`, | ||||
| rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`, | |||||
| rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`revenue_ratio`,rc.`revenue_year`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`, | |||||
| rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`, | rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`, | ||||
| rc.`apply_status`,rc.`bank_name`,rc.`rent_shop_type`,rc.`fix_start_date`,rc.`fix_end_date`, | rc.`apply_status`,rc.`bank_name`,rc.`rent_shop_type`,rc.`fix_start_date`,rc.`fix_end_date`, | ||||
| rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type, | rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type, | ||||