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

Commit 81246d8b authored by 胡佳晨's avatar 胡佳晨

暂时提交

parent b4cdb595
package com.liquidnet.service.goblin.dto.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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 GoblinSelfMarketingVo implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
/**
* 官方营销表id
*/
private String selfMarketId;
/**
* 营销名称
*/
private String name;
/**
* 营销类型[1-正在下单]
*/
private Integer type;
/**
* 活动状态[-1-全部|0-等待开始|1-活动中|2-活动结束|7-停用]
*/
private Integer status;
/**
* 营销描述
*/
private String desc;
/**
* 营销开始时间
*/
private String startTime;
/**
* 营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间
*/
private String endTime;
/**
* 删除标记[0-未删除|1-删除]
*/
private Integer delFlag;
private String createdAt;
private String comment;
private static final GoblinSelfMarketingVo obj = new GoblinSelfMarketingVo();
public static GoblinSelfMarketingVo getNew() {
try {
return (GoblinSelfMarketingVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinSelfMarketingVo();
}
}
}
...@@ -5,8 +5,10 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,8 +5,10 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel @ApiModel
public class GoblinZhengzaiStoreListVo { public class GoblinZhengzaiStoreListVo {
@ApiModelProperty(value = "活动id") @ApiModelProperty(value = "商铺id")
String storeId; String storeId;
@ApiModelProperty(value = "商铺名称")
String storeName;
@ApiModelProperty(value = "商铺商品数量") @ApiModelProperty(value = "商铺商品数量")
String spuCount; String spuCount;
@ApiModelProperty(value = "商铺款式数量") @ApiModelProperty(value = "商铺款式数量")
......
package com.liquidnet.client.admin.zhengzai.goblin.service.imp; package com.liquidnet.client.admin.zhengzai.goblin.service.imp;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinZhengzaiMarketService; import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinZhengzaiMarketService;
...@@ -10,12 +9,13 @@ import com.liquidnet.commons.lang.util.DateUtil; ...@@ -10,12 +9,13 @@ import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.constant.GoblinStatusConst; import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiStoreListVo; import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiStoreListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiVo; import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiVo;
import com.liquidnet.service.goblin.entity.GoblinSelfMarketing; import com.liquidnet.service.goblin.entity.GoblinSelfMarketing;
import com.liquidnet.service.goblin.mapper.GoblinSelfMarketingMapper; import com.liquidnet.service.goblin.mapper.GoblinSelfMarketingMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.convert.QueryMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -71,9 +71,11 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -71,9 +71,11 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
//mysql //mysql
goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId)); goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId));
//mongo //mongo
goblinMongoUtils.updateSelfMarket(marketId, selfMarketing); GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew();
BeanUtils.copyProperties(selfMarketing,vo);
goblinMongoUtils.updateSelfMarket(marketId, vo);
//redis //redis
goblinRedisUtils.setSelfMarket(marketId, selfMarketing); goblinRedisUtils.setSelfMarket(marketId, vo);
return ResponseDto.success(); return ResponseDto.success();
} }
...@@ -89,9 +91,13 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -89,9 +91,13 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
//mysql //mysql
goblinSelfMarketingMapper.insert(selfMarketing); goblinSelfMarketingMapper.insert(selfMarketing);
//mongo //mongo
goblinMongoUtils.insertSelfMarket(selfMarketing); GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew();
BeanUtils.copyProperties(selfMarketing,vo);
vo.setStartTime(st);
vo.setEndTime(et);
goblinMongoUtils.insertSelfMarket(vo);
//redis //redis
goblinRedisUtils.setSelfMarket(SelfMarketId, selfMarketing); goblinRedisUtils.setSelfMarket(SelfMarketId, vo);
return ResponseDto.success(); return ResponseDto.success();
} }
...@@ -106,9 +112,13 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -106,9 +112,13 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
//mysql //mysql
goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId)); goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId));
//mongo //mongo
goblinMongoUtils.updateSelfMarket(marketId, selfMarketing); GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew();
BeanUtils.copyProperties(selfMarketing,vo);
vo.setStartTime(st);
vo.setEndTime(et);
goblinMongoUtils.updateSelfMarket(marketId, vo);
//redis //redis
goblinRedisUtils.setSelfMarket(marketId, selfMarketing); goblinRedisUtils.setSelfMarket(marketId, vo);
return ResponseDto.success(); return ResponseDto.success();
} }
...@@ -132,6 +142,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -132,6 +142,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override @Override
public ResponseDto<Boolean> zhengzaiStoreList(String marketId) { public ResponseDto<Boolean> zhengzaiStoreList(String marketId) {
goblinSelfMarketingMapper.getZhengzaiStoreList(marketId);
return null; return null;
} }
......
package com.liquidnet.client.admin.zhengzai.goblin.utils; package com.liquidnet.client.admin.zhengzai.goblin.utils;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.entity.GoblinSelfMarketing; import com.liquidnet.service.goblin.entity.GoblinSelfMarketing;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult; import com.mongodb.client.result.UpdateResult;
...@@ -18,11 +19,11 @@ public class GoblinMongoUtils { ...@@ -18,11 +19,11 @@ public class GoblinMongoUtils {
@Autowired @Autowired
private MongoConverter mongoConverter; private MongoConverter mongoConverter;
public GoblinSelfMarketing insertSelfMarket(GoblinSelfMarketing data) { public GoblinSelfMarketingVo insertSelfMarket(GoblinSelfMarketingVo data) {
return mongoTemplate.insert(data, GoblinSelfMarketing.class.getSimpleName()); return mongoTemplate.insert(data, GoblinSelfMarketingVo.class.getSimpleName());
} }
public UpdateResult updateSelfMarket(String selfMarketId, GoblinSelfMarketing data) { public UpdateResult updateSelfMarket(String selfMarketId, GoblinSelfMarketingVo data) {
BasicDBObject object = GoblinObjectUtils.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(data)); BasicDBObject object = GoblinObjectUtils.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(data));
return mongoTemplate.getCollection(GoblinSelfMarketing.class.getSimpleName()).updateOne( return mongoTemplate.getCollection(GoblinSelfMarketing.class.getSimpleName()).updateOne(
Query.query(Criteria.where("selfMarketId").is(selfMarketId)).getQueryObject(), Query.query(Criteria.where("selfMarketId").is(selfMarketId)).getQueryObject(),
......
...@@ -2,6 +2,7 @@ package com.liquidnet.client.admin.zhengzai.goblin.utils; ...@@ -2,6 +2,7 @@ package com.liquidnet.client.admin.zhengzai.goblin.utils;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil; import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.service.goblin.constant.GoblinRedisConst; import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.entity.GoblinSelfMarketing; import com.liquidnet.service.goblin.entity.GoblinSelfMarketing;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -18,7 +19,7 @@ public class GoblinRedisUtils { ...@@ -18,7 +19,7 @@ public class GoblinRedisUtils {
* @param selfMarketId * @param selfMarketId
* @param data * @param data
*/ */
public void setSelfMarket(String selfMarketId, GoblinSelfMarketing data) { public void setSelfMarket(String selfMarketId, GoblinSelfMarketingVo data) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SELF_MARKET.concat(selfMarketId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_SELF_MARKET.concat(selfMarketId);
redisDataSourceUtil.getRedisGoblinUtil().set(redisKey, data); redisDataSourceUtil.getRedisGoblinUtil().set(redisKey, data);
} }
......
package com.liquidnet.service.goblin.dto;
public class GoblinZhengzaiStoreListDto {
String storeId;
String storeName;
String spuCount;
String skuCount;
}
package com.liquidnet.service.goblin.mapper; package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto;
import com.liquidnet.service.goblin.entity.GoblinSelfMarketing; import com.liquidnet.service.goblin.entity.GoblinSelfMarketing;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/** /**
* <p> * <p>
* 官方(平台)营销表[活动]表 Mapper 接口 * 官方(平台)营销表[活动]表 Mapper 接口
...@@ -13,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -13,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface GoblinSelfMarketingMapper extends BaseMapper<GoblinSelfMarketing> { public interface GoblinSelfMarketingMapper extends BaseMapper<GoblinSelfMarketing> {
public List<GoblinZhengzaiStoreListDto> getZhengzaiStoreList(String marketId);
} }
...@@ -2,4 +2,14 @@ ...@@ -2,4 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.goblin.mapper.GoblinSelfMarketingMapper"> <mapper namespace="com.liquidnet.service.goblin.mapper.GoblinSelfMarketingMapper">
<resultMap id="goblinZhengzaiStoreListDtoResult" type="com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto">
<result column="store_id" property="storeId"/>
<result column="store_name" property="storeName"/>
<result column="order_code" property="spuCount"/>
<result column="title" property="skuCount"/>
</resultMap>
<select id="getZhengzaiStoreList" resultMap="goblinZhengzaiStoreListDtoResult">
</select>
</mapper> </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