Procházet zdrojové kódy

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

release_toaliyun_real
lin před 2 roky
rodič
revize
83414078f1
5 změnil soubory, kde provedl 34 přidání a 7 odebrání
  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 Zobrazit soubor

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


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


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


private List<Long> couponIds;

private Date startTime;
private Date endTime;
} }

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxCouponService.java Zobrazit soubor

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


void delManyCouponMerchants(TenantEntity tenantInfo, List<Long> couponIds, List<Long> merchantIds); 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 Zobrazit soubor

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


@Override @Override
public PageInfo<WxCardDailyLog> listAsPage(WxCardDailyLog record, Integer pageIndex, Integer pageSize) { 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)); PageInfo<WxCardDailyLog> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardDailyLogMapper.findList(record));
if (CollectionUtils.isEmpty(pageInfo.getList())){ if (CollectionUtils.isEmpty(pageInfo.getList())){
return pageInfo; return pageInfo;
} }
List<Long> couponIds = pageInfo.getList().parallelStream().map(WxCardDailyLog::getCouponId).collect(Collectors.toList()); 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)){ if (CollectionUtils.isEmpty(list)){
return pageInfo; return pageInfo;
} }


+ 3
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Zobrazit soubor

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


@Override @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>() return wxCouponMapper.selectList(new LambdaQueryWrapper<WxCoupon>()
.eq(WxCoupon::getIsDel, 0) .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)); .eq(TenantEntity::getTenantId, tenantId));
} }




+ 15
- 3
mallinkService/src/main/resources/mapper/WxCardDailyLogMapper.xml Zobrazit soubor

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




Načítá se…
Zrušit
Uložit