| @@ -446,6 +446,8 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| contract.setUpdatetime(new Date()); | contract.setUpdatetime(new Date()); | ||||
| contract.setUpdateBy(user.getId()); | contract.setUpdateBy(user.getId()); | ||||
| wxRentContractService.updateRentContract(contract); | wxRentContractService.updateRentContract(contract); | ||||
| //删除预览的账单 | |||||
| wxRentContractService.deletePrewBill(contract); | |||||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | ||||
| if (null != wxRentContract.getPropertyId()) { | if (null != wxRentContract.getPropertyId()) { | ||||
| @@ -455,6 +457,9 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| propertyContract.setUpdatetime(new Date()); | propertyContract.setUpdatetime(new Date()); | ||||
| propertyContract.setUpdateBy(user.getId()); | propertyContract.setUpdateBy(user.getId()); | ||||
| wxPropertyContractService.updatePropertyContract(propertyContract); | wxPropertyContractService.updatePropertyContract(propertyContract); | ||||
| //删除预览的账单 | |||||
| wxPropertyContractService.deletePreviewBill(propertyContract); | |||||
| } | } | ||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -1,4 +1,5 @@ | |||||
| ALTER TABLE wx_rent_contract ADD COLUMN day_price_calcute INT(1) NOT NULL DEFAULT 1 COMMENT '每天价格计算规则'; | ALTER TABLE wx_rent_contract ADD COLUMN day_price_calcute INT(1) NOT NULL DEFAULT 1 COMMENT '每天价格计算规则'; | ||||
| 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 fixed_price INT(1) NOT NULL DEFAULT 0 COMMENT '是否固定价格'; | |||||
| @@ -229,6 +229,8 @@ public class WxRentContract extends TenantEntity { | |||||
| private String price; | private String price; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String priceTwoDecimal;//2位小数 | private String priceTwoDecimal;//2位小数 | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否固定租金", name = "fixedPrice") | |||||
| private Integer fixedPrice; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "起租开始时间", name = "rentalStartDate") | @io.swagger.annotations.ApiModelProperty(value = "起租开始时间", name = "rentalStartDate") | ||||
| private Date rentalStartDate; | private Date rentalStartDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "rentalEndDate") | @io.swagger.annotations.ApiModelProperty(value = "", name = "rentalEndDate") | ||||
| @@ -92,6 +92,8 @@ public interface WxPropertyContractService { | |||||
| void updatePropertyContract(WxPropertyContract record); | void updatePropertyContract(WxPropertyContract record); | ||||
| void deletePreviewBill(WxPropertyContract record); | |||||
| void setEndContractTime(WxPropertyContract proertyContract); | void setEndContractTime(WxPropertyContract proertyContract); | ||||
| List<WxPropertyContract> findToEndContractList(WxPropertyContract record); | List<WxPropertyContract> findToEndContractList(WxPropertyContract record); | ||||
| @@ -145,4 +145,6 @@ public interface WxRentContractService { | |||||
| void calcuteByTradeDaily(WxRentContract wxRentContract); | void calcuteByTradeDaily(WxRentContract wxRentContract); | ||||
| void deletePrewBill(WxRentContract wxRentContract); | |||||
| } | } | ||||
| @@ -448,6 +448,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| return new ResultData(Result.SUCCESS, "更新物业合同信息成功", record); | return new ResultData(Result.SUCCESS, "更新物业合同信息成功", record); | ||||
| } | } | ||||
| @Override | |||||
| public void deletePreviewBill(WxPropertyContract record) { | |||||
| wxBillPropertyMapper.deleteBillByContract(record); | |||||
| } | |||||
| @Override | @Override | ||||
| //@Transactional(rollbackFor = {Exception.class}) | //@Transactional(rollbackFor = {Exception.class}) | ||||
| public ResultData updateFile(WxPropertyContract record, MallUserInfo user, String userName,boolean writeComplate) { | public ResultData updateFile(WxPropertyContract record, MallUserInfo user, String userName,boolean writeComplate) { | ||||
| @@ -602,19 +602,18 @@ 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)) { | ||||
| //删除预账单,重新生成 | |||||
| wxBillRentMapper.deleteBillByContract(record); | |||||
| //删除商业管理费账单 | |||||
| WxBillRentManage wxBillRentManage = new WxBillRentManage(); | |||||
| wxBillRentManage.setRentContractId(record.getId()); | |||||
| wxBillRentManage.setManageFeeType(EnumRentContractManageFeeType.RENT_BUSSINESS_MANAGE_FEE.getCode()); | |||||
| wxBillRentManage.updateTenantInfo(record); | |||||
| wxBillRentManageMapper.deletePreviewBill(wxBillRentManage); | |||||
| //删除营业管理费账单 | |||||
| wxBillRentManage.setManageFeeType(EnumRentContractManageFeeType.RENT_OPERATING_MANAGE_FEE.getCode()); | |||||
| wxBillRentManageMapper.deletePreviewBill(wxBillRentManage); | |||||
| deletePrewBill(record); | |||||
| // //删除预账单,重新生成 | |||||
| // wxBillRentMapper.deleteBillByContract(record); | |||||
| // //删除商业管理费账单 | |||||
| // WxBillRentManage wxBillRentManage = new WxBillRentManage(); | |||||
| // wxBillRentManage.setRentContractId(record.getId()); | |||||
| // wxBillRentManage.setManageFeeType(EnumRentContractManageFeeType.RENT_BUSSINESS_MANAGE_FEE.getCode()); | |||||
| // wxBillRentManage.updateTenantInfo(record); | |||||
| // wxBillRentManageMapper.deletePreviewBill(wxBillRentManage); | |||||
| // //删除营业管理费账单 | |||||
| // wxBillRentManage.setManageFeeType(EnumRentContractManageFeeType.RENT_OPERATING_MANAGE_FEE.getCode()); | |||||
| // wxBillRentManageMapper.deletePreviewBill(wxBillRentManage); | |||||
| //联营扣点,不设置保底营业额,不生成账单 | //联营扣点,不设置保底营业额,不生成账单 | ||||
| //if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(record.getType()) && record.getRevenueRatio().equals(0)) { | //if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(record.getType()) && record.getRevenueRatio().equals(0)) { | ||||
| @@ -3480,4 +3479,19 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return new BigDecimal(sumMoney); | return new BigDecimal(sumMoney); | ||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void deletePrewBill(WxRentContract record) { | |||||
| //删除预账单,重新生成 | |||||
| wxBillRentMapper.deleteBillByContract(record); | |||||
| //删除商业管理费账单 | |||||
| WxBillRentManage wxBillRentManage = new WxBillRentManage(); | |||||
| wxBillRentManage.setRentContractId(record.getId()); | |||||
| wxBillRentManage.setManageFeeType(EnumRentContractManageFeeType.RENT_BUSSINESS_MANAGE_FEE.getCode()); | |||||
| wxBillRentManage.updateTenantInfo(record); | |||||
| wxBillRentManageMapper.deletePreviewBill(wxBillRentManage); | |||||
| //删除营业管理费账单 | |||||
| wxBillRentManage.setManageFeeType(EnumRentContractManageFeeType.RENT_OPERATING_MANAGE_FEE.getCode()); | |||||
| wxBillRentManageMapper.deletePreviewBill(wxBillRentManage); | |||||
| } | |||||
| } | } | ||||
| @@ -130,6 +130,7 @@ | |||||
| <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="fixed_price" jdbcType="INTEGER" property="fixedPrice"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| @@ -142,7 +143,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`,`fixed_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 +196,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 != fixedPrice ">and `fixed_price` = #{fixedPrice}</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 +380,13 @@ | |||||
| <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="fixed_price" property="fixedPrice"/> | |||||
| </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.fixed_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 | ||||
| @@ -425,6 +428,7 @@ | |||||
| <if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if> | <if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if> | ||||
| <if test=" null != dayPriceCalcute ">and rc.`day_price_calcute` = #{dayPriceCalcute}</if> | <if test=" null != dayPriceCalcute ">and rc.`day_price_calcute` = #{dayPriceCalcute}</if> | ||||
| <if test=" null != monthAverageDays ">and rc.`month_average_days` = #{monthAverageDays}</if> | <if test=" null != monthAverageDays ">and rc.`month_average_days` = #{monthAverageDays}</if> | ||||
| <if test=" null != fixedPrice ">and rc.`fixed_price` = #{fixedPrice}</if> | |||||
| <if test=" null != businessForRule and '' != businessForRule "> | <if test=" null != businessForRule and '' != businessForRule "> | ||||
| and rc.business_id in (${businessForRule}) | and rc.business_id in (${businessForRule}) | ||||
| </if> | </if> | ||||