记得上下班打卡 | git大法好,push需谨慎

Commit 10dc594e authored by 胡佳晨's avatar 胡佳晨

正在下单增加 店铺数量

parent 797acf9b
......@@ -42,6 +42,8 @@ public class GoblinSelfMarketingVo implements Serializable, Cloneable {
private String endTime;
@ApiModelProperty(value = "创建时间")
private String createdAt;
@ApiModelProperty(value = "店铺数量")
private Integer storeCount;
private static final GoblinSelfMarketingVo obj = new GoblinSelfMarketingVo();
......
......@@ -4,6 +4,7 @@ import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinZhengzaiMarketService;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiParam;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo;
......@@ -50,9 +51,9 @@ public class GoblinSelfZhengzaiController extends BaseController {
@RequestParam(value = "endTime", required = false) String et,
@RequestParam(value = "createdAt", required = false) String ct) {
LocalDateTime now = LocalDateTime.now();
List<GoblinSelfMarketing> list = goblinZhengzaiMarketService.zhengzaiList(page, purchaseName, status, st, et, ct).getData();
List<GoblinSelfMarketingDto> list = goblinZhengzaiMarketService.zhengzaiList(page, purchaseName, status, st, et, ct).getData();
startPage();
for (GoblinSelfMarketing item : list) {
for (GoblinSelfMarketingDto item : list) {
if (item.getStatus() != 7) {
if (now.isBefore(item.getStartTime())) {
item.setStatus(0);
......
......@@ -173,7 +173,7 @@
title: '创建时间'
},
{
field: 'comment',
field: 'storeCount',
title: '店铺数量'
},
{
......
package com.liquidnet.client.admin.zhengzai.goblin.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
......@@ -26,7 +27,7 @@ public interface IGoblinZhengzaiMarketService {
* @param ct 创建时间
* @return
*/
ResponseDto<List<GoblinSelfMarketing>> zhengzaiList(int page, String purchaseName, int status, String st, String et, String ct);
ResponseDto<List<GoblinSelfMarketingDto>> zhengzaiList(int page, String purchaseName, int status, String st, String et, String ct);
/**
* 正在状态操作
......
......@@ -10,6 +10,7 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreDetailsDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
......@@ -50,33 +51,34 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
GoblinMarketingZhengzaiRelationMapper goblinMarketingZhengzaiRelationMapper;
@Override
public ResponseDto<List<GoblinSelfMarketing>> zhengzaiList(int page, String purchaseName, int status, String st, String et, String ct) {
LambdaUpdateWrapper<GoblinSelfMarketing> queryMapper = Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getDelFlag, 0);
switch (status) {
case 0://未开始
queryMapper = queryMapper.gt(GoblinSelfMarketing::getStartTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
break;
case 1://进行中
queryMapper = queryMapper.le(GoblinSelfMarketing::getStartTime, LocalDateTime.now()).ge(GoblinSelfMarketing::getEndTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
break;
case 2://已结束
queryMapper = queryMapper.lt(GoblinSelfMarketing::getEndTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
break;
case 7://停用
queryMapper = queryMapper.eq(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
break;
}
if (!purchaseName.equals("")) {
queryMapper = queryMapper.like(GoblinSelfMarketing::getName, purchaseName);
}
if ((st != null && !st.equals("")) && (et != null && !et.equals(""))) {
queryMapper = queryMapper.ge(GoblinSelfMarketing::getStartTime, st).le(GoblinSelfMarketing::getEndTime, et);
}
if (ct != null && !ct.equals("")) {
queryMapper = queryMapper.eq(GoblinSelfMarketing::getCreatedAt, ct);
}
return ResponseDto.success(goblinSelfMarketingMapper.selectList(queryMapper));
public ResponseDto<List<GoblinSelfMarketingDto>> zhengzaiList(int page, String purchaseName, int status, String st, String et, String ct) {
// LambdaUpdateWrapper<GoblinSelfMarketing> queryMapper = Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getDelFlag, 0);
// switch (status) {
// case 0://未开始
// queryMapper = queryMapper.gt(GoblinSelfMarketing::getStartTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
// break;
// case 1://进行中
// queryMapper = queryMapper.le(GoblinSelfMarketing::getStartTime, LocalDateTime.now()).ge(GoblinSelfMarketing::getEndTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
// break;
// case 2://已结束
// queryMapper = queryMapper.lt(GoblinSelfMarketing::getEndTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
// break;
// case 7://停用
// queryMapper = queryMapper.eq(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
// break;
// }
//
// if (!purchaseName.equals("")) {
// queryMapper = queryMapper.like(GoblinSelfMarketing::getName, purchaseName);
// }
// if ((st != null && !st.equals("")) && (et != null && !et.equals(""))) {
// queryMapper = queryMapper.ge(GoblinSelfMarketing::getStartTime, st).le(GoblinSelfMarketing::getEndTime, et);
// }
// if (ct != null && !ct.equals("")) {
// queryMapper = queryMapper.eq(GoblinSelfMarketing::getCreatedAt, ct);
// }
List<GoblinSelfMarketingDto> marketing = goblinSelfMarketingMapper.getZhengzaiList(purchaseName, status, st, et, ct);
return ResponseDto.success(marketing);
}
@Override
......
package com.liquidnet.service.goblin.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 官方(平台)营销表[活动]表
* </p>
*
* @author liquidnet
* @since 2021-12-27
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinSelfMarketingDto implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
private String selfMarketId;
private String performanceId;
private String performanceImg;
private String name;
private Integer type;
private Integer status;
private String describes;
private LocalDateTime startTime;
private LocalDateTime endTime;
private LocalDateTime createdAt;
private Integer storeCount;
}
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreDetailsDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto;
import com.liquidnet.service.goblin.entity.GoblinSelfMarketing;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -20,4 +22,7 @@ public interface GoblinSelfMarketingMapper extends BaseMapper<GoblinSelfMarketin
List<GoblinZhengzaiStoreListDto> getZhengzaiStoreList(String marketId);
List<GoblinZhengzaiStoreDetailsDto> getZhengzaiStoreDetails(String marketId, String storeId);
List<GoblinSelfMarketingDto> getZhengzaiList(@Param("purchaseName") String purchaseName, @Param("status") int status,@Param("st") String st, @Param("et") String et, @Param("ct") String ct);
}
......@@ -24,6 +24,21 @@
<result column="buy_type" property="buyType"/>
</resultMap>
<resultMap id="goblinSelfMarketingDtoResult"
type="com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto">
<result column="self_market_id" property="selfMarketId"/>
<result column="performance_id" property="performanceId"/>
<result column="performance_img" property="performanceImg"/>
<result column="name" property="name"/>
<result column="type" property="type"/>
<result column="status" property="status"/>
<result column="describes" property="describes"/>
<result column="start_time" property="startTime"/>
<result column="end_time" property="endTime"/>
<result column="created_at" property="createdAt"/>
<result column="store_count" property="storeCount"/>
</resultMap>
<select id="getZhengzaiStoreList" resultMap="goblinZhengzaiStoreListDtoResult">
select b.store_id,c.store_name,b.show_time,IFNull(count(d.spu_id),0) as 'spu_count',IFNull(count(d.sku_id),0) as 'sku_count' from goblin_self_marketing as a
......@@ -44,4 +59,27 @@ GROUP BY b.store_id
select sku_id from goblin_marketing_zhengzai where self_market_id = #{marketId} and store_id = #{storeId}
)
</select>
<select id="getZhengzaiList" resultMap="goblinSelfMarketingDtoResult">
select
gsm.mid,gsm.name,gsm.performance_id,gsm.performance_img,gsm.created_at,gsm.updated_at,gsm.type,gsm.status,gsm.start_time,gsm.end_time,gsm.self_market_id,gsm.describes,count(gmzr.store_id)
as 'store_count'
from goblin_self_marketing as gsm left join goblin_marketing_zhengzai_relation gmzr on gsm.self_market_id =
gmzr.self_market_id
<where>
del_flag = 0
<if test="purchaseName != null and purchaseName!=''">and gsm.name like concat('%', #{purchaseName}, '%') '%'</if>
<if test="ct != null and ct!=''">and gsm.created_at = #{ct}</if>
<if test="st != null and et != null and st != '' and et != ''">and and gsm.start_time <![CDATA[ >= ]]> #{st} and
gsm.end_time <![CDATA[ <= ]]> #{et}
</if>
<if test="status==0">and gsm.start_time <![CDATA[ >= ]]> NOW() and gsm.status!=7</if>
<if test="status==1">and gsm.start_time <![CDATA[ < ]]> NOW() and gsm.end_time <![CDATA[ > ]]> NOW() and gsm.status!=7
</if>
<if test="status==2">and gsm.end_time <![CDATA[ <= ]]> NOW() and gsm.status!=7</if>
<if test="status==7">and gsm.status!=7</if>
</where>
group by gsm.self_market_id
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment