From fbc1b864f247126dacbf7c7ad9bdb77582f3047f Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 12 Oct 2018 11:51:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=90=88=E5=90=8C=E7=AE=A1=E7=90=86][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5,?= =?UTF-8?q?=E5=81=9C=E7=94=A8=E5=95=86=E6=88=B7]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/domain/po/WxRentContract.java | 30 +++++++++++++------ .../service/impl/WxMerchantServiceImpl.java | 4 +++ .../impl/WxRentContractServiceImpl.java | 6 ++++ .../resources/mapper/WxRentContractMapper.xml | 12 ++++---- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java index 53bf9bd6a..e66bd68b3 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -53,7 +53,7 @@ public class WxRentContract implements Serializable { /*商户**/ @io.swagger.annotations.ApiModelProperty(value="商户",name="merchantId") - private Integer merchantId; + private Long merchantId; /*月租金/分成(分)**/ @io.swagger.annotations.ApiModelProperty(value="月租金/分成(分)",name="price") private Integer price; @@ -99,13 +99,13 @@ public class WxRentContract implements Serializable { private String brand; /*经常业态ID**/ @io.swagger.annotations.ApiModelProperty(value="经常业态ID",name="businessId") - private Integer businessId; + private Long businessId; /*店铺类型**/ @io.swagger.annotations.ApiModelProperty(value="店铺类型",name="shopType") private Integer shopType; /*商铺ID**/ @io.swagger.annotations.ApiModelProperty(value="商铺ID",name="shopId") - private Integer shopId; + private Long shopId; /*更新时间**/ @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") private Date updatetime; @@ -122,10 +122,14 @@ public class WxRentContract implements Serializable { @io.swagger.annotations.ApiModelProperty(value="联系电话",name="linkPhone") private String linkPhone; - public Integer getMerchantId() { + @io.swagger.annotations.ApiModelProperty(value="联系电话",name="payAccount") + private String payAccount; + + + public Long getMerchantId() { return merchantId; } - public void setMerchantId(Integer _merchantId) { + public void setMerchantId(Long _merchantId) { merchantId = _merchantId; } public Integer getPrice() { @@ -212,10 +216,10 @@ public class WxRentContract implements Serializable { public void setBrand(String _brand) { brand = _brand; } - public Integer getBusinessId() { + public Long getBusinessId() { return businessId; } - public void setBusinessId(Integer _businessId) { + public void setBusinessId(Long _businessId) { businessId = _businessId; } public Integer getShopType() { @@ -224,10 +228,10 @@ public class WxRentContract implements Serializable { public void setShopType(Integer _shopType) { shopType = _shopType; } - public Integer getShopId() { + public Long getShopId() { return shopId; } - public void setShopId(Integer _shopId) { + public void setShopId(Long _shopId) { shopId = _shopId; } public Date getUpdatetime() { @@ -269,6 +273,14 @@ public class WxRentContract implements Serializable { this.linkPhone = linkPhone; } + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java index 492936e0c..7002ea661 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -134,6 +134,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { @Override public void disable(Long id) { WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(id); + if(wxMerchant==null){ + logger.info("未发现要停用的商户"); + return; + } wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode()); wxMerchantMapper.updateByPrimaryKeySelective(wxMerchant); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 71b921f38..eab0ce017 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -12,6 +12,7 @@ import com.iformall.enums.EnumShopStatus; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxRentContractMapper; import com.iformall.mapper.WxShopMapper; +import com.iformall.service.WxMerchantService; import com.iformall.service.WxRentContractService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,6 +42,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { @Autowired WxShopMapper wxShopMapper; + @Autowired + WxMerchantService wxMerchantService; + @Override public Map listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { Object rentContractStatusInfo = getRentContractStatusInfo(record.getTenantId().toString()); @@ -135,6 +139,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); try { wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract); + //停用商户 + wxMerchantService.disable(wxRentContract.getMerchantId()); }catch (MallinkException e){ logger.info("终止合同失败:"+e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index da22b8715..1591c5210 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -2,8 +2,8 @@ - - + + @@ -18,18 +18,19 @@ - + - + + - `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone` + `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone`,`pay_account` @@ -57,6 +58,7 @@ and `createtime` = #{createtime} and `link_person` = #{linkPerson} and `link_phone` = #{linkPhone} + and `pay_account` = #{payAccount} and id in