From 23172bb8ba477ca466ff415a3ea3209377c5a440 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 7 May 2025 09:00:45 +0800 Subject: [PATCH 01/15] bug 5801 --- .../core/alloc/controller/AllocCanteenController.java | 4 ++-- .../core/alloc/controller/AllocStallController.java | 4 ++-- .../core/alloc/service/impl/AllocCanteenServiceImpl.java | 8 ++++---- .../core/alloc/service/impl/AllocStallServiceImpl.java | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenController.java index 1f5f064..4d41346 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocCanteenController.java @@ -83,7 +83,7 @@ public class AllocCanteenController extends BaseController { try { return toAjax(allocCanteenService.insertAllocCanteen(allocCanteen)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } @@ -99,7 +99,7 @@ public class AllocCanteenController extends BaseController { try { return toAjax(allocCanteenService.updateAllocCanteen(allocCanteen)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocStallController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocStallController.java index ffd4be9..2ec5200 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocStallController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/controller/AllocStallController.java @@ -83,7 +83,7 @@ public class AllocStallController extends BaseController { try { return toAjax(allocStallService.insertAllocStall(allocStall)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } @@ -99,7 +99,7 @@ public class AllocStallController extends BaseController { try { return toAjax(allocStallService.updateAllocStall(allocStall)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java index 51dd96b..5222ab5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenServiceImpl.java @@ -67,11 +67,11 @@ public class AllocCanteenServiceImpl implements IAllocCanteenService { try { AllocCanteen checkResult = allocCanteenMapper.selectAllocCanteenByCanteenName(allocCanteen); if (Objects.nonNull(checkResult)) { - throw new ServiceException("食堂名称已存在"); + throw new ServiceException("该区域食堂名称已存在"); } return allocCanteenMapper.insertAllocCanteen(allocCanteen); } catch (Exception e) { - throw new ServiceException("新增食堂异常," + e.getMessage()); + throw new ServiceException(e.getMessage()); } } @@ -90,11 +90,11 @@ public class AllocCanteenServiceImpl implements IAllocCanteenService { .filter(item -> item.getAreaId().equals(allocCanteen.getAreaId())) .map(AllocCanteen::getCanteenName).collect(Collectors.toList()); if (otherCanteenNameList.contains(allocCanteen.getCanteenName())) { - throw new ServiceException("食堂名称已存在"); + throw new ServiceException("该区域食堂名称已存在"); } return allocCanteenMapper.updateAllocCanteen(allocCanteen); } catch (Exception e) { - throw new ServiceException("更新食堂异常," + e.getMessage()); + throw new ServiceException(e.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocStallServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocStallServiceImpl.java index 2e1e9af..e8b033c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocStallServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocStallServiceImpl.java @@ -63,7 +63,7 @@ public class AllocStallServiceImpl implements IAllocStallService { try { AllocStall checkResult = allocStallMapper.selectAllocStallByStallName(allocStall); if (Objects.nonNull(checkResult)) { - throw new ServiceException("档口名称已存在"); + throw new ServiceException("该食堂档口名称已存在"); } int stallCount = allocStallMapper.insertAllocStall(allocStall); if (stallCount > 0 && !CollectionUtils.isEmpty(allocStall.getAllocStallMealtimeList())) { @@ -74,7 +74,7 @@ public class AllocStallServiceImpl implements IAllocStallService { } return stallCount; } catch (Exception e) { - throw new ServiceException("新增档口异常," + e.getMessage()); + throw new ServiceException(e.getMessage()); } } @@ -93,7 +93,7 @@ public class AllocStallServiceImpl implements IAllocStallService { .filter(item -> item.getCanteenId().equals(allocStall.getCanteenId())) .map(AllocStall::getStallName).collect(Collectors.toList()); if (otherStallNameList.contains(allocStall.getStallName())) { - throw new ServiceException("档口名称已存在"); + throw new ServiceException("该食堂档口名称已存在"); } int stallCount = allocStallMapper.updateAllocStall(allocStall); if (stallCount > 0 && !CollectionUtils.isEmpty(allocStall.getAllocStallMealtimeList())) { @@ -102,7 +102,7 @@ public class AllocStallServiceImpl implements IAllocStallService { } return stallCount; } catch (Exception e) { - throw new ServiceException("更新档口异常," + e.getMessage()); + throw new ServiceException(e.getMessage()); } } From 046f6250a58e891240998191a54cbc35fafa58ad Mon Sep 17 00:00:00 2001 From: gaowdong Date: Wed, 7 May 2025 09:39:40 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E6=B6=88=E8=B4=B9=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/account/constants/AccTradeTypeEnum.java | 11 +++++++++++ .../core/order/domain/OrderRefundHistoryVO.java | 6 ++++-- .../core/order/service/impl/OrderInfoServiceImpl.java | 9 ++++++++- .../bonus/canteen/core/pay/constants/PayTypeEnum.java | 8 ++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/constants/AccTradeTypeEnum.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/constants/AccTradeTypeEnum.java index 3d0a779..789b6c9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/constants/AccTradeTypeEnum.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/constants/AccTradeTypeEnum.java @@ -1,5 +1,7 @@ package com.bonus.canteen.core.account.constants; +import com.bonus.canteen.core.pay.constants.PayTypeEnum; + public enum AccTradeTypeEnum { RECHARGE(10, "充值"), SUBSIDY(20, "补贴"), @@ -23,4 +25,13 @@ public enum AccTradeTypeEnum { public String getDesc() { return this.desc; } + + public static String getDescByKey(Integer targetKey) { + for (AccTradeTypeEnum tradeType : AccTradeTypeEnum.values()) { + if (tradeType.getKey().equals(targetKey)) { + return tradeType.getDesc(); + } + } + return ""; + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderRefundHistoryVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderRefundHistoryVO.java index cf2b7fe..53537bc 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderRefundHistoryVO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderRefundHistoryVO.java @@ -14,11 +14,13 @@ public class OrderRefundHistoryVO implements Serializable { private Long orderId; private BigDecimal realAmount; private LocalDateTime payTime; - private String payType; + private Integer payType; + private String payTypeName; @JsonIgnore private Long tradeId; private BigDecimal actualAmount; - private String tradeType; + private Integer tradeType; + private String tradeTypeName; private LocalDateTime tradeTime; private String updateBy; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java index 07fe49e..892814e 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java @@ -245,7 +245,14 @@ public class OrderInfoServiceImpl implements IOrderInfoService @Override public List orderRefundHistory(OrderRefundHistoryParam param) { - return orderInfoMapper.orderRefundHistory(param); + List list = orderInfoMapper.orderRefundHistory(param); + if(CollUtil.isNotEmpty(list)) { + list.forEach(orderRefundHistoryVO -> { + orderRefundHistoryVO.setPayTypeName(PayTypeEnum.getDescByKey(orderRefundHistoryVO.getPayType())); + orderRefundHistoryVO.setTradeTypeName(AccTradeTypeEnum.getDescByKey(orderRefundHistoryVO.getTradeType())); + }); + } + return list; } @Override diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/pay/constants/PayTypeEnum.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/pay/constants/PayTypeEnum.java index 7381ec8..2dc5b91 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/pay/constants/PayTypeEnum.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/pay/constants/PayTypeEnum.java @@ -119,5 +119,13 @@ public enum PayTypeEnum { return this.desc; } + public static String getDescByKey(Integer targetKey) { + for (PayTypeEnum payType : PayTypeEnum.values()) { + if (payType.getKey().equals(targetKey)) { + return payType.getDesc(); + } + } + return ""; + } } From f7778e64e82b6d8e5867762488f94ed74c45496a Mon Sep 17 00:00:00 2001 From: gaowdong Date: Wed, 7 May 2025 10:50:44 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/controller/OrderInfoController.java | 2 ++ .../order/domain/param/OrderQueryParam.java | 24 +++++++++++++++++++ .../mapper/order/OrderInfoMapper.xml | 15 ++++++++++++ 3 files changed, 41 insertions(+) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/controller/OrderInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/controller/OrderInfoController.java index c9fbccf..ad6d5a8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/controller/OrderInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/controller/OrderInfoController.java @@ -70,6 +70,8 @@ public class OrderInfoController extends BaseController if(Objects.isNull(orderQueryParam) || CollUtil.isEmpty(orderQueryParam.getOrderTypeList())) { throw new ServiceException("订单类型不能为空"); } + orderQueryParam.setStartDateTime(orderQueryParam.getStartDate().atTime(0,0,0)); + orderQueryParam.setEndDateTime(orderQueryParam.getEndDate().atTime(23,59,59)); startPage(); List list = orderInfoService.selectOrderInfoList(orderQueryParam); return getDataTable(list); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java index b7048dd..42b2ae0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java @@ -1,13 +1,16 @@ package com.bonus.canteen.core.order.domain.param; +import com.alibaba.excel.util.StringUtils; import com.bonus.common.core.annotation.Excel; import com.bonus.common.core.web.domain.BaseEntity; +import com.bonus.common.houqin.utils.SM4EncryptUtils; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; import java.util.Date; @@ -52,6 +55,8 @@ public class OrderQueryParam implements Serializable /** 是否在线订单 1 是 2 否 */ private Integer isOnline; + private Long areaId; + /** 食堂id */ private Long canteenId; @@ -117,10 +122,29 @@ public class OrderQueryParam implements Serializable @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endDateTime; + @ApiModelProperty("开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate startDate; + + @ApiModelProperty("结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate endDate; + private String searchValue; + private String custSearchInfo; + + private String goodsSearchInfo; + + private String encryptedCustSearchValue; + public OrderQueryParam() { this.endDateTime = LocalDateTime.now().plusDays(7); this.startDateTime = LocalDateTime.now().minusDays(7); + this.endDate = LocalDate.now().plusDays(7); + this.startDate = LocalDate.now().minusDays(7); + if(StringUtils.isNotBlank(custSearchInfo)) { + this.encryptedCustSearchValue = SM4EncryptUtils.sm4Encrypt(custSearchInfo); + } } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml index da8d2b6..f91ee51 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml @@ -83,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and oi.source_type = #{sourceType} and oi.is_online = #{isOnline} and oi.canteen_id = #{canteenId} + and ac.area_id = #{areaId} and oi.canteen_id in @@ -148,6 +149,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and od.goods_name like concat('%', #{searchValue}, '%')) ) + + and ( + su.nick_name like CONCAT('%',#{custSearchInfo},'%') + or su.phonenumber = #{encryptedCustSearchValue} + or su.user_id like concat('%', #{custSearchInfo}, '%') + ) + + + and ( + EXISTS (select 1 from order_detail od + where oi.order_id = od.order_id + and od.goods_name like concat('%', #{goodsSearchInfo}, '%')) + ) + order by oi.create_time desc From 858e09c19897c85fb4ef6e4c478f6090e3ca465a Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 7 May 2025 11:10:57 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canteen/core/user/service/impl/UserAddrServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserAddrServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserAddrServiceImpl.java index cd2b2ca..e80d729 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserAddrServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/user/service/impl/UserAddrServiceImpl.java @@ -3,6 +3,7 @@ package com.bonus.canteen.core.user.service.impl; import java.util.List; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.houqin.utils.id.Id; import com.bonus.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,6 +55,7 @@ public class UserAddrServiceImpl implements IUserAddrService { public int insertUserAddr(UserAddr userAddr) { userAddr.setCreateTime(DateUtils.getNowDate()); userAddr.setUserId(SecurityUtils.getUserId()); + userAddr.setAddrId(Id.next()); try { return userAddrMapper.insertUserAddr(userAddr); } catch (Exception e) { From 535c92764ba7a464abd3efa329cbad5fb1dfd7b2 Mon Sep 17 00:00:00 2001 From: gaowdong Date: Wed, 7 May 2025 11:29:40 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/canteen/core/order/constants/OrderTypeEnum.java | 2 +- .../java/com/bonus/canteen/core/order/domain/OrderInfo.java | 6 ++++++ .../core/order/service/impl/OrderInfoServiceImpl.java | 2 ++ .../src/main/resources/mapper/order/OrderInfoMapper.xml | 5 ++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/constants/OrderTypeEnum.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/constants/OrderTypeEnum.java index c6603b1..c6d19ca 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/constants/OrderTypeEnum.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/constants/OrderTypeEnum.java @@ -4,7 +4,7 @@ public enum OrderTypeEnum { CURR_MEAL(1, "当餐点餐"), RESERVE_MEAL(2, "预订餐"), BOOK_MEAL(3, "自定义报餐"), - SHOP(4, "商城"), + SHOP(4, "商超"), RESERVE_SHOP(5, "预订商城"), ROOM(6, "包间"), TABLE(7, "餐桌"), diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderInfo.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderInfo.java index 5942266..b82d81f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderInfo.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/OrderInfo.java @@ -180,6 +180,12 @@ public class OrderInfo extends BaseEntity private String nickName; + private String phoneNumber; + + private String deptFullName; + + private String areaName; + List orderDetailList; public List of(OrderAddParam param) { diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java index 892814e..d6a0848 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java @@ -33,6 +33,7 @@ import com.bonus.common.core.utils.StringUtils; import com.bonus.common.houqin.constant.SourceTypeEnum; import com.bonus.common.houqin.mq.constant.LeMqConstant; import com.bonus.common.houqin.utils.JacksonUtil; +import com.bonus.common.houqin.utils.SM4EncryptUtils; import com.bonus.common.security.utils.SecurityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -119,6 +120,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService orderDetail.setOrderId(order.getOrderId()); List orderDetailList = orderDetailService.selectOrderDetailList(orderDetail); order.setOrderDetailList(orderDetailList); + order.setPhoneNumber(SM4EncryptUtils.sm4Decrypt(order.getPhoneNumber())); }); } return orderInfoList; diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml index f91ee51..73959fb 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml @@ -57,11 +57,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" oi.refund_amount, oi.order_time, oi.order_type, oi.order_state, oi.order_refund_state, oi.deduction_type, oi.pay_time, oi.pay_type, oi.pay_channel, oi.pay_state, oi.pay_param, oi.delivery_amount, oi.packing_amount, oi.delivery_type, oi.comment_state, oi.remark, - di.device_name, su.nick_name, oi.create_by, oi.create_time, oi.update_by, oi.update_time + di.device_name, su.nick_name, oi.create_by, oi.create_time, oi.update_by, oi.update_time, + su.phonenumber as phoneNumber, sd.dept_full_name, aa.area_name from order_info oi left join alloc_canteen ac on ac.canteen_id = oi.canteen_id left join alloc_stall ast on ast.stall_id = oi.stall_id + left join alloc_area aa on aa.area_id = ac.area_id left join sys_user su on oi.user_id = su.user_id + left join sys_dept sd on sd.dept_id = su.dept_id left join device_info di on oi.device_sn = di.device_sn From 6af64d586b13bc23809d566ccb2810a08846c097 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 7 May 2025 11:32:51 +0800 Subject: [PATCH 06/15] bug 5911 --- .../alloc/domain/AllocCanteenSuggestion.java | 3 --- .../AllocCanteenSuggestionServiceImpl.java | 8 +++++++ .../alloc/AllocCanteenSuggestionMapper.xml | 22 +++++++++---------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenSuggestion.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenSuggestion.java index 5d8559e..8b74637 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenSuggestion.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/domain/AllocCanteenSuggestion.java @@ -19,9 +19,6 @@ import com.bonus.common.core.web.domain.BaseEntity; public class AllocCanteenSuggestion extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键自增 */ - private Long id; - /** 投诉建议id */ @Excel(name = "投诉建议id") @ApiModelProperty(value = "投诉建议id") diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenSuggestionServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenSuggestionServiceImpl.java index 6961628..a4bdfc0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenSuggestionServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenSuggestionServiceImpl.java @@ -1,8 +1,11 @@ package com.bonus.canteen.core.alloc.service.impl; import java.util.List; + +import com.bonus.canteen.core.nutrition.common.enums.YesOrNoEnum; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; +import com.bonus.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bonus.canteen.core.alloc.mapper.AllocCanteenSuggestionMapper; @@ -51,6 +54,10 @@ public class AllocCanteenSuggestionServiceImpl implements IAllocCanteenSuggestio @Override public int insertAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) { allocCanteenSuggestion.setCreateTime(DateUtils.getNowDate()); + allocCanteenSuggestion.setCreateBy(SecurityUtils.getUsername()); + allocCanteenSuggestion.setUserId(SecurityUtils.getUserId()); + allocCanteenSuggestion.setSourceType(7L); + allocCanteenSuggestion.setReplyState(YesOrNoEnum.NO.key().longValue()); try { return allocCanteenSuggestionMapper.insertAllocCanteenSuggestion(allocCanteenSuggestion); } catch (Exception e) { @@ -67,6 +74,7 @@ public class AllocCanteenSuggestionServiceImpl implements IAllocCanteenSuggestio @Override public int updateAllocCanteenSuggestion(AllocCanteenSuggestion allocCanteenSuggestion) { allocCanteenSuggestion.setUpdateTime(DateUtils.getNowDate()); + allocCanteenSuggestion.setUpdateBy(SecurityUtils.getUsername()); try { return allocCanteenSuggestionMapper.updateAllocCanteenSuggestion(allocCanteenSuggestion); } catch (Exception e) { diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenSuggestionMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenSuggestionMapper.xml index 5f8e2b1..bd9601c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenSuggestionMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/alloc/AllocCanteenSuggestionMapper.xml @@ -4,7 +4,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - @@ -22,7 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, complaint_id, user_id, content, canteen_id, complaint_picture, source_type, mobile, reply_content, revision, reply_state, create_by, create_time, update_by, update_time from alloc_canteen_suggestion + select complaint_id, user_id, content, canteen_id, complaint_picture, source_type, mobile, + reply_content, revision, reply_state, create_by, create_time, update_by, update_time + from alloc_canteen_suggestion - where id = #{id} + where complaint_id = #{complaintId} - + insert into alloc_canteen_suggestion - complaint_id, user_id, content, canteen_id, @@ -65,7 +65,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time, - #{complaintId}, #{userId}, #{content}, #{canteenId}, @@ -85,7 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update alloc_canteen_suggestion - complaint_id = #{complaintId}, user_id = #{userId}, content = #{content}, canteen_id = #{canteenId}, @@ -100,17 +98,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, - where id = #{id} + where complaint_id = #{complaintId} - delete from alloc_canteen_suggestion where id = #{id} + delete from alloc_canteen_suggestion where complaint_id = #{complaintId} - delete from alloc_canteen_suggestion where id in - - #{id} + delete from alloc_canteen_suggestion where complaint_id in + + #{complaintId} \ No newline at end of file From c6b930ffbe04107afdd294b7e2b0cca0fd89ba1a Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 7 May 2025 12:07:18 +0800 Subject: [PATCH 07/15] bug 5908 --- .../alloc/service/impl/AllocCanteenEvaluateServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenEvaluateServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenEvaluateServiceImpl.java index 4bd41b4..5603821 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenEvaluateServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/alloc/service/impl/AllocCanteenEvaluateServiceImpl.java @@ -52,6 +52,9 @@ public class AllocCanteenEvaluateServiceImpl implements IAllocCanteenEvaluateSer @Override public int insertAllocCanteenEvaluate(AllocCanteenEvaluate allocCanteenEvaluate) { allocCanteenEvaluate.setCreateTime(DateUtils.getNowDate()); + allocCanteenEvaluate.setCreateBy(SecurityUtils.getUsername()); + allocCanteenEvaluate.setUserId(SecurityUtils.getUserId()); + allocCanteenEvaluate.setEvaluateDate(DateUtils.getNowDate()); try { return allocCanteenEvaluateMapper.insertAllocCanteenEvaluate(allocCanteenEvaluate); } catch (Exception e) { @@ -68,6 +71,7 @@ public class AllocCanteenEvaluateServiceImpl implements IAllocCanteenEvaluateSer @Override public int updateAllocCanteenEvaluate(AllocCanteenEvaluate allocCanteenEvaluate) { allocCanteenEvaluate.setUpdateTime(DateUtils.getNowDate()); + allocCanteenEvaluate.setUpdateBy(SecurityUtils.getUsername()); try { return allocCanteenEvaluateMapper.updateAllocCanteenEvaluate(allocCanteenEvaluate); } catch (Exception e) { From 440ff09a8b9ac25d90fbd6062834c7bb949e4ff8 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 7 May 2025 12:24:52 +0800 Subject: [PATCH 08/15] bug 5902 --- .../canteen/core/account/mapper/AccCardMapper.java | 2 ++ .../account/service/impl/AccCardServiceImpl.java | 14 ++++++++++++-- .../resources/mapper/account/AccCardMapper.xml | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/mapper/AccCardMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/mapper/AccCardMapper.java index 65a4b0a..392c49f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/mapper/AccCardMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/mapper/AccCardMapper.java @@ -13,6 +13,8 @@ public interface AccCardMapper { public int selectAccCardCountByUserId(Long userId); + public int selectAccCardCountByCardSerialNum(String serialNum); + /** * 查询人员卡片资料 * diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccCardServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccCardServiceImpl.java index 04d84ab..23ae389 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccCardServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccCardServiceImpl.java @@ -78,10 +78,15 @@ public class AccCardServiceImpl implements IAccCardService { accCard.setUserId(accInfo.getUserId()); accCard.setCardStatus(CardStatusEnum.NORMAL.getKey()); accCard.setCardType(CardTypeEnum.IC_CARD.getKey()); - // 发卡前校验是否卡已存在, 已退卡的可以再发放 + // 发卡前校验是否此用户已有卡, 已退卡、已过期的可以再发放 int cardCountByUserId= accCardMapper.selectAccCardCountByUserId(accInfo.getUserId()); if (cardCountByUserId > 0) { - throw new ServiceException("用户(user_id=" + accInfo.getUserId() + ")已有卡, 不能再次发放"); + throw new ServiceException("此用户已有卡, 不能再次发放"); + } + // 发卡前校验是否卡号已存在, 卡号不能重复 + int cardCountByCardSerialNum= accCardMapper.selectAccCardCountByCardSerialNum(accCard.getSerialNum()); + if (cardCountByCardSerialNum > 0) { + throw new ServiceException("卡号已存在, 卡号不能重复"); } int count = accCardMapper.insertAccCard(accCard); saveAccCardChangeRecord(accCard); @@ -131,6 +136,11 @@ public class AccCardServiceImpl implements IAccCardService { accCard.setUpdateBy(SecurityUtils.getUsername()); accCard.setUpdateTime(DateUtils.getNowDate()); try { + // 发卡前校验是否卡号已存在, 卡号不能重复 + int cardCountByCardSerialNum= accCardMapper.selectAccCardCountByCardSerialNum(accCard.getSerialNum()); + if (cardCountByCardSerialNum > 0) { + throw new ServiceException("卡号已存在, 卡号不能重复"); + } AccInfo accInfo = accInfoMapper.selectAccInfoById(accCard.getAccId()); checkAccInfoAndStatus(accInfo); int count = accCardMapper.updateAccCard(accCard); diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccCardMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccCardMapper.xml index 8fdcc1b..0b2866d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccCardMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccCardMapper.xml @@ -70,6 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where user_id = #{userId} and card_status in (1,4,5) + + - select count(1) from acc_card where serial_num = #{serialNum} From 03322a3ffc83e9a6f25a9e97345d8e192b950da5 Mon Sep 17 00:00:00 2001 From: gaowdong Date: Wed, 7 May 2025 13:46:09 +0800 Subject: [PATCH 10/15] =?UTF-8?q?5912=20H5=E9=A2=84=E8=AE=A2=E9=A4=90?= =?UTF-8?q?=E4=B8=AD=E4=BC=91=E6=81=AF=E7=9A=84=E6=A1=A3=E5=8F=A3=E4=B9=9F?= =?UTF-8?q?=E8=83=BD=E4=B8=8B=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OrderInfoServiceImpl.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java index d6a0848..a522791 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/service/impl/OrderInfoServiceImpl.java @@ -12,6 +12,8 @@ import com.bonus.canteen.core.account.service.IAccInfoService; import com.bonus.canteen.core.account.service.IAccTradeService; import com.bonus.canteen.core.account.service.IAccWalletInfoService; import com.bonus.canteen.core.account.utils.AccRedisUtils; +import com.bonus.canteen.core.alloc.domain.AllocStall; +import com.bonus.canteen.core.alloc.service.IAllocStallService; import com.bonus.canteen.core.common.utils.MqUtil; import com.bonus.canteen.core.common.utils.RedisUtil; import com.bonus.canteen.core.order.business.OrderBusiness; @@ -30,6 +32,7 @@ import com.bonus.canteen.core.user.domain.DeviceMqPersonalUpdateMessageDTO; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.StringUtils; +import com.bonus.common.houqin.constant.DelFlagEnum; import com.bonus.common.houqin.constant.SourceTypeEnum; import com.bonus.common.houqin.mq.constant.LeMqConstant; import com.bonus.common.houqin.utils.JacksonUtil; @@ -70,6 +73,8 @@ public class OrderInfoServiceImpl implements IOrderInfoService private OrderBusiness orderBusiness; @Autowired private IAccWalletInfoService accWalletInfoService; + @Autowired + private IAllocStallService allocStallService; /** * 查询订单 @@ -137,6 +142,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService AccInfoDetailsVO accInfoVO = this.accInfoService.queryAccInfoByUserId(orderAddParam.getUserId()); accInfoService.checkAccStatus(accInfoVO); List canteenOrderInfoList = new OrderInfo().of(orderAddParam); + checkStallStatus(canteenOrderInfoList); checkOrdersTotalAmount(canteenOrderInfoList, orderAddParam.getRealAmount()); List orderInfoList = orderBusiness.orderPlaceHandler(canteenOrderInfoList); try { @@ -161,6 +167,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService AccInfoDetailsVO accInfoVO = this.accInfoService.queryAccInfoByUserId(orderAddParam.getUserId()); accInfoService.checkAccStatus(accInfoVO); List canteenOrderInfoList = new OrderInfo().of(orderAddParam); + checkStallStatus(canteenOrderInfoList); checkDeviceOrderExisting(canteenOrderInfoList); checkOrdersTotalAmount(canteenOrderInfoList, orderAddParam.getRealAmount()); List orderInfoList = orderBusiness.orderPlaceHandler(canteenOrderInfoList); @@ -213,6 +220,25 @@ public class OrderInfoServiceImpl implements IOrderInfoService } } + private void checkStallStatus(List orderInfoList) { + if(CollUtil.isEmpty(orderInfoList)) { + throw new ServiceException("订单不能为空"); + } + for(OrderInfo orderInfo : orderInfoList) { + if(orderInfo.getIsOnline() == 1) { + AllocStall allocStall = allocStallService.selectAllocStallByStallId(orderInfo.getStallId()); + if(Objects.isNull(allocStall) || DelFlagEnum.DEL_TRUE.key().toString().equals(allocStall.getDelFlag())) { + throw new ServiceException("档口不存在"); + } + if(1 == allocStall.getBusinessState()) { + throw new ServiceException("档口已休息"); + } + + } + } + + } + @Override public void pay(Long orderId) { if(Objects.isNull(orderId) || orderId <= 0) { From 44863a71d587840a8e6a4284f3d6dbdb091f5bd9 Mon Sep 17 00:00:00 2001 From: gaowdong Date: Wed, 7 May 2025 14:19:43 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=94=B6=E6=94=AF?= =?UTF-8?q?=E6=B1=87=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/report/AccReportMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/AccReportMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/AccReportMapper.xml index dc4aa29..520496e 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/AccReportMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/AccReportMapper.xml @@ -132,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" b.phonenumber, b.dept_id, b.dept_name, + b.dept_full_name, b.nick_name, c.wallet_bal_user as wallet_bal, c.wallet_bal_user as wallet_bal_now, From ebb4d734c59176f67b80a18c8fc21bc05c21c5be Mon Sep 17 00:00:00 2001 From: gaowdong Date: Wed, 7 May 2025 16:49:17 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E8=B4=A6=E6=88=B7=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=8F=8A=E8=B6=85=E5=B8=82=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AccTradeController.java | 15 ++ .../param/AccConsumeDetailQueryParam.java | 29 ++++ .../account/domain/vo/AccConsumeDetailVO.java | 67 +++++++++ .../core/account/mapper/AccTradeMapper.java | 5 + .../account/service/IAccTradeService.java | 5 + .../service/impl/AccTradeServiceImpl.java | 8 + .../controller/SupermarketInfoController.java | 20 +++ .../domain/ShopOrderQueryParam.java | 137 ++++++++++++++++++ .../mapper/account/AccTradeMapper.xml | 56 +++++++ 9 files changed, 342 insertions(+) create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccConsumeDetailQueryParam.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/vo/AccConsumeDetailVO.java create mode 100644 bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/ShopOrderQueryParam.java diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/controller/AccTradeController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/controller/AccTradeController.java index 9c50462..76fac5a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/controller/AccTradeController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/controller/AccTradeController.java @@ -2,6 +2,8 @@ package com.bonus.canteen.core.account.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.bonus.canteen.core.account.domain.param.AccConsumeDetailQueryParam; import com.bonus.common.log.enums.OperaType; import com.bonus.canteen.core.common.annotation.PreventRepeatSubmit; import io.swagger.annotations.Api; @@ -116,4 +118,17 @@ public class AccTradeController extends BaseController { public AjaxResult remove(@PathVariable Long[] tradeIds) { return toAjax(accTradeService.deleteAccTradeByTradeIds(tradeIds)); } + + /** + * 账户消费记录 + */ + @ApiOperation(value = "账户消费记录") + //@PreventRepeatSubmit + //@RequiresPermissions("account:trade:remove") + @SysLog(title = "账户消费记录", businessType = OperaType.QUERY, logType = 1,module = "账户->账户消费记录") + @PostMapping("/consume/detail") + public TableDataInfo consumeDetail(@RequestBody AccConsumeDetailQueryParam param) { + startPage(); + return getDataTable(accTradeService.queryAccConsumeDetail(param)); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccConsumeDetailQueryParam.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccConsumeDetailQueryParam.java new file mode 100644 index 0000000..d04236c --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/param/AccConsumeDetailQueryParam.java @@ -0,0 +1,29 @@ +package com.bonus.canteen.core.account.domain.param; + +import com.bonus.common.core.web.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class AccConsumeDetailQueryParam extends BaseEntity { + @ApiModelProperty("查询组织id集合") + private List deptIdList; + @ApiModelProperty("开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startDateTime; + @ApiModelProperty("结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endDateTime; + @ApiModelProperty("交易类型") + private Integer tradeType; + private Integer walletId; + private String searchValue; + public AccConsumeDetailQueryParam() { + this.endDateTime = LocalDateTime.now().plusDays(7); + this.startDateTime = LocalDateTime.now().minusDays(7); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/vo/AccConsumeDetailVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/vo/AccConsumeDetailVO.java new file mode 100644 index 0000000..66eda63 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/domain/vo/AccConsumeDetailVO.java @@ -0,0 +1,67 @@ +package com.bonus.canteen.core.account.domain.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Data +public class AccConsumeDetailVO implements Serializable { + private Long tradeId; + + /** + * 用户ID + */ + private Long userId; + + /** + * 用户昵称 + */ + private String nickName; + + /** + * 部门全名 + */ + private String deptFullName; + + /** + * 用户类型 + */ + private Integer userType; + + /** + * 支付时间 + */ + private LocalDateTime payTime; + + /** + * 下单时间 + */ + private LocalDateTime orderTime; + + /** + * 交易类型 + */ + private Integer tradeType; + + /** + * 钱包ID + */ + private Long walletId; + + /** + * 金额 + */ + private BigDecimal amount; + + /** + * 钱包余额 + */ + private BigDecimal walletBal; + + /** + * 来源类型 + */ + private Integer sourceType; +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/mapper/AccTradeMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/mapper/AccTradeMapper.java index a056d31..6fd57eb 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/mapper/AccTradeMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/mapper/AccTradeMapper.java @@ -3,7 +3,9 @@ package com.bonus.canteen.core.account.mapper; import java.util.List; import com.bonus.canteen.core.account.domain.AccTrade; import com.bonus.canteen.core.account.domain.bo.TradeAndWallerInfo; +import com.bonus.canteen.core.account.domain.param.AccConsumeDetailQueryParam; import com.bonus.canteen.core.account.domain.param.AccWalletOperationQueryParam; +import com.bonus.canteen.core.account.domain.vo.AccConsumeDetailVO; import com.bonus.canteen.core.account.domain.vo.AccOperationListVO; import com.bonus.canteen.core.account.domain.vo.AccTradeVo; import org.apache.ibatis.annotations.Param; @@ -74,4 +76,7 @@ public interface AccTradeMapper { List queryTradeAndWallerInfoByOrderNo(@Param("orderNo") String orderNo, @Param("accTradeType") Integer accTradeType); + + List queryAccConsumeDetail(@Param("param") AccConsumeDetailQueryParam param, + @Param("encryptedSearchValue") String encryptedSearchValue); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/IAccTradeService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/IAccTradeService.java index f8b653c..182f63d 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/IAccTradeService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/IAccTradeService.java @@ -3,9 +3,12 @@ package com.bonus.canteen.core.account.service; import com.bonus.canteen.core.account.constants.AccTradeTypeEnum; import com.bonus.canteen.core.account.domain.AccTrade; import com.bonus.canteen.core.account.domain.bo.TradeAndWallerInfo; +import com.bonus.canteen.core.account.domain.param.AccConsumeDetailQueryParam; import com.bonus.canteen.core.account.domain.param.AccWalletOperationQueryParam; +import com.bonus.canteen.core.account.domain.vo.AccConsumeDetailVO; import com.bonus.canteen.core.account.domain.vo.AccOperationListVO; import com.bonus.canteen.core.account.domain.vo.AccTradeVo; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -73,4 +76,6 @@ public interface IAccTradeService { List queryAccOperationList(AccWalletOperationQueryParam param); List queryTradeAndWallerInfoByOrderNo(String orderNo, AccTradeTypeEnum accTradeTypeEnum); + + List queryAccConsumeDetail(AccConsumeDetailQueryParam param); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java index 5baa338..e96c39f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/service/impl/AccTradeServiceImpl.java @@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollUtil; import com.bonus.canteen.core.account.constants.AccTradeTypeEnum; import com.bonus.canteen.core.account.domain.AccTrade; import com.bonus.canteen.core.account.domain.bo.TradeAndWallerInfo; +import com.bonus.canteen.core.account.domain.param.AccConsumeDetailQueryParam; import com.bonus.canteen.core.account.domain.param.AccWalletOperationQueryParam; +import com.bonus.canteen.core.account.domain.vo.AccConsumeDetailVO; import com.bonus.canteen.core.account.domain.vo.AccOperationListVO; import com.bonus.canteen.core.account.domain.vo.AccTradeVo; import com.bonus.canteen.core.account.mapper.AccTradeMapper; @@ -152,4 +154,10 @@ public class AccTradeServiceImpl implements IAccTradeService { public List queryTradeAndWallerInfoByOrderNo(String orderNo, AccTradeTypeEnum accTradeTypeEnum) { return accTradeMapper.queryTradeAndWallerInfoByOrderNo(orderNo, accTradeTypeEnum.getKey()); } + + @Override + public List queryAccConsumeDetail(AccConsumeDetailQueryParam param) { + String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(param.getSearchValue()); + return accTradeMapper.queryAccConsumeDetail(param, encryptedSearchValue); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketInfoController.java index d6b50e8..9c617ec 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketInfoController.java @@ -1,5 +1,9 @@ package com.bonus.canteen.core.supermarket.controller; +import com.bonus.canteen.core.order.domain.OrderInfo; +import com.bonus.canteen.core.order.domain.param.OrderQueryParam; +import com.bonus.canteen.core.order.service.IOrderInfoService; +import com.bonus.canteen.core.supermarket.domain.ShopOrderQueryParam; import com.bonus.canteen.core.supermarket.domain.SupermarketInfo; import com.bonus.canteen.core.supermarket.service.SupermarketInfoService; import com.bonus.common.core.utils.poi.ExcelUtil; @@ -10,10 +14,12 @@ import com.bonus.common.log.annotation.SysLog; import com.bonus.common.log.enums.OperaType; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.util.List; /** @@ -28,6 +34,8 @@ import java.util.List; public class SupermarketInfoController extends BaseController { @Autowired private SupermarketInfoService supermarketInfoService; + @Autowired + private IOrderInfoService orderInfoService; /** * @author jsk @@ -86,4 +94,16 @@ public class SupermarketInfoController extends BaseController { return toAjax(supermarketInfoService.deleteSupermarketInfoBySupermarketId(supermarketInfo)); } + @ApiOperation(value = "查询超市订单列表") + @PostMapping("/order/list") + public TableDataInfo orderList(@RequestBody @Valid ShopOrderQueryParam shopOrderQueryParam) { + startPage(); + shopOrderQueryParam.setStartDateTime(shopOrderQueryParam.getStartDate().atTime(0,0,0)); + shopOrderQueryParam.setEndDateTime(shopOrderQueryParam.getEndDate().atTime(23,59,59)); + OrderQueryParam orderQueryParam = new OrderQueryParam(); + BeanUtils.copyProperties(shopOrderQueryParam, orderQueryParam); + List list = orderInfoService.selectOrderInfoList(orderQueryParam); + return getDataTable(list); + } + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/ShopOrderQueryParam.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/ShopOrderQueryParam.java new file mode 100644 index 0000000..9303cd8 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/ShopOrderQueryParam.java @@ -0,0 +1,137 @@ +package com.bonus.canteen.core.supermarket.domain; + +import com.alibaba.excel.util.StringUtils; +import com.bonus.common.houqin.utils.SM4EncryptUtils; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +/** + * 订单对象 order_info + * + * @author ruoyi + * @date 2025-04-14 + */ + +@Data +public class ShopOrderQueryParam implements Serializable +{ + private static final long serialVersionUID = 1L; + + /** 设备订单号 */ + private String deviceOrderId; + + /** 设备sn */ + private String deviceSn; + + private Long orderId; + + private List orderIdList; + + private List deptIdList; + + /** 设备编号 */ + private String deviceNum; + + /** 人员编号 */ + private Long userId; + + /** 身份验证方式 1 刷卡 2 刷脸 3 扫码 */ + private Integer identityVerification; + + /** 订单来源类型 */ + private Integer sourceType; + + /** 是否在线订单 1 是 2 否 */ + private Integer isOnline; + + private Long areaId; + + /** 食堂id */ + private Long canteenId; + + private List canteenIdList; + + /** 档口id */ + private Long stallId; + + private List stallIdList; + + /** 餐次类型 1-早餐 2-午餐 3-晚餐 4-下午茶 5-夜宵 */ + private Integer mealtimeType; + + private List mealtimeTypeList; + + /** 订单日期 yyyy-MM-dd */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date orderDate; + + /** 下单时间 yyyy-MM-dd HH:mm:ss */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date orderTime; + + /** 订单类型 1 当餐 2 预订餐 3 报餐 4 商城 11 线下消费 12 自助餐 21 补扣 22 外部订单 */ + @NotNull(message = "订单类型不能为空") + private Integer orderType; + + private List orderTypeList; + + /** 订单状态 1 已下单 2 已完成 3 已取消 */ + private Integer orderState; + + private List orderStateList; + + /** 订单退款状态 1 未退单 2 已退单 3 部分退单 */ + private Integer orderRefundState; + + /** 扣款类型 1 下单扣款 2 核销扣款 */ + private Integer deductionType; + + /** 支付时间 yyyy-MM-dd HH:mm:ss */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date payTime; + + /** 支付方式 */ + private Integer payType; + + /** 支付渠道 */ + private Integer payChannel; + + /** 支付状态 1 待支付 2 支付中 3 支付成功 4 支付失败 5 支付取消 6 部分支付 */ + private Integer payState; + + private List payStateList; + + /** 评论状态 1 已评论 2 未评论 */ + private Integer commentState; + + @ApiModelProperty("开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startDateTime; + + @ApiModelProperty("结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endDateTime; + + @ApiModelProperty("开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate startDate; + + @ApiModelProperty("结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate endDate; + + private String custSearchInfo; + + public ShopOrderQueryParam() { + this.endDate = LocalDate.now().plusDays(7); + this.startDate = LocalDate.now().minusDays(7); + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccTradeMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccTradeMapper.xml index 7c47403..f296a98 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccTradeMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccTradeMapper.xml @@ -294,4 +294,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ate.trade_type = #{accTradeType} + + \ No newline at end of file From 3ae2dd7544809edf1b9262381b8a1610b09f2bce Mon Sep 17 00:00:00 2001 From: gaowdong Date: Wed, 7 May 2025 17:01:07 +0800 Subject: [PATCH 13/15] =?UTF-8?q?5901=20=E4=BA=A4=E6=98=93=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E6=A8=A1=E5=9D=97=E6=95=B0=E6=8D=AE=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E6=97=B6=E9=97=B4=E5=80=92=E5=BA=8F=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/report/TradeReportMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/TradeReportMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/TradeReportMapper.xml index 2526943..750a71c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/TradeReportMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/report/TradeReportMapper.xml @@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" or su.user_id like concat('%', #{param.searchValue}, '%') ) + order by at2.trade_time desc