Browse Source

Merge branch 'release_toaliyun_real_20230605' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_20230605

release_toaliyun_real
lin 2 years ago
parent
commit
83414078f1
5 changed files with 34 additions and 7 deletions
  1. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCardDailyLog.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxCouponService.java
  3. +10
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCardDailyLogServiceImpl.java
  4. +3
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  5. +15
    -3
      mallinkService/src/main/resources/mapper/WxCardDailyLogMapper.xml

+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCardDailyLog.java View File

@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;

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

@TableName(value = "wx_card_daily_log")
@Data
@@ -47,4 +48,8 @@ public class WxCardDailyLog extends TenantEntity {
@TableField(exist = false)
private String title;

private List<Long> couponIds;

private Date startTime;
private Date endTime;
}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxCouponService.java View File

@@ -310,5 +310,5 @@ public interface WxCouponService {

void delManyCouponMerchants(TenantEntity tenantInfo, List<Long> couponIds, List<Long> merchantIds);

List<WxCoupon> getByIdList(List<Long> collect, String tenantId);
List<WxCoupon> getByIdListOrTitle(List<Long> couponIds, String tenantId, String title);
}

+ 10
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCardDailyLogServiceImpl.java View File

@@ -7,6 +7,7 @@ import com.iformall.domain.po.*;
import com.iformall.mapper.*;
import com.iformall.service.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -29,12 +30,20 @@ public class WxCardDailyLogServiceImpl implements WxCardDailyLogService {

@Override
public PageInfo<WxCardDailyLog> listAsPage(WxCardDailyLog record, Integer pageIndex, Integer pageSize) {
if (StringUtils.isNotBlank(record.getTitle())){
List<WxCoupon> title = wxCouponService.getByIdListOrTitle(new ArrayList<>(), record.getTenantId(), record.getTitle());
if (!CollectionUtils.isEmpty(title)){
List<Long> couponIds = title.parallelStream().map(WxCoupon::getId).collect(Collectors.toList());
record.setCouponIds(couponIds);
}
}

PageInfo<WxCardDailyLog> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardDailyLogMapper.findList(record));
if (CollectionUtils.isEmpty(pageInfo.getList())){
return pageInfo;
}
List<Long> couponIds = pageInfo.getList().parallelStream().map(WxCardDailyLog::getCouponId).collect(Collectors.toList());
List<WxCoupon> list = wxCouponService.getByIdList(couponIds, record.getTenantId());
List<WxCoupon> list = wxCouponService.getByIdListOrTitle(couponIds, record.getTenantId(), null);
if (CollectionUtils.isEmpty(list)){
return pageInfo;
}


+ 3
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java View File

@@ -2106,10 +2106,11 @@ public class WxCouponServiceImpl implements WxCouponService {
}

@Override
public List<WxCoupon> getByIdList(List<Long> couponIds, String tenantId) {
public List<WxCoupon> getByIdListOrTitle(List<Long> couponIds, String tenantId, String title) {
return wxCouponMapper.selectList(new LambdaQueryWrapper<WxCoupon>()
.eq(WxCoupon::getIsDel, 0)
.in(WxCoupon::getId, couponIds)
.in(CollectionUtils.isNotEmpty(couponIds), WxCoupon::getId, couponIds)
.like(StringUtils.isNotBlank(title), WxCoupon::getTitle, title)
.eq(TenantEntity::getTenantId, tenantId));
}



+ 15
- 3
mallinkService/src/main/resources/mapper/WxCardDailyLogMapper.xml View File

@@ -37,13 +37,13 @@
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != cardPasswordId ">
and `card_password_id` = #{cardPasswordId}
and `card_password_id` like concat('%', #{cardPasswordId},'%')
</if>
<if test=" null != couponId ">
and `coupon_id` = #{couponId}
and `coupon_id` like concat('%', #{couponId},'%')
</if>
<if test=" null != cardInfoId ">
and `card_info_id` = #{cardInfoId}
and `card_info_id` like concat('%', #{cardInfoId},'%')
</if>
<if test=" null != type ">
and `type` = #{type}
@@ -54,12 +54,24 @@
<if test=" null != operatorUser and '' != operatorUser">
and `operator_user` like concat('%', #{operatorUser},'%')
</if>
<if test=" null != startTime ">
and `create_date` &gt;= #{startTime}
</if>
<if test=" null != endTime ">
and `create_date` &lt;= #{endTime}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != couponIds ">
and coupon_id in
<foreach collection="couponIds" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>



Loading…
Cancel
Save