16 Commits
v4.2 ... v4.2.0

Author SHA1 Message Date
OceansDeep
e38f9aa2ff !13 fix https://gitee.com/beijing_hongye_huicheng/lilishop/issues/I3YFU4
Merge pull request !13 from OceansDeep/feature/pg
2021-07-01 02:16:42 +00:00
paulGao
696e075fcd Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop into feature/pg 2021-07-01 10:12:40 +08:00
paulGao
d25ba76094 fix https://gitee.com/beijing_hongye_huicheng/lilishop/issues/I3YFU4 2021-07-01 10:12:33 +08:00
Chopper
7e3a9eb904 Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop 2021-06-30 19:59:42 +08:00
Chopper
079437100d 版本好升级 2021-06-30 19:59:36 +08:00
lifenlong
d7ce709ce6 使用hutool进行格式转换 2021-06-30 16:29:19 +08:00
lifenlong
cff2b95c48 同步 2021-06-30 15:47:33 +08:00
lifenlong
1a77b3cec7 商品数据转换问题 2021-06-30 15:46:52 +08:00
Chopper
23388eff6b 升级项目版本号 2021-06-30 14:53:26 +08:00
lifenlong
46f216c191 1.店铺关闭,批量下架店铺商品问题。
2.解决实物/虚拟订单发货逻辑判断问题
2021-06-30 10:26:32 +08:00
lifenlong
a60a535708 修改分销可提现金额 2021-06-30 08:41:04 +08:00
lifenlong
888b5e2558 解决直播间时间不正确问题 2021-06-29 17:01:55 +08:00
lifenlong
1431d990f9 解决直播间时间不正确问题 2021-06-29 16:58:54 +08:00
Chopper
f509b8745d token生成时权限过滤问题处理 2021-06-29 16:43:38 +08:00
Chopper
c1b9f287c7 新增管理员即赋予权限无法生效问题处理。直播间未登录用户报错问题处理 2021-06-29 16:26:52 +08:00
Chopper
3ee3e49d0b 用户在请求直播时没有登录抛出异常问题处理。 2021-06-29 15:40:37 +08:00
23 changed files with 73 additions and 73 deletions

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</parent>
<artifactId>admin</artifactId>

View File

@@ -10,14 +10,14 @@
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</parent>
<dependencies>
<dependency>
<groupId>cn.lili</groupId>
<artifactId>framework</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</dependency>
<dependency>

View File

@@ -53,7 +53,7 @@ public class DistributionBuyerController {
@ApiOperation(value = "获取分销员分页订单列表")
@GetMapping("/distributionOrder")
public ResultMessage<IPage<DistributionOrder>> distributionOrderPage(DistributionOrderSearchParams distributionOrderSearchParams) {
distributionOrderSearchParams.setDistributionId(UserContext.getCurrentUser().getId());
distributionOrderSearchParams.setDistributionId(distributionService.getDistribution().getId());
return ResultUtil.data(distributionOrderService.getDistributionOrderPage(distributionOrderSearchParams));
}

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</parent>
<groupId>cn.lili</groupId>
@@ -17,7 +17,7 @@
<dependency>
<groupId>cn.lili</groupId>
<artifactId>framework</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</dependency>
</dependencies>

View File

@@ -77,7 +77,7 @@ spring:
default-datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.116:3306/Bulbasaur?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://192.168.0.116:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: lilishop
maxActive: 20
@@ -194,9 +194,9 @@ logging:
# 输出级别
level:
cn.lili: info
# org.hibernate: debug
# org.springframework: debug
# org.springframework.data.mongodb.core: debug
org.hibernate: debug
org.springframework: debug
org.springframework.data.mongodb.core: debug
file:
# 指定路径
path: lili-logs

View File

@@ -8,14 +8,14 @@
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</parent>
<dependencies>
<dependency>
<groupId>cn.lili</groupId>
<artifactId>framework</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</dependency>
<dependency>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</parent>
<artifactId>framework</artifactId>

View File

@@ -84,7 +84,7 @@ public class ManagerTokenGenerate extends AbstractTokenGenerate {
//for循环路径集合
for (String path : paths) {
//如果是超级权限 则计入超级权限
if (menu.getIsSupper()) {
if (menu.getIsSupper() != null && menu.getIsSupper()) {
//如果已有超级权限,则这里就不做权限的累加
if (!superPermissions.contains(path)) {
superPermissions.add(path);

View File

@@ -72,7 +72,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
//直播开启延时任务
BroadcastMessage broadcastMessage = new BroadcastMessage(studio.getId(), StudioStatusEnum.START.name());
TimeTriggerMsg timeTriggerMsg = new TimeTriggerMsg(TimeExecuteConstant.BROADCAST_EXECUTOR,
Long.parseLong(studio.getStartTime()),
Long.parseLong(studio.getStartTime()) * 1000L,
broadcastMessage,
DelayQueueTools.wrapperUniqueKey(DelayTypeEnums.BROADCAST, studio.getId()),
rocketmqCustomProperties.getPromotionTopic());
@@ -83,7 +83,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
//直播结束延时任务
broadcastMessage = new BroadcastMessage(studio.getId(), StudioStatusEnum.END.name());
timeTriggerMsg = new TimeTriggerMsg(TimeExecuteConstant.BROADCAST_EXECUTOR,
Long.parseLong(studio.getEndTime()), broadcastMessage,
Long.parseLong(studio.getEndTime()) * 1000L, broadcastMessage,
DelayQueueTools.wrapperUniqueKey(DelayTypeEnums.BROADCAST, studio.getId()),
rocketmqCustomProperties.getPromotionTopic());
//发送促销活动开始的延时任务
@@ -108,8 +108,8 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
this.timeTrigger.edit(
TimeExecuteConstant.BROADCAST_EXECUTOR,
broadcastMessage,
Long.parseLong(oldStudio.getStartTime()),
Long.parseLong(studio.getStartTime()),
Long.parseLong(oldStudio.getStartTime()) * 1000L,
Long.parseLong(studio.getStartTime()) * 1000L,
DelayQueueTools.wrapperUniqueKey(DelayTypeEnums.BROADCAST, studio.getId()),
DateUtil.getDelayTime(Long.parseLong(studio.getStartTime())),
rocketmqCustomProperties.getPromotionTopic());
@@ -119,8 +119,8 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
this.timeTrigger.edit(
TimeExecuteConstant.BROADCAST_EXECUTOR,
broadcastMessage,
Long.parseLong(oldStudio.getEndTime()),
Long.parseLong(studio.getEndTime()),
Long.parseLong(oldStudio.getEndTime()) * 1000L,
Long.parseLong(studio.getEndTime()) * 1000L,
DelayQueueTools.wrapperUniqueKey(DelayTypeEnums.BROADCAST, studio.getId()),
DateUtil.getDelayTime(Long.parseLong(studio.getEndTime())),
rocketmqCustomProperties.getPromotionTopic());
@@ -200,7 +200,7 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
.eq(recommend != null, "recommend", true)
.eq(status != null, "status", status)
.orderByDesc("create_time");
if (UserContext.getCurrentUser().getRole().equals(UserEnums.STORE)) {
if (UserContext.getCurrentUser() != null && UserContext.getCurrentUser().getRole().equals(UserEnums.STORE)) {
queryWrapper.eq("store_id", UserContext.getCurrentUser().getStoreId());
}
return this.page(PageUtil.initPage(pageVO), queryWrapper);

View File

@@ -55,8 +55,8 @@ public class DistributionOrderSearchParams extends PageVO {
queryWrapper.like(StringUtils.isNotBlank(distributionName), "distribution_name", distributionName);
queryWrapper.eq(StringUtils.isNotBlank(distributionOrderStatus), "distribution_order_status", distributionOrderStatus);
queryWrapper.eq(StringUtils.isNotBlank(orderSn), "order_sn", orderSn);
queryWrapper.eq(StringUtils.isNotBlank(StringUtils.toString(distributionId)), "distribution_id", distributionId);
queryWrapper.eq(StringUtils.isNotBlank(StringUtils.toString(storeId)), "store_id", storeId);
queryWrapper.eq(StringUtils.isNotBlank(distributionId), "distribution_id", distributionId);
queryWrapper.eq(StringUtils.isNotBlank(storeId), "store_id", storeId);
if (endTime != null && startTime != null) {
queryWrapper.between("create_time", startTime, endTime);
}

View File

@@ -16,6 +16,6 @@ public interface DistributionMapper extends BaseMapper<Distribution> {
@Update("UPDATE li_distribution set can_rebate = can_rebate+#{canRebate} WHERE id = #{distributionId}")
void subCanRebate(Double canRebate,String distributionId);
@Update("UPDATE li_distribution set can_rebate = (can_rebate+#{canRebate}) AND rebate_total=(rebate_total+#{canRebate}) AND distribution_order_count=(distribution_order_count+1) WHERE id = #{distributionId}")
@Update("UPDATE li_distribution set can_rebate = (can_rebate+#{canRebate}) , rebate_total=(rebate_total+#{canRebate}) , distribution_order_count=(distribution_order_count+1) WHERE id = #{distributionId}")
void addCanRebate(Double canRebate,String distributionId);
}

View File

@@ -1,5 +1,6 @@
package cn.lili.modules.goods.entity.dos;
import cn.hutool.core.convert.Convert;
import cn.hutool.json.JSONUtil;
import cn.lili.base.BaseEntity;
import cn.lili.common.enums.ResultCode;
@@ -234,19 +235,19 @@ public class Goods extends BaseEntity {
if (sku.get("sn") == null) {
throw new ServiceException(ResultCode.GOODS_SKU_SN_ERROR);
}
if (StringUtil.isEmpty(sku.get("price").toString()) || Integer.parseInt( sku.get("price").toString()) <= 0) {
if (StringUtil.isEmpty(sku.get("price").toString()) || Convert.toDouble(sku.get("price")) <= 0) {
throw new ServiceException(ResultCode.GOODS_SKU_PRICE_ERROR);
}
if (StringUtil.isEmpty(sku.get("cost").toString()) || Integer.parseInt( sku.get("cost").toString()) <= 0) {
if (StringUtil.isEmpty(sku.get("cost").toString()) || Convert.toDouble(sku.get("cost")) <= 0) {
throw new ServiceException(ResultCode.GOODS_SKU_COST_ERROR);
}
//虚拟商品没有重量字段
if(sku.containsKey("weight")) {
if (StringUtil.isEmpty(sku.get("weight").toString()) || Integer.parseInt(sku.get("weight").toString()) < 0) {
if (sku.containsKey("weight")) {
if (StringUtil.isEmpty(sku.get("weight").toString()) || Convert.toDouble(sku.get("weight").toString()) < 0) {
throw new ServiceException(ResultCode.GOODS_SKU_WEIGHT_ERROR);
}
}
if (StringUtil.isEmpty(sku.get("quantity").toString()) || Integer.parseInt( sku.get("quantity").toString()) < 0) {
if (StringUtil.isEmpty(sku.get("quantity").toString()) || Convert.toInt(sku.get("quantity").toString()) < 0) {
throw new ServiceException(ResultCode.GOODS_SKU_QUANTITY_ERROR);
}

View File

@@ -10,6 +10,8 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
/**
* 规格项数据处理层
*
@@ -19,12 +21,12 @@ import org.apache.ibatis.annotations.Update;
public interface GoodsMapper extends BaseMapper<Goods> {
/**
* 下架所有商家商品
* 根据店铺ID获取商品ID列表
*
* @param storeId
* @param storeId 店铺ID
*/
@Update("update li_goods set market_enable = 0 WHERE store_id = #{storeId}")
void underStoreGoods(String storeId);
@Select("SELECT id FROM li_goods WHERE store_id = #{storeId}")
List<String> getGoodsIdByStoreId(String storeId);
@Update("UPDATE li_goods SET comment_num = comment_num + #{commentNum} WHERE id = #{goodsId}")
void addGoodsCommentNum(Integer commentNum, String goodsId);

View File

@@ -93,7 +93,10 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
@Override
public void underStoreGoods(String storeId) {
this.baseMapper.underStoreGoods(storeId);
//获取商品ID列表
List<String> list= this.baseMapper.getGoodsIdByStoreId(storeId);
//下架店铺下的商品
updateGoodsMarketAble(list,GoodsStatusEnum.DOWN,"店铺关闭");
}
@Override

View File

@@ -190,6 +190,11 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId);
GoodsVO goodsVO = goodsService.getGoodsVO(goodsId);
if (goodsVO == null || !goodsVO.getMarketEnable().equals(GoodsStatusEnum.UPPER.name())
|| !goodsVO.getIsAuth().equals(GoodsAuthEnum.PASS.name())
|| Boolean.TRUE.equals(goodsVO.getDeleteFlag())) {
throw new ServiceException(ResultCode.GOODS_NOT_EXIST);
}
//如果规格为空则使用商品ID进行查询
if (goodsSku == null) {
skuId = goodsVO.getSkuList().get(0).getId();
@@ -198,8 +203,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
if (goodsSku == null) {
throw new ServiceException(ResultCode.GOODS_NOT_EXIST);
}
} else if (!goodsSku.getMarketEnable().equals(GoodsStatusEnum.UPPER.name()) || !goodsVO.getIsAuth().equals(GoodsAuthEnum.PASS.name()) || Boolean.TRUE.equals(goodsSku.getDeleteFlag())) {
throw new ServiceException(ResultCode.GOODS_NOT_EXIST);
}
//获取当前商品的索引信息
EsGoodsIndex goodsIndex = goodsIndexService.findById(skuId);

View File

@@ -219,27 +219,25 @@ public class Order extends BaseEntity {
BeanUtil.copyProperties(tradeDTO, this);
BeanUtil.copyProperties(cartVO.getPriceDetailDTO(), this);
BeanUtil.copyProperties(cartVO, this);
//订单类型判断--普通订单,活动订单。
//订单类型判断--普通订单,虚拟订单。
if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.CART) || tradeDTO.getCartTypeEnum().equals(CartTypeEnum.BUY_NOW)) {
this.setOrderType(OrderTypeEnum.NORMAL.name());
} else if (tradeDTO.getCartTypeEnum().equals(CartTypeEnum.VIRTUAL)) {
this.setOrderType(tradeDTO.getCartTypeEnum().name());
} else {
this.setOrderType(OrderTypeEnum.NORMAL.name());
}
this.setId(oldId);
//促销信息填充
if (cartVO.getSkuList().get(0).getPromotions() != null && tradeDTO.getCartTypeEnum().equals(CartTypeEnum.PINTUAN)) {
Optional<String> pintuanId = cartVO.getSkuList().get(0).getPromotions().stream().filter(i -> i.getPromotionType().equals(PromotionTypeEnum.PINTUAN.name())).map(PromotionGoods::getPromotionId).findFirst();
if (pintuanId.isPresent()) {
promotionId = pintuanId.get();
this.setOrderType(OrderTypeEnum.PINTUAN.name());
if (tradeDTO.getParentOrderSn() == null) {
this.setParentOrderSn("");
}
}
}
// if (cartVO.getSkuList().get(0).getPromotions() != null && tradeDTO.getCartTypeEnum().equals(CartTypeEnum.PINTUAN)) {
// Optional<String> pintuanId = cartVO.getSkuList().get(0).getPromotions().stream().filter(i -> i.getPromotionType().equals(PromotionTypeEnum.PINTUAN.name())).map(PromotionGoods::getPromotionId).findFirst();
// if (pintuanId.isPresent()) {
// promotionId = pintuanId.get();
// this.setOrderType(OrderTypeEnum.PINTUAN.name());
// if (tradeDTO.getParentOrderSn() == null) {
// this.setParentOrderSn("");
// }
// }
// }
//设置默认支付状态
this.setOrderStatus(OrderStatusEnum.UNPAID.name());

View File

@@ -13,17 +13,8 @@ public enum OrderTypeEnum {
*/
NORMAL,
/**
* 赠品订单
*/
GIFT,
/**
* 虚拟订单
*/
VIRTUAL,
/**
* 拼团订单
*/
PINTUAN
VIRTUAL
}

View File

@@ -69,9 +69,10 @@ public class AllowOperation implements Serializable {
//新订单,允许支付
this.pay = status.equals(OrderStatusEnum.UNPAID.name()) && payStatus.equals(PayStatusEnum.UNPAID.name());
//订单未发货,就可以编辑收货人信息实物订单
this.editConsignee = order.getOrderType().equals(OrderTypeEnum.VIRTUAL.name()) &&
order.getDeliverStatus().equals(DeliverStatusEnum.UNDELIVERED.name()) && !status.equals(OrderStatusEnum.CANCELLED.name());
//可编辑订单收件人信息=实物订单 && 订单未发货 && 订单未取消
this.editConsignee = order.getOrderType().equals(OrderTypeEnum.NORMAL.name())
&& order.getDeliverStatus().equals(DeliverStatusEnum.UNDELIVERED.name())
&& !status.equals(OrderStatusEnum.CANCELLED.name());
//是否允许被发货
this.ship = editConsignee && status.equals(OrderStatusEnum.UNDELIVERED.name());

View File

@@ -199,13 +199,12 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
if (roles.size() > 10) {
throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN);
}
if (roles != null && roles.size() > 0) {
if (roles.size() > 0) {
dbUser.setRoleIds(StringUtils.join(",", roles));
}
this.save(dbUser);
updateRole(adminUser.getId(), roles);
dbUser = this.findByUsername(dbUser.getUsername());
updateRole(dbUser.getId(), roles);
}

View File

@@ -8,14 +8,14 @@
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</parent>
<dependencies>
<dependency>
<groupId>cn.lili</groupId>
<artifactId>framework</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</dependency>
</dependencies>

View File

@@ -12,11 +12,11 @@
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
<properties>
<docker-registry>registry.cn-beijing.aliyuncs.com/lili-images</docker-registry>
<images-version>0.0.5</images-version>
<images-version>0.0.1</images-version>
</properties>
<modules>
<module>framework</module>

View File

@@ -8,14 +8,14 @@
<parent>
<groupId>cn.lili</groupId>
<artifactId>lili-shop-parent</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</parent>
<dependencies>
<dependency>
<groupId>cn.lili</groupId>
<artifactId>framework</artifactId>
<version>1.0.1</version>
<version>4.2.0</version>
</dependency>
</dependencies>

View File

@@ -119,4 +119,6 @@ CREATE TABLE `li_coupon_activity_item` (
/** 修改商品模板详情字段类型**/
ALTER TABLE `li_draft_goods` MODIFY COLUMN `intro` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;
/** 添加秒杀设置**/
INSERT INTO `li_setting` ( `id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `setting_value` ) VALUES ( 'SECKILL_SETTING', NULL, NULL, NULL, 'admin', '2021-06-04 09:58:39.384000', '{\"seckillRule\":\"秒杀规则\",\"hours\":\"9,10,11,12,13,14,15,21,22,23\"}' );
INSERT INTO `li_setting` ( `id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `setting_value` ) VALUES ( 'SECKILL_SETTING', NULL, NULL, NULL, 'admin', '2021-06-04 09:58:39.384000', '{\"seckillRule\":\"秒杀规则\",\"hours\":\"9,10,11,12,13,14,15,21,22,23\"}' );
/** 添加直播间商品默认数量**/
alter table li_studio alter column room_goods_num set default 0;