Przeglądaj źródła

fix bug

release_toaliyun_real
winter 4 lat temu
rodzic
commit
ae26e9e05c
8 zmienionych plików z 75 dodań i 7 usunięć
  1. +1
    -2
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  3. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponService.java
  4. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxMerchantService.java
  5. +2
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java
  6. +67
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  7. +0
    -4
      mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml
  8. +1
    -1
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 1
- 2
mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java Wyświetl plik

@@ -98,7 +98,6 @@ public class WxCouponChannelController extends BaseController {
return new ResultData(page);
}
@RedisCache
@ApiOperation("分页列表接口")
@GetMapping("douyinLiveList")
@ApiImplicitParams({
@@ -124,7 +123,7 @@ public class WxCouponChannelController extends BaseController {
if (null == page ) {
page = wxCouponChannelService.liveHomePage(wxCouponChannel, pageNum, pageSize);
if(page.getList() != null && page.getList().size() > 0){
RedisCacheUtils.cache(redisTemplate, key, page, 100);
RedisCacheUtils.cache(redisTemplate, key, page, 60*60);
}
}
return new ResultData(page);


+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java Wyświetl plik

@@ -192,6 +192,8 @@ public class WxCoupon extends TenantEntity {
private String merchantParams;
@TableField(exist = false)
private Long merchantId;
@TableField(exist = false)
private String merchantName;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="投放频道参数,用来过滤",name="targetAd")


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponService.java Wyświetl plik

@@ -268,4 +268,5 @@ public interface WxCouponService {
Map<Long, WxCoupon> getCouponMap(List<Long> couponIds, TenantEntity tenantEntity);

List<WxMerchantVo> getCouponMerchantList(TenantEntity tenantInfo, Long couponId);
}

+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxMerchantService.java Wyświetl plik

@@ -160,6 +160,7 @@ public interface WxMerchantService {
List<WxMerchantVo> findMerchantVoList(Long couponId,TenantEntity tenantEntity,boolean hasShop);
Map<Long,List<WxMerchantVo>> findCouponMerchantVoList(List<Long> couponIds,TenantEntity tenantEntity,boolean hasShop);
Map<Long,String> getLiveCouponMerchantMap(List<Long> couponIds,TenantEntity tenantEntity);

List<WxMerchant> getMerchantList(WxMerchant wxMerchant);



+ 2
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java Wyświetl plik

@@ -512,6 +512,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
}
List<Long> couponIds = list.stream().map(cc -> cc.getCouponId()).collect(Collectors.toList());
Map<Long,WxCoupon> couponMap = wxCouponService.getCouponMap(couponIds,tenantEntity);
Map<Long,String> merchantNameMap = wxMerchantService.getLiveCouponMerchantMap(couponIds,tenantEntity);
List<WxCoupon> retList = new ArrayList<>();
for (WxCouponChannel cc:list) {
WxCoupon cm = couponMap.get(cc.getCouponId());
@@ -525,6 +526,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
vo.setInventory(cm.getInventory());
vo.setSalePrice(cm.getSalePrice());
vo.setPrice(cm.getPrice());
vo.setMerchantName(merchantNameMap.get(cc.getCouponId()));
retList.add(vo);
}
}


+ 67
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Wyświetl plik

@@ -1230,6 +1230,73 @@ public class WxMerchantServiceImpl implements WxMerchantService {
return wxCouponOrderService.userTradeDetailList(record,record.getStarttime(),record.getEndtime(),pageIndex,pageSize);
}
@Override
public Map<Long,String> getLiveCouponMerchantMap(List<Long> couponIds,TenantEntity tenantEntity) {
Map<Long,String> retMap = new HashMap<Long,String>();
if (null == couponIds || couponIds.size() <= 0) {
return retMap;
}
WxCouponMerchant couponMerchantQ = new WxCouponMerchant();
couponMerchantQ.updateTenantInfo(tenantEntity);
couponMerchantQ.setStatus(0);
couponMerchantQ.setProductIds(couponIds);
List<WxCouponMerchant> couponMerchantList = wxCouponMerchantMapper.findList(couponMerchantQ);
if (null == couponMerchantList) {
return retMap;
}
Map<Long,List<Long>> couponMerchantIdMap = new HashMap<Long,List<Long>>();
List<Long> merchantIdList = new ArrayList<Long>();
for (int i = 0 ; i < couponMerchantList.size() ; i ++) {
WxCouponMerchant cm = couponMerchantList.get(i);
Long couponId = cm.getProductId();
Long merchantId = cm.getMerchantId();
if (null != couponId && null != merchantId) {
List<Long> mIdList = couponMerchantIdMap.get(couponId);
if (null == mIdList) {
mIdList = new ArrayList<Long>();
couponMerchantIdMap.put(couponId, mIdList);
}
mIdList.add(merchantId);
merchantIdList.add(merchantId);
}
}
Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>();
if (merchantIdList.size() > 0 ) {
WxMerchant merchantQ = new WxMerchant();
merchantQ.updateTenantInfo(tenantEntity);
merchantQ.setIds(merchantIdList);
List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ);
if (null != merchantList) {
for (int i = 0 ; i < merchantList.size() ; i++) {
WxMerchant m = merchantList.get(i);
if (null != m) {
merchantMap.put(m.getId(), m);
}
}
}
}
for (Iterator<Long> it = couponMerchantIdMap.keySet().iterator();it.hasNext();) {
Long couponId = it.next();
List<Long> mids = couponMerchantIdMap.get(couponId);
if (null != mids) {
if (mids.size() == 1) {
WxMerchant merchant = merchantMap.get(mids.get(0));
if (null != merchant) {
retMap.put(couponId, merchant.getName());
}else {
retMap.put(couponId, "暂无商户可用");
}
}else if(mids.size() > 1){
retMap.put(couponId, mids.size()+"家商户通用");
}else {
retMap.put(couponId, "暂无商户可用");
}
}
}
return retMap;
}
@Override
public Map<Long,List<WxMerchantVo>> findCouponMerchantVoList(List<Long> couponIds,TenantEntity tenantEntity,boolean hasShop) {
Map<Long,List<WxMerchantVo>> retMap = new HashMap<Long,List<WxMerchantVo>>();


+ 0
- 4
mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml Wyświetl plik

@@ -354,10 +354,6 @@
and cc.`status` = #{status}
</if>
<if test=" null != couponStatus ">
and cc.`coupon_status` = #{couponStatus}
</if>

<if test=" null != subTargetId ">
and cc.`sub_target_id` = #{subTargetId}
</if>


+ 1
- 1
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Wyświetl plik

@@ -1260,7 +1260,7 @@
</update>

<select id="newfindCList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select id,remain_inventory,inventory,cover_img,sub_title,item_group,sale_price,use_price,price,tail_price,
select id,remain_inventory,inventory,cover_img,title,sub_title,item_group,sale_price,use_price,price,tail_price,
orig_price,unit,use_limit_rule,use_limit_quantity,send_type,support_transfer,press_limit_num,auto_refund,
conditions,valid_type,valid_start_date,valid_end_date,pick_start_date,pick_end_date,valid_days,credit_price,
content_type,source_type


Ładowanie…
Anuluj
Zapisz