Sfoglia il codice sorgente

[品牌][修改][品牌删除功能]

release_toaliyun_real
luozukai 7 anni fa
parent
commit
ab876d19e3
6 ha cambiato i file con 43 aggiunte e 1 eliminazioni
  1. +18
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxBrandController.java
  2. +2
    -0
      mallinkAdmin/src/main/resources/db/migration/V201906051403__L_ALTER_RENT.sql
  3. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
  4. +8
    -0
      mallinkService/src/main/java/com/iformall/service/WxMerchantService.java
  5. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  6. +6
    -1
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml

+ 18
- 0
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxBrandController.java Vedi File

@@ -6,10 +6,13 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxBrand;
import com.iformall.domain.po.WxMerchant;
import com.iformall.service.WxBrandService;
import com.iformall.service.WxMerchantService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +33,8 @@ public class WxBrandController extends BaseController {

@Autowired
private WxBrandService wxBrandService;
@Autowired
private WxMerchantService wxMerchantService;


@GetMapping("list")
@@ -60,6 +65,19 @@ public class WxBrandController extends BaseController {
public ResultData update(@RequestBody WxBrand wxBrand) {
logger.debug("[" + getIpAddr() + "] WxBrandController::update");
wxBrand.setTenantId(getTenantId());

if(wxBrand.getIsDel().equals(1)){
//判断是否解绑商户
WxMerchant wxMerchant = new WxMerchant();
wxMerchant.setTenantId(wxBrand.getTenantId());
wxMerchant.setIsDel(0);
wxMerchant.setBrand(wxBrand.getId());
List<WxMerchant> merchantList = wxMerchantService.findList(wxMerchant);
if(CollectionUtils.isNotEmpty(merchantList)){
return new ResultData(Result.ERROR, "您有未解绑的商户,请先解绑。");
}
}

return wxBrandService.update(wxBrand);
}



+ 2
- 0
mallinkAdmin/src/main/resources/db/migration/V201906051403__L_ALTER_RENT.sql Vedi File

@@ -0,0 +1,2 @@
alter table wx_merchant
add column `is_del` SMALLINT(1) DEFAULT 0 COMMENT '是否删除1是0否';

+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java Vedi File

@@ -175,6 +175,10 @@ public class WxMerchant extends BaseEntity {
@Transient
private WxProfitSharingReceiver wxProfitSharingReceiver;


@io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = " ")
private Integer isDel;

@Override
public String getSortColumns() {
super.setSortColumns(this.sortColumns);


+ 8
- 0
mallinkService/src/main/java/com/iformall/service/WxMerchantService.java Vedi File

@@ -43,6 +43,14 @@ public interface WxMerchantService {
*/
List<WxMerchant> etcpList(WxMerchant record);

/**
* 根据实体查询分页列表
*
* @param record
* @return
*/
List<WxMerchant> findList(WxMerchant record);

/**
* 查询商户列表
* @param tenantId


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Vedi File

@@ -148,6 +148,11 @@ public class WxMerchantServiceImpl implements WxMerchantService {
return wxMerchantMapper.findList(record);
}

@Override
public List<WxMerchant> findList(WxMerchant record) {
return wxMerchantMapper.findList(record);
}

@Override
public List<WxMerchantSimpleVo> findList(String tenantId) {
WxMerchant wxMerchant = new WxMerchant();


+ 6
- 1
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml Vedi File

@@ -27,12 +27,14 @@
<result column="qr_code" jdbcType="VARCHAR" property="qrCode"/>
<result column="introduction" jdbcType="VARCHAR" property="introduction"/>
<result column="action_desc" jdbcType="VARCHAR" property="actionDesc"/>
<result column="is_del" property="isDel"/>

</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`img_url`,`name`,`link_phone`,`create_date`,`update_date`,`car_vendor_type`,`car_params`,`status`,`link_person`,
`business_id`,`sub_business_id`,`shop_type`,`brand`,`type`,`is_public`,email,`title`,`cover_picture`,`is_admin`,`bill_setting`,`qr_code`,
`introduction`,`action_desc`
`introduction`,`action_desc`,is_del
</sql>

<sql id="dynamicWhereConditions">
@@ -99,6 +101,9 @@
<if test=" null != isAdmin ">
and `is_admin` = #{isAdmin}
</if>
<if test=" null != isDel ">
and `is_del` = #{isDel}
</if>
<if test=" null != rentShopType ">
and id not in(
select merchant_id from wx_rent_contract where tenant_id=#{tenantId} and rent_shop_type=1 and merchant_id is


Caricamento…
Annulla
Salva