From c72f3b14608d55bef0a5cedec8819ad5ef1312e4 Mon Sep 17 00:00:00 2001 From: liujiang <569804566@qq.com> Date: Thu, 17 Jul 2025 22:37:27 +0800 Subject: [PATCH] =?UTF-8?q?master=EF=BC=9A=E6=84=8F=E8=A7=81=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E5=8A=9F=E8=83=BD=20=E5=AE=8C=E5=96=84=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/xkt/FeedbackController.java | 58 ++++++++++++++ .../xkt/vo/feedback/FeedbackPageVO.java | 18 +++++ .../xkt/vo/feedback/FeedbackResVO.java | 25 ++++++ .../xkt/vo/feedback/FeedbackVO.java | 32 ++++++++ .../vo/userFavorite/UserFavoritePageVO.java | 2 +- .../vo/userSubscriptions/UserSubscPageVO.java | 6 ++ .../java/com/ruoyi/quartz/task/XktTask.java | 2 +- .../java/com/ruoyi/xkt/domain/Feedback.java | 34 ++++++++ .../ruoyi/xkt/dto/feedback/FeedbackDTO.java | 23 ++++++ .../xkt/dto/feedback/FeedbackPageDTO.java | 18 +++++ .../xkt/dto/feedback/FeedbackResDTO.java | 25 ++++++ .../userSubscriptions/UserSubscPageDTO.java | 4 + .../UserSubscPageResDTO.java | 7 ++ .../com/ruoyi/xkt/mapper/FeedbackMapper.java | 13 +++ .../ruoyi/xkt/service/IFeedbackService.java | 39 +++++++++ .../xkt/service/impl/FeedbackServiceImpl.java | 79 +++++++++++++++++++ .../service/impl/StoreProductServiceImpl.java | 6 +- .../impl/UserSubscriptionsServiceImpl.java | 11 ++- .../mapper/UserSubscriptionsMapper.xml | 28 ++++--- 19 files changed, 411 insertions(+), 19 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/FeedbackController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackPageVO.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackResVO.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackVO.java create mode 100644 xkt/src/main/java/com/ruoyi/xkt/domain/Feedback.java create mode 100644 xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackDTO.java create mode 100644 xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackPageDTO.java create mode 100644 xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackResDTO.java create mode 100644 xkt/src/main/java/com/ruoyi/xkt/mapper/FeedbackMapper.java create mode 100644 xkt/src/main/java/com/ruoyi/xkt/service/IFeedbackService.java create mode 100644 xkt/src/main/java/com/ruoyi/xkt/service/impl/FeedbackServiceImpl.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/FeedbackController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/FeedbackController.java new file mode 100644 index 000000000..6b77e221e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/FeedbackController.java @@ -0,0 +1,58 @@ +package com.ruoyi.web.controller.xkt; + +import cn.hutool.core.bean.BeanUtil; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.XktBaseController; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.page.Page; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.web.controller.xkt.vo.feedback.FeedbackPageVO; +import com.ruoyi.web.controller.xkt.vo.feedback.FeedbackResVO; +import com.ruoyi.web.controller.xkt.vo.feedback.FeedbackVO; +import com.ruoyi.web.controller.xkt.vo.notice.NoticeResVO; +import com.ruoyi.xkt.dto.feedback.FeedbackDTO; +import com.ruoyi.xkt.dto.feedback.FeedbackPageDTO; +import com.ruoyi.xkt.dto.feedback.FeedbackResDTO; +import com.ruoyi.xkt.service.IFeedbackService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * 意见反馈Controller + * + * @author ruoyi + * @date 2025-03-26 + */ +@Api(tags = "意见反馈") +@RestController +@RequiredArgsConstructor +@RequestMapping("/rest/v1/feedback") +public class FeedbackController extends XktBaseController { + + final IFeedbackService feedbackService; + + @ApiOperation(value = "新增意见反馈", httpMethod = "POST", response = R.class) + @Log(title = "新增意见反馈", businessType = BusinessType.INSERT) + @PostMapping("") + public R create(@Validated @RequestBody FeedbackVO feedbackVO) { + return success(feedbackService.create(BeanUtil.toBean(feedbackVO, FeedbackDTO.class))); + } + + @PreAuthorize("@ss.hasAnyRoles('admin,general_admin')") + @ApiOperation(value = "意见反馈列表", httpMethod = "POST", response = R.class) + @PostMapping("/page") + public R> page(@Validated @RequestBody FeedbackPageVO pageVO) { + return R.ok(feedbackService.page(BeanUtil.toBean(pageVO, FeedbackPageDTO.class))); + } + + @ApiOperation(value = "意见反馈详情", httpMethod = "PUT", response = R.class) + @GetMapping("/{id}") + public R getInfo(@PathVariable Long id) { + return R.ok(BeanUtil.toBean(feedbackService.getInfo(id), FeedbackResVO.class)); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackPageVO.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackPageVO.java new file mode 100644 index 000000000..c386752a0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackPageVO.java @@ -0,0 +1,18 @@ +package com.ruoyi.web.controller.xkt.vo.feedback; + +import com.ruoyi.web.controller.xkt.vo.BasePageVO; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author liujiang + * @version v1.0 + * @date 2025/3/27 15:12 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@ApiModel +public class FeedbackPageVO extends BasePageVO { + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackResVO.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackResVO.java new file mode 100644 index 000000000..4841b617b --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackResVO.java @@ -0,0 +1,25 @@ +package com.ruoyi.web.controller.xkt.vo.feedback; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @author liujiang + * @version v1.0 + * @date 2025/3/27 15:12 + */ +@ApiModel("消息返回数据") +@Data +@Accessors(chain = true) +public class FeedbackResVO { + + @ApiModelProperty(value = "ID") + private Long id; + @ApiModelProperty(value = "内容") + private String content; + @ApiModelProperty(value = "联系方式") + private String contract; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackVO.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackVO.java new file mode 100644 index 000000000..c4af24154 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/feedback/FeedbackVO.java @@ -0,0 +1,32 @@ +package com.ruoyi.web.controller.xkt.vo.feedback; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; +import javax.validation.constraints.Size; + +/** + * @author liujiang + * @version v1.0 + * @date 2025/3/27 15:12 + */ +@Data +@ApiModel +@JsonInclude(JsonInclude.Include.NON_NULL) +public class FeedbackVO { + + @ApiModelProperty(value = "用户反馈内容", required = true) + @Size(max = 200, message = "反馈内容不能超过200个字!") + @NotBlank(message = "反馈内容不能为空!") + private String content; + @ApiModelProperty(value = "用户反馈联系方式", required = true) + @Size(max = 20, message = "联系方式不能超过20个字!") + @NotBlank(message = "联系方式不能为空!") + @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系电话格式不正确,请输入有效的中国大陆手机号") + private String contact; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/userFavorite/UserFavoritePageVO.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/userFavorite/UserFavoritePageVO.java index 458622f92..162296bdb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/userFavorite/UserFavoritePageVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/userFavorite/UserFavoritePageVO.java @@ -22,7 +22,7 @@ import java.util.List; public class UserFavoritePageVO extends BasePageVO { @NotNull(message = "商品状态不可为空!") - @ApiModelProperty(value = "商品状态,在售传:2, 已失效传:4,5", required = true) + @ApiModelProperty(value = "商品状态,在售传:2, 已失效传:4,5, APP 传 2 4 5", required = true) private List statusList; @ApiModelProperty(value = "商品货号") private String prodArtNum; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/userSubscriptions/UserSubscPageVO.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/userSubscriptions/UserSubscPageVO.java index 28c7754e5..de3d2c051 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/userSubscriptions/UserSubscPageVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/xkt/vo/userSubscriptions/UserSubscPageVO.java @@ -7,6 +7,9 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + /** * @author liujiang * @version v1.0 @@ -20,5 +23,8 @@ public class UserSubscPageVO extends BasePageVO { @ApiModelProperty(value = "档口名称") private String storeName; + @NotNull(message = "查询来源不能为空!") + @ApiModelProperty(value = "查询来源", notes = "1 PC, 2 APP") + private Integer source; } diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/XktTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/XktTask.java index a77e58184..1154c44f5 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/XktTask.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/XktTask.java @@ -1516,7 +1516,7 @@ public class XktTask { // 新增一条档口消息通知 Notice notice = new Notice().setNoticeTitle(storeName + "商品上新啦!").setNoticeType(NoticeType.NOTICE.getValue()) .setNoticeContent(storeName + "上新了货号为: " + storeProd.getProdArtNum() + " 的商品!请及时关注!") - .setOwnerType(NoticeOwnerType.STORE.getValue()).setStoreId(storeProd.getStoreId()) + .setOwnerType(NoticeOwnerType.SYSTEM.getValue()).setStoreId(storeProd.getStoreId()) .setUserId(userId).setPerpetuity(NoticePerpetuityType.PERMANENT.getValue()); this.noticeMapper.insert(notice); final Date voucherDate = java.sql.Date.valueOf(LocalDate.now()); diff --git a/xkt/src/main/java/com/ruoyi/xkt/domain/Feedback.java b/xkt/src/main/java/com/ruoyi/xkt/domain/Feedback.java new file mode 100644 index 000000000..50356f81c --- /dev/null +++ b/xkt/src/main/java/com/ruoyi/xkt/domain/Feedback.java @@ -0,0 +1,34 @@ +package com.ruoyi.xkt.domain; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.ruoyi.common.core.domain.XktBaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 意见反馈 + * + * @author liujiang + * @date 2025-05-03 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class Feedback extends XktBaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 意见反馈ID + */ + @TableId + private Long id; + /** + * 反馈内容 + */ + private String content; + /** + * 联系方式 + */ + private String contact; + +} diff --git a/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackDTO.java b/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackDTO.java new file mode 100644 index 000000000..faa4b8d6a --- /dev/null +++ b/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackDTO.java @@ -0,0 +1,23 @@ +package com.ruoyi.xkt.dto.feedback; + +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author liujiang + * @version v1.0 + * @date 2025/3/27 15:12 + */ +@Data +@ApiModel +@JsonInclude(JsonInclude.Include.NON_NULL) +public class FeedbackDTO { + + @ApiModelProperty(value = "用户反馈内容") + private String content; + @ApiModelProperty(value = "用户反馈联系方式") + private String contact; + +} diff --git a/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackPageDTO.java b/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackPageDTO.java new file mode 100644 index 000000000..945b387fd --- /dev/null +++ b/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackPageDTO.java @@ -0,0 +1,18 @@ +package com.ruoyi.xkt.dto.feedback; + +import com.ruoyi.xkt.dto.BasePageDTO; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @author liujiang + * @version v1.0 + * @date 2025/3/27 15:12 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@ApiModel +public class FeedbackPageDTO extends BasePageDTO { + +} diff --git a/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackResDTO.java b/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackResDTO.java new file mode 100644 index 000000000..1d3cf8043 --- /dev/null +++ b/xkt/src/main/java/com/ruoyi/xkt/dto/feedback/FeedbackResDTO.java @@ -0,0 +1,25 @@ +package com.ruoyi.xkt.dto.feedback; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * @author liujiang + * @version v1.0 + * @date 2025/3/27 15:12 + */ +@ApiModel("消息返回数据") +@Data +@Accessors(chain = true) +public class FeedbackResDTO { + + @ApiModelProperty(value = "ID") + private Long id; + @ApiModelProperty(value = "内容") + private String content; + @ApiModelProperty(value = "联系方式") + private String contract; + +} diff --git a/xkt/src/main/java/com/ruoyi/xkt/dto/userSubscriptions/UserSubscPageDTO.java b/xkt/src/main/java/com/ruoyi/xkt/dto/userSubscriptions/UserSubscPageDTO.java index bb803570a..c383bada4 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/dto/userSubscriptions/UserSubscPageDTO.java +++ b/xkt/src/main/java/com/ruoyi/xkt/dto/userSubscriptions/UserSubscPageDTO.java @@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import javax.validation.constraints.NotBlank; + /** * @author liujiang * @version v1.0 @@ -18,5 +20,7 @@ public class UserSubscPageDTO extends BasePageDTO { @ApiModelProperty(value = "档口名称") private String storeName; + @ApiModelProperty(value = "查询来源", notes = "1 PC, 2 APP") + private Integer source; } diff --git a/xkt/src/main/java/com/ruoyi/xkt/dto/userSubscriptions/UserSubscPageResDTO.java b/xkt/src/main/java/com/ruoyi/xkt/dto/userSubscriptions/UserSubscPageResDTO.java index 713a02a07..92cff5bb5 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/dto/userSubscriptions/UserSubscPageResDTO.java +++ b/xkt/src/main/java/com/ruoyi/xkt/dto/userSubscriptions/UserSubscPageResDTO.java @@ -1,11 +1,14 @@ package com.ruoyi.xkt.dto.userSubscriptions; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; +import java.util.Date; + /** * @author liujiang * @version v1.0 @@ -33,6 +36,10 @@ public class UserSubscPageResDTO { private String qqAccount; @ApiModelProperty(value = "档口地址") private String storeAddress; + @ApiModelProperty(value = "档口状态") + private Integer storeDelFlag; + @ApiModelProperty(value = "关注日期") + private Long focusDays; @ApiModelProperty(value = "最近30天销售量") private Long last30DaysSaleQuantity; @ApiModelProperty(value = "最近7天新增商品数") diff --git a/xkt/src/main/java/com/ruoyi/xkt/mapper/FeedbackMapper.java b/xkt/src/main/java/com/ruoyi/xkt/mapper/FeedbackMapper.java new file mode 100644 index 000000000..26c0075f8 --- /dev/null +++ b/xkt/src/main/java/com/ruoyi/xkt/mapper/FeedbackMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.xkt.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.xkt.domain.Feedback; + +/** + * 意见反馈 数据层 + * + * @author ruoyi + */ +public interface FeedbackMapper extends BaseMapper { + +} diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/IFeedbackService.java b/xkt/src/main/java/com/ruoyi/xkt/service/IFeedbackService.java new file mode 100644 index 000000000..e76fb5e60 --- /dev/null +++ b/xkt/src/main/java/com/ruoyi/xkt/service/IFeedbackService.java @@ -0,0 +1,39 @@ +package com.ruoyi.xkt.service; + +import com.ruoyi.common.core.page.Page; +import com.ruoyi.xkt.dto.feedback.FeedbackDTO; +import com.ruoyi.xkt.dto.feedback.FeedbackPageDTO; +import com.ruoyi.xkt.dto.feedback.FeedbackResDTO; + +/** + * 意见反馈Service接口 + * + * @author ruoyi + * @date 2025-03-26 + */ +public interface IFeedbackService { + + /** + * 新增意见反馈 + * + * @param feedbackDTO 意见反馈入参 + * @return Integer + */ + Integer create(FeedbackDTO feedbackDTO); + + /** + * 意见反馈分页查询 + * + * @param pageDTO 分页查询入参 + * @return + */ + Page page(FeedbackPageDTO pageDTO); + + /** + * 获取意见反馈详情 + * + * @param id 意见反馈ID + * @return FeedbackResDTO + */ + FeedbackResDTO getInfo(Long id); +} diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/FeedbackServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/FeedbackServiceImpl.java new file mode 100644 index 000000000..355f7e14a --- /dev/null +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/FeedbackServiceImpl.java @@ -0,0 +1,79 @@ +package com.ruoyi.xkt.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.page.Page; +import com.ruoyi.xkt.domain.Feedback; +import com.ruoyi.xkt.dto.feedback.FeedbackDTO; +import com.ruoyi.xkt.dto.feedback.FeedbackPageDTO; +import com.ruoyi.xkt.dto.feedback.FeedbackResDTO; +import com.ruoyi.xkt.mapper.FeedbackMapper; +import com.ruoyi.xkt.service.IFeedbackService; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Optional; + +/** + * 意见反馈 服务层实现 + * + * @author ruoyi + */ +@Service +@RequiredArgsConstructor +public class FeedbackServiceImpl implements IFeedbackService { + + final FeedbackMapper feedbackMapper; + + /** + * 新增意见反馈 + * + * @param feedbackDTO 意见反馈入参 + * @return Integer + */ + @Override + @Transactional + public Integer create(FeedbackDTO feedbackDTO) { + Feedback feedback = BeanUtil.toBean(feedbackDTO, Feedback.class); + return this.feedbackMapper.insert(feedback); + } + + /** + * 意见反馈分页查询 + * + * @param pageDTO 分页查询入参 + * @return + */ + @Override + @Transactional(readOnly = true) + public Page page(FeedbackPageDTO pageDTO) { + PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize()); + List feedbackList = this.feedbackMapper.selectList(new LambdaQueryWrapper() + .eq(Feedback::getDelFlag, Constants.UNDELETED)); + return CollectionUtils.isEmpty(feedbackList) ? Page.empty(pageDTO.getPageSize(), pageDTO.getPageNum()) + : Page.convert(new PageInfo<>(feedbackList), BeanUtil.copyToList(feedbackList, FeedbackResDTO.class)); + } + + /** + * 获取意见反馈详情 + * + * @param id 意见反馈ID + * @return FeedbackResDTO + */ + @Override + @Transactional(readOnly = true) + public FeedbackResDTO getInfo(Long id) { + Feedback feedback = Optional.ofNullable(this.feedbackMapper.selectOne(new LambdaQueryWrapper() + .eq(Feedback::getId, id).eq(Feedback::getDelFlag, Constants.UNDELETED))) + .orElseThrow(() -> new RuntimeException("意见反馈不存在!")); + return BeanUtil.toBean(feedback, FeedbackResDTO.class); + } + + +} diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreProductServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreProductServiceImpl.java index 310bc3e3b..be2c823bd 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreProductServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/StoreProductServiceImpl.java @@ -1158,7 +1158,7 @@ public class StoreProductServiceImpl implements IStoreProductService { // 新增一条档口消息通知 Notice notice = new Notice().setNoticeTitle(storeName + "商品上新啦!").setNoticeType(NoticeType.NOTICE.getValue()) .setNoticeContent(storeName + "上新了货号为: " + storeProd.getProdArtNum() + " 的商品!请及时关注!") - .setOwnerType(NoticeOwnerType.STORE.getValue()).setStoreId(storeProd.getStoreId()) + .setOwnerType(NoticeOwnerType.SYSTEM.getValue()).setStoreId(storeProd.getStoreId()) .setUserId(userId).setPerpetuity(NoticePerpetuityType.PERMANENT.getValue()); this.noticeMapper.insert(notice); final Date voucherDate = java.sql.Date.valueOf(LocalDate.now()); @@ -1193,7 +1193,7 @@ public class StoreProductServiceImpl implements IStoreProductService { // 新增一条档口消息通知 Notice notice = new Notice().setNoticeTitle(storeName + "商品更新啦!").setNoticeType(NoticeType.NOTICE.getValue()) .setNoticeContent(storeName + "更新了货号为: " + storeProd.getProdArtNum() + " 的商品!请及时关注!") - .setOwnerType(NoticeOwnerType.STORE.getValue()).setStoreId(storeProd.getStoreId()) + .setOwnerType(NoticeOwnerType.SYSTEM.getValue()).setStoreId(storeProd.getStoreId()) .setUserId(userId).setPerpetuity(NoticePerpetuityType.PERMANENT.getValue()); this.noticeMapper.insert(notice); final Date voucherDate = java.sql.Date.valueOf(LocalDate.now()); @@ -1233,7 +1233,7 @@ public class StoreProductServiceImpl implements IStoreProductService { // 新增一条档口消息通知 Notice notice = new Notice().setNoticeType(NoticeType.NOTICE.getValue()).setUserId(userId) .setPerpetuity(NoticePerpetuityType.PERMANENT.getValue()) - .setOwnerType(NoticeOwnerType.STORE.getValue()).setStoreId(storeProd.getStoreId()) + .setOwnerType(NoticeOwnerType.SYSTEM.getValue()).setStoreId(storeProd.getStoreId()) .setNoticeTitle(ObjectUtils.isNotEmpty(store) ? store.getStoreName() : "" + "商品" + (offSale ? "下架" : "重新上架") + "啦!") .setNoticeContent(ObjectUtils.isNotEmpty(store) ? store.getStoreName() : "" + (offSale ? "下架" : "重新上架") + "了货号为: " + storeProd.getProdArtNum() + " 的商品!请及时关注!"); diff --git a/xkt/src/main/java/com/ruoyi/xkt/service/impl/UserSubscriptionsServiceImpl.java b/xkt/src/main/java/com/ruoyi/xkt/service/impl/UserSubscriptionsServiceImpl.java index 99810d3dd..e7246e917 100644 --- a/xkt/src/main/java/com/ruoyi/xkt/service/impl/UserSubscriptionsServiceImpl.java +++ b/xkt/src/main/java/com/ruoyi/xkt/service/impl/UserSubscriptionsServiceImpl.java @@ -131,12 +131,19 @@ public class UserSubscriptionsServiceImpl implements IUserSubscriptionsService { @Transactional(readOnly = true) public Page page(UserSubscPageDTO pageDTO) { // 获取当前登录用户 - LoginUser loginUser = SecurityUtils.getLoginUser(); + Long userId = SecurityUtils.getUserIdSafe(); + if (ObjectUtils.isEmpty(userId)) { + throw new ServiceException("用户未登录,请先登录!", HttpStatus.ERROR); + } PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize()); - List list = this.userSubMapper.selectUserSubscPage(loginUser.getUserId(), pageDTO.getStoreName()); + List list = this.userSubMapper.selectUserSubscPage(userId, pageDTO.getStoreName()); if (CollectionUtils.isEmpty(list)) { return Page.empty(pageDTO.getPageNum(), pageDTO.getPageSize()); } + // APP 查询直接返回数据即可 + if (pageDTO.getSource() == 2) { + return Page.convert(new PageInfo<>(list)); + } // 今天 final Date now = java.sql.Date.valueOf(LocalDate.now()); // 30天前 diff --git a/xkt/src/main/resources/mapper/UserSubscriptionsMapper.xml b/xkt/src/main/resources/mapper/UserSubscriptionsMapper.xml index 1ced30992..a62035968 100644 --- a/xkt/src/main/resources/mapper/UserSubscriptionsMapper.xml +++ b/xkt/src/main/resources/mapper/UserSubscriptionsMapper.xml @@ -18,20 +18,24 @@