|
|
|
@@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|