Merge branch 'glt_xm' into dev_xm
# Conflicts: # src/main/java/com/gxwebsoft/shop/service/impl/ShopFlashSaleActivityServiceImpl.java # src/main/java/com/gxwebsoft/shop/vo/ShopFlashSaleActivityVO.java
This commit is contained in:
@@ -17,10 +17,10 @@ import java.time.LocalDateTime;
|
|||||||
*/
|
*/
|
||||||
public interface GltTicketOrderService extends IService<GltTicketOrder> {
|
public interface GltTicketOrderService extends IService<GltTicketOrder> {
|
||||||
|
|
||||||
int DELIVERY_STATUS_WAITING = 10;
|
int DELIVERY_STATUS_WAITING = 10; //待配送
|
||||||
int DELIVERY_STATUS_DELIVERING = 20;
|
int DELIVERY_STATUS_DELIVERING = 20; //配送中
|
||||||
int DELIVERY_STATUS_WAIT_CONFIRM = 30;
|
int DELIVERY_STATUS_WAIT_CONFIRM = 30; //等待收货
|
||||||
int DELIVERY_STATUS_FINISHED = 40;
|
int DELIVERY_STATUS_FINISHED = 40; //收货完成
|
||||||
|
|
||||||
int RECEIVE_CONFIRM_TYPE_MANUAL = 10;
|
int RECEIVE_CONFIRM_TYPE_MANUAL = 10;
|
||||||
int RECEIVE_CONFIRM_TYPE_PHOTO = 20;
|
int RECEIVE_CONFIRM_TYPE_PHOTO = 20;
|
||||||
|
|||||||
@@ -141,39 +141,38 @@ public class ShopFlashSaleActivityServiceImpl extends ServiceImpl<ShopFlashSaleA
|
|||||||
resultVOList = BeanUtil.copyToList(activityList, ShopFlashSaleActivityVO.class);
|
resultVOList = BeanUtil.copyToList(activityList, ShopFlashSaleActivityVO.class);
|
||||||
List<Integer> goodsIdList = resultVOList.stream().map(ShopFlashSaleActivityVO::getGoodsId).distinct().collect(Collectors.toList());
|
List<Integer> goodsIdList = resultVOList.stream().map(ShopFlashSaleActivityVO::getGoodsId).distinct().collect(Collectors.toList());
|
||||||
List<ShopGoods> shopGoods = shopGoodsMapper.selectBatchIds(goodsIdList);
|
List<ShopGoods> shopGoods = shopGoodsMapper.selectBatchIds(goodsIdList);
|
||||||
|
for(ShopFlashSaleActivityVO activityVO : resultVOList){
|
||||||
Map<Integer, Integer> finalActivityMap = activityMap;
|
if(newUser){
|
||||||
Boolean finalNewUser = newUser;
|
if(activityVO.getDisplayType() == 2){
|
||||||
resultVOList.forEach(activity -> {
|
activityVO.setEnable(false);
|
||||||
//5.1 判断新老用户商品购买能力、超买能力
|
activityVO.setEnableMsg("当前商品仅限老用户购买!");
|
||||||
if(finalNewUser){
|
|
||||||
if(activity.getDisplayType() == 2){
|
|
||||||
activity.setEnable(false);
|
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if(activity.getDisplayType() == 1){
|
if(activityVO.getDisplayType() == 1){
|
||||||
activity.setEnable(false);
|
activityVO.setEnable(false);
|
||||||
|
activityVO.setEnableMsg("当前商品仅限新用户购买!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(activity.getEnable()){
|
if(activityVO.getEnable()){
|
||||||
//超下单数量活动不可选
|
//超下单数量活动不可选
|
||||||
Integer orderTotalNum = finalActivityMap.get(activity.getId());
|
Integer orderTotalNum = activityMap.get(activityVO.getId());
|
||||||
if(orderTotalNum != null && orderTotalNum >= activity.getSaleLimit()){
|
if(orderTotalNum != null && orderTotalNum >= activityVO.getSaleLimit()){
|
||||||
activity.setEnable(false);
|
activityVO.setEnable(false);
|
||||||
|
activityVO.setEnableMsg("当前商品您购买次数已达上限!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//5.2 回显商品信息
|
//5.2 回显商品信息
|
||||||
ShopGoods shopGood = shopGoods.stream().filter(goods -> activity.getGoodsId().equals(goods.getGoodsId())).findFirst().orElse(null);
|
ShopGoods shopGood = shopGoods.stream().filter(goods -> activityVO.getGoodsId().equals(goods.getGoodsId())).findFirst().orElse(null);
|
||||||
if(shopGood != null){
|
if(shopGood != null){
|
||||||
activity.setGoodsPrice(shopGood.getPrice());
|
activityVO.setGoodsPrice(shopGood.getPrice());
|
||||||
activity.setGoodsTotalPrice(shopGood.getPrice().multiply(new BigDecimal(activity.getNum())));
|
activityVO.setGoodsTotalPrice(shopGood.getPrice().multiply(new BigDecimal(activityVO.getNum())));
|
||||||
activity.setGoodsName(shopGood.getName());
|
activityVO.setGoodsName(shopGood.getName());
|
||||||
activity.setImage(shopGood.getImage());
|
activityVO.setImage(shopGood.getImage());
|
||||||
activity.setUnitName(shopGood.getUnitName());
|
activityVO.setUnitName(shopGood.getUnitName());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
return resultVOList;
|
return resultVOList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class ShopFlashSaleActivityVO implements Serializable {
|
|||||||
@Schema(description = "库存")
|
@Schema(description = "库存")
|
||||||
private Integer stock;
|
private Integer stock;
|
||||||
|
|
||||||
@Schema(description = "展示类型,0:普通用户,1:新用户 2:老用户")
|
@Schema(description = "展示类型,0:普通用户,1:新用户 2:老用户")
|
||||||
private Integer displayType;
|
private Integer displayType;
|
||||||
|
|
||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
@@ -77,12 +77,15 @@ public class ShopFlashSaleActivityVO implements Serializable {
|
|||||||
@Schema(description = "是否弹窗 0-否 1-是")
|
@Schema(description = "是否弹窗 0-否 1-是")
|
||||||
private Integer popFlag;
|
private Integer popFlag;
|
||||||
|
|
||||||
@Schema(description = "租户id")
|
|
||||||
private Integer tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "是否可选")
|
@Schema(description = "是否可选")
|
||||||
private Boolean enable = true;
|
private Boolean enable = true;
|
||||||
|
|
||||||
|
@Schema(description = "不可购买原因!")
|
||||||
|
private String enableMsg;
|
||||||
|
|
||||||
|
@Schema(description = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
@Schema(description = "创建者")
|
@Schema(description = "创建者")
|
||||||
private String creator;
|
private String creator;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user