| @@ -109,12 +109,9 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| // if (wxMerchantService.hasMerchant(wxMerchant)) { | // if (wxMerchantService.hasMerchant(wxMerchant)) { | ||||
| // return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | // return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | ||||
| // } | // } | ||||
| //查询商户是否存在计租中合同 | |||||
| if (!wxRentContractService.hasContract(wxRentContract)){ | |||||
| return new ResultData(ErrorCode.MERCHANT_HASRENTCONTRACT); | |||||
| } | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxRentContract.updateTenantInfo(user); | wxRentContract.updateTenantInfo(user); | ||||
| //wxRentContract.setTenantId("789"); | |||||
| wxRentContract.setAdjustPeriodHandle(); | wxRentContract.setAdjustPeriodHandle(); | ||||
| Date oldDate = wxRentContract.getRentalStartDate(); | Date oldDate = wxRentContract.getRentalStartDate(); | ||||
| if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | ||||
| @@ -38,9 +38,9 @@ ALTER TABLE `wx_coupon_order` | |||||
| ADD COLUMN `pay_vendor` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '订单渠道,EnumPayWay.class'; | ADD COLUMN `pay_vendor` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '订单渠道,EnumPayWay.class'; | ||||
| UPDATE wx_coupon_order o INNER JOIN wx_pay_order po ON po.order_id = o.`id` SET o.pay_vendor = po.pay_vendor; | UPDATE wx_coupon_order o INNER JOIN wx_pay_order po ON po.order_id = o.`id` SET o.pay_vendor = po.pay_vendor; | ||||
| ---刷新完之后把DEFAULT 1 去掉 | ---刷新完之后把DEFAULT 1 去掉 | ||||
| ALTER TABLE `wx_card_spend` | ALTER TABLE `wx_card_spend` | ||||
| ADD COLUMN `remark` VARCHAR(30) DEFAULT NULL COMMENT '备注'; | ADD COLUMN `remark` VARCHAR(30) DEFAULT NULL COMMENT '备注'; | ||||
| @@ -50,13 +50,23 @@ ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT 'app平台 1:微信 2: | |||||
| ALTER TABLE `wx_profit_sharing_receiver` | ALTER TABLE `wx_profit_sharing_receiver` | ||||
| ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '平台 1:微信 2:阿里 3:头条'; | ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '平台 1:微信 2:阿里 3:头条'; | ||||
| create table wx_rent_contract_20200826 like wx_rent_contract; | |||||
| insert into wx_rent_contract_20200826 select * from wx_rent_contract; | |||||
| ALTER TABLE wx_rent_contract DROP COLUMN shop_id; | ALTER TABLE wx_rent_contract DROP COLUMN shop_id; | ||||
| create table wx_property_contract_20200826 like wx_property_contract; | |||||
| insert into wx_property_contract_20200826 select * from wx_property_contract; | |||||
| ALTER TABLE wx_property_contract DROP COLUMN shop_id; | |||||
| ALTER TABLE `wx_rent_contract` ADD COLUMN `shop_name` VARCHAR(100) COMMENT '店铺名称'; | ALTER TABLE `wx_rent_contract` ADD COLUMN `shop_name` VARCHAR(100) COMMENT '店铺名称'; | ||||
| ALTER TABLE `wx_rent_contract` | ALTER TABLE `wx_rent_contract` | ||||
| ADD COLUMN `from_id` BIGINT(20) DEFAULT NULL COMMENT '来源ID,针对续签,从哪个合同续签'; | ADD COLUMN `from_id` BIGINT(20) DEFAULT NULL COMMENT '来源ID,针对续签,从哪个合同续签'; | ||||
| 合同状态为4(即将到期)更新为计租中,合同状态为8(补录),9(续签)更新为草稿。 | |||||
| @@ -79,7 +79,7 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||||
| List<WxRentContract> getAllContractBymerchantId(WxRentContract wxRentContract); | List<WxRentContract> getAllContractBymerchantId(WxRentContract wxRentContract); | ||||
| List<WxRentContract> getContractByMerchant(WxRentContract wxRentContract); | |||||
| //List<WxRentContract> getContractByMerchant(WxRentContract wxRentContract); | |||||
| Integer getCanApplyCount(@Param("id") Long id); | Integer getCanApplyCount(@Param("id") Long id); | ||||
| @@ -104,8 +104,6 @@ public interface WxRentContractService { | |||||
| ResultData apply(WxRentContract wxRentContract,MallUserInfo user); | ResultData apply(WxRentContract wxRentContract,MallUserInfo user); | ||||
| boolean hasContract(WxRentContract wxRentContract); | |||||
| /** | /** | ||||
| * 合同正常到期 | * 合同正常到期 | ||||
| * @param wxRentContract | * @param wxRentContract | ||||
| @@ -2492,15 +2492,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public boolean hasContract(WxRentContract wxRentContract) { | |||||
| List<WxRentContract> list = wxRentContractMapper.getContractByMerchant(wxRentContract); | |||||
| if (list.isEmpty()){ | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| @Override | @Override | ||||
| public void outDateContract(WxMall wxMall) { | public void outDateContract(WxMall wxMall) { | ||||
| //查询有计租合同的商户 | //查询有计租合同的商户 | ||||
| @@ -668,9 +668,9 @@ | |||||
| ) | ) | ||||
| </select> --> | </select> --> | ||||
| <select id="getContractByMerchant" resultType="com.iformall.domain.po.WxRentContract" parameterType="com.iformall.domain.po.WxRentContract"> | |||||
| <!-- <select id="getContractByMerchant" resultType="com.iformall.domain.po.WxRentContract" parameterType="com.iformall.domain.po.WxRentContract"> | |||||
| select * from wx_rent_contract where merchant_id = #{merchantId} and status=3 | select * from wx_rent_contract where merchant_id = #{merchantId} and status=3 | ||||
| </select> | |||||
| </select> --> | |||||
| <select id="getCanApplyCount" resultType="Integer" parameterType="Long"> | <select id="getCanApplyCount" resultType="Integer" parameterType="Long"> | ||||
| select count(1) from wx_rent_contract where id != #{id} and (status=1 or (status=10 and apply_status=3) ) | select count(1) from wx_rent_contract where id != #{id} and (status=1 or (status=10 and apply_status=3) ) | ||||