| @@ -38,6 +38,9 @@ public class WxRaffleActivityRecord extends TenantEntity { | |||||
| @Excel(name="商户名称",width = 20,orderNum = "2") | @Excel(name="商户名称",width = 20,orderNum = "2") | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String merchantName; | private String merchantName; | ||||
| @Excel(name="商铺号",width = 20,orderNum = "3") | |||||
| @TableField(exist = false) | |||||
| private String shopNumber; | |||||
| @Excel(name="订单号",width = 20,orderNum = "4") | @Excel(name="订单号",width = 20,orderNum = "4") | ||||
| @io.swagger.annotations.ApiModelProperty(value = "订单号", name = "orderNo") | @io.swagger.annotations.ApiModelProperty(value = "订单号", name = "orderNo") | ||||
| private String orderNo; | private String orderNo; | ||||
| @@ -3,6 +3,7 @@ package com.iformall.service; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxShopVo; | import com.iformall.domain.vo.WxShopVo; | ||||
| @@ -109,5 +110,7 @@ public interface WxShopService { | |||||
| List<Long> getShopIds(WxShop wxShop); | List<Long> getShopIds(WxShop wxShop); | ||||
| Map<Long,WxShop> findShopMap(WxShop wxShop); | Map<Long,WxShop> findShopMap(WxShop wxShop); | ||||
| Map<Long,String> getMerchantShopNumberMap(TenantEntity tenantEntity,List<Long> merchantIds); | |||||
| } | } | ||||
| @@ -26,6 +26,7 @@ import com.iformall.mapper.WxRaffleActivityRecordMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.MallUserInfoService; | import com.iformall.service.MallUserInfoService; | ||||
| import com.iformall.service.WxRaffleActivityService; | import com.iformall.service.WxRaffleActivityService; | ||||
| import com.iformall.service.WxShopService; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -58,6 +59,10 @@ public class WxRaffleActivityServiceImpl implements WxRaffleActivityService { | |||||
| @Autowired | @Autowired | ||||
| MallUserInfoService mallUserInfoService; | MallUserInfoService mallUserInfoService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxShopService wxShopService; | |||||
| @Autowired | @Autowired | ||||
| ExcelService excelService; | ExcelService excelService; | ||||
| @@ -177,6 +182,11 @@ public class WxRaffleActivityServiceImpl implements WxRaffleActivityService { | |||||
| Map<Long,MallUserInfo> userMap = getMallUserInfoMap(tenantEntity); | Map<Long,MallUserInfo> userMap = getMallUserInfoMap(tenantEntity); | ||||
| Map<Long,String> merchantShopNumberMap = null; | |||||
| if (null != midList && midList.size() > 0 ) { | |||||
| merchantShopNumberMap = wxShopService.getMerchantShopNumberMap(tenantEntity, midList); | |||||
| } | |||||
| for (WxRaffleActivityRecord _r : recordList) { | for (WxRaffleActivityRecord _r : recordList) { | ||||
| if (null != _r.getActivityId()) { | if (null != _r.getActivityId()) { | ||||
| WxRaffleActivity _a = activityMap.get(_r.getActivityId()); | WxRaffleActivity _a = activityMap.get(_r.getActivityId()); | ||||
| @@ -190,7 +200,12 @@ public class WxRaffleActivityServiceImpl implements WxRaffleActivityService { | |||||
| if (null != _m) { | if (null != _m) { | ||||
| _r.setMerchantName(_m.getName()); | _r.setMerchantName(_m.getName()); | ||||
| } | } | ||||
| if (null != merchantShopNumberMap && merchantShopNumberMap.containsKey(_r.getMerchantId())) { | |||||
| _r.setShopNumber(merchantShopNumberMap.get(_r.getMerchantId())); | |||||
| } | |||||
| } | } | ||||
| _r.setRecordItemList(getActivityRecordItemListByRecordId(aidList,_r.getId(),_r)); | _r.setRecordItemList(getActivityRecordItemListByRecordId(aidList,_r.getId(),_r)); | ||||
| _r.setItemDetail(_r.generateItemDetaiJson(userMap)); | _r.setItemDetail(_r.generateItemDetaiJson(userMap)); | ||||
| @@ -725,4 +725,35 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| } | } | ||||
| return shopMap; | return shopMap; | ||||
| } | } | ||||
| @Override | |||||
| public Map<Long, String> getMerchantShopNumberMap(TenantEntity tenantEntity,List<Long> merchantIds) { | |||||
| WxMerchantShop merchantShopQ = new WxMerchantShop(); | |||||
| merchantShopQ.updateTenantInfo(tenantEntity); | |||||
| merchantShopQ.setMerchantIds(merchantIds); | |||||
| merchantShopQ.setIsDel(0); | |||||
| List<WxMerchantShop> merchantShopList = wxMerchantShopMapper.findList(merchantShopQ); | |||||
| WxShop sq = new WxShop(); | |||||
| sq.updateTenantInfo(tenantEntity); | |||||
| Map<Long,WxShop> shopMap = this.findShopMap(sq); | |||||
| if (null != merchantShopList && merchantShopList.size() > 0) { | |||||
| Map<Long, String> retMap = new HashMap<Long, String>(); | |||||
| for (int i = 0 ;i < merchantShopList.size() ; i ++) { | |||||
| WxMerchantShop ms = merchantShopList.get(i); | |||||
| if (null != ms ) { | |||||
| WxShop shop = shopMap.get(ms.getShopId()); | |||||
| if (null != shop) { | |||||
| if (!retMap.containsKey(ms.getMerchantId())) { | |||||
| retMap.put(ms.getMerchantId(),shop.getShopNumber()); | |||||
| }else { | |||||
| retMap.put(ms.getMerchantId(),retMap.get(ms.getMerchantId())+","+shop.getShopNumber()); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| return retMap; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | } | ||||