采用阿里代码规约,对代码进行优化
This commit is contained in:
parent
3e73257922
commit
18d2379a19
@ -36,11 +36,16 @@ public class MemberCollectionController {
|
||||
@Autowired
|
||||
private StoreCollectionService storeCollectionService;
|
||||
|
||||
/**
|
||||
* 商品收藏关键字
|
||||
*/
|
||||
private String goods="GOODS";
|
||||
|
||||
@ApiOperation(value = "查询会员收藏列表")
|
||||
@ApiImplicitParam(name = "type", value = "类型", dataType = "String", paramType = "path", example = "GOODS:商品,STORE:店铺")
|
||||
@GetMapping("/{type}")
|
||||
public ResultMessage<Object> goodsList(@PathVariable String type, PageVO page) {
|
||||
if (type.equals("GOODS")) {
|
||||
if (goods.equals(type)) {
|
||||
return ResultUtil.data(goodsCollectionService.goodsCollection(page));
|
||||
}
|
||||
return ResultUtil.data(storeCollectionService.storeCollection(page));
|
||||
@ -54,7 +59,7 @@ public class MemberCollectionController {
|
||||
@PostMapping("/add/{type}/{id}")
|
||||
public ResultMessage<Object> addGoodsCollection(@PathVariable String type,
|
||||
@NotNull(message = "值不能为空") @PathVariable String id) {
|
||||
if (type.equals("GOODS")) {
|
||||
if (goods.equals(type)) {
|
||||
return ResultUtil.data(goodsCollectionService.addGoodsCollection(id));
|
||||
}
|
||||
return ResultUtil.data(storeCollectionService.addStoreCollection(id));
|
||||
@ -69,7 +74,7 @@ public class MemberCollectionController {
|
||||
@DeleteMapping(value = "/delete/{type}/{id}")
|
||||
public ResultMessage<Object> deleteGoodsCollection(@PathVariable String type,
|
||||
@NotNull(message = "值不能为空") @PathVariable String id) {
|
||||
if (type.equals("GOODS")) {
|
||||
if (goods.equals(type)) {
|
||||
return ResultUtil.data(goodsCollectionService.deleteGoodsCollection(id));
|
||||
}
|
||||
return ResultUtil.data(storeCollectionService.deleteStoreCollection(id));
|
||||
@ -83,7 +88,7 @@ public class MemberCollectionController {
|
||||
@GetMapping(value = "/isCollection/{type}/{id}")
|
||||
public ResultMessage<Boolean> isCollection(@PathVariable String type,
|
||||
@NotNull(message = "值不能为空") @PathVariable String id) {
|
||||
if (type.equals("GOODS")) {
|
||||
if (goods.equals(type)) {
|
||||
return ResultUtil.data(this.goodsCollectionService.isCollection(id));
|
||||
}
|
||||
return ResultUtil.data(this.storeCollectionService.isCollection(id));
|
||||
|
@ -34,6 +34,7 @@ public class MiniProgramBuyerController {
|
||||
public ConnectService connectService;
|
||||
@Autowired
|
||||
public WechatMpCodeUtil wechatMpCodeUtil;
|
||||
@SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
|
||||
@Autowired
|
||||
public WechatMPMessageService wechatMPMessageService;
|
||||
@Autowired
|
||||
|
@ -14,9 +14,11 @@ import org.springframework.stereotype.Service;
|
||||
* @date 2020-07-03 11:20
|
||||
*/
|
||||
@Service
|
||||
public class GoodsSkuExecute implements GoodsCommentCompleteEvent {
|
||||
public class GoodsSkuExecute implements GoodsCommentCompleteEvent {
|
||||
|
||||
//商品
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsSkuService goodsSkuService;
|
||||
|
||||
|
@ -29,18 +29,25 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class MemberExperienceExecute implements MemberRegisterEvent, GoodsCommentCompleteEvent, OrderStatusChangeEvent {
|
||||
|
||||
//配置
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
//会员
|
||||
/**
|
||||
* 会员
|
||||
*/
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
//订单
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
/**
|
||||
* 会员注册赠送经验值
|
||||
*
|
||||
* @param member 会员
|
||||
*/
|
||||
@Override
|
||||
@ -53,6 +60,7 @@ public class MemberExperienceExecute implements MemberRegisterEvent, GoodsCommen
|
||||
|
||||
/**
|
||||
* 商品评价赠送经验值
|
||||
*
|
||||
* @param memberEvaluation 会员评价
|
||||
*/
|
||||
@Override
|
||||
@ -65,17 +73,18 @@ public class MemberExperienceExecute implements MemberRegisterEvent, GoodsCommen
|
||||
|
||||
/**
|
||||
* 完成订单赠送经验值
|
||||
*
|
||||
* @param orderMessage 订单消息
|
||||
*/
|
||||
@Override
|
||||
public void orderChange(OrderMessage orderMessage) {
|
||||
if(orderMessage.getNewStatus().equals(OrderStatusEnum.COMPLETED)){
|
||||
if (orderMessage.getNewStatus().equals(OrderStatusEnum.COMPLETED)) {
|
||||
//获取经验值设置
|
||||
ExperienceSetting experienceSetting = getExperienceSetting();
|
||||
//获取订单信息
|
||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||
//计算赠送经验值数量
|
||||
Double point= CurrencyUtil.mul(experienceSetting.getMoney(),order.getFlowPrice(),0);
|
||||
Double point = CurrencyUtil.mul(experienceSetting.getMoney(), order.getFlowPrice(), 0);
|
||||
//赠送会员经验值
|
||||
memberService.updateMemberExperience(point.longValue(), true, order.getMemberId(), "会员下单,赠送经验值" + point + "分");
|
||||
}
|
||||
@ -83,9 +92,10 @@ public class MemberExperienceExecute implements MemberRegisterEvent, GoodsCommen
|
||||
|
||||
/**
|
||||
* 获取经验值设置
|
||||
*
|
||||
* @return 经验值设置
|
||||
*/
|
||||
private ExperienceSetting getExperienceSetting(){
|
||||
private ExperienceSetting getExperienceSetting() {
|
||||
Setting setting = settingService.get(SettingEnum.EXPERIENCE_SETTING.name());
|
||||
return new Gson().fromJson(setting.getSettingValue(), ExperienceSetting.class);
|
||||
}
|
||||
|
@ -33,57 +33,66 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentCompleteEvent, OrderStatusChangeEvent, AfterSaleStatusChangeEvent {
|
||||
|
||||
//配置
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
//会员
|
||||
/**
|
||||
* 会员
|
||||
*/
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
//订单
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
/**
|
||||
* 会员注册赠送积分
|
||||
*
|
||||
* @param member 会员
|
||||
*/
|
||||
@Override
|
||||
public void memberRegister(Member member) {
|
||||
//获取积分设置
|
||||
PointSetting pointSetting=getPointSetting();
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(Long.valueOf(pointSetting.getRegister().longValue()), true, member.getId(), "会员注册,赠送积分" + pointSetting.getRegister() + "分");
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员评价赠送积分
|
||||
*
|
||||
* @param memberEvaluation 会员评价
|
||||
*/
|
||||
@Override
|
||||
public void goodsComment(MemberEvaluation memberEvaluation) {
|
||||
//获取积分设置
|
||||
PointSetting pointSetting=getPointSetting();
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(Long.valueOf(pointSetting.getComment().longValue()), true, memberEvaluation.getMemberId(), "会员评价,赠送积分" + pointSetting.getComment() + "分");
|
||||
}
|
||||
|
||||
/**
|
||||
* 非积分订单订单完成后赠送积分
|
||||
*
|
||||
* @param orderMessage 订单消息
|
||||
*/
|
||||
@Override
|
||||
public void orderChange(OrderMessage orderMessage) {
|
||||
|
||||
if(orderMessage.getNewStatus().equals(OrderStatusEnum.COMPLETED)){
|
||||
if (orderMessage.getNewStatus().equals(OrderStatusEnum.COMPLETED)) {
|
||||
//根据订单编号获取订单数据,如果为积分订单则跳回
|
||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||
if(order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINT.name())){
|
||||
if (order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINT.name())) {
|
||||
return;
|
||||
}
|
||||
//获取积分设置
|
||||
PointSetting pointSetting=getPointSetting();
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
//计算赠送积分数量
|
||||
Double point=CurrencyUtil.mul(pointSetting.getMoney(),order.getFlowPrice(),0);
|
||||
Double point = CurrencyUtil.mul(pointSetting.getMoney(), order.getFlowPrice(), 0);
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(point.longValue(), true, order.getMemberId(), "会员下单,赠送积分" + point + "分");
|
||||
|
||||
@ -92,15 +101,16 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
||||
|
||||
/**
|
||||
* 提交售后后扣除积分
|
||||
*
|
||||
* @param afterSale 售后
|
||||
*/
|
||||
@Override
|
||||
public void afterSaleStatusChange(AfterSale afterSale) {
|
||||
if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) {
|
||||
//获取积分设置
|
||||
PointSetting pointSetting=getPointSetting();
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
//计算扣除积分数量
|
||||
Double point=CurrencyUtil.mul(pointSetting.getMoney(), afterSale.getActualRefundPrice(),0);
|
||||
Double point = CurrencyUtil.mul(pointSetting.getMoney(), afterSale.getActualRefundPrice(), 0);
|
||||
//扣除会员积分
|
||||
memberService.updateMemberPoint(point.longValue(), false, afterSale.getMemberId(), "会员退款,扣除积分" + point + "分");
|
||||
|
||||
@ -109,9 +119,10 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
||||
|
||||
/**
|
||||
* 获取积分设置
|
||||
*
|
||||
* @return 积分设置
|
||||
*/
|
||||
private PointSetting getPointSetting(){
|
||||
private PointSetting getPointSetting() {
|
||||
Setting setting = settingService.get(SettingEnum.POINT_SETTING.name());
|
||||
return new Gson().fromJson(setting.getSettingValue(), PointSetting.class);
|
||||
}
|
||||
|
@ -24,7 +24,9 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class PaymentExecute implements OrderStatusChangeEvent {
|
||||
|
||||
//订单
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
|
@ -32,23 +32,35 @@ import java.util.List;
|
||||
@Service
|
||||
public class StockUpdateExecute implements OrderStatusChangeEvent {
|
||||
|
||||
//出库失败消息
|
||||
/**
|
||||
* 出库失败消息
|
||||
*/
|
||||
static String outOfStockMessage = "库存不足,出库失败";
|
||||
//Redis
|
||||
/**
|
||||
* Redis
|
||||
*/
|
||||
@Autowired
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
@Autowired
|
||||
private DefaultRedisScript<Boolean> quantityScript;
|
||||
//订单
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
//规格商品
|
||||
/**
|
||||
* 规格商品
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsSkuService goodsSkuService;
|
||||
//促销商品
|
||||
/**
|
||||
* 促销商品
|
||||
*/
|
||||
@Autowired
|
||||
private PromotionGoodsService promotionGoodsService;
|
||||
//缓存
|
||||
/**
|
||||
* 缓存
|
||||
*/
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
|
||||
|
@ -41,31 +41,49 @@ import java.util.List;
|
||||
@RocketMQMessageListener(topic = "${lili.data.rocketmq.goods-topic}", consumerGroup = "${lili.data.rocketmq.goods-group}")
|
||||
public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
||||
|
||||
//ES商品
|
||||
/**
|
||||
* ES商品
|
||||
*/
|
||||
@Autowired
|
||||
private EsGoodsIndexService goodsIndexService;
|
||||
//店铺
|
||||
/**
|
||||
* 店铺
|
||||
*/
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
//商品
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
//商品
|
||||
/**
|
||||
* 商品Sku
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsSkuService goodsSkuService;
|
||||
//用户足迹
|
||||
/**
|
||||
* 用户足迹
|
||||
*/
|
||||
@Autowired
|
||||
private FootprintService footprintService;
|
||||
//商品收藏
|
||||
/**
|
||||
* 商品收藏
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsCollectionService goodsCollectionService;
|
||||
//商品评价
|
||||
/**
|
||||
* 商品评价
|
||||
*/
|
||||
@Autowired
|
||||
private List<GoodsCommentCompleteEvent> goodsCommentCompleteEvents;
|
||||
//分销商品
|
||||
/**
|
||||
* 分销商品
|
||||
*/
|
||||
@Autowired
|
||||
private DistributionGoodsService distributionGoodsService;
|
||||
//分销员-商品关联表
|
||||
/**
|
||||
* 分销员-商品关联表
|
||||
*/
|
||||
@Autowired
|
||||
private DistributionSelectedGoodsService distributionSelectedGoodsService;
|
||||
|
||||
@ -133,20 +151,21 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
||||
* 1.更新店铺的商品数量
|
||||
* 2.删除分销员-分销商品绑定关系
|
||||
* 3.删除分销商品
|
||||
*
|
||||
* @param messageExt 消息
|
||||
*/
|
||||
private void deleteGoods(MessageExt messageExt){
|
||||
Goods goods=JSONUtil.toBean(new String(messageExt.getBody()),Goods.class);
|
||||
private void deleteGoods(MessageExt messageExt) {
|
||||
Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
|
||||
//更新店铺商品数量
|
||||
storeService.updateStoreGoodsNum(goods.getStoreId());
|
||||
|
||||
//删除获取分销商品
|
||||
DistributionGoods distributionGoods=distributionGoodsService.getOne(new LambdaQueryWrapper<DistributionGoods>()
|
||||
.eq(DistributionGoods::getGoodsId,goods.getId()));
|
||||
DistributionGoods distributionGoods = distributionGoodsService.getOne(new LambdaQueryWrapper<DistributionGoods>()
|
||||
.eq(DistributionGoods::getGoodsId, goods.getId()));
|
||||
|
||||
//删除分销商品绑定关系
|
||||
distributionSelectedGoodsService.remove(new LambdaQueryWrapper<DistributionSelectedGoods>()
|
||||
.eq(DistributionSelectedGoods::getDistributionGoodsId,distributionGoods.getId()));
|
||||
.eq(DistributionSelectedGoods::getDistributionGoodsId, distributionGoods.getId()));
|
||||
|
||||
//删除分销商品
|
||||
distributionGoodsService.removeById(distributionGoods.getId());
|
||||
@ -157,9 +176,10 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
||||
* 1.更新商品购买数量
|
||||
* 2.更新SKU购买数量
|
||||
* 3.更新索引购买数量
|
||||
*
|
||||
* @param messageExt
|
||||
*/
|
||||
private void goodsBuyComplete(MessageExt messageExt){
|
||||
private void goodsBuyComplete(MessageExt messageExt) {
|
||||
String goodsCompleteMessageStr = new String(messageExt.getBody());
|
||||
List<GoodsCompleteMessage> goodsCompleteMessageList = JSONUtil.toList(JSONUtil.parseArray(goodsCompleteMessageStr), GoodsCompleteMessage.class);
|
||||
for (GoodsCompleteMessage goodsCompleteMessage : goodsCompleteMessageList) {
|
||||
|
@ -30,16 +30,24 @@ import java.util.List;
|
||||
@RocketMQMessageListener(topic = "${lili.data.rocketmq.member-topic}", consumerGroup = "${lili.data.rocketmq.member-group}")
|
||||
public class MemberMessageListener implements RocketMQListener<MessageExt> {
|
||||
|
||||
//会员签到
|
||||
/**
|
||||
* 会员签到
|
||||
*/
|
||||
@Autowired
|
||||
private MemberSignService memberSignService;
|
||||
//会员积分变化
|
||||
/**
|
||||
* 会员积分变化
|
||||
*/
|
||||
@Autowired
|
||||
private List<MemberPointChangeEvent> memberPointChangeEvents;
|
||||
//会员提现
|
||||
/**
|
||||
* 会员提现
|
||||
*/
|
||||
@Autowired
|
||||
private List<MemberWithdrawalEvent> memberWithdrawalEvents;
|
||||
//会员注册
|
||||
/**
|
||||
* 会员注册
|
||||
*/
|
||||
@Autowired
|
||||
private List<MemberRegisterEvent> memberSignEvents;
|
||||
|
||||
|
@ -3,7 +3,6 @@ package cn.lili.listener;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.modules.message.entity.dto.NoticeMessageDTO;
|
||||
import cn.lili.modules.message.service.NoticeMessageService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.rocketmq.common.message.MessageExt;
|
||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||
@ -20,7 +19,9 @@ import org.springframework.stereotype.Component;
|
||||
@RocketMQMessageListener(topic = "${lili.data.rocketmq.notice-topic}", consumerGroup = "${lili.data.rocketmq.notice-group}")
|
||||
public class NoticeMessageListener implements RocketMQListener<MessageExt> {
|
||||
|
||||
//站内信
|
||||
/**
|
||||
* 站内信
|
||||
*/
|
||||
@Autowired
|
||||
private NoticeMessageService noticeMessageService;
|
||||
|
||||
|
@ -28,6 +28,7 @@ import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -41,22 +42,34 @@ import java.util.List;
|
||||
@RocketMQMessageListener(topic = "${lili.data.rocketmq.notice-send-topic}", consumerGroup = "${lili.data.rocketmq.notice-send-group}")
|
||||
public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
|
||||
|
||||
//会员
|
||||
@Autowired
|
||||
/**
|
||||
* 会员
|
||||
*/
|
||||
@Resource
|
||||
private MemberMapper memberMapper;
|
||||
//短信
|
||||
/**
|
||||
* 短信
|
||||
*/
|
||||
@Autowired
|
||||
private SmsUtil smsUtil;
|
||||
//店铺消息
|
||||
/**
|
||||
* 店铺消息
|
||||
*/
|
||||
@Autowired
|
||||
private StoreMessageService storeMessageService;
|
||||
//会员消息
|
||||
/**
|
||||
* 会员消息
|
||||
*/
|
||||
@Autowired
|
||||
private MemberMessageService memberMessageService;
|
||||
//店铺
|
||||
/**
|
||||
* 店铺
|
||||
*/
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
//会员
|
||||
/**
|
||||
* 会员
|
||||
*/
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
@ -100,7 +113,7 @@ public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
|
||||
private void saveStoreMessage(Message message) {
|
||||
List<StoreMessage> list = new ArrayList<>();
|
||||
//发送全部商家情况
|
||||
if (message.getMessageRange().equals("ALL")) {
|
||||
if ("ALL".equals(message.getMessageRange())) {
|
||||
List<Store> storeList = storeService.list(new QueryWrapper<Store>().eq("store_disable", "OPEN"));
|
||||
storeList.forEach(item -> {
|
||||
StoreMessage storeMessage = new StoreMessage();
|
||||
@ -141,7 +154,7 @@ public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
|
||||
private void saveMemberMessage(Message message) {
|
||||
List<MemberMessage> list = new ArrayList<>();
|
||||
//如果是给所有会员发送消息
|
||||
if (message.getMessageRange().equals("ALL")) {
|
||||
if ("ALL".equals(message.getMessageRange())) {
|
||||
//查询所有会员总数,因为会员总数比较大 如果一次性查出来会占用数据库资源,所以要分页查询
|
||||
MemberSearchVO memberSearchVO = new MemberSearchVO();
|
||||
memberSearchVO.setDisabled(SwitchEnum.OPEN.name());
|
||||
|
@ -27,13 +27,19 @@ import java.util.List;
|
||||
@RocketMQMessageListener(topic = "${lili.data.rocketmq.order-topic}", consumerGroup = "${lili.data.rocketmq.order-group}")
|
||||
public class OrderMessageListener implements RocketMQListener<MessageExt> {
|
||||
|
||||
//交易
|
||||
/**
|
||||
* 交易
|
||||
*/
|
||||
@Autowired
|
||||
private List<TradeEvent> tradeEvent;
|
||||
//订单状态
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
@Autowired
|
||||
private List<OrderStatusChangeEvent> orderStatusChangeEvents;
|
||||
//缓存
|
||||
/**
|
||||
* 缓存
|
||||
*/
|
||||
@Autowired
|
||||
private Cache<Object> cache;
|
||||
|
||||
|
@ -37,16 +37,24 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class OrderEveryDayTaskExecute implements EveryDayExecute {
|
||||
|
||||
//订单
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
//订单货物
|
||||
/**
|
||||
* 订单货物
|
||||
*/
|
||||
@Autowired
|
||||
private OrderItemService orderItemService;
|
||||
//设置
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
//会员评价
|
||||
/**
|
||||
* 会员评价
|
||||
*/
|
||||
@Autowired
|
||||
private MemberEvaluationService memberEvaluationService;
|
||||
|
||||
|
@ -39,33 +39,49 @@ import java.util.List;
|
||||
@Component
|
||||
public class PromotionEverydayExecute implements EveryDayExecute {
|
||||
|
||||
//Mongo
|
||||
/**
|
||||
* Mongo
|
||||
*/
|
||||
@Autowired
|
||||
private MongoTemplate mongoTemplate;
|
||||
//es
|
||||
/**
|
||||
* ES商品索引
|
||||
*/
|
||||
@Autowired
|
||||
private EsGoodsIndexService esGoodsIndexService;
|
||||
//满额活动
|
||||
/**
|
||||
* 满额活动
|
||||
*/
|
||||
@Autowired
|
||||
private FullDiscountService fullDiscountService;
|
||||
//拼团
|
||||
/**
|
||||
* 拼团
|
||||
*/
|
||||
@Autowired
|
||||
private PintuanService pintuanService;
|
||||
//优惠券
|
||||
/**
|
||||
* 优惠券
|
||||
*/
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
//会员优惠券
|
||||
/**
|
||||
* 会员优惠券
|
||||
*/
|
||||
@Autowired
|
||||
private MemberCouponService memberCouponService;
|
||||
//促销商品
|
||||
/**
|
||||
* 促销商品
|
||||
*/
|
||||
@Autowired
|
||||
private PromotionGoodsService promotionGoodsService;
|
||||
|
||||
//系统设置
|
||||
/**
|
||||
* 系统设置
|
||||
*/
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
|
||||
//秒杀活动
|
||||
/**
|
||||
* 秒杀活动
|
||||
*/
|
||||
@Autowired
|
||||
private SeckillService seckillService;
|
||||
|
||||
|
@ -20,7 +20,9 @@ import java.util.Date;
|
||||
@Component
|
||||
public class MemberStatisticsExecute implements EveryDayExecute {
|
||||
|
||||
//会员统计
|
||||
/**
|
||||
* 会员统计
|
||||
*/
|
||||
@Autowired
|
||||
private MemberStatisticsDataService memberStatisticsDataService;
|
||||
|
||||
|
@ -24,10 +24,14 @@ import java.util.stream.Collectors;
|
||||
@Component
|
||||
public class OnlineMemberStatistics implements EveryHourExecute {
|
||||
|
||||
//缓存
|
||||
/**
|
||||
* 缓存
|
||||
*/
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
//统计小时
|
||||
/**
|
||||
* 统计小时
|
||||
*/
|
||||
@Autowired
|
||||
private StatisticsProperties statisticsProperties;
|
||||
|
||||
|
@ -25,10 +25,14 @@ import java.util.List;
|
||||
*/
|
||||
@Component
|
||||
public class StoreRatingExecute implements EveryDayExecute {
|
||||
//店铺
|
||||
/**
|
||||
* 店铺
|
||||
*/
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
//会员评价
|
||||
/**
|
||||
* 会员评价
|
||||
*/
|
||||
@Resource
|
||||
private MemberEvaluationMapper memberEvaluationMapper;
|
||||
|
||||
|
@ -4,7 +4,6 @@ import cn.hutool.core.convert.Convert;
|
||||
import cn.lili.common.cache.Cache;
|
||||
import cn.lili.common.cache.CachePrefix;
|
||||
import cn.lili.common.utils.BeanUtil;
|
||||
import cn.lili.common.utils.DateUtil;
|
||||
import cn.lili.modules.statistics.model.dos.PlatformViewData;
|
||||
import cn.lili.modules.statistics.service.PlatformViewDataService;
|
||||
import cn.lili.timetask.handler.EveryDayExecute;
|
||||
@ -29,10 +28,14 @@ import java.util.List;
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PageViewStatisticsExecute implements EveryDayExecute {
|
||||
//缓存
|
||||
/**
|
||||
* 缓存
|
||||
*/
|
||||
@Autowired
|
||||
private Cache cache;
|
||||
//平台PV统计
|
||||
/**
|
||||
* 平台PV统计
|
||||
*/
|
||||
@Autowired
|
||||
private PlatformViewDataService platformViewDataService;
|
||||
|
||||
|
@ -25,16 +25,24 @@ import org.springframework.stereotype.Component;
|
||||
@Slf4j
|
||||
@Component(TimeExecuteConstant.PROMOTION_EXECUTOR)
|
||||
public class PromotionTimeTriggerExecutor implements TimeTriggerExecutor {
|
||||
//促销
|
||||
/**
|
||||
* 促销
|
||||
*/
|
||||
@Autowired
|
||||
private PromotionService promotionService;
|
||||
//Rocketmq
|
||||
/**
|
||||
* RocketMQ
|
||||
*/
|
||||
@Autowired
|
||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||
//延时任务
|
||||
/**
|
||||
* 延时任务
|
||||
*/
|
||||
@Autowired
|
||||
private TimeTrigger timeTrigger;
|
||||
//订单
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
|
@ -215,7 +215,7 @@ public class Goods extends BaseEntity {
|
||||
this.price = goodsOperationDTO.getPrice();
|
||||
this.weight = goodsOperationDTO.getWeight();
|
||||
this.templateId = goodsOperationDTO.getTemplateId();
|
||||
this.recommend = goodsOperationDTO.isRecommend();
|
||||
this.recommend = goodsOperationDTO.getRecommend();
|
||||
this.sellingPoint = goodsOperationDTO.getSellingPoint();
|
||||
this.salesModel = goodsOperationDTO.getSalesModel();
|
||||
this.goodsUnit = goodsOperationDTO.getGoodsUnit();
|
||||
@ -226,7 +226,7 @@ public class Goods extends BaseEntity {
|
||||
this.params = JSONUtil.toJsonStr(goodsOperationDTO.getGoodsParamsDTOList());
|
||||
}
|
||||
//如果立即上架则
|
||||
this.marketEnable = goodsOperationDTO.isRelease() ? GoodsStatusEnum.UPPER.name() : GoodsStatusEnum.DOWN.name();
|
||||
this.marketEnable = goodsOperationDTO.getRelease() ? GoodsStatusEnum.UPPER.name() : GoodsStatusEnum.DOWN.name();
|
||||
this.goodsType = goodsOperationDTO.getGoodsType();
|
||||
|
||||
//循环sku,判定sku是否有效
|
||||
|
@ -1,9 +1,8 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Category;
|
||||
import cn.lili.modules.goods.entity.vos.CategoryVO;
|
||||
@ -62,7 +61,7 @@ public class CategoryManagerController {
|
||||
@ApiOperation(value = "添加商品分类")
|
||||
public ResultMessage<Category> saveCategory(@Valid Category category) {
|
||||
//非顶级分类
|
||||
if (category.getParentId() != null && !category.getParentId().equals("0")) {
|
||||
if (category.getParentId() != null && !"0".equals(category.getParentId())) {
|
||||
Category parent = categoryService.getById(category.getParentId());
|
||||
if (parent == null) {
|
||||
throw new ServiceException(ResultCode.CATEGORY_PARENT_NOT_EXIST);
|
||||
|
@ -34,10 +34,14 @@ import java.util.List;
|
||||
@Api(tags = "管理端,商品管理接口")
|
||||
@RequestMapping("/manager/goods")
|
||||
public class GoodsManagerController {
|
||||
//商品
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
//规格商品
|
||||
/**
|
||||
* 规格商品
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsSkuService goodsSkuService;
|
||||
|
||||
|
@ -4,11 +4,8 @@ import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.message.entity.dos.MemberMessage;
|
||||
import cn.lili.modules.message.entity.dos.StoreMessage;
|
||||
import cn.lili.modules.message.entity.vos.MemberMessageQueryVO;
|
||||
import cn.lili.modules.message.entity.vos.StoreMessageQueryVO;
|
||||
import cn.lili.modules.message.service.MemberMessageService;
|
||||
import cn.lili.modules.message.service.StoreMessageService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -25,8 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author pikachu
|
||||
* @date: 2020/12/6 16:09
|
||||
*/
|
||||
@Transactional
|
||||
@RestController
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Api(tags = "管理端,会员消息消息管理接口")
|
||||
@RequestMapping("/manager/message/member")
|
||||
public class MemberMessageManagerController {
|
||||
|
@ -39,8 +39,8 @@ public class MemberWithdrawApplyManagerController {
|
||||
@GetMapping
|
||||
public ResultMessage<IPage<MemberWithdrawApply>> getByPage(PageVO page, MemberWithdrawApplyQueryVO memberWithdrawApplyQueryVO) {
|
||||
//构建查询 返回数据
|
||||
IPage<MemberWithdrawApply> memberWithdrawApplyIPage = memberWithdrawApplyService.getMemberWithdrawPage(page, memberWithdrawApplyQueryVO);
|
||||
return ResultUtil.data(memberWithdrawApplyIPage);
|
||||
IPage<MemberWithdrawApply> memberWithdrawApplyPage = memberWithdrawApplyService.getMemberWithdrawPage(page, memberWithdrawApplyQueryVO);
|
||||
return ResultUtil.data(memberWithdrawApplyPage);
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,8 +22,8 @@ import java.util.List;
|
||||
* @date: 2020/11/17 7:56 下午
|
||||
*/
|
||||
@Slf4j
|
||||
@Transactional
|
||||
@RestController
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Api(tags = "日志管理接口")
|
||||
@RequestMapping("/manager/log")
|
||||
public class LogManagerController {
|
||||
|
@ -25,7 +25,7 @@ import java.util.List;
|
||||
@RestController
|
||||
@Api(tags = "管理端,行政地区管理接口")
|
||||
@RequestMapping("/manager/region")
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class RegionManagerController {
|
||||
@Autowired
|
||||
private RegionService regionService;
|
||||
|
@ -49,7 +49,7 @@ public class StoreManagerController {
|
||||
|
||||
@ApiOperation(value = "获取店铺分页列表")
|
||||
@GetMapping("/all")
|
||||
public ResultMessage<List<Store>> getALL() {
|
||||
public ResultMessage<List<Store>> getAll() {
|
||||
return ResultUtil.data(storeService.list(new QueryWrapper<Store>().eq("store_disable", "OPEN")));
|
||||
}
|
||||
|
||||
|
@ -22,15 +22,15 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author pikachu
|
||||
* @date: 2020/12/6 16:09
|
||||
*/
|
||||
@Transactional
|
||||
@RestController
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Api(tags = "管理端,店铺消息消息管理接口")
|
||||
@RequestMapping("/manager/message/store")
|
||||
public class StoreMessageManagerController {
|
||||
|
||||
@Autowired
|
||||
private StoreMessageService storeMessageService;
|
||||
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "多条件分页获取")
|
||||
public ResultMessage<IPage<StoreMessage>> getByCondition(StoreMessageQueryVO storeMessageQueryVO,
|
||||
|
@ -23,8 +23,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author Chopper
|
||||
* @date 2020/11/17 4:34 下午
|
||||
*/
|
||||
@Transactional
|
||||
@RestController
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Api(tags = "管理端,订单日志管理接口")
|
||||
@RequestMapping("/manager/orderLog")
|
||||
public class OrderLogManagerController {
|
||||
|
@ -34,10 +34,14 @@ import java.util.List;
|
||||
@Api(tags = "管理端,订单API")
|
||||
public class OrderManagerController {
|
||||
|
||||
//订单
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
//订单价格
|
||||
/**
|
||||
* 订单价格
|
||||
*/
|
||||
@Autowired
|
||||
private OrderPriceService orderPriceService;
|
||||
|
||||
|
@ -39,13 +39,19 @@ import java.util.List;
|
||||
@RequestMapping("/store/goods")
|
||||
public class GoodsStoreController {
|
||||
|
||||
//商品
|
||||
/**
|
||||
* 商品
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
//商品sku
|
||||
/**
|
||||
* 商品sku
|
||||
*/
|
||||
@Autowired
|
||||
private GoodsSkuService goodsSkuService;
|
||||
//店铺详情
|
||||
/**
|
||||
* 店铺详情
|
||||
*/
|
||||
@Autowired
|
||||
private StoreDetailService storeDetailService;
|
||||
|
||||
|
@ -22,8 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author Chopper
|
||||
* @date: 2020/11/22 14:23
|
||||
*/
|
||||
@Transactional
|
||||
@RestController
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Api(tags = "店铺端,日志管理接口")
|
||||
@RequestMapping("/store/log")
|
||||
public class LogStoreController {
|
||||
|
Loading…
x
Reference in New Issue
Block a user