From 7f7796156bcfce4bcb7f6072bfc37fa8abd4593c Mon Sep 17 00:00:00 2001 From: cheney <1251790704@qq.com> Date: Thu, 11 Jan 2024 10:46:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=8D=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/EnterpriseCertification.java | 2 +- .../com/huoran/common/entity/UserAccount.java | 8 + .../entity/UserAuthenticationInformation.java | 2 +- .../AliRealNameAuthenticationController.java | 4 +- .../EnterpriseCertificationController.java | 2 +- .../nakadai/controller/MyOrderController.java | 70 ++++++++- .../nakadai/controller/OrderController.java | 18 +-- .../controller/PlatformOrderController.java | 11 +- .../nakadai/controller/ProductController.java | 37 ++++- .../nakadai/entity/app/dto/OrderShopDto.java | 19 +++ .../nakadai/entity/app/param/OrderParam.java | 4 +- .../huoran/nakadai/entity/model/Order.java | 12 ++ .../nakadai/entity/req/OrderPageReq.java | 28 ++++ .../nakadai/entity/req/ProductPageReq.java | 21 +++ .../nakadai/entity/vo/ProductCount.java | 14 ++ .../nakadai/listener/SubmitOrderListener.java | 4 +- .../mapper/EnterpriseCertificationMapper.java | 2 +- .../huoran/nakadai/mapper/OrderMapper.java | 10 +- .../huoran/nakadai/mapper/ProductMapper.java | 2 + .../nakadai/mapper/ShopDetailMapper.java | 2 + .../UserAuthenticationInformationMapper.java | 2 +- .../xml/EnterpriseCertificationMapper.xml | 4 +- .../huoran/nakadai/mapper/xml/OrderMapper.xml | 137 ++++++++++++++++-- .../nakadai/mapper/xml/ProductMapper.xml | 5 + .../huoran/nakadai/service/BasketService.java | 2 +- .../EnterpriseCertificationService.java | 2 +- .../nakadai/service/MyOrderService.java | 6 +- .../huoran/nakadai/service/OrderService.java | 3 +- .../nakadai/service/ProductService.java | 3 + .../UserAuthenticationInformationService.java | 2 +- .../service/impl/BasketServiceImpl.java | 66 ++++----- .../EnterpriseCertificationServiceImpl.java | 2 +- .../service/impl/MyOrderServiceImpl.java | 7 +- .../service/impl/OrderServiceImpl.java | 8 +- .../service/impl/ProductServiceImpl.java | 6 +- .../service/impl/ShopDetailServiceImpl.java | 21 ++- ...rAuthenticationInformationServiceImpl.java | 2 +- .../com/huoran/nakadai/utils/PageParam.java | 35 +---- 38 files changed, 443 insertions(+), 142 deletions(-) rename {nakadai/src/main/java/com/huoran/nakadai => common/src/main/java/com/huoran/common}/entity/EnterpriseCertification.java (99%) rename {nakadai/src/main/java/com/huoran/nakadai => common/src/main/java/com/huoran/common}/entity/UserAuthenticationInformation.java (98%) create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/req/OrderPageReq.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java create mode 100644 nakadai/src/main/java/com/huoran/nakadai/entity/vo/ProductCount.java diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/EnterpriseCertification.java b/common/src/main/java/com/huoran/common/entity/EnterpriseCertification.java similarity index 99% rename from nakadai/src/main/java/com/huoran/nakadai/entity/EnterpriseCertification.java rename to common/src/main/java/com/huoran/common/entity/EnterpriseCertification.java index 96a5b97..dbb99d6 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/EnterpriseCertification.java +++ b/common/src/main/java/com/huoran/common/entity/EnterpriseCertification.java @@ -1,4 +1,4 @@ -package com.huoran.nakadai.entity; +package com.huoran.common.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; diff --git a/common/src/main/java/com/huoran/common/entity/UserAccount.java b/common/src/main/java/com/huoran/common/entity/UserAccount.java index 0827fb0..6c38c19 100644 --- a/common/src/main/java/com/huoran/common/entity/UserAccount.java +++ b/common/src/main/java/com/huoran/common/entity/UserAccount.java @@ -90,4 +90,12 @@ public class UserAccount implements Serializable { @ApiModelProperty(value = "班级id") @TableField(exist = false) private String userName; + + @ApiModelProperty(value = "企业认证") + @TableField(exist = false) + private EnterpriseCertification enterpriseCertification; + + @ApiModelProperty(value = "个人认证") + @TableField(exist = false) + private UserAuthenticationInformation userAuthenticationInformation; } \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/UserAuthenticationInformation.java b/common/src/main/java/com/huoran/common/entity/UserAuthenticationInformation.java similarity index 98% rename from nakadai/src/main/java/com/huoran/nakadai/entity/UserAuthenticationInformation.java rename to common/src/main/java/com/huoran/common/entity/UserAuthenticationInformation.java index 32fd2e3..e9ee05e 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/UserAuthenticationInformation.java +++ b/common/src/main/java/com/huoran/common/entity/UserAuthenticationInformation.java @@ -1,4 +1,4 @@ -package com.huoran.nakadai.entity; +package com.huoran.common.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java index 5d8c465..1a1d8b5 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/AliRealNameAuthenticationController.java @@ -6,9 +6,9 @@ import com.huoran.common.entity.UserAccount; import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; import com.huoran.nakadai.config.AliRealNameAuthenticationConfig; -import com.huoran.nakadai.entity.EnterpriseCertification; +import com.huoran.common.entity.EnterpriseCertification; import com.huoran.nakadai.entity.UserInfo; -import com.huoran.nakadai.entity.UserAuthenticationInformation; +import com.huoran.common.entity.UserAuthenticationInformation; import com.huoran.nakadai.entity.res.BusinessLicenseOCRResp; import com.huoran.nakadai.entity.res.CreditCodeResp; import com.huoran.nakadai.entity.res.IdCardOCRResp; diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java index 632b7b8..7fcd37c 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/EnterpriseCertificationController.java @@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.huoran.common.entity.UserAccount; import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; -import com.huoran.nakadai.entity.EnterpriseCertification; +import com.huoran.common.entity.EnterpriseCertification; import com.huoran.nakadai.entity.req.EnterpriseCertificationLIstReq; import com.huoran.nakadai.entity.vo.WxMssVo; import com.huoran.nakadai.service.EnterpriseCertificationService; diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java index 90e21c2..b6d20ec 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java @@ -12,10 +12,14 @@ package com.huoran.nakadai.controller; import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.huoran.common.entity.UserAccount; import com.huoran.common.exception.YamiShopBindException; import com.huoran.common.response.ServerResponseEntity; import com.huoran.common.utils.SecurityUtils; +import com.huoran.common.entity.EnterpriseCertification; +import com.huoran.common.entity.UserAuthenticationInformation; import com.huoran.nakadai.entity.app.dto.MyOrderDto; import com.huoran.nakadai.entity.app.dto.OrderCountData; import com.huoran.nakadai.entity.app.dto.OrderItemDto; @@ -24,7 +28,9 @@ import com.huoran.nakadai.entity.enums.OrderStatus; import com.huoran.nakadai.entity.model.Order; import com.huoran.nakadai.entity.model.OrderItem; import com.huoran.nakadai.entity.model.ShopDetail; -import com.huoran.nakadai.entity.model.UserAddrOrder; +import com.huoran.nakadai.entity.req.OrderPageReq; +import com.huoran.nakadai.mapper.PlatformTeamAccountMapper; +import com.huoran.nakadai.mapper.PlatformTeamClassificationMapper; import com.huoran.nakadai.service.*; import com.huoran.nakadai.utils.Arith; import com.huoran.nakadai.utils.PageParam; @@ -32,6 +38,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Collections; @@ -56,6 +63,18 @@ public class MyOrderController { private final MyOrderService myOrderService; + @Autowired + private PlatformTeamClassificationMapper platformTeamClassificationMapper; + + @Autowired + public EnterpriseCertificationService enterpriseCertificationService; + + @Autowired + public UserAuthenticationInformationService userAuthenticationInformationService; + + @Autowired + private PlatformTeamAccountMapper platformTeamAccountMapper; + private final ShopDetailService shopDetailService; private final OrderItemService orderItemService; @@ -76,9 +95,9 @@ public class MyOrderController { if (order == null) { throw new RuntimeException("该订单不存在"); } - if (!Objects.equals(order.getUserId(), userId)) { - throw new RuntimeException("你没有权限获取该订单信息"); - } +// if (!Objects.equals(order.getUserId(), userId)) { +// throw new RuntimeException("你没有权限获取该订单信息"); +// } ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(order.getShopId()); // UserAddrOrder userAddrOrder = userAddrOrderService.getById(order.getAddrOrderId()); @@ -88,6 +107,7 @@ public class MyOrderController { orderShopDto.setShopId(shopDetail.getShopId()); orderShopDto.setShopName(shopDetail.getShopName()); + orderShopDto.setShopLogo(shopDetail.getShopLogo()); orderShopDto.setActualTotal(order.getActualTotal()); // orderShopDto.setUserAddrDto(userAddrDto); orderShopDto.setOrderItemDtos(orderItemList); @@ -96,6 +116,7 @@ public class MyOrderController { orderShopDto.setCreateTime(order.getCreateTime()); orderShopDto.setRemarks(order.getRemarks()); orderShopDto.setStatus(order.getStatus()); + orderShopDto.setOrderType(order.getOrderType()); double total = 0.0; Integer totalNum = 0; @@ -106,6 +127,32 @@ public class MyOrderController { orderShopDto.setTotal(total); orderShopDto.setTotalNum(totalNum); + //获取采购方信息,根据accountId查询 + UserAccount userAccount = platformTeamAccountMapper.selectAccountPlatform(order.getUserId()); + List userAccountList = platformTeamClassificationMapper.selectAccountList(userAccount.getAppOpenId()); + for (UserAccount account : userAccountList) { + if ("7".equals(account.getPlatformId())){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("account_id", account.getId()); + UserAuthenticationInformation userAuthenticationInformation = userAuthenticationInformationService.getOne(queryWrapper); + orderShopDto.setPhone(account.getPhone()); + orderShopDto.setPurchasingPerson(account.getAccount()); + if (userAuthenticationInformation!=null){ + orderShopDto.setPurchasingPerson(userAuthenticationInformation.getRealName()); + } + }else { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("open_id", account.getAppOpenId()); + EnterpriseCertification enterpriseCertification = enterpriseCertificationService.getOne(queryWrapper); + orderShopDto.setAuthentication("未认证"); + orderShopDto.setKindergarten(account.getAccount()); + if (enterpriseCertification!=null){ + orderShopDto.setAuthentication("已认证"); + orderShopDto.setKindergarten(enterpriseCertification.getCompanyName()); + } + } + } + return ServerResponseEntity.success(orderShopDto); } @@ -115,10 +162,17 @@ public class MyOrderController { */ @GetMapping("/myOrder") @ApiOperation(value = "根据订单状态获取订单列表信息,状态为0时获取所有订单 1:待付款 2:待发货 3:待收货 4:待评价 5:成功 6:失败") - public ServerResponseEntity> myOrder(@RequestParam(value = "status") Integer status, PageParam page) { - String userId = SecurityUtils.getCurrentInfo().getAccountId(); - IPage myOrderDtoIpage = myOrderService.pageMyOrderByUserIdAndStatus(page, userId, status); - return ServerResponseEntity.success(myOrderDtoIpage); + public ServerResponseEntity> myOrder(OrderPageReq orderParam) { + PageParam page = new PageParam<>(); + if (orderParam.getCurrent()!= null){ + page.setCurrent(orderParam.getCurrent()); + } + if (orderParam.getSize()!= null){ + page.setSize(orderParam.getSize()); + } + orderParam.setUserId(SecurityUtils.getCurrentInfo().getAccountId()); + IPage myOrderDtoPage = myOrderService.pageMyOrderByUserIdAndStatus(page,orderParam); + return ServerResponseEntity.success(myOrderDtoPage); } /** diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java index 7b294bb..fba9a08 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java @@ -10,7 +10,6 @@ package com.huoran.nakadai.controller; -import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; @@ -19,7 +18,6 @@ import cn.hutool.core.io.IoUtil; import cn.hutool.core.lang.Snowflake; import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelWriter; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.google.common.base.Objects; import com.huoran.common.exception.YamiShopBindException; import com.huoran.common.response.ServerResponseEntity; @@ -32,14 +30,12 @@ import com.huoran.nakadai.entity.app.param.SubmitOrderParam; import com.huoran.nakadai.entity.enums.OrderStatus; import com.huoran.nakadai.entity.model.Order; import com.huoran.nakadai.entity.model.OrderItem; -import com.huoran.nakadai.entity.model.UserAddr; import com.huoran.nakadai.entity.model.UserAddrOrder; import com.huoran.nakadai.entity.param.DeliveryOrderParam; import com.huoran.nakadai.event.ConfirmOrderEvent; import com.huoran.nakadai.service.*; import com.huoran.nakadai.utils.Arith; -import com.huoran.nakadai.utils.PageParam; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -59,7 +55,6 @@ import java.util.Arrays; import java.util.Date; import java.util.List; -import static com.huoran.nakadai.utils.SpringContextUtils.applicationContext; /** * @author lgh on 2018/09/15. @@ -97,6 +92,7 @@ public class OrderController { // 组装获取用户提交的购物车商品项 List shopCartItems = basketService.getShopCartItemsByOrderItems(orderParam.getBasketIds(),orderParam.getOrderItem(),userId); +// List shopCartItems = basketService.getShopCartItems(userId); if (CollectionUtil.isEmpty(shopCartItems)) { throw new YamiShopBindException("请选择您需要的商品加入购物车"); @@ -229,18 +225,6 @@ public class OrderController { return ServerResponseEntity.success(new OrderNumbersDto(orderNumbers.toString())); } - /** - * 分页获取 - */ -// @GetMapping("/page") -// @ApiOperation(value = "商机线索列表") -// public ServerResponseEntity> page(OrderParam orderParam, PageParam page, HttpServletRequest request) { -// Integer shopId = TokenUtils.getShopIdByJwtToken(request); -// orderParam.setShopId(SecurityUtils.getCurrentInfo().getShopId()); -// IPage orderPage = orderService.pageOrdersDetailByOrderParam(page, orderParam); -// return ServerResponseEntity.success(orderPage); -// } - /** * 获取信息 */ diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformOrderController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformOrderController.java index d47593c..e6f615b 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformOrderController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformOrderController.java @@ -26,9 +26,11 @@ import com.huoran.common.utils.TokenUtils; import com.huoran.nakadai.entity.enums.OrderStatus; import com.huoran.nakadai.entity.model.Order; import com.huoran.nakadai.entity.model.OrderItem; +import com.huoran.nakadai.entity.model.Product; import com.huoran.nakadai.entity.model.UserAddrOrder; import com.huoran.nakadai.entity.param.DeliveryOrderParam; import com.huoran.nakadai.entity.param.OrderParam; +import com.huoran.nakadai.entity.req.OrderPageReq; import com.huoran.nakadai.service.*; import com.huoran.nakadai.utils.PageParam; import io.swagger.annotations.Api; @@ -76,7 +78,14 @@ public class PlatformOrderController { */ @GetMapping("/page") @ApiOperation(value = "商机线索列表") - public ServerResponseEntity> page(OrderParam orderParam, PageParam page, HttpServletRequest request) { + public ServerResponseEntity> page(OrderPageReq orderParam) { + PageParam page = new PageParam<>(); + if (orderParam.getCurrent()!= null){ + page.setCurrent(orderParam.getCurrent()); + } + if (orderParam.getSize()!= null){ + page.setSize(orderParam.getSize()); + } orderParam.setShopId(SecurityUtils.getCurrentInfo().getShopId()); IPage orderPage = orderService.pageOrdersDetailByOrderParam(page, orderParam); return ServerResponseEntity.success(orderPage); diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java index 5454ffb..91a3476 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java @@ -14,14 +14,18 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.huoran.common.exception.YamiShopBindException; +import com.huoran.common.response.R; import com.huoran.common.response.ServerResponseEntity; import com.huoran.common.utils.TokenUtils; import com.huoran.nakadai.entity.model.Product; import com.huoran.nakadai.entity.model.Sku; import com.huoran.nakadai.entity.param.ProductParam; +import com.huoran.nakadai.entity.req.ProductPageReq; import com.huoran.nakadai.entity.res.PlatformTeamAccountResp; +import com.huoran.nakadai.entity.vo.ProductCount; import com.huoran.nakadai.service.BasketService; import com.huoran.nakadai.service.ProdTagReferenceService; import com.huoran.nakadai.service.ProductService; @@ -36,6 +40,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Objects; @@ -58,17 +63,41 @@ public class ProductController { @Autowired private BasketService basketService; + @GetMapping("/list") + @ApiOperation(value = "采购查询店铺中所有产品规则列表展示") + public ServerResponseEntity> list(@RequestParam("shopId") Integer shopId) { + List productList = productService.list( + new QueryWrapper().eq("shop_id", shopId).eq("status", 1)); + List skuList = new ArrayList<>(); + for (Product product : productList) { + List list = skuService.list(new QueryWrapper().eq("prod_id", product.getProdId()). + eq("is_delete", 0)); + for (Sku sku : list) { + sku.setProdName(product.getProdName()); + } + skuList.addAll(list); + } + return ServerResponseEntity.success(skuList); + } + @GetMapping("/page") @ApiOperation(value = "分页获取商品信息", response = Product.class) - public ServerResponseEntity> page(ProductParam product,HttpServletRequest request) { + public R page(ProductPageReq productPageReq, HttpServletRequest request) { PageParam page = new PageParam<>(); + if (productPageReq.getCurrent()!= null){ + page.setCurrent(productPageReq.getCurrent()); + } + if (productPageReq.getSize()!= null){ + page.setSize(productPageReq.getSize()); + } IPage products = productService.page(page, new LambdaQueryWrapper() - .like(StrUtil.isNotBlank(product.getProdName()), Product::getProdName, product.getProdName()) + .like(StrUtil.isNotBlank(productPageReq.getProdName()), Product::getProdName, productPageReq.getProdName()) .eq(Product::getShopId, TokenUtils.getShopIdByJwtToken(request)) - .eq(product.getStatus() != null, Product::getStatus, product.getStatus()) + .eq(productPageReq.getStatus() != null, Product::getStatus, productPageReq.getStatus()) .orderByDesc(Product::getPutawayTime)); - return ServerResponseEntity.success(products); + List productCount = productService.selectCount(TokenUtils.getShopIdByJwtToken(request)); + return R.ok().put("page", products).put("productCount", productCount); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderShopDto.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderShopDto.java index 8a350f1..3531356 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderShopDto.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/dto/OrderShopDto.java @@ -11,6 +11,7 @@ package com.huoran.nakadai.entity.app.dto; +import com.huoran.common.entity.UserAccount; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -33,6 +34,24 @@ public class OrderShopDto implements Serializable { @ApiModelProperty(value = "店铺id" , required = true) private Integer shopId; + @ApiModelProperty(value = "采购人" , hidden = true) + private String purchasingPerson; + + @ApiModelProperty(value = "采购人联系方式" , hidden = true) + private String phone; + + @ApiModelProperty(value = "幼儿园" , hidden = true) + private String kindergarten; + + @ApiModelProperty(value = "是否认证" , hidden = true) + private String authentication; + + @ApiModelProperty(value = "店铺logo" , hidden = true) + private String shopLogo; + + @ApiModelProperty(value = "订单类型:1为个人、2为组织") + private Integer orderType; + /** * 店铺名称 **/ diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderParam.java b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderParam.java index 4de7170..8cbee04 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderParam.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/app/param/OrderParam.java @@ -24,11 +24,11 @@ import java.util.List; public class OrderParam { - @ApiModelProperty(value = "购物车id 数组" ) + @ApiModelProperty(value = "购物车id 数组" ,hidden = true) private List basketIds; @ApiModelProperty(value = "立即购买时提交的商品项" ) - private OrderItemParam orderItem; + private List orderItem; // @ApiModelProperty(value = "地址ID,0为默认地址" ,required=true) // @NotNull(message = "地址不能为空") diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Order.java b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Order.java index cbd262f..6e36d03 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/model/Order.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/model/Order.java @@ -188,6 +188,18 @@ public class Order implements Serializable { @TableField(exist = false) private String shopName; + @TableField(exist = false) + private String content; + + @TableField(exist = false) + private String num; + + @TableField(exist = false) + private String purchasingPerson; + + @TableField(exist = false) + private String logo; + @TableField(exist = false) private List orderItems; diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/req/OrderPageReq.java b/nakadai/src/main/java/com/huoran/nakadai/entity/req/OrderPageReq.java new file mode 100644 index 0000000..c3c888d --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/OrderPageReq.java @@ -0,0 +1,28 @@ +package com.huoran.nakadai.entity.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class OrderPageReq { + + @ApiModelProperty(value = "每页大小,默认10") + private Integer size = 10; + + @ApiModelProperty(value = "当前页,默认1") + private Integer current = 1; + + @ApiModelProperty(value = "订单类型:1为个人、2为组织") + private Integer orderType; + + @ApiModelProperty(value = "查询条件") + private String queryCriteria; + + //商机线索查询店铺订单 + @ApiModelProperty(hidden = true) + private Integer shopId; + + //我的采购查询个人订单 + @ApiModelProperty(hidden = true) + private String userId; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java b/nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java new file mode 100644 index 0000000..142c662 --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java @@ -0,0 +1,21 @@ +package com.huoran.nakadai.entity.req; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +@Data +public class ProductPageReq { + + @ApiModelProperty(value = "每页大小,默认10") + private Integer size = 10; + + @ApiModelProperty(value = "当前页,默认1") + private Integer current = 1; + + @ApiModelProperty(value = "默认是0,表示上架, 2下架,3草稿,4审核") + private Integer status; + + @ApiModelProperty(value = "商品名称") + private String prodName; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/vo/ProductCount.java b/nakadai/src/main/java/com/huoran/nakadai/entity/vo/ProductCount.java new file mode 100644 index 0000000..5f3f83b --- /dev/null +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/vo/ProductCount.java @@ -0,0 +1,14 @@ +package com.huoran.nakadai.entity.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class ProductCount { + + @ApiModelProperty(value = "状态") + private Integer status; + + @ApiModelProperty(value = "数量") + private Integer count; +} diff --git a/nakadai/src/main/java/com/huoran/nakadai/listener/SubmitOrderListener.java b/nakadai/src/main/java/com/huoran/nakadai/listener/SubmitOrderListener.java index 34ce080..0807e61 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/listener/SubmitOrderListener.java +++ b/nakadai/src/main/java/com/huoran/nakadai/listener/SubmitOrderListener.java @@ -282,11 +282,11 @@ public class SubmitOrderListener { } if (sku.getStatus() != 1) { - throw new YamiShopBindException("商品[" + sku.getProdName() + "]已下架"); + throw new YamiShopBindException("商品[" + sku.getSkuName() + "]已下架"); } // -1为无限库存 if (sku.getStocks() != -1 && shopCartItem.getProdCount() > sku.getStocks()) { - throw new YamiShopBindException("商品:[" + sku.getProdName() + "]库存不足"); + throw new YamiShopBindException("商品:[" + sku.getSkuName() + "]库存不足"); } if (sku.getStocks() != -1) { diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/EnterpriseCertificationMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/EnterpriseCertificationMapper.java index ab75a9c..1020766 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/EnterpriseCertificationMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/EnterpriseCertificationMapper.java @@ -3,7 +3,7 @@ package com.huoran.nakadai.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.huoran.common.entity.UserAccount; -import com.huoran.nakadai.entity.EnterpriseCertification; +import com.huoran.common.entity.EnterpriseCertification; import com.huoran.nakadai.entity.UserInfo; import com.huoran.nakadai.entity.req.EnterpriseCertificationLIstReq; import org.apache.ibatis.annotations.Mapper; diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderMapper.java index 9572931..8e222dd 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/OrderMapper.java @@ -12,12 +12,15 @@ package com.huoran.nakadai.mapper; import cn.hutool.core.date.DateTime; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.huoran.nakadai.entity.app.dto.MyOrderDto; import com.huoran.nakadai.entity.app.dto.OrderCountData; import com.huoran.nakadai.entity.distribution.UserShoppingDataDto; import com.huoran.nakadai.entity.model.Order; import com.huoran.nakadai.entity.param.OrderParam; +import com.huoran.nakadai.entity.req.OrderPageReq; import com.huoran.nakadai.utils.PageAdapter; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -80,14 +83,14 @@ public interface OrderMapper extends BaseMapper { * @param orderParam 订单参数 * @return */ - List listOrdersDetailByOrderParam(@Param("adapter") PageAdapter adapter, @Param("orderParam") OrderParam orderParam); + List listOrdersDetailByOrderParam(@Param("adapter") PageAdapter adapter, @Param("orderParam") OrderPageReq orderParam); /** * 根据订单参数获取订单数 * @param orderParam * @return */ - Long countOrderDetail(@Param("orderParam") OrderParam orderParam); + Long countOrderDetail(@Param("orderParam") OrderPageReq orderParam); /** * 根据店铺id和用户id获取购买过的商品id列表 @@ -135,4 +138,7 @@ public interface OrderMapper extends BaseMapper { */ OrderCountData getOrderCount(String userId); + IPage listOrdersByOrderParam(Page orderPage,@Param("orderParam") OrderPageReq orderParam); + + IPage listOrdersByUserId(Page orderPage,@Param("orderParam") OrderPageReq orderParam); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ProductMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProductMapper.java index cac78a0..1315975 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/ProductMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ProductMapper.java @@ -17,6 +17,7 @@ import com.huoran.nakadai.entity.app.dto.ProductDto; import com.huoran.nakadai.entity.app.dto.TagProductDto; import com.huoran.nakadai.entity.dto.SearchProdDto; import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.entity.vo.ProductCount; import com.huoran.nakadai.utils.PageParam; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -129,4 +130,5 @@ public interface ProductMapper extends BaseMapper { */ IPage collectionProds(@Param("page") PageParam page, @Param("userId") String userId); + List selectCountByShopId(@Param("shopId")Integer shopIdByJwtToken); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/ShopDetailMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/ShopDetailMapper.java index 0dd3b48..6276687 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/ShopDetailMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/ShopDetailMapper.java @@ -12,9 +12,11 @@ package com.huoran.nakadai.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.huoran.nakadai.entity.model.ShopDetail; +import org.apache.ibatis.annotations.Mapper; /** * @author lanhai */ +@Mapper public interface ShopDetailMapper extends BaseMapper { } \ No newline at end of file diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/UserAuthenticationInformationMapper.java b/nakadai/src/main/java/com/huoran/nakadai/mapper/UserAuthenticationInformationMapper.java index c270fa7..313d7fd 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/UserAuthenticationInformationMapper.java +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/UserAuthenticationInformationMapper.java @@ -1,7 +1,7 @@ package com.huoran.nakadai.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.huoran.nakadai.entity.UserAuthenticationInformation; +import com.huoran.common.entity.UserAuthenticationInformation; import org.apache.ibatis.annotations.Mapper; /** diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EnterpriseCertificationMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EnterpriseCertificationMapper.xml index 6e37417..28b3082 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EnterpriseCertificationMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/EnterpriseCertificationMapper.xml @@ -17,7 +17,7 @@ - SELECT t.* FROM diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml index abef18d..1a22a3d 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml @@ -263,28 +263,39 @@ ON o.addr_order_id = uao.addr_order_id + + + + + + + + + + + + + + + + + + + + + + + + @@ -351,5 +362,105 @@ FROM tz_order o WHERE o.user_id =#{userId} + + diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProductMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProductMapper.xml index e0efbaf..a4cb6f3 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProductMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/ProductMapper.xml @@ -223,5 +223,10 @@ (SELECT uc.`prod_id` FROM tz_user_collection uc WHERE uc.user_id = #{userId}) + diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/BasketService.java b/nakadai/src/main/java/com/huoran/nakadai/service/BasketService.java index 8152e54..00a8cb5 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/BasketService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/BasketService.java @@ -107,6 +107,6 @@ public interface BasketService extends IService { * @param basketId 购物车id * @return 所有的商品购物项 */ - List getShopCartItemsByOrderItems(List basketId, OrderItemParam orderItem, String userId); + List getShopCartItemsByOrderItems(List basketId, List orderItem, String userId); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/EnterpriseCertificationService.java b/nakadai/src/main/java/com/huoran/nakadai/service/EnterpriseCertificationService.java index a117b7a..955e8c8 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/EnterpriseCertificationService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/EnterpriseCertificationService.java @@ -3,7 +3,7 @@ package com.huoran.nakadai.service; import com.baomidou.mybatisplus.extension.service.IService; import com.huoran.common.entity.UserAccount; import com.huoran.common.response.R; -import com.huoran.nakadai.entity.EnterpriseCertification; +import com.huoran.common.entity.EnterpriseCertification; import com.huoran.nakadai.entity.UserInfo; import com.huoran.nakadai.entity.req.EnterpriseCertificationLIstReq; diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/MyOrderService.java b/nakadai/src/main/java/com/huoran/nakadai/service/MyOrderService.java index 141ef4a..2a5bb14 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/MyOrderService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/MyOrderService.java @@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.huoran.nakadai.entity.app.dto.MyOrderDto; import com.huoran.nakadai.entity.model.Order; +import com.huoran.nakadai.entity.req.OrderPageReq; /** * 我的订单 @@ -24,10 +25,7 @@ public interface MyOrderService extends IService { /** * 通过用户id和订单状态分页获取订单信息 - * @param page 分页参数 - * @param userId 用户id - * @param status 订单状态 * @return */ - IPage pageMyOrderByUserIdAndStatus(Page page, String userId, Integer status); + IPage pageMyOrderByUserIdAndStatus(Page orderPage,OrderPageReq orderParam); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/OrderService.java b/nakadai/src/main/java/com/huoran/nakadai/service/OrderService.java index 3b33c2e..57dc601 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/OrderService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/OrderService.java @@ -18,6 +18,7 @@ import com.huoran.nakadai.entity.app.dto.OrderCountData; import com.huoran.nakadai.entity.app.dto.ShopCartOrderMergerDto; import com.huoran.nakadai.entity.model.Order; import com.huoran.nakadai.entity.param.OrderParam; +import com.huoran.nakadai.entity.req.OrderPageReq; import java.util.Date; @@ -105,7 +106,7 @@ public interface OrderService extends IService { * @param orderParam * @return */ - IPage pageOrdersDetailByOrderParam(Page page, OrderParam orderParam); + IPage pageOrdersDetailByOrderParam(Page page, OrderPageReq orderParam); /** * 删除订单 diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/ProductService.java b/nakadai/src/main/java/com/huoran/nakadai/service/ProductService.java index 355cc24..5f30882 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/ProductService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/ProductService.java @@ -17,6 +17,7 @@ import com.huoran.nakadai.entity.app.dto.ProductDto; import com.huoran.nakadai.entity.app.dto.TagProductDto; import com.huoran.nakadai.entity.dto.SearchProdDto; import com.huoran.nakadai.entity.model.Product; +import com.huoran.nakadai.entity.vo.ProductCount; import com.huoran.nakadai.utils.PageParam; @@ -115,4 +116,6 @@ public interface ProductService extends IService { * @return */ IPage collectionProds(PageParam page, String userId); + + List selectCount(Integer shopIdByJwtToken); } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/UserAuthenticationInformationService.java b/nakadai/src/main/java/com/huoran/nakadai/service/UserAuthenticationInformationService.java index 844a117..7456e0a 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/UserAuthenticationInformationService.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/UserAuthenticationInformationService.java @@ -1,7 +1,7 @@ package com.huoran.nakadai.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.huoran.nakadai.entity.UserAuthenticationInformation; +import com.huoran.common.entity.UserAuthenticationInformation; /** *

diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/BasketServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/BasketServiceImpl.java index c5ad9ff..67faf7c 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/BasketServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/BasketServiceImpl.java @@ -37,10 +37,7 @@ import org.springframework.cache.annotation.CacheEvict; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Service; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -165,40 +162,43 @@ public class BasketServiceImpl extends ServiceImpl impleme } @Override - public List getShopCartItemsByOrderItems(List basketId, OrderItemParam orderItem, String userId) { - if (orderItem == null && CollectionUtil.isEmpty(basketId)) { + public List getShopCartItemsByOrderItems(List basketId, List orderItemList, String userId) { + if (orderItemList == null && CollectionUtil.isEmpty(basketId)) { return Collections.emptyList(); } // 当立即购买时,没有提交的订单是没有购物车信息的 - if (CollectionUtil.isEmpty(basketId) && orderItem != null) { - - Sku sku = skuService.getSkuBySkuId(orderItem.getSkuId()); - if (sku == null) { - throw new RuntimeException("订单包含无法识别的商品"); - } - Product prod = productService.getProductByProdId(orderItem.getProdId()); - if (prod == null) { - throw new RuntimeException("订单包含无法识别的商品"); - } - - // 拿到购物车的所有item - ShopCartItemDto shopCartItemDto = new ShopCartItemDto(); - shopCartItemDto.setBasketId(-1); - shopCartItemDto.setSkuId(orderItem.getSkuId()); - shopCartItemDto.setProdCount(orderItem.getProdCount()); - shopCartItemDto.setProdId(orderItem.getProdId()); - shopCartItemDto.setSkuName(sku.getSkuName()); - shopCartItemDto.setPic(StrUtil.isBlank(sku.getPic())? prod.getPic() : sku.getPic()); - shopCartItemDto.setProdName(sku.getProdName()); - shopCartItemDto.setProductTotalAmount(Arith.mul(sku.getPrice(),orderItem.getProdCount())); - shopCartItemDto.setPrice(sku.getPrice()); + if (CollectionUtil.isEmpty(basketId) && orderItemList != null) { + List shopCartItemDtoList = new ArrayList<>(); + for (OrderItemParam orderItem : orderItemList) { + Sku sku = skuService.getSkuBySkuId(orderItem.getSkuId()); + if (sku == null) { + throw new RuntimeException("订单包含无法识别的商品"); + } + Product prod = productService.getProductByProdId(orderItem.getProdId()); + if (prod == null) { + throw new RuntimeException("订单包含无法识别的商品"); + } + + // 拿到购物车的所有item + ShopCartItemDto shopCartItemDto = new ShopCartItemDto(); + shopCartItemDto.setBasketId(-1); + shopCartItemDto.setSkuId(orderItem.getSkuId()); + shopCartItemDto.setProdCount(orderItem.getProdCount()); + shopCartItemDto.setProdId(orderItem.getProdId()); + shopCartItemDto.setSkuName(sku.getSkuName()); + shopCartItemDto.setPic(StrUtil.isBlank(sku.getPic())? prod.getPic() : sku.getPic()); + shopCartItemDto.setProdName(sku.getProdName()); + shopCartItemDto.setProductTotalAmount(Arith.mul(sku.getPrice(),orderItem.getProdCount())); + shopCartItemDto.setPrice(sku.getPrice()); // shopCartItemDto.setDistributionCardNo(orderItem.getDistributionCardNo()); - shopCartItemDto.setBasketDate(new Date()); - ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(orderItem.getShopId()); - shopCartItemDto.setShopId(shopDetail.getShopId()); - shopCartItemDto.setShopName(shopDetail.getShopName()); - return Collections.singletonList(shopCartItemDto); + shopCartItemDto.setBasketDate(new Date()); + ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(orderItem.getShopId()); + shopCartItemDto.setShopId(shopDetail.getShopId()); + shopCartItemDto.setShopName(shopDetail.getShopName()); + shopCartItemDtoList.add(shopCartItemDto); + } + return shopCartItemDtoList; } List dbShopCartItems = getShopCartItems(userId); diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java index 5a834fb..a5b2710 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/EnterpriseCertificationServiceImpl.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.huoran.common.entity.UserAccount; import com.huoran.common.response.R; -import com.huoran.nakadai.entity.EnterpriseCertification; +import com.huoran.common.entity.EnterpriseCertification; import com.huoran.nakadai.entity.UserInfo; import com.huoran.nakadai.entity.req.EnterpriseCertificationLIstReq; import com.huoran.nakadai.mapper.EnterpriseCertificationMapper; diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/MyOrderServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/MyOrderServiceImpl.java index e96d1fd..8dd2bc6 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/MyOrderServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/MyOrderServiceImpl.java @@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.huoran.nakadai.entity.app.dto.MyOrderDto; import com.huoran.nakadai.entity.model.Order; +import com.huoran.nakadai.entity.req.OrderPageReq; import com.huoran.nakadai.mapper.OrderMapper; import com.huoran.nakadai.service.MyOrderService; import com.huoran.nakadai.utils.PageAdapter; @@ -32,10 +33,8 @@ public class MyOrderServiceImpl extends ServiceImpl implemen private OrderMapper orderMapper; @Override - public IPage pageMyOrderByUserIdAndStatus(Page page, String userId, Integer status) { - page.setRecords(orderMapper.listMyOrderByUserIdAndStatus(new PageAdapter(page), userId, status)); - page.setTotal(orderMapper.countMyOrderByUserIdAndStatus(userId, status)); - return page; + public IPage pageMyOrderByUserIdAndStatus(Page orderPage,OrderPageReq orderParam) { + return orderMapper.listOrdersByUserId(orderPage, orderParam); } } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderServiceImpl.java index 39984db..245b067 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderServiceImpl.java @@ -21,6 +21,8 @@ import com.huoran.nakadai.entity.app.dto.ShopCartOrderMergerDto; import com.huoran.nakadai.entity.model.Order; import com.huoran.nakadai.entity.model.OrderItem; import com.huoran.nakadai.entity.param.OrderParam; +import com.huoran.nakadai.entity.req.OrderPageReq; +import com.huoran.nakadai.entity.res.GoodsRes; import com.huoran.nakadai.event.CancelOrderEvent; import com.huoran.nakadai.event.ReceiptOrderEvent; import com.huoran.nakadai.event.SubmitOrderEvent; @@ -155,10 +157,8 @@ public class OrderServiceImpl extends ServiceImpl implements } @Override - public IPage pageOrdersDetailByOrderParam(Page page, OrderParam orderParam) { - page.setRecords(orderMapper.listOrdersDetailByOrderParam(new PageAdapter(page), orderParam)); - page.setTotal(orderMapper.countOrderDetail(orderParam)); - return page; + public IPage pageOrdersDetailByOrderParam(Page orderPage, OrderPageReq orderParam) { + return orderMapper.listOrdersByOrderParam(orderPage, orderParam); } @Override diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProductServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProductServiceImpl.java index 608a645..1cb083d 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProductServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ProductServiceImpl.java @@ -22,6 +22,7 @@ import com.huoran.nakadai.entity.dto.SearchProdDto; import com.huoran.nakadai.entity.model.ProdTagReference; import com.huoran.nakadai.entity.model.Product; import com.huoran.nakadai.entity.model.Sku; +import com.huoran.nakadai.entity.vo.ProductCount; import com.huoran.nakadai.mapper.ProdTagReferenceMapper; import com.huoran.nakadai.mapper.ProductMapper; import com.huoran.nakadai.mapper.SkuMapper; @@ -197,5 +198,8 @@ public class ProductServiceImpl extends ServiceImpl impl return productMapper.collectionProds(page, userId); } - + @Override + public List selectCount(Integer shopIdByJwtToken) { + return baseMapper.selectCountByShopId(shopIdByJwtToken); + } } diff --git a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ShopDetailServiceImpl.java b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ShopDetailServiceImpl.java index f53792b..e1c58c2 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/service/impl/ShopDetailServiceImpl.java +++ b/nakadai/src/main/java/com/huoran/nakadai/service/impl/ShopDetailServiceImpl.java @@ -12,7 +12,9 @@ package com.huoran.nakadai.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huoran.nakadai.entity.PlatformTeamClassification; import com.huoran.nakadai.entity.model.ShopDetail; +import com.huoran.nakadai.mapper.PlatformTeamClassificationMapper; import com.huoran.nakadai.mapper.ShopDetailMapper; import com.huoran.nakadai.service.ShopDetailService; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +32,9 @@ public class ShopDetailServiceImpl extends ServiceImpl extends Page { /** * 每页显示条数,默认 10 */ -// @Schema(description = "每页大小,默认10") + @ApiModelProperty(value = "每页大小,默认10") private long size = 10; /** * 当前页 */ -// @Schema(description = "当前页,默认1") + @ApiModelProperty(value = "当前页,默认1") private long current = 1; /** * 查询数据列表 */ -// @Hidden + @ApiModelProperty(hidden = true) private List records; /** * 总数 @@ -44,20 +45,6 @@ public class PageParam extends Page { // @Hidden private long total = 0; - - /** - * 是否进行 count 查询 - */ - @JsonIgnore - private boolean isSearchCount = true; - - @JsonIgnore - private String countId; - @JsonIgnore - private Long maxLimit; - @JsonIgnore - private boolean optimizeCountSql; - @Override public List getRecords() { return this.records; @@ -80,20 +67,6 @@ public class PageParam extends Page { return this; } - @JsonIgnore - public boolean getSearchCount() { - if (total < 0) { - return false; - } - return isSearchCount; - } - -// @Override -// public Page setSearchCount(boolean isSearchCount) { -// this.isSearchCount = isSearchCount; -// return this; -// } - @Override public long getSize() { return this.size; From e9b7260197328abb27d667ff49fd1d162852e34d Mon Sep 17 00:00:00 2001 From: cheney <1251790704@qq.com> Date: Thu, 11 Jan 2024 10:54:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=99=90=E5=88=B6=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/huoran/nakadai/controller/OrderController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java index fba9a08..79deedf 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/OrderController.java @@ -232,9 +232,9 @@ public class OrderController { public ServerResponseEntity info(@PathVariable("orderNumber") String orderNumber,HttpServletRequest request) { Integer shopId = TokenUtils.getShopIdByJwtToken(request); Order order = orderService.getOrderByOrderNumber(orderNumber); - if (!Objects.equal(shopId, order.getShopId())) { - throw new YamiShopBindException("您没有权限获取该订单信息"); - } +// if (!Objects.equal(shopId, order.getShopId())) { +// throw new YamiShopBindException("您没有权限获取该订单信息"); +// } List orderItems = orderItemService.getOrderItemsByOrderNumber(orderNumber); order.setOrderItems(orderItems); // UserAddrOrder userAddrOrder = userAddrOrderService.getById(order.getAddrOrderId()); From b9bdd8500bcd364babc018425b9b2b48071ed01c Mon Sep 17 00:00:00 2001 From: cheney <1251790704@qq.com> Date: Thu, 11 Jan 2024 11:21:03 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9B=A2=E9=98=9F=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=90=8C=E6=AD=A5=EF=BC=8C=E5=9B=A2=E9=98=9F?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PlatformTeamAccountController.java | 2 ++ .../mapper/xml/PlatformTeamAccountMapper.xml | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java index 2582061..0d126a9 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/PlatformTeamAccountController.java @@ -28,6 +28,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpResponse; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.web.bind.annotation.*; @@ -246,6 +247,7 @@ public class PlatformTeamAccountController { @ApiOperation(value = "小程序团队信息维护") @PostMapping("/updateTeamInfo") + @CacheEvict(cacheNames = "shop_detail", key = "#teamInfo.id") public R updateTeamInfo(@RequestBody TeamInfo teamInfo) { PlatformTeamClassification platformTeamClassification = new PlatformTeamClassification(); BeanUtils.copyProperties(teamInfo, platformTeamClassification); diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml index 0dfa987..646f83b 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/PlatformTeamAccountMapper.xml @@ -126,6 +126,18 @@ AND ua.app_open_id = a.app_open_id AND ua.platform_id = 7 ) AS userName, + ( + SELECT + u.user_avatars + FROM + hr_user_account ua + INNER JOIN hr_user_info u ON u.user_id = ua.user_id + AND u.is_del = 0 + WHERE + ua.is_del = 0 + AND ua.app_open_id = a.app_open_id + AND ua.platform_id = 7 + ) AS userAvatars, u.last_login_time, u.login_number, a.work_number, @@ -136,7 +148,7 @@ pc.classification_name as teamName, pc.id as partnerClassificationId, pc.is_team, - u.user_avatars,pc.parent_id, + pc.parent_id, pc.create_time as joinTime, CASE WHEN count(ai.id) > 0 THEN '已认证'