Browse Source

同步优化逻辑

master
xh-pan1 2 years ago
parent
commit
967159b792
  1. 10
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/AdminController.java
  2. 1
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/ShopController.java
  3. 22
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereShopProductServiceImpl.java
  4. 4
      cereshop-admin/src/main/java/com/shop/cereshop/admin/utils/ContextUtil.java
  5. 10
      cereshop-admin/src/main/resources/mybatis/mapper/shop/CerePlatformShopDAO.xml
  6. 13
      cereshop-app/src/main/java/com/shop/cereshop/app/controller/canvas/CanvasController.java
  7. 17
      cereshop-app/src/main/java/com/shop/cereshop/app/controller/classify/ClassifyController.java
  8. 9
      cereshop-app/src/main/java/com/shop/cereshop/app/controller/order/OrderController.java
  9. 4
      cereshop-app/src/main/java/com/shop/cereshop/app/controller/product/ProductController.java
  10. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/cart/CereShopCartDAO.java
  11. 8
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/product/CereProductClassifyDAO.java
  12. 16
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/product/CereShopProductDAO.java
  13. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CerePlatformShopDAO.java
  14. 33
      cereshop-app/src/main/java/com/shop/cereshop/app/page/canvas/CanvasProductNumber.java
  15. 57
      cereshop-app/src/main/java/com/shop/cereshop/app/page/canvas/CanvasProductSku.java
  16. 34
      cereshop-app/src/main/java/com/shop/cereshop/app/page/canvas/CanvasProductUsers.java
  17. 33
      cereshop-app/src/main/java/com/shop/cereshop/app/page/index/ProductImage.java
  18. 10
      cereshop-app/src/main/java/com/shop/cereshop/app/page/product/ProductDetail.java
  19. 5
      cereshop-app/src/main/java/com/shop/cereshop/app/param/order/OrderGetAllParam.java
  20. 12
      cereshop-app/src/main/java/com/shop/cereshop/app/pay/xs/service/impl/XsPayServiceImpl.java
  21. 7
      cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java
  22. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/CereProductClassifyService.java
  23. 2
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/CereShopProductService.java
  24. 52
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereProductClassifyServiceImpl.java
  25. 86
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java
  26. 3
      cereshop-app/src/main/java/com/shop/cereshop/app/utils/DistributionUtil.java
  27. 4
      cereshop-app/src/main/java/com/shop/cereshop/app/utils/WechatUtil.java
  28. 1
      cereshop-app/src/main/resources/mybatis/mapper/order/CereShopOrderDAO.xml
  29. 61
      cereshop-app/src/main/resources/mybatis/mapper/product/CereProductClassifyDAO.xml
  30. 185
      cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml
  31. 21
      cereshop-app/src/main/resources/mybatis/mapper/shop/CerePlatformShopDAO.xml
  32. 0
      cereshop-business/cert/.gitkeep
  33. 0
      cereshop-business/cert/wechat/.gitkeep
  34. 1
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessUserController.java
  35. 1
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/PermissionController.java
  36. 1
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/RoleController.java
  37. 4
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopCouponDAO.java
  38. 19
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopCouponExcludeDAO.java
  39. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopDiscountDAO.java
  40. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopGroupWorkDAO.java
  41. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopSeckillDAO.java
  42. 6
      cereshop-business/src/main/java/com/shop/cereshop/business/page/tool/ShopCouponDetail.java
  43. 12
      cereshop-business/src/main/java/com/shop/cereshop/business/page/tool/ToolProduct.java
  44. 12
      cereshop-business/src/main/java/com/shop/cereshop/business/param/tool/ToolProductParam.java
  45. 1
      cereshop-business/src/main/java/com/shop/cereshop/business/service/permission/impl/CerePlatformPermissionServiceImpl.java
  46. 37
      cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopCouponServiceImpl.java
  47. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopDiscountServiceImpl.java
  48. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopGroupWorkServiceImpl.java
  49. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopSeckillServiceImpl.java
  50. 148
      cereshop-business/src/main/resources/mybatis/mapper/log/CerePlatformWebLogDAO.xml
  51. 14
      cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopCouponDAO.xml
  52. 15
      cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopCouponExcludeDAO.xml
  53. 9
      cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopDiscountDAO.xml
  54. 7
      cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopGroupWorkDAO.xml
  55. 7
      cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopSeckillDAO.xml
  56. 33
      cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/tool/CereShopCouponExclude.java
  57. 4
      cereshop-commons/src/main/java/com/shop/cereshop/commons/utils/KdniaoTrackQueryAPI.java
  58. 4
      cereshop-commons/src/main/java/com/shop/cereshop/commons/utils/ProjectInvokeUtil.java
  59. 3
      doc/2.0/update.sql

10
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/AdminController.java

@ -116,7 +116,7 @@ public class AdminController {
}
CerePlatformUser user = null;
if (!EmptyUtils.isEmpty(param.getCode())) {
if (!param.getCode().equals("9999")) {
if (!param.getCode().equals("9999") || noDemoAccount(param)) {
//手机号登录,校验验证码
String code = (String) stringRedisService.get(param.getUsername());
if (!param.getCode().equals(code)) {
@ -162,6 +162,14 @@ public class AdminController {
return new Result(user);
}
private boolean noDemoAccount(UserLoginParam param) {
CerePlatformUser user = cerePlatformUserService.findById(1L);
if (user.getPhone().equals(param.getUsername())) {
return false;
}
return true;
}
// @GetMapping("bigReq")
// public Result bigReqList() {
// List<String> result = new ArrayList<>(2048);

1
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/ShopController.java

@ -145,6 +145,7 @@ public class ShopController {
@PostMapping(value = "cleanShop")
@ApiOperation(value = "注销商家数据")
public Result<Boolean> cleanShop(@RequestBody ShopGetByIdParam param) throws CoBusinessException{
ContextUtil.interceptDelete();
Boolean result = cerePlatformShopService.cleanShop(param.getShopId());
return new Result(result);
}

22
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/product/impl/CereShopProductServiceImpl.java

@ -191,15 +191,19 @@ public class CereShopProductServiceImpl implements CereShopProductService {
@Override
public void setFictitious(ProductUpdateParam param, CerePlatformUser user) throws CoBusinessException {
String time = TimeUtils.yyMMddHHmmss();
CereShopProduct cereShopProduct=new CereShopProduct();
cereShopProduct.setProductId(param.getProductId());
cereShopProduct.setFictitiousNumber(param.getFictitiousNumber());
cereShopProduct.setUpdateTime(time);
cereShopProductDAO.updateByPrimaryKeySelective(cereShopProduct);
//新增日志
cerePlatformLogService.addLog(user,"商品管理","平台端操作","设置虚拟销量",String.valueOf(cereShopProduct.getProductId()),time);
HttpResult result = projectInvokeUtil.postRefreshSkuRealInfo(param.getProductId(), null,
RefreshSkuRealInfoSourceEnum.EDIT_FICTITIOUS_NUMBER, param.getFictitiousNumber());
if (result.getStatus() == 200) {
CereShopProduct cereShopProduct=new CereShopProduct();
cereShopProduct.setProductId(param.getProductId());
cereShopProduct.setFictitiousNumber(param.getFictitiousNumber());
cereShopProduct.setUpdateTime(time);
cereShopProductDAO.updateByPrimaryKeySelective(cereShopProduct);
//新增日志
cerePlatformLogService.addLog(user,"商品管理","平台端操作","设置虚拟销量",String.valueOf(cereShopProduct.getProductId()),time);
} else {
throw new CoBusinessException(CoReturnFormat.SYS_ERROR);
}
}
@Override

4
cereshop-admin/src/main/java/com/shop/cereshop/admin/utils/ContextUtil.java

@ -23,8 +23,8 @@ public class ContextUtil {
}
public static boolean getAdmin(){
return false;
//return adminTL.get() != null && adminTL.get();
//return false;
return adminTL.get() != null && adminTL.get();
}
public static void interceptDelete() throws CoBusinessException {

10
cereshop-admin/src/main/resources/mybatis/mapper/shop/CerePlatformShopDAO.xml

@ -314,15 +314,15 @@
b.business_user_id
FROM cere_platform_shop a,
cere_platform_business b
where a.shop_phone = b.username
where a.charge_person_phone = b.phone
and shop_id = #{shopId}
</select>
<select id="getAll" parameterType="com.shop.cereshop.admin.param.shop.ShopGetAllParam" resultType="com.shop.cereshop.admin.page.shop.ShopGetAll">
SELECT a.shop_id,a.shop_name,a.shop_code,a.charge_person_name,a.charge_person_phone,
a.state,a.create_time,a.contract_state, b.business_user_id
FROM cere_platform_shop a,cere_platform_business b
where a.shop_phone=b.username
SELECT a.shop_id, a.shop_name, a.shop_code, a.charge_person_name, a.charge_person_phone,
a.state, a.create_time, a.contract_state, b.business_user_id
FROM cere_platform_shop a, cere_platform_business b
where a.charge_person_phone = b.phone
<if test="shopName!=null and shopName!=''">
and shop_name like concat('%',#{shopName},'%')
</if>

13
cereshop-app/src/main/java/com/shop/cereshop/app/controller/canvas/CanvasController.java

@ -102,12 +102,23 @@ public class CanvasController {
*/
@GetMapping("getProducts")
@ApiOperation(value = "商家编辑查询")
public Result<Page<CanvasProduct>> getCanvasProducts(CanvasAppProductParam param) throws CoBusinessException,Exception{
public Result<Page<CanvasProduct>> getProducts(CanvasAppProductParam param) throws CoBusinessException,Exception{
Page page=cereShopProductService.getCanvasProducts(param);
return new Result(page, CoReturnFormat.SUCCESS);
}
/**
* 画布选择商品查询新接口,如果调用有问题可以切换回getProducts接口
* @param param
* @return
*/
@GetMapping("getProducts2")
@ApiOperation(value = "商家编辑查询新接口")
public Result<Page<CanvasProduct>> getProducts2(CanvasAppProductParam param) throws CoBusinessException,Exception{
Page page=cereShopProductService.getProducts2(param);
return new Result(page, CoReturnFormat.SUCCESS);
}
/**
* 查询分类层级
* @return
*/

17
cereshop-app/src/main/java/com/shop/cereshop/app/controller/classify/ClassifyController.java

@ -62,6 +62,23 @@ public class ClassifyController {
}
/**
* 分类商品查询新接口如果调用有问题可以切换回getProducts接口
* @return
*/
@GetMapping("getClassifyProducts2")
@ApiOperation(value = "商品搜索查询新接口")
public Result<Page<Product>> getClassifyProducts2(ClassifyProductParam param, HttpServletRequest request) throws CoBusinessException{
String token = request.getHeader("Authorization");
CereBuyerUser user=null;
if(!EmptyUtils.isEmpty(token)){
//根据token查询用户信息
user=cereBuyerUserService.findByToken(token);
}
Page page= cereProductClassifyService.getClassifyProducts2(param,user);
return new Result(page,CoReturnFormat.SUCCESS);
}
/**
* 查询所有一级类目
* @return
*/

9
cereshop-app/src/main/java/com/shop/cereshop/app/controller/order/OrderController.java

@ -44,6 +44,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -232,6 +234,7 @@ public class OrderController {
CereBuyerUser user = (CereBuyerUser) request.getAttribute("user");
String ip= AppletPayUtil.getClientIp(request);
OrderPay pay = cereShopOrderService.gotoAppPay(param,user,ip);
return new Result(pay,CoReturnFormat.SUCCESS,user.getWechatName(),"APP立即支付", GsonUtil.objectToGson(param));
}
@ -249,6 +252,8 @@ public class OrderController {
CereBuyerUser user = (CereBuyerUser) request.getAttribute("user");
String ip = AppletPayUtil.getClientIp(request);
OrderPay pay = cereShopOrderService.gotoH5Pay(param,user,ip);
HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
response.addHeader("Access-Control-Allow-Origin","*");
return new Result(pay,CoReturnFormat.SUCCESS,user.getWechatName(),"H5立即支付", GsonUtil.objectToGson(param));
}
@ -623,13 +628,13 @@ public class OrderController {
* 支付业务处理接口
* @param param
* @return
*/
@PostMapping(value = "pay")
@ApiOperation(value = "支付业务处理接口")
public Result pay(@RequestBody PayParam param) throws CoBusinessException,Exception{
cereShopOrderService.pay(param);
return new Result(CoReturnFormat.SUCCESS);
}*/
}
/**
* 查询花呗手续费配置

4
cereshop-app/src/main/java/com/shop/cereshop/app/controller/product/ProductController.java

@ -215,7 +215,7 @@ public class ProductController {
return new Result(result, CoReturnFormat.SUCCESS);
}
/*@PostMapping("refreshSkuRealInfo")
@PostMapping("refreshSkuRealInfo")
@ApiOperation(value = "刷新sku的实时信息")
public Result<Boolean> refreshSkuRealInfo(@RequestBody RefreshRealInfoDTO refreshRealInfoDTO) throws CoBusinessException {
log.info("product refreshSkuRealInfo {}", JSON.toJSONString(refreshRealInfoDTO));
@ -234,7 +234,7 @@ public class ProductController {
cereSkuRealInfoService.refreshSkuRealInfo(refreshRealInfoDTO);
}
return new Result(true, CoReturnFormat.SUCCESS);
}*/
}
@GetMapping("getBroadCastList")
@ApiOperation(value = "查询循环播报列表")

2
cereshop-app/src/main/java/com/shop/cereshop/app/dao/cart/CereShopCartDAO.java

@ -56,6 +56,8 @@ public interface CereShopCartDAO extends BaseMapper<CereShopCart> {
void insertBatch(@Param("list") List<CereShopCart> list);
void insertOrUpdate(CereShopCart record);
void updateBatch(@Param("list") List<CereShopCart> list);
Integer findNumber(@Param("buyerUserId") Long buyerUserId);

8
cereshop-app/src/main/java/com/shop/cereshop/app/dao/product/CereProductClassifyDAO.java

@ -8,13 +8,16 @@ package com.shop.cereshop.app.dao.product;
import com.shop.cereshop.app.page.classify.Classify;
import com.shop.cereshop.app.page.index.Product;
import com.shop.cereshop.app.page.index.ProductClassify;
import com.shop.cereshop.app.page.index.ProductImage;
import com.shop.cereshop.app.param.classify.ClassifyProductParam;
import com.shop.cereshop.commons.domain.product.CereProductClassify;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface CereProductClassifyDAO extends BaseMapper<CereProductClassify> {
@ -35,4 +38,9 @@ public interface CereProductClassifyDAO extends BaseMapper<CereProductClassify>
List<Classify> findThreeClassify();
List<Product> getClaasifyProducts(ClassifyProductParam param);
List<Product> getClassifyProducts2(ClassifyProductParam param);
@MapKey("productId")
Map<Long, ProductImage> getClassifyImage(List<Product> list);
}

16
cereshop-app/src/main/java/com/shop/cereshop/app/dao/product/CereShopProductDAO.java

@ -7,6 +7,9 @@ package com.shop.cereshop.app.dao.product;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.app.page.canvas.CanvasProduct;
import com.shop.cereshop.app.page.canvas.CanvasProductNumber;
import com.shop.cereshop.app.page.canvas.CanvasProductSku;
import com.shop.cereshop.app.page.canvas.CanvasProductUsers;
import com.shop.cereshop.app.page.index.Product;
import com.shop.cereshop.app.page.product.ProductDetail;
import com.shop.cereshop.app.page.product.ShareProduct;
@ -15,10 +18,12 @@ import com.shop.cereshop.app.param.index.SearchParam;
import com.shop.cereshop.app.param.product.PageProductParam;
import com.shop.cereshop.commons.domain.product.CereShopProduct;
import com.shop.cereshop.commons.domain.product.Classify;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface CereShopProductDAO extends BaseMapper<CereShopProduct> {
@ -50,6 +55,8 @@ public interface CereShopProductDAO extends BaseMapper<CereShopProduct> {
List<CanvasProduct> getCanvasProducts(CanvasAppProductParam param);
List<CanvasProduct> getCanvasProducts2(CanvasAppProductParam param);
List<Classify> findAllClassify();
List<Classify> findChildsClassify();
@ -73,4 +80,13 @@ public interface CereShopProductDAO extends BaseMapper<CereShopProduct> {
List<Product> findByShopIdAndSkuIdList(@Param("shopId") Long shopId, @Param("skuIdList") List<Long> skuIdList);
ProductDetail queryProductDetail(Long skuId);
@MapKey("productId")
Map<Long, CanvasProductUsers> getProductUsers(CanvasAppProductParam param);
@MapKey("productId")
Map<Long, CanvasProductSku> getProductSku(CanvasAppProductParam param);
@MapKey("productId")
Map<Long, CanvasProductNumber> getProductNumber(CanvasAppProductParam param);
}

6
cereshop-app/src/main/java/com/shop/cereshop/app/dao/shop/CerePlatformShopDAO.java

@ -16,10 +16,12 @@ import com.shop.cereshop.app.page.tool.ToolProduct;
import com.shop.cereshop.app.param.shop.ShopParam;
import com.shop.cereshop.commons.domain.shop.CerePlatformShop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface CerePlatformShopDAO extends BaseMapper<CerePlatformShop> {
@ -89,4 +91,8 @@ public interface CerePlatformShopDAO extends BaseMapper<CerePlatformShop> {
List<ToolProduct> findDiscountProducts(@Param("shopDiscountId") Long shopDiscountId);
Integer findShopNumber(@Param("shopId") Long shopId);
@MapKey("shopId")
Map<Long, Shop> getClaasifyShop(List<Product> list);
}

33
cereshop-app/src/main/java/com/shop/cereshop/app/page/canvas/CanvasProductNumber.java

@ -0,0 +1,33 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.page.canvas;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 画布商品购买数据
*/
@Data
@ApiModel(value = "CanvasProductNumber", description = "画布商品购买数据")
public class CanvasProductNumber {
/**
* 产品ID
*/
@ApiModelProperty(value = "产品ID")
private Long productId;
/**
* 销量
*/
@ApiModelProperty(value = "销量")
private Integer number;
}

57
cereshop-app/src/main/java/com/shop/cereshop/app/page/canvas/CanvasProductSku.java

@ -0,0 +1,57 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.page.canvas;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 画布商品sku数据
*/
@Data
@ApiModel(value = "CanvasProductSku", description = "画布商品sku数据")
public class CanvasProductSku {
/**
* 产品ID
*/
@ApiModelProperty(value = "产品ID")
private Long productId;
/**
* 规格id
*/
@ApiModelProperty(value = "规格id")
private Long skuId;
/**
* 产品主图
*/
@ApiModelProperty(value = "产品主图")
private String image;
/**
* 商品原价
*/
@ApiModelProperty(value = "商品原价")
private BigDecimal originalPrice;
/**
* 商品售价
*/
@ApiModelProperty(value = "商品售价")
private BigDecimal price;
/**
* 库存
*/
@ApiModelProperty(value = "库存")
private Integer stockNumber;
}

34
cereshop-app/src/main/java/com/shop/cereshop/app/page/canvas/CanvasProductUsers.java

@ -0,0 +1,34 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.page.canvas;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 画布商品付款人数
*/
@Data
@ApiModel(value = "CanvasProductUsers", description = "画布商品付款人数")
public class CanvasProductUsers {
/**
* 产品ID
*/
@ApiModelProperty(value = "产品ID")
private Long productId;
/**
* 付款人数
*/
@ApiModelProperty(value = "付款人数")
private Integer users;
}

33
cereshop-app/src/main/java/com/shop/cereshop/app/page/index/ProductImage.java

@ -0,0 +1,33 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.app.page.index;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 产品图片
*/
@Data
@ApiModel(value = "ProductImage", description = "产品图片")
public class ProductImage {
/**
* 商品id
*/
@ApiModelProperty(value = "商品id")
private Long productId;
/**
* 商品图片
*/
@ApiModelProperty(value = "商品图片")
private String image;
}

10
cereshop-app/src/main/java/com/shop/cereshop/app/page/product/ProductDetail.java

@ -175,11 +175,11 @@ public class ProductDetail {
@ApiModelProperty(value = "收货地址")
private CereBuyerReceive receive;
// /**
// * 快递费用
// */
// @ApiModelProperty(value = "快递费用")
// private BigDecimal logisticsPrice;
/**
* 快递费用
*/
@ApiModelProperty(value = "快递费用")
private BigDecimal logisticsPrice;
/**
* 付款人数

5
cereshop-app/src/main/java/com/shop/cereshop/app/param/order/OrderGetAllParam.java

@ -33,4 +33,9 @@ public class OrderGetAllParam extends PageParam {
* 客户id
*/
private Long buyerUserId;
/**
* 页大小
*/
private Integer page;
}

12
cereshop-app/src/main/java/com/shop/cereshop/app/pay/xs/service/impl/XsPayServiceImpl.java

@ -263,10 +263,20 @@ public class XsPayServiceImpl implements XsPayService {
throw new CoBusinessException("10000","订单查找出错");
}
//是否是全部都是跨境订单--TODO BY pxh
log.info("orderList:" + new Gson().toJson(orderList));
CereBuyerUser user = cereBuyerUserService.selectByBuyerUserId(orderList.get(0).getBuyerUserId());
if(user == null){
throw new CoBusinessException("10000","系统出错,请联系管理员");
}
if(StringUtils.isEmpty(user.getRealName())){
throw new CoBusinessException("10000","用户需要先设置真实姓名后下单");
}
if(StringUtils.isEmpty(user.getIdCard())){
throw new CoBusinessException("10000","用户需要先设置身份证信息后下单");
}
List<CereOrderProduct> cereOrderProductList = cereOrderProductDAO.findByOrderIds(orderList.stream().map(CereShopOrder::getOrderId).collect(Collectors.toList()));
log.info("cereOrderProductList:" + new Gson().toJson(cereOrderProductList));
//构建请求参数

7
cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java

@ -176,6 +176,7 @@ public class CereShopCartServiceImpl implements CereShopCartService {
//新增购物车商品数据
shopCart=cereShopCartDAO.findSku(param.getSkuId());
shopCart.setCreateTime(time);
shopCart.setUpdateTime(time);
shopCart.setBuyerUserId(user.getBuyerUserId());
shopCart.setNumber(param.getNumber());
if(data!=null){
@ -184,10 +185,14 @@ public class CereShopCartServiceImpl implements CereShopCartService {
//更新活动价格
shopCart.setProductPrice(data.getPrice());
}
cereShopCartDAO.insert(shopCart);
cereShopCartDAO.insertOrUpdate(shopCart);
//查询规格属性值数据同步到购物车商品规格明细表中
List<CereCartAttribute> attributes=cereShopCartDAO.findAttributes(param.getSkuId());
if(attributes!=null){
if (shopCart.getCartId() == null) {
CereShopCart cart = cereShopCartDAO.findShopCart(user.getBuyerUserId(),param.getSkuId());
shopCart.setCartId(cart.getCartId());
}
CereShopCart finalShopCart = shopCart;
attributes.forEach(a -> a.setCartId(finalShopCart.getCartId()));
cereCartAttributeService.insertBatch(attributes);

2
cereshop-app/src/main/java/com/shop/cereshop/app/service/product/CereProductClassifyService.java

@ -23,5 +23,7 @@ public interface CereProductClassifyService {
List<Classify> getFirstClassify(ClassifyParam param) throws CoBusinessException;
Page getClaasifyProducts(ClassifyProductParam param, CereBuyerUser user) throws CoBusinessException;
Page getClassifyProducts2(ClassifyProductParam param, CereBuyerUser user);
}

2
cereshop-app/src/main/java/com/shop/cereshop/app/service/product/CereShopProductService.java

@ -41,6 +41,8 @@ public interface CereShopProductService {
Page getCanvasProducts(CanvasAppProductParam param) throws CoBusinessException,Exception;
Page getProducts2(CanvasAppProductParam param) throws CoBusinessException,Exception;
List<Classify> getClassify() throws CoBusinessException;
CereShopDistributor check(Long shopId, CereBuyerUser user) throws CoBusinessException;

52
cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereProductClassifyServiceImpl.java

@ -8,9 +8,12 @@ package com.shop.cereshop.app.service.product.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.app.dao.product.CereProductClassifyDAO;
import com.shop.cereshop.app.dao.shop.CerePlatformShopDAO;
import com.shop.cereshop.app.page.classify.Classify;
import com.shop.cereshop.app.page.index.Product;
import com.shop.cereshop.app.page.index.ProductClassify;
import com.shop.cereshop.app.page.index.ProductImage;
import com.shop.cereshop.app.page.shop.Shop;
import com.shop.cereshop.app.param.classify.ClassifyParam;
import com.shop.cereshop.app.param.classify.ClassifyProductParam;
import com.shop.cereshop.app.service.product.CereProductClassifyService;
@ -23,7 +26,7 @@ import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
@ -31,6 +34,9 @@ import java.util.List;
public class CereProductClassifyServiceImpl implements CereProductClassifyService {
@Autowired
private CerePlatformShopDAO cerePlatformShopDAO;
@Autowired
private CereProductClassifyDAO cereProductClassifyDAO;
@Autowired
@ -99,4 +105,48 @@ public class CereProductClassifyServiceImpl implements CereProductClassifyServic
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;
}
@Override
public Page getClassifyProducts2(ClassifyProductParam param, CereBuyerUser user) {
PageHelper.startPage(param.getPage(),param.getPageSize());
if (user != null) {
param.setBuyerUserId(user.getBuyerUserId());
}
//获取产品信息
List<Product> list = getProducts(param, user);
PageInfo<Product> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;
}
private List<Product> getProducts(ClassifyProductParam param, CereBuyerUser user) {
//查询产品信息
List<Product> list=cereProductClassifyDAO.getClassifyProducts2(param);
//查询商铺信息
Map<Long, Shop> shopMap = cerePlatformShopDAO.getClaasifyShop(list);
//查询图片信息
Map<Long, ProductImage> productImageMap =cereProductClassifyDAO.getClassifyImage(list);
if(!EmptyUtils.isEmpty(list)){
list.forEach(a -> {
//设置店铺名称店铺logo
a.setShopName(shopMap.get(a.getShopId()).getShopName());
a.setShopLogo(shopMap.get(a.getShopId()).getShopLogo());
//设置图片路径
a.setImage(productImageMap.get(a.getProductId()).getImage());
//查询付款人数
a.setUsers(cerePlatformShopservice.findPayUsers(a.getProductId()));
//设置活动信息
ProductBo productBo = cereShopProductService.fetchProductCache(a.getShopId(), a.getProductId(), a.getSkuId(), user, true);
if (productBo != null) {
a.setActivityType(productBo.getActivityType());
a.setOriginalPrice(productBo.getOriginalPrice());
a.setPrice(productBo.getPrice());
a.setTotal(productBo.getTotal());
}
});
}
return list;
}
}

86
cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java

@ -16,10 +16,14 @@ import com.shop.cereshop.app.dao.product.CereProductStatsByDayDAO;
import com.shop.cereshop.app.dao.product.CereShopProductDAO;
import com.shop.cereshop.app.dao.product.CereSkuRealInfoDAO;
import com.shop.cereshop.app.page.canvas.CanvasProduct;
import com.shop.cereshop.app.page.canvas.CanvasProductNumber;
import com.shop.cereshop.app.page.canvas.CanvasProductSku;
import com.shop.cereshop.app.page.canvas.CanvasProductUsers;
import com.shop.cereshop.app.page.cart.CartSku;
import com.shop.cereshop.app.page.index.Product;
import com.shop.cereshop.app.page.order.ShopDistributor;
import com.shop.cereshop.app.page.product.*;
import com.shop.cereshop.app.page.settlement.Distribution;
import com.shop.cereshop.app.param.canvas.CanvasAppProductParam;
import com.shop.cereshop.app.param.index.SearchParam;
import com.shop.cereshop.app.param.product.PageProductParam;
@ -312,10 +316,12 @@ public class CereShopProductServiceImpl implements CereShopProductService {
sku.setWeight(detail.getWeight());
skuList.add(sku);
// Distribution distribution = cereShopOrderService.setLogisticPrice(logistics, skuList, detail.getReceive(), numberMap);
// if (distribution != null) {
// detail.setLogisticsPrice(distribution.getDistributionPrice());
// }
final Long storehouseId = detail.getStorehouseId();
logistics = logistics.stream().filter(item -> item.getStorehouseId().equals(storehouseId)).collect(Collectors.toList());
Distribution distribution = cereShopOrderService.setLogisticPrice(logistics, skuList, detail.getReceive(), numberMap);
if (distribution != null) {
detail.setLogisticsPrice(distribution.getDistributionPrice());
}
}
//查询该商品收藏id
@ -943,6 +949,78 @@ public class CereShopProductServiceImpl implements CereShopProductService {
}
@Override
public Page getProducts2(CanvasAppProductParam param) throws CoBusinessException,Exception {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<CanvasProduct> list=null;
Map<Long,CanvasProductUsers> productUsersMap = new HashMap<>();
Map<Long, CanvasProductSku> productSkuMap = new HashMap<>();
Map<Long, CanvasProductNumber> productNumberMap = new HashMap<>();
if(IntegerEnum.CANVAS_ACTIVITY_GROUP_WORK.getCode().equals(param.getType())){
list=cereShopProductDAO.getGroupWorkProducts(param);
}else if(IntegerEnum.CANVAS_ACTIVITY_SECKILL.getCode().equals(param.getType())){
list=cereShopProductDAO.getSeckillProducts(param);
}else if(IntegerEnum.CANVAS_ACTIVITY_DISCOUNT.getCode().equals(param.getType())){
list=cereShopProductDAO.getDiscountProducts(param);
}else {
list= cereShopProductDAO.getCanvasProducts2(param);
//补充查询产品付款人数
productUsersMap = cereShopProductDAO.getProductUsers(param);
//补充查询产品sku信息
productSkuMap = cereShopProductDAO.getProductSku(param);
//补充查询产品购买数据
productNumberMap = cereShopProductDAO.getProductNumber(param);
}
//填充产品属性
fillProductProperties(list, productUsersMap, productSkuMap, productNumberMap);
PageInfo<CanvasProduct> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;
}
private void fillProductProperties(List<CanvasProduct> list, Map<Long, CanvasProductUsers> productUsersMap, Map<Long, CanvasProductSku> productSkuMap, Map<Long, CanvasProductNumber> productNumberMap) {
boolean usersMapIsEmpty = productUsersMap.isEmpty();
boolean skuMapIsEmpty = productSkuMap.isEmpty();
boolean numberMapIsEmpty = productNumberMap.isEmpty();
if(!EmptyUtils.isEmpty(list)){
for (CanvasProduct product : list) {
Long productId = product.getProductId();
if(!usersMapIsEmpty){
//填充产品购买人数信息
product.setUsers(productUsersMap.get(productId).getUsers());
}
if(!skuMapIsEmpty){
//填充产品sku信息
CanvasProductSku canvasProductSku = productSkuMap.get(productId);
product.setSkuId(canvasProductSku.getSkuId());
product.setImage(canvasProductSku.getImage());
product.setOriginalPrice(canvasProductSku.getOriginalPrice());
product.setPrice(canvasProductSku.getPrice());
product.setStockNumber(canvasProductSku.getStockNumber());
}
if(!numberMapIsEmpty){
//填充产品销量信息
product.setNumber(productNumberMap.get(productId).getNumber());
}
ProductBo productBo = fetchProductCache(product.getShopId(), productId, product.getSkuId(), null, true);
if (productBo != null) {
product.setPrice(productBo.getPrice());
product.setOriginalPrice(productBo.getOriginalPrice());
product.setActivityType(productBo.getActivityType());
product.setIfEnable(productBo.getIfEnable());
product.setTime(productBo.getTime());
product.setStockNumber(productBo.getSurplusNumber());
}
}
}
}
@Override
public List<Classify> getClassify() throws CoBusinessException {
//查询所有一级类目
List<Classify> list=cereShopProductDAO.findAllClassify();

3
cereshop-app/src/main/java/com/shop/cereshop/app/utils/DistributionUtil.java

@ -59,7 +59,8 @@ public class DistributionUtil {
}
} else if (ParamEnum.CHARGE_TYPE_WEIGHT.getCode().equals(orderLogistic.getChargeType())) {
for (CartSku cartSku : cartSkus) {
totalFactor = totalFactor.add(cartSku.getWeight());
BigDecimal buyNumber = new BigDecimal(buyNumberMap.get(cartSku.getSkuId()));
totalFactor = totalFactor.add(cartSku.getWeight().multiply(buyNumber));
}
}
boolean zeroFactor = false;

4
cereshop-app/src/main/java/com/shop/cereshop/app/utils/WechatUtil.java

@ -365,9 +365,9 @@ public class WechatUtil {
}
/**
* 向指定 PAY_URL 发送POST方法的请求
* 向指定 URL 发送POST方法的请求
*
* @param url 发送请求的 PAY_URL
* @param url 发送请求的 URL
* @return 所代表远程资源的响应结果
*/
public static String sendPost(String url, Map<String, ?> paramMap) {

1
cereshop-app/src/main/resources/mybatis/mapper/order/CereShopOrderDAO.xml

@ -535,6 +535,7 @@
LEFT JOIN cere_shop_comment sc ON sc.order_id = a.order_id
</if>
where a.buyer_user_id=#{buyerUserId}
and a.order_id>=(select order_id from cere_shop_order where buyer_user_id=#{buyerUserId} limit #{page},1)
<if test="search!=null and search!=''">
and (a.order_formid like concat('%',#{search},'%') OR
f.product_name like concat('%',#{search},'%'))

61
cereshop-app/src/main/resources/mybatis/mapper/product/CereProductClassifyDAO.xml

@ -14,6 +14,13 @@
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<resultMap id="mapProductImage" type="com.shop.cereshop.app.page.index.ProductImage" >
<result property="productId" column="product_id" javaType="java.lang.Long"/>
<result property="image" column="image" javaType="java.lang.String"/>
</resultMap>
<sql id="Base_Column_List">
classify_id, classify_pid, classify_hierarchy, classify_level, classify_level_hierarchy,
classify_name, classify_image, sort, link, create_time, update_time
@ -208,4 +215,58 @@
</if>
a.update_time DESC,a.create_time DESC
</select>
<select id="getClassifyProducts2" parameterType="com.shop.cereshop.app.param.classify.ClassifyProductParam"
resultType="com.shop.cereshop.app.page.index.Product">
SELECT
a.shop_id,
a.product_id,
a.product_name,
b.sku_id,
b.original_price,
b.price,
0 as activityType,
ifnull(f.number, 0) + a.fictitious_number as number
from cere_shop_product a
LEFT JOIN (SELECT a.product_id,a.price,a.sku_id,a.original_price from cere_product_sku a,cere_shop_product b
where a.product_id=b.product_id GROUP BY a.product_id) b ON a.product_id=b.product_id
LEFT JOIN cere_product_classify e ON a.classify_id=e.classify_id
LEFT JOIN (SELECT SUM(number) number,sku_id,order_id from cere_order_product GROUP BY sku_id) f ON b.sku_id=f.sku_id
where a.shelve_state=1
<if test="classifyId!=null">
and (a.classify_id=#{classifyId} OR e.classify_level_hierarchy like concat('%/',#{classifyId},'%'))
</if>
<if test="productName!=null and productName!=''">
and a.product_name like concat('%',#{productName},'%')
</if>
ORDER BY
<if test='type=="1"'>
price,
</if>
<if test='type=="2"'>
price DESC,
</if>
<if test='volume=="1"'>
f.number,
</if>
<if test='volume=="2"'>
f.number DESC,
</if>
a.update_time DESC,a.create_time DESC
</select>
<select id="getClassifyImage" parameterType="java.util.List"
resultMap="mapProductImage">
SELECT
c.product_id,
c.product_image image
from (SELECT a.product_id,a.product_image from cere_product_image a,cere_shop_product b
where a.product_id=b.product_id GROUP BY a.product_id) c
where c.product_id in
(
<foreach collection="list" item="i" index="index" separator=",">
#{i.productId}
</foreach>
)
</select>
</mapper>

185
cereshop-app/src/main/resources/mybatis/mapper/product/CereShopProductDAO.xml

@ -21,6 +21,26 @@
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.shop.cereshop.commons.domain.product.CereShopProduct">
<result column="product_text" jdbcType="LONGVARCHAR" property="productText" />
</resultMap>
<resultMap type="com.shop.cereshop.app.page.canvas.CanvasProductSku" id="canvasProductSkuMap">
<result property="productId" column="product_id"/>
<result property="image" column="image"/>
<result property="price" column="price"/>
<result property="skuId" column="sku_id"/>
<result property="originalPrice" column="original_price"/>
<result property="stockNumber" column="stock_number"/>
</resultMap>
<resultMap id="productUsersMap" type="com.shop.cereshop.app.page.canvas.CanvasProductUsers">
<result property="productId" column="product_id" javaType="java.lang.Long"/>
<result property="users" column="users" javaType="java.lang.Integer"/>
</resultMap>
<resultMap id="productNumberMap" type="com.shop.cereshop.app.page.canvas.CanvasProductNumber">
<result property="productId" column="product_id" javaType="java.lang.Long"/>
<result property="number" column="number" javaType="java.lang.Integer"/>
</resultMap>
<sql id="Base_Column_List">
product_id, shop_id, product_name, product_brief, shop_group_id, classify_id, supplier_id,
supplier_name, if_logistics, shelve_state, if_oversold,fictitious_number, create_time, update_time,product_text,reject
@ -403,6 +423,171 @@
ORDER BY a.create_time DESC
</select>
<select id="getCanvasProducts2" parameterType="com.shop.cereshop.app.param.canvas.CanvasAppProductParam" resultType="com.shop.cereshop.app.page.canvas.CanvasProduct">
SELECT a.shop_id,d.shop_name,d.shop_logo,a.product_id,a.product_name,a.fictitious_number
from cere_shop_product a
LEFT JOIN cere_platform_shop d ON a.shop_id=d.shop_id
LEFT JOIN cere_product_classify e ON a.classify_id=e.classify_id
where a.shelve_state=1 and d.state=1
<if test="search!=null and search!=''">
and (d.shop_name like concat('%',#{search},'%') OR
a.product_id like concat('%',#{search},'%') OR
a.product_name like concat('%',#{search},'%'))
</if>
<if test="shelveState!=null">
and a.shelve_state=#{shelveState}
</if>
<if test="classifyId!=null">
and (a.classify_id=#{classifyId} OR e.classify_level_hierarchy like concat('%/',#{classifyId},'%'))
</if>
<if test="ids!=null and ids.size()>0">
and a.product_id in (
<foreach collection="ids" item="id" index="index" separator=",">
#{id}
</foreach>
)
</if>
ORDER BY a.create_time DESC
</select>
<select id="getProductUsers" parameterType="com.shop.cereshop.app.param.canvas.CanvasAppProductParam"
resultMap="productUsersMap">
select
a.product_id,
ifnull(x.users, 0) + a.fictitious_number as users
from
cere_shop_product a
left join (
select
COUNT(a.buyer_user_id) users,
a.product_id
from
(
select
b.buyer_user_id,
a.product_id
from
cere_order_product a,
cere_shop_order b
where
a.order_id = b.order_id
and b.state in (2, 3, 4)
group by
a.product_id,
b.buyer_user_id) a
group by
a.product_id) x on
a.product_id = x.product_id
where
a.shelve_state = 1
<if test="ids!=null and ids.size()>0">
and a.product_id in (
<foreach collection="ids" item="id" index="index" separator=",">
#{id}
</foreach>
)
</if>
group by a.product_id
</select>
<select id="getProductSku" parameterType="com.shop.cereshop.app.param.canvas.CanvasAppProductParam"
resultMap="canvasProductSkuMap">
select
b.product_id,
if(h.image is null or h.image = '', c.product_image, h.image) image,
b.price,
b.sku_id,
b.original_price,
b.stock_number
from
(
select
a.product_id,
a.price,
a.sku_id,
a.original_price,
a.stock_number
from
cere_product_sku a,
cere_shop_product b
where
a.product_id = b.product_id
group by
a.product_id) b
left join (
select
a.product_id,
a.product_image
from
cere_product_image a,
cere_shop_product b
where
a.product_id = b.product_id
group by
a.product_id) c on
b.product_id = c.product_id
left join (
select
a.sku_id,
a.image
from
cere_sku_name a,
cere_product_sku b
where
a.sku_id = b.sku_id
limit 1) h on
b.sku_id = h.sku_id
<if test="ids!=null and ids.size()>0">
where b.product_id in (
<foreach collection="ids" item="id" index="index" separator=",">
#{id}
</foreach>
)
</if>
group by b.product_id
</select>
<select id="getProductNumber" parameterType="com.shop.cereshop.app.param.canvas.CanvasAppProductParam"
resultMap="productNumberMap">
select
b.product_id ,
if(f.number is null,b.fictitious_number,f.number + b.fictitious_number) number
from
(
select
a.product_id,
a.price,
a.sku_id,
a.original_price,
a.stock_number,
b.fictitious_number
from
cere_product_sku a,
cere_shop_product b
where
a.product_id = b.product_id
group by
a.product_id) b
left join (
select
SUM(number) number,
sku_id,
order_id
from
cere_order_product
group by
sku_id) f on
b.sku_id = f.sku_id
<if test="ids!=null and ids.size()>0">
where b.product_id in (
<foreach collection="ids" item="id" index="index" separator=",">
#{id}
</foreach>
)
</if>
group by b.product_id
</select>
<select id="getGroupWorkProducts" parameterType="com.shop.cereshop.app.param.canvas.CanvasAppProductParam" resultType="com.shop.cereshop.app.page.canvas.CanvasProduct">
SELECT b.shop_id,d.shop_name,d.shop_logo,a.product_id,b.product_name, ifnull(x.users, 0) + b.fictitious_number as users, h.start_time,h.end_time,h.state,
IF(m.image IS NULL OR m.image='',c.product_image,m.image) image,h.if_enable,h.enable_time,

21
cereshop-app/src/main/resources/mybatis/mapper/shop/CerePlatformShopDAO.xml

@ -21,6 +21,13 @@
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
</resultMap>
<resultMap type="com.shop.cereshop.app.page.shop.Shop" id="shopMap">
<result property="shopId" column="shop_id"/>
<result property="shopName" column="shop_name"/>
<result property="shopLogo" column="shop_logo"/>
</resultMap>
<sql id="Base_Column_List">
shop_id, shop_code, shop_name, shop_brief, shop_phone, shop_password, charge_person_name,
charge_person_phone, shop_adress, effective_date, effective_year, contract_state,
@ -570,4 +577,18 @@
LEFT JOIN cere_platform_shop e ON b.shop_id=e.shop_id
where a.shop_discount_id=#{shopDiscountId} LIMIT 4
</select>
<select id="getClaasifyShop" parameterType="java.util.List" resultMap="shopMap">
SELECT
d.shop_id,
d.shop_name,
d.shop_logo
from cere_platform_shop d
where d.state=1 and d.shop_id in (
<foreach collection="list" item="i" index="index" separator=",">
#{i.shopId}
</foreach>
)
</select>
</mapper>

0
cereshop-business/cert/.gitkeep

0
cereshop-business/cert/wechat/.gitkeep

1
cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessUserController.java

@ -121,6 +121,7 @@ public class BusinessUserController {
@ApiOperation(value = "删除用户")
@NoRepeatWebLog
public Result delete(@RequestBody BusinessDeleteUser param, HttpServletRequest request) throws CoBusinessException{
ContextUtil.interceptDelete();
//获取当前登录账户
CerePlatformBusiness user = (CerePlatformBusiness) request.getAttribute("user");
cerePlatformBusinessService.delete(param,user);

1
cereshop-business/src/main/java/com/shop/cereshop/business/controller/PermissionController.java

@ -87,6 +87,7 @@ public class PermissionController {
@ApiOperation(value = "删除菜单权限")
@NoRepeatWebLog
public Result delete(@RequestBody PermissionDeleteParam param, HttpServletRequest request) throws CoBusinessException{
ContextUtil.interceptDelete();
//获取当前登录账户
CerePlatformBusiness user = (CerePlatformBusiness) request.getAttribute("user");
cerePlatformPermissionService.delete(param,user);

1
cereshop-business/src/main/java/com/shop/cereshop/business/controller/RoleController.java

@ -89,6 +89,7 @@ public class RoleController {
@ApiOperation(value = "删除角色")
@NoRepeatWebLog
public Result delete(@RequestBody RoleDeleteParam param, HttpServletRequest request) throws CoBusinessException{
ContextUtil.interceptDelete();
//获取当前登录账户
CerePlatformBusiness user = (CerePlatformBusiness) request.getAttribute("user");
cerePlatformRoleService.delete(param,user);

4
cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopCouponDAO.java

@ -35,7 +35,9 @@ public interface CereShopCouponDAO extends BaseMapper<CereShopCoupon> {
List<ShopCoupon> getAll(ShopCouponGetAllParam param);
List<ToolProduct> getProducts(@Param("shopId") Long shopId);
List<ToolProduct> getProducts(@Param("shopId") Long shopId,
@Param("shopCouponId") Long shopCouponId,
@Param("queryType") Integer queryType);
List<OperateCoupon> selectCoupon(OperateCouponParam param);

19
cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopCouponExcludeDAO.java

@ -0,0 +1,19 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.business.dao.tool;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.commons.domain.tool.CereShopCouponExclude;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CereShopCouponExcludeDAO extends BaseMapper<CereShopCouponExclude> {
int insertBatch(List<CereShopCouponExclude> list);
}

2
cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopDiscountDAO.java

@ -35,7 +35,7 @@ public interface CereShopDiscountDAO extends BaseMapper<CereShopDiscount> {
List<ShopDiscount> getAll(ShopDiscountGetAllParam param);
List<ToolProduct> getProducts(@Param("shopId") Long shopId);
List<ToolProduct> getProducts(@Param("shopId") Long shopId, @Param("shopDiscountId") Long shopDiscountId);
List<CouponProduct> findDataProducts(@Param("shopDiscountId") Long shopDiscountId,@Param("shopId") Long shopId);

2
cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopGroupWorkDAO.java

@ -32,7 +32,7 @@ public interface CereShopGroupWorkDAO extends BaseMapper<CereShopGroupWork> {
ShopGroupWorkUDetail getById(@Param("shopGroupWorkId") Long shopGroupWorkId);
List<ToolProduct> getProducts(@Param("shopId") Long shopId);
List<ToolProduct> getProducts(@Param("shopId") Long shopId, @Param("shopGroupWorkId") Long shopGroupWorkId);
List<ShopGroupWork> getAll(ShopGroupWorkGetAllParam param);

2
cereshop-business/src/main/java/com/shop/cereshop/business/dao/tool/CereShopSeckillDAO.java

@ -35,7 +35,7 @@ public interface CereShopSeckillDAO extends BaseMapper<CereShopSeckill> {
List<ShopSeckill> getAll(ShopSeckillGetAllParam param);
List<ToolProduct> getProducts(@Param("shopId") Long shopId);
List<ToolProduct> getProducts(@Param("shopId") Long shopId, @Param("shopSeckillId") Long shopSeckillId);
List<CouponProduct> findDataProducts(@Param("shopSeckillId") Long shopSeckillId,@Param("shopId") Long shopId);

6
cereshop-business/src/main/java/com/shop/cereshop/business/page/tool/ShopCouponDetail.java

@ -147,6 +147,12 @@ public class ShopCouponDetail implements Serializable {
@ApiModelProperty(value = "选中商品数据")
private List<ToolProduct> products;
/**
* 指定商品不可用列表
*/
@ApiModelProperty(value = "指定商品不可用列表")
private List<Long> excludeIds;
private static final long serialVersionUID = 1L;
}

12
cereshop-business/src/main/java/com/shop/cereshop/business/page/tool/ToolProduct.java

@ -95,4 +95,16 @@ public class ToolProduct {
*/
@ApiModelProperty(value = "已拼人数")
private Integer workUsers;
/**
* 拼团的拼团价
*/
@ApiModelProperty(value = "拼团的拼团价")
private BigDecimal workPrice;
/**
* 秒杀的直降多少元
*/
@ApiModelProperty(value = "秒杀的直降多少元")
private BigDecimal downPrice;
}

12
cereshop-business/src/main/java/com/shop/cereshop/business/param/tool/ToolProductParam.java

@ -22,4 +22,16 @@ public class ToolProductParam extends PageParam {
*/
@ApiModelProperty(value = "店铺id")
private Long shopId;
/**
* 活动id
*/
@ApiModelProperty(value = "活动id")
private Long activityId;
/**
* 查询类型 2-指定商品可用 3-指定商品不可用
*/
@ApiModelProperty(value = "查询类型")
private Integer queryType;
}

1
cereshop-business/src/main/java/com/shop/cereshop/business/service/permission/impl/CerePlatformPermissionServiceImpl.java

@ -97,6 +97,7 @@ public class CerePlatformPermissionServiceImpl implements CerePlatformPermission
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void delete(PermissionDeleteParam param, CerePlatformBusiness user) throws CoBusinessException {
ContextUtil.interceptDelete();
String time=TimeUtils.yyMMddHHmmss();
cerePlatformPermissionDAO.deleteByPrimaryKey(param.getPermissionId());
//同步删除角色关联菜单权限数据

37
cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopCouponServiceImpl.java

@ -5,9 +5,11 @@
*/
package com.shop.cereshop.business.service.tool.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.business.dao.tool.CereShopCouponDAO;
import com.shop.cereshop.business.dao.tool.CereShopCouponExcludeDAO;
import com.shop.cereshop.business.page.canvas.ProductCoupon;
import com.shop.cereshop.business.page.operate.OperateCoupon;
import com.shop.cereshop.business.page.tool.*;
@ -25,6 +27,7 @@ import com.shop.cereshop.commons.domain.business.CerePlatformBusiness;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.tool.CereShopCoupon;
import com.shop.cereshop.commons.domain.tool.CereShopCouponDetail;
import com.shop.cereshop.commons.domain.tool.CereShopCouponExclude;
import com.shop.cereshop.commons.exception.CoBusinessException;
import com.shop.cereshop.commons.utils.EmptyUtils;
import com.shop.cereshop.commons.utils.TimeUtils;
@ -59,11 +62,15 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
@Autowired
private CereRedisKeyServcice cereRedisKeyServcice;
@Autowired
private CereShopCouponExcludeDAO cereShopCouponExcludeDAO;
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void save(ShopCouponSaveParam param, CerePlatformBusiness user) throws CoBusinessException,Exception {
String time = TimeUtils.yyMMddHHmmss();
List<Long> ids=null;
List<Long> excludeIds = null;
if(IntegerEnum.APPLY_TYPE_ALL.getCode().equals(param.getApplyType())){
//如果是全部商品,查询本店所有有效商品id
ids=cereShopCouponDAO.findProductIdsByShopId(param.getShopId());
@ -73,6 +80,7 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
}else {
//如果是指定商品不可用,查询本店所有不在这个范围内的有效商品id
ids=cereShopCouponDAO.findProductIdsByShopIdAndIds(param.getShopId(),param.getIds());
excludeIds = param.getIds();
}
if (param.getType() == 2) {
if (IntegerEnum.TIME_TYPE_FIXED.getCode().equals(param.getTimeType())) {
@ -158,6 +166,15 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
}).collect(Collectors.toList());
cereShopCouponDetailService.insertBatch(collect);
}
if (!EmptyUtils.isEmpty(excludeIds)) {
List<CereShopCouponExclude> excludeList = excludeIds.stream().map(id -> {
CereShopCouponExclude exclude = new CereShopCouponExclude();
exclude.setProductId(id);
exclude.setShopCouponId(cereShopCoupon.getShopCouponId());
return exclude;
}).collect(Collectors.toList());
cereShopCouponExcludeDAO.insertBatch(excludeList);
}
//新增日志
cerePlatformLogService.addLog(user,"优惠券管理","商家端操作","新增优惠券",cereShopCoupon.getShopCouponId(),time);
}
@ -189,6 +206,7 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
public void update(ShopCouponUpdateParam param, CerePlatformBusiness user) throws CoBusinessException, Exception {
String time = TimeUtils.yyMMddHHmmss();
List<Long> ids=new ArrayList<>();
List<Long> excludeIds = null;
if(IntegerEnum.APPLY_TYPE_ALL.getCode().equals(param.getApplyType())){
//如果是全部商品,查询本店所有有效商品id
ids=cereShopCouponDAO.findProductIdsByShopId(param.getShopId());
@ -198,6 +216,7 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
}else {
//如果是指定商品不可用,查询本店所有不在这个范围内的有效商品id
ids=cereShopCouponDAO.findProductIdsByShopIdAndIds(param.getShopId(),param.getIds());
excludeIds = param.getIds();
}
if (param.getType() == 2) {
if (IntegerEnum.TIME_TYPE_FIXED.getCode().equals(param.getTimeType())) {
@ -282,6 +301,8 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
}
//清空商品明细数据
cereShopCouponDetailService.deleteById(cereShopCoupon.getShopCouponId());
cereShopCouponExcludeDAO.delete(Wrappers.<CereShopCouponExclude>lambdaQuery()
.eq(CereShopCouponExclude::getShopCouponId, cereShopCoupon.getShopCouponId()));
//新增商品明细数据
if(!EmptyUtils.isEmpty(ids)){
List<CereShopCouponDetail> collect = ids.stream().map(id -> {
@ -292,6 +313,15 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
}).collect(Collectors.toList());
cereShopCouponDetailService.insertBatch(collect);
}
if (!EmptyUtils.isEmpty(excludeIds)) {
List<CereShopCouponExclude> excludeList = excludeIds.stream().map(id -> {
CereShopCouponExclude exclude = new CereShopCouponExclude();
exclude.setProductId(id);
exclude.setShopCouponId(cereShopCoupon.getShopCouponId());
return exclude;
}).collect(Collectors.toList());
cereShopCouponExcludeDAO.insertBatch(excludeList);
}
//新增日志
cerePlatformLogService.addLog(user,"优惠券管理","商家端操作","修改优惠券",cereShopCoupon.getShopCouponId(),time);
}
@ -302,6 +332,11 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
if(detail!=null){
//查询商品明细数据
detail.setProducts(cereShopCouponDetailService.findProducts(shopCouponId));
if (IntegerEnum.APPLY_TYPE_NO.getCode().equals(detail.getApplyType())) {
detail.setExcludeIds(cereShopCouponExcludeDAO.selectList(Wrappers.<CereShopCouponExclude>lambdaQuery()
.eq(CereShopCouponExclude::getShopCouponId, shopCouponId)).stream().map(CereShopCouponExclude::getProductId)
.collect(Collectors.toList()));
}
}
return detail;
}
@ -361,7 +396,7 @@ public class CereShopCouponServiceImpl implements CereShopCouponService {
@Override
public Page getProducts(ToolProductParam param) throws CoBusinessException {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<ToolProduct> list=cereShopCouponDAO.getProducts(param.getShopId());
List<ToolProduct> list=cereShopCouponDAO.getProducts(param.getShopId(), param.getActivityId(), param.getQueryType());
PageInfo<ToolProduct> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;

2
cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopDiscountServiceImpl.java

@ -391,7 +391,7 @@ public class CereShopDiscountServiceImpl implements CereShopDiscountService{
@Override
public Page getProducts(ToolProductParam param) throws CoBusinessException {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<ToolProduct> list=cereShopDiscountDAO.getProducts(param.getShopId());
List<ToolProduct> list=cereShopDiscountDAO.getProducts(param.getShopId(), param.getActivityId());
PageInfo<ToolProduct> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;

2
cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopGroupWorkServiceImpl.java

@ -384,7 +384,7 @@ public class CereShopGroupWorkServiceImpl implements CereShopGroupWorkService {
@Override
public Page getProducts(ToolProductParam param) throws CoBusinessException {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<ToolProduct> list=cereShopGroupWorkDAO.getProducts(param.getShopId());
List<ToolProduct> list=cereShopGroupWorkDAO.getProducts(param.getShopId(), param.getActivityId());
PageInfo<ToolProduct> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;

2
cereshop-business/src/main/java/com/shop/cereshop/business/service/tool/impl/CereShopSeckillServiceImpl.java

@ -396,7 +396,7 @@ public class CereShopSeckillServiceImpl implements CereShopSeckillService {
@Override
public Page getProducts(ToolProductParam param) throws CoBusinessException {
PageHelper.startPage(param.getPage(),param.getPageSize());
List<ToolProduct> list=cereShopSeckillDAO.getProducts(param.getShopId());
List<ToolProduct> list=cereShopSeckillDAO.getProducts(param.getShopId(), param.getActivityId());
PageInfo<ToolProduct> pageInfo=new PageInfo<>(list);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;

148
cereshop-business/src/main/resources/mybatis/mapper/log/CerePlatformWebLogDAO.xml

@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.business.dao.log.CerePlatformWebLogDAO">
<resultMap id="BaseResultMap" type="com.shop.cereshop.commons.domain.log.CerePlatformWebLog">
<id column="web_log_id" jdbcType="BIGINT" property="webLogId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="params" jdbcType="VARCHAR" property="params" />
<result column="type" jdbcType="BIT" property="type" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="ip_source" jdbcType="VARCHAR" property="ipSource" />
<result column="describe" jdbcType="VARCHAR" property="describe" />
<result column="browser_name" jdbcType="VARCHAR" property="browserName" />
<result column="time" jdbcType="INTEGER" property="time" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
web_log_id, `name`, url, params, `type`, ip, ip_source, `describe`, browser_name,
`time`, create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cere_platform_web_log
where web_log_id = #{webLogId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cere_platform_web_log
where web_log_id = #{webLogId,jdbcType=BIGINT}
</delete>
<insert id="insertSelective" keyColumn="web_log_id" keyProperty="webLogId" parameterType="com.shop.cereshop.commons.domain.log.CerePlatformWebLog" useGeneratedKeys="true">
insert into cere_platform_web_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
`name`,
</if>
<if test="url != null">
url,
</if>
<if test="params != null">
params,
</if>
<if test="type != null">
`type`,
</if>
<if test="ip != null">
ip,
</if>
<if test="ipSource != null">
ip_source,
</if>
<if test="describe != null">
`describe`,
</if>
<if test="browserName != null">
browser_name,
</if>
<if test="time != null">
`time`,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="params != null">
#{params,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=BIT},
</if>
<if test="ip != null">
#{ip,jdbcType=VARCHAR},
</if>
<if test="ipSource != null">
#{ipSource,jdbcType=VARCHAR},
</if>
<if test="describe != null">
#{describe,jdbcType=VARCHAR},
</if>
<if test="browserName != null">
#{browserName,jdbcType=VARCHAR},
</if>
<if test="time != null">
#{time,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shop.cereshop.commons.domain.log.CerePlatformWebLog">
update cere_platform_web_log
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="params != null">
params = #{params,jdbcType=VARCHAR},
</if>
<if test="type != null">
`type` = #{type,jdbcType=BIT},
</if>
<if test="ip != null">
ip = #{ip,jdbcType=VARCHAR},
</if>
<if test="ipSource != null">
ip_source = #{ipSource,jdbcType=VARCHAR},
</if>
<if test="describe != null">
`describe` = #{describe,jdbcType=VARCHAR},
</if>
<if test="browserName != null">
browser_name = #{browserName,jdbcType=VARCHAR},
</if>
<if test="time != null">
`time` = #{time,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=VARCHAR},
</if>
</set>
where web_log_id = #{webLogId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.shop.cereshop.commons.domain.log.CerePlatformWebLog">
update cere_platform_web_log
set `name` = #{name,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
params = #{params,jdbcType=VARCHAR},
`type` = #{type,jdbcType=BIT},
ip = #{ip,jdbcType=VARCHAR},
ip_source = #{ipSource,jdbcType=VARCHAR},
`describe` = #{describe,jdbcType=VARCHAR},
browser_name = #{browserName,jdbcType=VARCHAR},
`time` = #{time,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=VARCHAR}
where web_log_id = #{webLogId,jdbcType=BIGINT}
</update>
</mapper>

14
cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopCouponDAO.xml

@ -161,13 +161,25 @@
<select id="getProducts" parameterType="java.lang.Object" resultType="com.shop.cereshop.business.page.tool.ToolProduct">
SELECT a.product_id,a.product_name,b.minMoney originalPrice,d.product_image image,g.stock_number from cere_shop_product a
<if test="shopCouponId != null and queryType == 2">
join cere_shop_coupon_detail cscd on cscd.product_id = a.product_id
</if>
<if test="shopCouponId != null and queryType == 3">
join cere_shop_coupon_exclude csce on csce.product_id = a.product_id
</if>
LEFT JOIN (SELECT product_id,MIN(price) minMoney from cere_product_sku GROUP BY product_id) b ON a.product_id=b.product_id
LEFT JOIN (SELECT product_id,MAX(price) maxMoney from cere_product_sku GROUP BY product_id) c ON a.product_id=c.product_id
LEFT JOIN (SELECT a.product_id,a.product_image from cere_product_image a,cere_shop_product b where a.product_id=b.product_id GROUP BY a.product_id) d
ON a.product_id=d.product_id
LEFT JOIN cere_product_classify e ON a.classify_id=e.classify_id
LEFT JOIN (SELECT SUM(stock_number) stock_number,product_id from cere_product_sku GROUP BY product_id) g ON b.product_id=g.product_id
where a.shop_id=#{shopId} and a.shelve_state=1
where a.shop_id = #{shopId} and a.shelve_state = 1
<if test="shopCouponId != null and queryType == 2">
and cscd.shop_coupon_id = #{shopCouponId}
</if>
<if test="shopCouponId != null and queryType == 3">
and csce.shop_coupon_id = #{shopCouponId}
</if>
</select>
<select id="findCouponName" parameterType="java.lang.Object" resultType="java.lang.String">

15
cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopCouponExcludeDAO.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.shop.cereshop.business.dao.tool.CereShopCouponExcludeDAO">
<insert id="insertBatch" parameterType="java.util.List">
insert into cere_shop_coupon_exclude (shop_coupon_id, product_id) values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.shopCouponId},
#{item.productId}
)
</foreach>
</insert>
</mapper>

9
cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopDiscountDAO.xml

@ -267,11 +267,18 @@
b.product_name,
a.original_price,
a.price,
<if test="shopDiscountId != null">
dd.discount,
</if>
c.product_image image,
a.stock_number,
a.sku_id,
e.`value`
from cere_product_sku a
<if test="shopDiscountId != null">
join cere_shop_discount_detail dd on dd.sku_id = a.sku_id
and dd.shop_discount_id = #{shopDiscountId}
</if>
LEFT JOIN cere_shop_product b ON a.product_id = b.product_id
LEFT JOIN (SELECT a.product_id, a.product_image
from cere_product_image a,
@ -413,7 +420,7 @@
<update id="updateDiscountEndState" parameterType="java.lang.Object">
update cere_shop_discount SET state=2,update_time=#{time} where shop_discount_id in (
<foreach collection="list" item="item" index="index" separator=",">
#{item.shopDiscountId}
#{item.discountId}
</foreach>
)
</update>

7
cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopGroupWorkDAO.xml

@ -250,11 +250,18 @@
b.product_name,
a.price,
a.original_price,
<if test="shopGroupWorkId != null">
gwd.price as workPrice,
</if>
c.product_image image,
a.stock_number,
a.sku_id,
e.`value`
from cere_product_sku a
<if test="shopGroupWorkId != null">
join cere_shop_group_work_detail gwd on gwd.sku_id = a.sku_id
and gwd.shop_group_work_id = #{shopGroupWorkId}
</if>
LEFT JOIN cere_shop_product b ON a.product_id = b.product_id
LEFT JOIN (SELECT a.product_id, a.product_image
from cere_product_image a,

7
cereshop-business/src/main/resources/mybatis/mapper/tool/CereShopSeckillDAO.xml

@ -267,11 +267,18 @@
b.product_name,
a.original_price,
a.price,
<if test="shopSeckillId != null">
sd.down_price as downPrice,
</if>
c.product_image image,
a.stock_number,
a.sku_id,
e.`value`
from cere_product_sku a
<if test="shopSeckillId != null">
join cere_shop_seckill_detail sd on sd.sku_id = a.sku_id
and sd.shop_seckill_id = #{shopSeckillId}
</if>
LEFT JOIN cere_shop_product b ON a.product_id = b.product_id
LEFT JOIN (SELECT a.product_id, a.product_image
from cere_product_image a,

33
cereshop-commons/src/main/java/com/shop/cereshop/commons/domain/tool/CereShopCouponExclude.java

@ -0,0 +1,33 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.commons.domain.tool;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* cere_shop_coupon_exclude 店铺优惠券商品指定不可用
* @author
*/
@Data
public class CereShopCouponExclude implements Serializable {
/**
* 店铺优惠券id
*/
@ApiModelProperty(value = "店铺优惠券id")
private Long shopCouponId;
/**
* 商品id
*/
@ApiModelProperty(value = "商品id")
private Long productId;
private static final long serialVersionUID = 1L;
}

4
cereshop-commons/src/main/java/com/shop/cereshop/commons/utils/KdniaoTrackQueryAPI.java

@ -86,8 +86,8 @@ public class KdniaoTrackQueryAPI {
}
/**
* 向指定 PAY_URL 发送POST方法的请求
* @param url 发送请求的 PAY_URL
* 向指定 URL 发送POST方法的请求
* @param url 发送请求的 URL
* @param params 请求的参数集合
* @return 远程资源的响应结果
*/

4
cereshop-commons/src/main/java/com/shop/cereshop/commons/utils/ProjectInvokeUtil.java

@ -28,7 +28,7 @@ public class ProjectInvokeUtil {
map.put("skuId", skuId);
map.put("fictitiousNumber", fictitiousNumber);
map.put("sourceEnum", sourceEnum.ordinal());
return null;
return HttpUtils.doPostJson(refreshSkuRealInfoUrl, JSON.toJSONString(map));
}
public HttpResult postRefreshSkuRealInfoForActivity(Long activityId,
@ -36,7 +36,7 @@ public class ProjectInvokeUtil {
Map<String, Object> map = new HashMap<>();
map.put("activityId", activityId);
map.put("sourceEnum", sourceEnum.ordinal());
return null;
return HttpUtils.doPostJson(refreshSkuRealInfoUrl, JSON.toJSONString(map));
}
}

3
doc/2.0/update.sql

@ -75,3 +75,6 @@ ALTER TABLE `cere_shop_coupon` ADD COLUMN `type` int(11) NOT NULL DEFAULT 1 COMM
ALTER TABLE `cere_shop_product` ADD COLUMN `brand_id` bigint(20) NULL DEFAULT NULL COMMENT '品牌id' AFTER `credit_limit`;
-- 20230510更新
alter table `cere_shop_cart` add UNIQUE KEY `uqe_buyer_user_id_sku_id` (`buyer_user_id`,`sku_id`);
Loading…
Cancel
Save