| @@ -486,6 +486,23 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| /** | |||||
| * 设置定时终止时间 | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("setEndContractTime") | |||||
| @SystemControllerLog(description = "租赁合同-设置定时终止合同时间") | |||||
| public ResultData setEndContractTime(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::endContract"); | |||||
| WxRentContract contract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| if (contract == null) { | |||||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | |||||
| } | |||||
| contract.setEndContractTime(wxRentContract.getEndContractTime()); | |||||
| wxRentContractService.setEndContractTime(contract); | |||||
| return new ResultData(); | |||||
| } | |||||
| @RequestMapping("/download") | @RequestMapping("/download") | ||||
| public void download(HttpServletRequest request, HttpServletResponse response){ | public void download(HttpServletRequest request, HttpServletResponse response){ | ||||
| @@ -9,3 +9,6 @@ ADD COLUMN `revenue_ratio_way` int(1) COMMENT '联营扣点调整方式1按比 | |||||
| ALTER TABLE `mallink`.`wx_rent_contract` | ALTER TABLE `mallink`.`wx_rent_contract` | ||||
| ADD COLUMN `revenue_ratio_set` JSON COMMENT '联营扣点调整比率(仅联营面积取高时用)' AFTER `revenue_ratio_way`; | ADD COLUMN `revenue_ratio_set` JSON COMMENT '联营扣点调整比率(仅联营面积取高时用)' AFTER `revenue_ratio_way`; | ||||
| ALTER TABLE `mallink`.`wx_rent_contract` | |||||
| ADD COLUMN `end_contract_time` datetime COMMENT '终止时间'; | |||||
| @@ -84,5 +84,26 @@ public class ContractSchedule { | |||||
| log.info("合同状态更新结束"); | log.info("合同状态更新结束"); | ||||
| } | } | ||||
| /** | |||||
| * 凌晨5分 | |||||
| */ | |||||
| @Async | |||||
| @Scheduled(cron = "0 5 0 * * ?") | |||||
| public void endContract() { | |||||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||||
| for (WxMall wxMall : wxMalls) { | |||||
| //租金合同 | |||||
| WxRentContract record = new WxRentContract(); | |||||
| record.updateTenantInfo(wxMall); | |||||
| List<WxRentContract> contractList = wxRentContractService.findToEndContractList(record); | |||||
| for (WxRentContract rent:contractList) { | |||||
| try { | |||||
| wxRentContractService.endContract(rent); | |||||
| }catch(Exception e) { | |||||
| log.error("rentcontract outDate error.",e); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -96,6 +96,7 @@ public class OrderExpiringSchedule { | |||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| } | } | ||||
| //@Async,事物失效 | |||||
| @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | @Scheduled(cron = "0 */5 * * * *?") // 每5分钟检查一次 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void orderExpireSchedule() { | public void orderExpireSchedule() { | ||||
| @@ -13,6 +13,7 @@ import com.iformall.utils.MaUtil; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -41,7 +42,7 @@ public class OrderRefundAuditSchedule { | |||||
| @Autowired | @Autowired | ||||
| MaUtil maUtil; | MaUtil maUtil; | ||||
| @Async | |||||
| @Scheduled(cron = "0 */5 * * * ?")// | @Scheduled(cron = "0 */5 * * * ?")// | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void orderQueryRefund() { | public void orderQueryRefund() { | ||||
| @@ -130,7 +131,7 @@ public class OrderRefundAuditSchedule { | |||||
| return wxAppinfoMapper.findList(appinfo); | return wxAppinfoMapper.findList(appinfo); | ||||
| } | } | ||||
| @Async | |||||
| @Scheduled(cron = "0 30 */1 * * ?")// 每个小时的30分钟 | @Scheduled(cron = "0 30 */1 * * ?")// 每个小时的30分钟 | ||||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | ||||
| public void merchantAuditCallback() { | public void merchantAuditCallback() { | ||||
| @@ -7,6 +7,7 @@ import com.iformall.service.*; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| @@ -42,6 +43,7 @@ public class TtMerchantReciverSchedule { | |||||
| /** | /** | ||||
| * 每半小时 | * 每半小时 | ||||
| */ | */ | ||||
| @Async | |||||
| @Scheduled(cron = "0 */30 * * * ?") | @Scheduled(cron = "0 */30 * * * ?") | ||||
| // @Scheduled(cron = "0 */5 * * * *?") //测试五分钟执行 | // @Scheduled(cron = "0 */5 * * * *?") //测试五分钟执行 | ||||
| public void updateMerchantReciverSchedule() { | public void updateMerchantReciverSchedule() { | ||||
| @@ -317,7 +317,8 @@ public class WxRentContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "审批流类型: 审批流1合同2账单3终止审批", name = "businessType") | @io.swagger.annotations.ApiModelProperty(value = "审批流类型: 审批流1合同2账单3终止审批", name = "businessType") | ||||
| private Integer businessType; | private Integer businessType; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "终止时间", name = "endContractTime") | |||||
| private Date endContractTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | ||||
| private Integer rentShopType; | private Integer rentShopType; | ||||
| @@ -60,4 +60,8 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||||
| List<Long> getUsedRentShopIds(WxRentContract wxRentContract); | List<Long> getUsedRentShopIds(WxRentContract wxRentContract); | ||||
| long findCount(WxRentContract wxRentContract); | long findCount(WxRentContract wxRentContract); | ||||
| void setEndContractTime(WxRentContract rentContract); | |||||
| List<WxRentContract> findToEndContractList(WxRentContract rentContract); | |||||
| } | } | ||||
| @@ -131,4 +131,8 @@ public interface WxRentContractService { | |||||
| Map<String, Object> currentValidByMerchantId(TenantEntity tenantInfo, Long merchantId,String shopNumber); | Map<String, Object> currentValidByMerchantId(TenantEntity tenantInfo, Long merchantId,String shopNumber); | ||||
| long findCount(WxRentContract wxRentContract); | long findCount(WxRentContract wxRentContract); | ||||
| void setEndContractTime(WxRentContract wxRentContract); | |||||
| List<WxRentContract> findToEndContractList(WxRentContract record); | |||||
| } | } | ||||
| @@ -1856,6 +1856,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| contract.setStatus(EnumRentContractStatus.TERMINATE.getCode()); | contract.setStatus(EnumRentContractStatus.TERMINATE.getCode()); | ||||
| contract.setUpdatetime(new Date()); | contract.setUpdatetime(new Date()); | ||||
| contract.setEndContractTime(wxRentContract.getEndContractTime()); | |||||
| wxRentContractMapper.updateById(contract); | wxRentContractMapper.updateById(contract); | ||||
| //终止租赁合同,同时终止物业合同 | //终止租赁合同,同时终止物业合同 | ||||
| @@ -3440,4 +3441,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return count; | return count; | ||||
| } | } | ||||
| @Override | |||||
| public void setEndContractTime(WxRentContract wxRentContract) { | |||||
| wxRentContractMapper.setEndContractTime(wxRentContract); | |||||
| } | |||||
| @Override | |||||
| public List<WxRentContract> findToEndContractList(WxRentContract record) { | |||||
| return wxRentContractMapper.findToEndContractList(record); | |||||
| } | |||||
| } | } | ||||
| @@ -116,6 +116,7 @@ | |||||
| <result column="bus_discount_ratio" property="busDiscountRatio"/> | <result column="bus_discount_ratio" property="busDiscountRatio"/> | ||||
| <result column="bus_discount_time" property="busDiscountTime"/> | <result column="bus_discount_time" property="busDiscountTime"/> | ||||
| <result column="end_contract_time" jdbcType="TIMESTAMP" property="endContractTime"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| @@ -128,7 +129,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`, | |||||
| `start_date`,`end_date`,`shop_name`,`from_id`,`end_contract_time`, | |||||
| `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 | ||||
| @@ -495,7 +496,7 @@ | |||||
| 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.`revenue_ratio`,rc.`revenue_year`,rc.`revenue_ratio_way`,rc.`revenue_ratio_set`,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.`revenue_ratio_way`,rc.`revenue_ratio_set`,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.end_contract_time`, | |||||
| 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, | ||||
| rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time | rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time | ||||
| @@ -520,7 +521,7 @@ | |||||
| 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.`revenue_ratio`,rc.`revenue_year`,rc.`revenue_ratio_way`,rc.`revenue_ratio_set`,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.`revenue_ratio_way`,rc.`revenue_ratio_set`,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.`end_contract_time`, | |||||
| 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, | ||||
| rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time | rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time | ||||
| @@ -556,5 +557,16 @@ | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <update id = "setEndContractTime" parameterType="com.iformall.domain.po.WxRentContract" > | |||||
| update wx_rent_contract set end_contract_time = #{endContractTime} where id = #{id} | |||||
| </update> | |||||
| <select id = "findToEndContractList" parameterType="com.iformall.domain.po.WxRentContract" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_rent_contract | |||||
| where `tenant_id` = #{tenantId} and status = 3 and end_contract_time <= now(); | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||