diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 8d6bae00..4e3b6042 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -270,7 +270,7 @@ dubbo: bxg: shop: # API_URL: http://192.168.10.113:48080/bxgApp - API_URL: https://d85a-113-57-54-241.jp.ngrok.io + API_URL: http://1cbbf622.r5.cpolar.top SITE_URL: http://192.168.10.113:48080/bxgApp UNI_SITE_URL: http://192.168.10.113:48080/bxgApp ADMIN_API_URL: http://192.168.10.113:48080/bxg diff --git a/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java b/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java index 109a5cb8..cfbdb120 100644 --- a/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java +++ b/zsw-bxg/src/main/java/co/yixiang/app/modules/order/rest/AppStoreOrderController.java @@ -422,6 +422,24 @@ public class AppStoreOrderController { return ApiResult.ok(); } + /** + * 订单删除,用户不可见,但后台可见 + */ + @AppLog(value = "订单删除", type = 1) + @NoRepeatSubmit + @AuthCheck + @PostMapping("/order/delete") + @ApiOperation(value = "用户进行订单删除", notes = "用户进行订单删除") + public ApiResult delOrder(@Validated @RequestBody HandleOrderParam param) { + Long uid = LocalUser.getUser().getUid(); + YxStoreOrderQueryVo orderInfo = storeOrderService.getOrderInfo(param.getId(), uid); + if (ObjectUtil.isNull(orderInfo)) { + throw new YshopException("订单不存在"); + } + storeOrderService.deleteOrder(param.getId(), uid); + return ApiResult.ok(); + } + /** * 获取物流信息 diff --git a/zsw-bxg/src/main/java/co/yixiang/enums/OrderInfoEnum.java b/zsw-bxg/src/main/java/co/yixiang/enums/OrderInfoEnum.java index 0d30267f..99dfffab 100644 --- a/zsw-bxg/src/main/java/co/yixiang/enums/OrderInfoEnum.java +++ b/zsw-bxg/src/main/java/co/yixiang/enums/OrderInfoEnum.java @@ -21,6 +21,7 @@ public enum OrderInfoEnum { STATUS_NE1(-1,"申请退款"), STATUS_NE2(-2,"退款成功"), STATUS_0(0,"默认"), + STATUS_5(5,"通过审核"), STATUS_1(1,"待收货"), STATUS_2(2,"已收货"), STATUS_3(3,"已完成"), diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java index bd86e772..d7211b1c 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreSeckillServiceImpl.java @@ -31,7 +31,6 @@ import co.yixiang.modules.activity.service.mapper.YxStoreSeckillMapper; import co.yixiang.modules.activity.vo.SeckillConfigVo; import co.yixiang.modules.activity.vo.StoreSeckillVo; import co.yixiang.modules.activity.vo.YxStoreSeckillQueryVo; -import co.yixiang.modules.product.domain.YxStoreProduct; import co.yixiang.modules.product.domain.YxStoreProductAttrValue; import co.yixiang.modules.product.service.YxStoreProductAttrService; import co.yixiang.modules.product.service.YxStoreProductReplyService; @@ -67,6 +66,7 @@ import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; /** @@ -101,18 +101,23 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl yxSystemGroupDataList = yxSystemGroupDataService.queryAll(queryCriteria); - List list = new ArrayList<>(); + AtomicInteger timeId = new AtomicInteger(); int today = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(new Date())); yxSystemGroupDataList.forEach(i -> { String jsonStr = i.getValue(); @@ -144,7 +149,17 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl0){ + seckillConfigVo.setIsCanbuy(true); + } } else if (currentHour < time) { seckillTimeDto.setState("即将开始"); seckillTimeDto.setTime(jsonObject.get("time").toString().length() > 1 ? jsonObject.get("time").toString() + ":00" : "0" + jsonObject.get("time").toString() + ":00"); @@ -161,7 +176,12 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl{ + if (seckillTimeDto.getId()==timeId.get()){ + seckillConfigVo.setSeckillTimeIndex(list.indexOf(seckillTimeDto)); + } + }); seckillConfigVo.setSeckillTime(list); return seckillConfigVo; } @@ -262,10 +282,33 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl pageModel = new Page<>(page, limit); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) -// .eq(YxStoreSeckill::getIsHot,1) +// .eq(YxStoreSeckill::getIsHot,1) .le(YxStoreSeckill::getStartTime,nowTime) .ge(YxStoreSeckill::getStopTime,nowTime) .orderByDesc(YxStoreSeckill::getSort); + SeckillConfigVo seckillConfigVo=yxStoreSeckillService.getStoreSeckil(); + if (seckillConfigVo.getSeckillTime().size()==0){ + return null; //没有秒杀配置,不返回秒杀商品 + }else if (seckillConfigVo.getSeckillTime().size()==1){ //只有1条不管是正在进行中还是未开始) + wrapper.eq(YxStoreSeckill::getTimeId,seckillConfigVo.getSeckillTime().get(0).getId()); + }else{ //有多条 + if (seckillConfigVo.getSeckillTimeIndex() != -1){ //不为-1,有进行中的 + List list=yxStoreSeckillService.lambdaQuery() + .eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) + .le(YxStoreSeckill::getStartTime,nowTime) + .ge(YxStoreSeckill::getStopTime,nowTime) + .eq(YxStoreSeckill::getTimeId,seckillConfigVo.getSeckillTime().get(seckillConfigVo.getSeckillTimeIndex()).getId()) + .list(); + if (list.size()!=0){ //进行中的不为0 + wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()) +// .eq(YxStoreSeckill::getIsHot,1) + .le(YxStoreSeckill::getStartTime,nowTime) + .ge(YxStoreSeckill::getStopTime,nowTime) + .eq(YxStoreSeckill::getTimeId,seckillConfigVo.getSeckillTime().get(seckillConfigVo.getSeckillTimeIndex()).getId()) + .orderByDesc(YxStoreSeckill::getSort); + } + } + } List yxStoreSeckillQueryVos = generator.convert (yxStoreSeckillMapper.selectPage(pageModel,wrapper).getRecords(), YxStoreSeckillQueryVo.class); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/SeckillConfigVo.java b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/SeckillConfigVo.java index 34b2071f..0b350330 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/SeckillConfigVo.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/activity/vo/SeckillConfigVo.java @@ -5,10 +5,13 @@ import co.yixiang.modules.activity.service.dto.SeckillTimeDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; import java.util.List; @Data -public class SeckillConfigVo { +public class SeckillConfigVo implements Serializable { + + private static final long serialVersionUID = 1L; @ApiModelProperty(value = "秒杀产品时间信息") private List seckillTime; @@ -17,4 +20,8 @@ public class SeckillConfigVo { @ApiModelProperty(value = "秒杀产品时间索引") private Integer seckillTimeIndex; + + + @ApiModelProperty(value = "是否是进行中商品") + private Boolean isCanbuy; //1:true 0:false } diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/domain/YxEvaluation.java b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/domain/YxEvaluation.java index dc864017..28e1a709 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/domain/YxEvaluation.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/evaluation/domain/YxEvaluation.java @@ -48,7 +48,6 @@ public class YxEvaluation implements Serializable { /** 关联商品信息 */ - @NotNull private String product; /** 图文配置*/ diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/domain/YxStoreOrder.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/domain/YxStoreOrder.java index 1a693d7b..41d41eba 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/order/domain/YxStoreOrder.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/domain/YxStoreOrder.java @@ -241,6 +241,10 @@ public class YxStoreOrder extends BaseDomain { private Integer isSystemDel; + /** 用户是否点击删除,删除后用户自己不可见 */ + @TableField(fill= FieldFill.INSERT) + private Integer userDel; + @TableField(fill= FieldFill.INSERT) private Integer isDel; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java index a7796783..06adddc6 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/rest/StoreOrderController.java @@ -122,25 +122,17 @@ public class StoreOrderController { Pageable pageable, @RequestParam(name = "orderStatus") String orderStatus, @RequestParam(name = "orderType") String orderType) { -// String[] orderTypeList=orderType.split(","); -// Map result=new HashMap<>(); -// for (String type : orderTypeList) { -// YxStoreOrderQueryCriteria newCriteria = this.handleQuery(criteria,orderStatus,type); -// Map result1=yxStoreOrderService.queryAll(newCriteria, pageable); -// if (result.isEmpty()){ -// result.putAll(yxStoreOrderService.queryAll(newCriteria, pageable)); -// }else { -// List storeOrderDTOS= (List) result.get("content"); -// Long totalElements=(Long)result.get("totalElements")+(Long)result1.get("totalElements"); -// storeOrderDTOS.addAll((List) result1.get("content")); -// result.put("content",storeOrderDTOS); -// result.put("totalElements",totalElements); -// } -// } - YxStoreOrderQueryCriteria newCriteria = this.handleQuery(criteria,orderStatus,orderType); - return new ResponseEntity<>(yxStoreOrderService.queryAll(newCriteria, pageable), HttpStatus.OK); -// return new ResponseEntity<>(result,HttpStatus.OK); - } + //增加支持多选类型搜索 + Map map; + String[] orderTypeList=orderType.split(","); + if(orderTypeList.length>1){//多选方法 + map=yxStoreOrderService.queryManyType(orderTypeList, pageable,criteria); + }else { + YxStoreOrderQueryCriteria newCriteria = this.handleQuery(criteria,orderStatus,orderType); + map=yxStoreOrderService.queryAll(newCriteria, pageable); + } + return new ResponseEntity<>(map, HttpStatus.OK); + } @ApiOperation(value = "根据订单id获取订单详情") @GetMapping(value = "/getStoreOrderDetail/{id}") @@ -223,6 +215,15 @@ public class StoreOrderController { return new ResponseEntity(HttpStatus.NO_CONTENT); } + @ApiOperation(value = "通过审核,准备发货") + @PutMapping(value = "/ordercheck") + @PreAuthorize("@ss.hasAnyPermissions('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')") + public ResponseEntity checkdate(@Validated @RequestBody YxStoreOrder resources) { + yxStoreOrderService.orderCheck(resources.getOrderId()); + return new ResponseEntity(HttpStatus.NO_CONTENT); + } + + @ApiOperation(value = "修改快递单号") @PutMapping(value = "/yxStoreOrder/updateDelivery") @PreAuthorize("hasAnyAuthority('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')") @@ -393,17 +394,22 @@ public class StoreOrderController { //订单状态查询 if (StrUtil.isNotEmpty(orderStatus)) { switch (orderStatus) { - case "0": + case "0": //未支付 criteria.setPaid(OrderInfoEnum.PAY_STATUS_0.getValue()); criteria.setStatus(OrderInfoEnum.STATUS_0.getValue()); criteria.setRefundStatus(OrderInfoEnum.REFUND_STATUS_0.getValue()); break; - case "1": + case "1": //未发货(待审核) criteria.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue()); criteria.setStatus(OrderInfoEnum.STATUS_0.getValue()); criteria.setRefundStatus(OrderInfoEnum.REFUND_STATUS_0.getValue()); break; - case "2": + case "5": //拣货中(通过审核,原未发货) + criteria.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue()); + criteria.setStatus(OrderInfoEnum.STATUS_5.getValue()); //审核通过后变成STATUS_5 + criteria.setRefundStatus(OrderInfoEnum.REFUND_STATUS_0.getValue()); + break; + case "2": //待收货 criteria.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue()); criteria.setStatus(OrderInfoEnum.STATUS_1.getValue()); criteria.setRefundStatus(OrderInfoEnum.REFUND_STATUS_0.getValue()); @@ -435,24 +441,24 @@ public class StoreOrderController { //订单类型查询 if (StrUtil.isNotEmpty(orderType)) { switch (orderType) { - case "1": + case "1": //普通 criteria.setBargainId(0); criteria.setCombinationId(0); criteria.setSeckillId(0); break; - case "2": + case "2": //拼团 criteria.setNewCombinationId(0); break; - case "3": + case "3": //秒杀 criteria.setNewSeckillId(0); break; - case "4": + case "4": //砍价 criteria.setNewBargainId(0); break; - case "5": + case "5": //核销 criteria.setShippingType(2); break; - case "6": + case "6": //积分 criteria.setPayIntegral(new BigDecimal("0.00")); break; default: diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java index 4e242fa4..f36793a2 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/YxStoreOrderService.java @@ -77,6 +77,12 @@ public interface YxStoreOrderService extends BaseService{ */ void orderDelivery(String orderId,String deliveryId,String deliveryName,String deliveryType); + /** + * 订单审核 + * @param orderId 单号 + */ + void orderCheck(String orderId); + /** * 修改快递单号 * @param orderId 单号 @@ -123,6 +129,12 @@ public interface YxStoreOrderService extends BaseService{ void cancelOrder(String orderId,Long uid); + /** + * 用户端删除订单 + * @param orderId 订单号 + * @param uid 用户id + */ + void deleteOrder(String orderId,Long uid); /** * 申请退款 * @param explain 退款备注 @@ -239,6 +251,13 @@ public interface YxStoreOrderService extends BaseService{ + /** + * 查询数据分页 + * @param typeList 多种类型的数组 + * @param pageable 分页参数 + * @return Map + */ + Map queryManyType(String[] typeList, Pageable pageable,YxStoreOrderQueryCriteria criteria); /** * 查询数据分页 diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java index 362a1f85..99ca85a1 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/order/service/impl/YxStoreOrderServiceImpl.java @@ -84,6 +84,7 @@ import co.yixiang.tools.service.AlipayConfigService; import co.yixiang.utils.FileUtil; import co.yixiang.utils.OrderUtil; import co.yixiang.utils.RedisUtils; +import co.yixiang.utils.StringUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -518,6 +519,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(YxStoreOrder::getOrderId, orderId); + YxStoreOrder storeOrder = new YxStoreOrder(); + storeOrder.setUserDel(OrderStatusEnum.STATUS_1.getValue());//仅把user_del变为1 + yxStoreOrderMapper.update(storeOrder, wrapper); +// yxStoreOrderMapper.deleteById(order.getId()); + } + + /** * 未付款取消订单 * @@ -1126,6 +1164,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl orderList(Long uid, int type, int page, int limit) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(YxStoreOrder::getUserDel,0);//用户删除后则用户不可见 if (uid != null) { wrapper.eq(YxStoreOrder::getUid, uid); } @@ -1401,8 +1440,9 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl queryManyType(String[] typeList, Pageable pageable,YxStoreOrderQueryCriteria criteria) { + LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); + if(StringUtils.isNotBlank(criteria.getOrderId())){ + queryWrapper.and(wrapper->{ + wrapper.like(YxStoreOrder::getOrderId,criteria.getOrderId()); + }); +// queryWrapper.like(YxStoreOrder::getOrderId,criteria.getOrderId()); + } + if(StringUtils.isNotBlank(criteria.getUserPhone())){ + queryWrapper.and(wrapper->{ + wrapper.like(YxStoreOrder::getUserPhone,criteria.getUserPhone()); + }); +// queryWrapper.like(YxStoreOrder::getUserPhone,criteria.getUserPhone()); + } + if(StringUtils.isNotBlank(criteria.getUserAddress())){ + queryWrapper.like(YxStoreOrder::getUserAddress,criteria.getUserAddress()); + } + for (String orderType:typeList){ + switch (orderType) { + case "1": //普通 +// criteria.setBargainId(0); +// criteria.setCombinationId(0); +// criteria.setSeckillId(0); + queryWrapper .or((wrapper)->{ + wrapper.eq(YxStoreOrder::getBargainId,0) + .eq(YxStoreOrder::getCombinationId,0) + .eq(YxStoreOrder::getSeckillId,0); + }); + break; + case "2": //拼团 +// criteria.setNewCombinationId(0); + queryWrapper.or((wrapper)->{ + wrapper.ne(YxStoreOrder::getCombinationId,0); + }); + break; + case "3": //秒杀 +// criteria.setNewSeckillId(0); + queryWrapper.or((wrapper)->{ + wrapper.ne(YxStoreOrder::getSeckillId,0); + }); + break; + case "4": //砍价 +// criteria.setNewBargainId(0); + queryWrapper.or((wrapper)->{ + wrapper.ne(YxStoreOrder::getBargainId,0); + }); + break; + case "5": //核销 +// criteria.setShippingType(2); + queryWrapper.or((wrapper)->{ + wrapper.ne(YxStoreOrder::getShippingType,2); + }); + break; + case "6": //积分 +// criteria.setPayIntegral(new BigDecimal("0.00")); + queryWrapper.or((wrapper)->{ + wrapper.gt(YxStoreOrder::getPayIntegral,new BigDecimal("0.00")); + }); + break; + default: + } + } + getPage(pageable); + PageInfo page = new PageInfo<>(storeOrderMapper.selectList(queryWrapper)); + List storeOrderDTOS = new ArrayList<>(); + for (YxStoreOrder yxStoreOrder : page.getList()) { + this.orderList(storeOrderDTOS, yxStoreOrder); + + } + Map map = new LinkedHashMap<>(2); + map.put("content", storeOrderDTOS); + map.put("totalElements", page.getTotal()); + return map; + } + @Override public Map queryAll(YxStoreOrderQueryCriteria criteria, Pageable pageable) { getPage(pageable); diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java index d07be74d..7af75435 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/domain/YxStoreProduct.java @@ -171,11 +171,18 @@ public class YxStoreProduct extends BaseDomain { @ApiModelProperty(value = "是否猜你喜欢(0:否,1:是)") private Integer isBenefit; + /** 猜你喜欢排序 */ + @ApiModelProperty(value = "猜你喜欢排序") + private Integer benefitSort; + /** 是否精品 */ @ApiModelProperty(value = "是否精品(0:否,1:是)") private Integer isBest; + /** 精品排序 */ + @ApiModelProperty(value = "精品排序") + private Integer bestSort; /** 是否新品 */ @ApiModelProperty(value = "是否新品(0:否,1:是)") diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java index 9f8070a8..1565fba2 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/rest/StoreProductController.java @@ -242,6 +242,8 @@ public class StoreProductController { productDto.setIsHotList(yxStoreProduct.getIsHotList()); productDto.setHotListId(yxStoreProduct.getHotListId()); productDto.setHotSales(yxStoreProduct.getHotSales()); + productDto.setBenefitSort(yxStoreProduct.getBenefitSort()); + productDto.setBestSort(yxStoreProduct.getBestSort()); BeanUtil.copyProperties(yxStoreProduct,productDto,"sliderImage"); productDto.setSliderImage(Arrays.asList(yxStoreProduct.getSliderImage().split(","))); YxStoreProductAttrResult storeProductAttrResult = yxStoreProductAttrResultService diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java index b484fbbf..a8d9a38d 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/ProductDto.java @@ -100,10 +100,18 @@ public class ProductDto { @JsonProperty("is_benefit") private Integer isBenefit; + /** 猜你喜欢排序 */ + @JsonProperty(value = "benefit_sort") + private Integer benefitSort; + /** 是否精品 */ @JsonProperty("is_best") private Integer isBest; + /** 精品排序 */ + @JsonProperty(value = "best_sort") + private Integer bestSort; + /** 是否新品 */ @JsonProperty("is_new") private Integer isNew; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java index ae835153..6ba70158 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/dto/StoreProductDto.java @@ -106,10 +106,18 @@ public class StoreProductDto @JsonProperty("is_benefit") private Integer isBenefit; + /** 猜你喜欢排序 */ + @JsonProperty(value = "benefit_sort") + private Integer benefitSort; + /** 是否精品 */ @JsonProperty("is_best") private Integer isBest; + /** 精品排序 */ + @JsonProperty(value = "best_sort") + private Integer bestSort; + /** 是否新品 */ @JsonProperty("is_new") private Integer isNew; diff --git a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java index 4eaea658..0167fbc1 100644 --- a/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java +++ b/zsw-bxg/src/main/java/co/yixiang/modules/product/service/impl/YxStoreProductServiceImpl.java @@ -459,32 +459,35 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue()) - .eq(YxStoreProduct::getIsDel,ShopCommonEnum.DELETE_0.getValue()) - .orderByDesc(YxStoreProduct::getSort); + .eq(YxStoreProduct::getIsDel,ShopCommonEnum.DELETE_0.getValue()); +// .orderByDesc(YxStoreProduct::getSort); + wrapper.eq(YxStoreProduct::getIsIntegral,0); // order switch (ProductEnum.toType(order)) { //精品推荐 case TYPE_1: - wrapper.eq(YxStoreProduct::getIsBest, - ShopCommonEnum.IS_STATUS_1.getValue()); + wrapper.eq(YxStoreProduct::getIsBest, ShopCommonEnum.IS_STATUS_1.getValue()) + .orderByDesc(YxStoreProduct::getBestSort); break; //首发新品 case TYPE_3: - wrapper.eq(YxStoreProduct::getIsNew, - ShopCommonEnum.IS_STATUS_1.getValue()); + wrapper.eq(YxStoreProduct::getIsNew, ShopCommonEnum.IS_STATUS_1.getValue()) + .orderByDesc(YxStoreProduct::getSort); + break; // 猜你喜欢 case TYPE_4: - wrapper.eq(YxStoreProduct::getIsBenefit, - ShopCommonEnum.IS_STATUS_1.getValue()); + wrapper.eq(YxStoreProduct::getIsBenefit, ShopCommonEnum.IS_STATUS_1.getValue()) + .orderByDesc(YxStoreProduct::getBenefitSort); + break; // 热门榜单 case TYPE_2: - wrapper.eq(YxStoreProduct::getIsHot, - ShopCommonEnum.IS_STATUS_1.getValue()); + wrapper.eq(YxStoreProduct::getIsHot, ShopCommonEnum.IS_STATUS_1.getValue()) + .orderByDesc(YxStoreProduct::getSort); break; - default: + default:wrapper.orderByDesc(YxStoreProduct::getSort); } Page pageModel = new Page<>(page, limit); @@ -631,6 +634,8 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl