Просмотр исходного кода

/。 卷订单商户

release_toaliyun_real
xhxu 4 лет назад
Родитель
Сommit
325989ce27
4 измененных файлов: 54 добавлений и 29 удалений
  1. +2
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMerchantMapper.java
  2. +43
    -25
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  4. +8
    -2
      mallinkService/src/main/resources/mapper/WxCouponMerchantMapper.xml

+ 2
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCouponMerchantMapper.java Просмотреть файл

@@ -17,7 +17,8 @@ public interface WxCouponMerchantMapper extends CommonMapper<WxCouponMerchant, L
List<WxCouponMerchant> findList(WxCouponMerchant wxCouponMerchant);
List<WxCouponMerchant> findMerchantListByProduct(@Param("productId")Long productId,@Param("tenantId")String tenantId);
List<Long> findMerchantIdListByProduct(@Param("productId")Long productId,@Param("tenantId")String tenantId);
List<WxMerchantProductVo> findMerchantProduct(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList);
// List<WxMerchantProductVo> findMerchantProduct(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList);
List<WxMerchantProductVo> findMerchantProduct(@Param("tenantId")String tenantId,@Param("productIds")List<Long> productIds);
List<WxMerchantProductVo> findOnlyMerchantProduct(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList);
List<Long> findMerchantProductIds(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList,@Param("status")Integer status);
List<Long> findMerchantByProductIds(@Param("tenantId")String tenantId,@Param("productIds")List<Long> productIds);


+ 43
- 25
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java Просмотреть файл

@@ -865,7 +865,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
if (null != merchantIdList && merchantIdList.size() > 0 ) {
WxMerchant merchantQ = new WxMerchant();
merchantQ.updateTenantInfo(tenantEntity);
merchantQ.setIds(merchantIdList);;
// merchantQ.setIds(merchantIdList);
List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ);
if (null != merchantList) {
for (int i = 0 ; i < merchantList.size() ; i ++) {
@@ -876,6 +876,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
}
Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>();
if (null != couponIdList && couponIdList.size() > 0 ) {
WxCoupon couponQ = new WxCoupon();
couponQ.updateTenantInfo(tenantEntity);
@@ -887,22 +888,34 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
couponMap.put(c.getId(), c);
}
}

List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), couponIdList);
if (null != merchantProductVos) {
for (int i = 0 ; i < merchantProductVos.size(); i ++) {
WxMerchantProductVo mp = merchantProductVos.get(i);
if (mp.getMc() > 1) {
merchantProductIdMap.put(mp.getProductId(), -999L);
}else {
merchantProductIdMap.put(mp.getProductId(), mp.getMerchantId());
}
}
}
}
Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>();
if (null != merchantIdList && merchantIdList.size() > 0 ) {
List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), merchantIdList);
if (null != merchantProductVos) {
for (int i = 0 ; i < merchantProductVos.size(); i ++) {
WxMerchantProductVo mp = merchantProductVos.get(i);
if (mp.getMc() > 1) {
merchantProductIdMap.put(mp.getProductId(), -999L);
}else {
merchantProductIdMap.put(mp.getProductId(), mp.getMerchantId());
}
}
}
}
// Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>();
// if (null != merchantIdList && merchantIdList.size() > 0 ) {
// List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), couponIdList);
// if (null != merchantProductVos) {
// for (int i = 0 ; i < merchantProductVos.size(); i ++) {
// WxMerchantProductVo mp = merchantProductVos.get(i);
// if (mp.getMc() > 1) {
// merchantProductIdMap.put(mp.getProductId(), -999L);
// }else {
// merchantProductIdMap.put(mp.getProductId(), mp.getMerchantId());
// }
// }
// }
// }
Map<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>();
@@ -948,17 +961,22 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
}
co.setSubsidyNum(co.getSubsidy());
Long merchanId = merchantProductIdMap.get(co.getCouponId());
if (null != merchanId) {
if (merchanId == -999L) {
co.setMerchantName("多商户通用");
co.setMerchantId(0L);
}else {
co.setMerchantName(merchantNameMap.get(merchanId));
co.setMerchantId(merchanId);
}

if(co.getMerchantId() == null){
Long merchanId = merchantProductIdMap.get(co.getCouponId());
if (null != merchanId) {
if (merchanId == -999L) {
co.setMerchantName("多商户通用");
co.setMerchantId(0L);
}else {
co.setMerchantName(merchantNameMap.get(merchanId));
co.setMerchantId(merchanId);
}
}
}else{
co.setMerchantName(merchantNameMap.get(co.getMerchantId()));
}

WxCUserBasicInfo basicInfo = cUserMap.get(co.getCUserId());
if (null != basicInfo) {


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Просмотреть файл

@@ -1016,7 +1016,7 @@ public class WxCouponServiceImpl implements WxCouponService {
if (onlyOneMerchantCoupons) {
merchantProductVos = wxCouponMerchantMapper.findOnlyMerchantProduct(tenantEntity.getTenantId(), merchantIds);
}else {
merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), merchantIds);
merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), couponIds);
}
if (null != merchantProductVos && merchantProductVos.size() > 0 ) {
for (int i = 0 ; i < merchantProductVos.size(); i ++) {


+ 8
- 2
mallinkService/src/main/resources/mapper/WxCouponMerchantMapper.xml Просмотреть файл

@@ -112,12 +112,18 @@
<if test=" null != tenantId and '' != tenantId">
and wcm.`tenant_id` = #{tenantId}
</if>
<if test=" null != merchantIdList">
<if test=" null != productIds">
and wcm.product_id in
<foreach collection="productIds" index="index" item="productIdItem" open="(" separator="," close=")">
#{productIdItem}
</foreach>
</if>
<!--<if test=" null != merchantIdList">
and wcm.merchant_id in
<foreach collection="merchantIdList" index="index" item="merchantIdItem" open="(" separator="," close=")">
#{merchantIdItem}
</foreach>
</if>
</if>-->
GROUP BY product_id
</select>


Загрузка…
Отмена
Сохранить