yangyb před 2 týdny
rodič
revize
d842c4754c

+ 39 - 0
mall-service/src/main/java/com/txz/mall/controller/ProductController.java

@@ -139,6 +139,45 @@ public class ProductController {
         return Result.success(pageInfo);
     }
 
+    @PostMapping("/combination/list")
+    @ApiOperation(value = "商品拼团列表")
+    public Result<List<StoreProduct>> appList(@RequestBody StoreProductDTO dto, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
+        PageHelper.startPage(page, size);
+        Condition condition = new Condition(StoreProduct.class);
+        Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("isDelete", 0);
+        condition.setOrderByClause("create_time DESC");
+        criteria.andEqualTo("isShow", 1);
+        criteria.andEqualTo("isPink", 1);
+        if (StringUtils.isNotBlank(dto.getStoreName())) {
+            criteria.andLike("storeName", "%" + dto.getStoreName() + "%");
+        }
+        if (StringUtils.isNotBlank(dto.getItemNumber())) {
+            criteria.andLike("itemNumber", "%" + dto.getItemNumber() + "%");
+        }
+        if (dto.getIsNew() != null) {
+            criteria.andEqualTo("isNew", 1);
+        }
+        if (dto.getCateId() != null) {
+            criteria.andEqualTo("cateId", dto.getCateId());
+        }
+        if (dto.getIsRecycle() != null) {
+            criteria.andEqualTo("isRecycle", dto.getIsRecycle());
+        }
+        if (dto.getMinPrice() != null && dto.getMaxPrice() != null) {
+            criteria.andBetween("price", dto.getMinPrice(), dto.getMaxPrice());
+        }
+        PageInfo pageInfo = null;
+        try {
+            List<StoreProduct> list = storeProductService.findByCondition(condition);
+            pageInfo = new PageInfo(list);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success(pageInfo);
+    }
+
 
     @ApiOperation("商品导入")
     @PostMapping("/import")

+ 2 - 2
mall-service/src/main/java/com/txz/mall/model/StoreCombination.java

@@ -107,9 +107,9 @@ public class StoreCombination {
     /**
      * 推荐
      */
-    @Column(name = "is_host")
+    @Column(name = "is_hot")
     @ApiModelProperty(value = "推荐")
-    private Integer isHost;
+    private Integer isHot;
 
     /**
      * 商品状态

+ 4 - 0
mall-service/src/main/java/com/txz/mall/model/StoreProduct.java

@@ -190,6 +190,10 @@ public class StoreProduct {
 //    @ApiModelProperty(value = "砍价状态  0未开启 1开启")
 //    private Integer isBargain;
 
+    @Column(name = "is_pink")
+    @ApiModelProperty(value = "拼团状态  0未开启 1开启")
+    private Integer isPink;
+
     /**
      * 是否优品推荐
      */

+ 2 - 0
mall-service/src/main/java/com/txz/mall/service/impl/StoreCombinationServiceImpl.java

@@ -57,6 +57,8 @@ public class StoreCombinationServiceImpl extends AbstractService<StoreCombinatio
                 continue;
             }
             BeanUtils.copyProperties(productCollect.get(0), storeCombination);
+            storeCombination.setProductName(productCollect.get(0).getStoreName());
+            storeCombination.setStock(productCollect.get(0).getStock());
             storeCombination.setStartTime(flashActivity.getStartTime());
             storeCombination.setStopTime(flashActivity.getEndTime());
             if (activityVO != null) {

+ 1 - 1
mall-service/src/main/java/com/txz/mall/service/impl/StoreOrderServiceImpl.java

@@ -1143,7 +1143,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
 //
         StoreOrder storeOrder = findById(orderId);
         if (storeOrder.getPaid() == 1) {
-
+            goOpen(orderId);
             return true;
         } else {
             return false;

+ 1 - 1
mall-service/src/main/resources/mapper/StoreCombinationMapper.xml

@@ -19,7 +19,7 @@
         <result column="sort" jdbcType="INTEGER" property="sort"/>
         <result column="sales" jdbcType="INTEGER" property="sales"/>
         <result column="stock" jdbcType="INTEGER" property="stock"/>
-        <result column="is_host" jdbcType="INTEGER" property="isHost"/>
+        <result column="is_hot" jdbcType="INTEGER" property="isHot"/>
         <result column="is_show" jdbcType="INTEGER" property="isShow"/>
         <result column="combination" jdbcType="INTEGER" property="combination"/>
         <result column="mer_use" jdbcType="INTEGER" property="merUse"/>

+ 1 - 0
mall-service/src/main/resources/mapper/StoreProductMapper.xml

@@ -32,6 +32,7 @@
     <result column="cost" jdbcType="DECIMAL" property="cost"/>
     <result column="is_seckill" jdbcType="INTEGER" property="isSeckill"/>
     <result column="is_bargain" jdbcType="INTEGER" property="isBargain"/>
+    <result column="is_pink" jdbcType="INTEGER" property="isPink"/>
     <result column="is_good" jdbcType="INTEGER" property="isGood"/>
     <result column="is_sub" jdbcType="INTEGER" property="isSub"/>
     <result column="ficti" jdbcType="INTEGER" property="ficti"/>