| @@ -277,6 +277,17 @@ public class WxPropertyContractController extends WxContractBaseController { | |||||
| return new ResultData(proertyContract); | return new ResultData(proertyContract); | ||||
| } | } | ||||
| /** | |||||
| * 设置定时终止时间 | |||||
| * @return | |||||
| */ | |||||
| @PostMapping("setEndContractTime") | |||||
| @SystemControllerLog(description = "物业合同-设置定时终止合同时间") | |||||
| public ResultData setEndContractTime(@RequestBody WxPropertyContract proertyContract) { | |||||
| wxPropertyContractService.setEndContractTime(proertyContract); | |||||
| return new ResultData(); | |||||
| } | |||||
| @PostMapping("effective") | @PostMapping("effective") | ||||
| @ApiImplicitParams({}) | @ApiImplicitParams({}) | ||||
| @SystemControllerLog(description = "物业合同-合同生效") | @SystemControllerLog(description = "物业合同-合同生效") | ||||
| @@ -481,6 +481,7 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | ||||
| WxPropertyContract wpc = new WxPropertyContract(); | WxPropertyContract wpc = new WxPropertyContract(); | ||||
| wpc.setId(wxRentContract.getPropertyId()); | wpc.setId(wxRentContract.getPropertyId()); | ||||
| wpc.setEndContractTime(wxRentContract.getEndContractTime()); | |||||
| wxPropertyContractService.endContract(wpc); | wxPropertyContractService.endContract(wpc); | ||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -456,6 +456,16 @@ public class WxCouponController extends BaseController { | |||||
| wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | ||||
| } | } | ||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | ||||
| //根据上架时间查询券 | |||||
| WxCouponChannel couponChannelQ = new WxCouponChannel(); | |||||
| couponChannelQ.updateTenantInfo(tenantEntity); | |||||
| couponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||||
| couponChannelQ.setStartdate(wxCoupon.getStartdate()); | |||||
| couponChannelQ.setEnddate(wxCoupon.getEnddate()); | |||||
| List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); | |||||
| if (null != couponIds && couponIds.size() > 0 ) { | |||||
| wxCoupon.setIds(couponIds); | |||||
| } | |||||
| PageInfo<WxCouponStatisVo> pageInfo = wxCouponService.findCountData(wxCoupon,tenantEntitys, pageNum, pageSize); | PageInfo<WxCouponStatisVo> pageInfo = wxCouponService.findCountData(wxCoupon,tenantEntitys, pageNum, pageSize); | ||||
| for (WxCouponStatisVo coupon : pageInfo.getList()) { | for (WxCouponStatisVo coupon : pageInfo.getList()) { | ||||
| if (coupon.getSaleAmount() == null) { | if (coupon.getSaleAmount() == null) { | ||||
| @@ -486,6 +496,16 @@ public class WxCouponController extends BaseController { | |||||
| wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59")); | ||||
| } | } | ||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | ||||
| //根据上架时间查询券 | |||||
| WxCouponChannel couponChannelQ = new WxCouponChannel(); | |||||
| couponChannelQ.updateTenantInfo(tenantEntity); | |||||
| couponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||||
| couponChannelQ.setStartdate(wxCoupon.getStartdate()); | |||||
| couponChannelQ.setEnddate(wxCoupon.getEnddate()); | |||||
| List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); | |||||
| if (null != couponIds && couponIds.size() > 0 ) { | |||||
| wxCoupon.setIds(couponIds); | |||||
| } | |||||
| wxCouponService.exportCardData(wxCoupon,tenantEntitys, request, response); | wxCouponService.exportCardData(wxCoupon,tenantEntitys, request, response); | ||||
| } | } | ||||
| @@ -509,6 +529,16 @@ public class WxCouponController extends BaseController { | |||||
| } | } | ||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | ||||
| //根据上架时间查询券 | |||||
| WxCouponChannel couponChannelQ = new WxCouponChannel(); | |||||
| couponChannelQ.updateTenantInfo(tenantEntity); | |||||
| couponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||||
| couponChannelQ.setStartdate(wxCoupon.getStartdate()); | |||||
| couponChannelQ.setEnddate(wxCoupon.getEnddate()); | |||||
| List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); | |||||
| if (null != couponIds && couponIds.size() > 0 ) { | |||||
| wxCoupon.setIds(couponIds); | |||||
| } | |||||
| PageInfo<WxCouponStatisVo> pageInfo = wxCouponService.findCouponData(wxCoupon, tenantEntitys, pageNum, pageSize); | PageInfo<WxCouponStatisVo> pageInfo = wxCouponService.findCouponData(wxCoupon, tenantEntitys, pageNum, pageSize); | ||||
| for (WxCouponStatisVo coupon : pageInfo.getList()) { | for (WxCouponStatisVo coupon : pageInfo.getList()) { | ||||
| @@ -537,6 +567,16 @@ public class WxCouponController extends BaseController { | |||||
| } | } | ||||
| wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode()); | ||||
| //根据上架时间查询券 | |||||
| WxCouponChannel couponChannelQ = new WxCouponChannel(); | |||||
| couponChannelQ.updateTenantInfo(tenantEntity); | |||||
| couponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||||
| couponChannelQ.setStartdate(wxCoupon.getStartdate()); | |||||
| couponChannelQ.setEnddate(wxCoupon.getEnddate()); | |||||
| List<Long> couponIds = wxCouponChannelService.findCouponIdList(couponChannelQ); | |||||
| if (null != couponIds && couponIds.size() > 0 ) { | |||||
| wxCoupon.setIds(couponIds); | |||||
| } | |||||
| wxCouponService.exportCouponData(wxCoupon,tenantEntitys, request, response); | wxCouponService.exportCouponData(wxCoupon,tenantEntitys, request, response); | ||||
| } | } | ||||
| @@ -13,4 +13,8 @@ ADD COLUMN `revenue_ratio_set` JSON COMMENT '联营扣点调整比率(仅联 | |||||
| ALTER TABLE `mallink`.`wx_rent_contract` | ALTER TABLE `mallink`.`wx_rent_contract` | ||||
| ADD COLUMN `end_contract_time` datetime COMMENT '终止时间'; | ADD COLUMN `end_contract_time` datetime COMMENT '终止时间'; | ||||
| ALTER TABLE `mallink`.`wx_property_contract` | |||||
| ADD COLUMN `end_contract_time` datetime COMMENT '终止时间'; | |||||
| ALTER TABLE `mallink`.`wx_rent_contract` | |||||
| ADD COLUMN `bussiness_management_fee` bigint(12) COMMENT '商业管理费'; | |||||
| @@ -105,5 +105,27 @@ public class ContractSchedule { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * 凌晨5分 | |||||
| */ | |||||
| @Async | |||||
| @Scheduled(cron = "0 5 0 * * ?") | |||||
| public void endProperyContract() { | |||||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||||
| for (WxMall wxMall : wxMalls) { | |||||
| //物业合同 | |||||
| WxPropertyContract record = new WxPropertyContract(); | |||||
| record.updateTenantInfo(wxMall); | |||||
| List<WxPropertyContract> contractList = wxPropertyContractService.findToEndContractList(record); | |||||
| for (WxPropertyContract rent:contractList) { | |||||
| try { | |||||
| wxPropertyContractService.endContract(rent); | |||||
| }catch(Exception e) { | |||||
| log.error("rentcontract outDate error.",e); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -124,6 +124,9 @@ public class WxPropertyContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "起租结束时间", name = "rentalEndDate") | @io.swagger.annotations.ApiModelProperty(value = "起租结束时间", name = "rentalEndDate") | ||||
| private Date endDate; | private Date endDate; | ||||
| @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; | ||||
| @@ -56,5 +56,9 @@ public interface WxPropertyContractMapper extends CommonMapper<WxPropertyContrac | |||||
| WxPropertyContract getByBill(WxBillProperty billRent); | WxPropertyContract getByBill(WxBillProperty billRent); | ||||
| void endContract(WxRentContract wxRentContract); | |||||
| void endContract(WxPropertyContract wxPropertyContract); | |||||
| void setEndContractTime(WxPropertyContract wxPropertyContract); | |||||
| List<WxPropertyContract> findToEndContractList(WxPropertyContract rentContract); | |||||
| } | } | ||||
| @@ -8,6 +8,8 @@ import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxMall; | import com.iformall.domain.po.WxMall; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| @@ -93,5 +95,9 @@ public interface WxPropertyContractService { | |||||
| WxPropertyContract getSimpleDetail(@Param("id") Long id); | WxPropertyContract getSimpleDetail(@Param("id") Long id); | ||||
| void updatePropertyContract(WxPropertyContract record); | void updatePropertyContract(WxPropertyContract record); | ||||
| void setEndContractTime(WxPropertyContract proertyContract); | |||||
| List<WxPropertyContract> findToEndContractList(WxPropertyContract record); | |||||
| } | } | ||||
| @@ -1191,6 +1191,16 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void setEndContractTime(WxPropertyContract proertyContract) { | |||||
| wxPropertyContractMapper.setEndContractTime(proertyContract); | |||||
| } | |||||
| @Override | |||||
| public List<WxPropertyContract> findToEndContractList(WxPropertyContract record) { | |||||
| return wxPropertyContractMapper.findToEndContractList(record); | |||||
| } | |||||
| } | } | ||||
| @@ -1901,14 +1901,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| wxPropertyContract.setStatuss(EnumRentContractStatus.getValidStatus()); | wxPropertyContract.setStatuss(EnumRentContractStatus.getValidStatus()); | ||||
| wxPropertyContract.setUpdatetime(new Date()); | wxPropertyContract.setUpdatetime(new Date()); | ||||
| wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode()); | wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode()); | ||||
| wxPropertyContractMapper.endContract(wxRentContract); | |||||
| wxPropertyContractMapper.endContract(wxPropertyContract); | |||||
| //作废未生效的合同 | //作废未生效的合同 | ||||
| List<Integer> unvalidstatuss = new ArrayList<Integer>(); | List<Integer> unvalidstatuss = new ArrayList<Integer>(); | ||||
| unvalidstatuss.add(EnumRentContractStatus.DRAFT.getCode()); | unvalidstatuss.add(EnumRentContractStatus.DRAFT.getCode()); | ||||
| unvalidstatuss.add(EnumRentContractStatus.PERFORMANCE.getCode()); | unvalidstatuss.add(EnumRentContractStatus.PERFORMANCE.getCode()); | ||||
| wxPropertyContract.setStatuss(unvalidstatuss); | wxPropertyContract.setStatuss(unvalidstatuss); | ||||
| wxPropertyContract.setStatus(EnumRentContractStatus.INVALID.getCode()); | wxPropertyContract.setStatus(EnumRentContractStatus.INVALID.getCode()); | ||||
| wxPropertyContractMapper.endContract(wxRentContract); | |||||
| wxPropertyContractMapper.endContract(wxPropertyContract); | |||||
| //物业账单失效 | //物业账单失效 | ||||
| wxBillPropertyMapper.updateInvalidStatusByRent(wxRentContract); | wxBillPropertyMapper.updateInvalidStatusByRent(wxRentContract); | ||||
| @@ -1048,6 +1048,13 @@ | |||||
| <if test="wxCoupon.id != null"> | <if test="wxCoupon.id != null"> | ||||
| and c.id = #{wxCoupon.id} | and c.id = #{wxCoupon.id} | ||||
| </if> | </if> | ||||
| <if test=" null != wxCoupon.ids "> | |||||
| and c.id in | |||||
| <foreach collection="wxCoupon.ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != wxCoupon.sortColumns">order by ${wxCoupon.sortColumns}</if> | <if test=" null != wxCoupon.sortColumns">order by ${wxCoupon.sortColumns}</if> | ||||
| <if test=" null == wxCoupon.sortColumns">order by c.status asc,c.create_date desc</if> | <if test=" null == wxCoupon.sortColumns">order by c.status asc,c.create_date desc</if> | ||||
| </select> | </select> | ||||
| @@ -48,6 +48,8 @@ | |||||
| <result column="operation_type" property="operationType"/> | <result column="operation_type" property="operationType"/> | ||||
| <result column="late_pay_ratio" property="latePayRatio"/> | <result column="late_pay_ratio" property="latePayRatio"/> | ||||
| <result column="late_pay_day" property="latePayDay"/> | <result column="late_pay_day" property="latePayDay"/> | ||||
| <result column="end_contract_time" jdbcType="TIMESTAMP" property="endContractTime"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| @@ -57,7 +59,7 @@ | |||||
| `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`, | `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`, | ||||
| `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`, | `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`, | ||||
| `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,fixed_price, | `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,fixed_price, | ||||
| `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day | |||||
| `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day,end_contract_time | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -395,7 +397,11 @@ | |||||
| </update> | </update> | ||||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | <update id="updateStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| update wx_property_contract set status=#{status} where id=#{id} | |||||
| update wx_property_contract set status=#{status} | |||||
| <if test=" null != endContractTime "> | |||||
| ,end_contract_time = #{endContractTime} | |||||
| </if> | |||||
| where id=#{id} | |||||
| </update> | </update> | ||||
| @@ -430,4 +436,15 @@ | |||||
| </if> | </if> | ||||
| </update> | </update> | ||||
| <update id = "setEndContractTime" parameterType="com.iformall.domain.po.WxPropertyContract"> | |||||
| update wx_property_contract set end_contract_time = #{endContractTime} where id = #{id} | |||||
| </update> | |||||
| <select id = "findToEndContractList" parameterType="com.iformall.domain.po.WxPropertyContract" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_property_contract | |||||
| where `tenant_id` = #{tenantId} and status = 3 and end_contract_time <= now(); | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||