Browse Source

[商铺商户][修改]:商户编辑时返回数据修改

release_toaliyun_real
gongbiao 7 years ago
parent
commit
efbc40eaa0
2 changed files with 27 additions and 2 deletions
  1. +12
    -1
      mallinkService/src/main/java/com/simple/domain/po/WxMerchant.java
  2. +15
    -1
      mallinkService/src/main/java/com/simple/service/impl/WxMerchantServiceImpl.java

+ 12
- 1
mallinkService/src/main/java/com/simple/domain/po/WxMerchant.java View File

@@ -42,7 +42,10 @@ public class WxMerchant implements Serializable {
private String userids;
@Transient
private String shopids;

@Transient
private List<WxShop> shops;

/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@@ -171,6 +174,14 @@ public class WxMerchant implements Serializable {
this.shopids = shopids;
}

public List<WxShop> getShops() {
return shops;
}

public void setShops(List<WxShop> shops) {
this.shops = shops;
}

public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")


+ 15
- 1
mallinkService/src/main/java/com/simple/service/impl/WxMerchantServiceImpl.java View File

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@@ -42,7 +43,20 @@ public class WxMerchantServiceImpl implements WxMerchantService {

@Override
public WxMerchant getById(Long id) {
return wxMerchantMapper.selectByPrimaryKey(id);
WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(id);
WxMerchantShop wxMerchantShop=new WxMerchantShop();
wxMerchantShop.setMerchantId(wxMerchant.getId());
List<WxShop> shops = new ArrayList<>();

List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop);
for(WxMerchantShop merchantShop:wxMerchantShopList){
WxShop wxShop = WxShopMapper.selectByPrimaryKey(merchantShop.getShopId());
if(wxShop!=null)
shops.add(wxShop);
}

wxMerchant.setShops(shops);
return wxMerchant;
}




Loading…
Cancel
Save