Explorar el Código

Merge remote-tracking branch 'origin/ScrmStores' into ScrmStores

chenguo hace 19 horas
padre
commit
704448db68

+ 4 - 0
fs-service/src/main/java/com/fs/user/domain/FsUserComplaint.java

@@ -66,5 +66,9 @@ public class FsUserComplaint extends BaseEntity{
     @Excel(name = "用户是否有未读消息 0:否 1:是 ")
     private Integer isReadPlatform;
 
+    /** 店铺id */
+    @Excel(name = "店铺id")
+    private Long storeId;
+
 
 }

+ 9 - 3
fs-service/src/main/resources/mapper/user/FsUserComplaintMapper.xml

@@ -23,11 +23,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isReadUser"    column="is_read_user"    />
         <result property="isReadStore"    column="is_read_store"    />
         <result property="isReadPlatform"    column="is_read_platform"    />
+        <result property="storeId"    column="store_id"    />
     </resultMap>
 
     <sql id="selectFsUserComplaintVo">
         select id, fs_user_id, title, content, images, type, link_id, create_time, create_by, update_time, update_by,
-               remark,complaint_type,is_handle_store,is_handle_platform,is_read_user,is_read_store,is_read_platform
+               remark,complaint_type,is_handle_store,is_handle_platform,is_read_user,is_read_store,is_read_platform,store_id
         from fs_user_complaint
     </sql>
 
@@ -46,13 +47,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isReadUser != null "> and is_read_user = #{isReadUser}</if>
             <if test="isReadStore != null "> and is_read_store = #{isReadStore}</if>
             <if test="isReadPlatform != null "> and is_read_platform = #{isReadPlatform}</if>
+            <if test="storeId != null "> and store_id = #{storeId}</if>
         </where>
         order by id desc
     </select>
 
     <select id="selectFsUserComplaintVoList" resultType="com.fs.user.domain.vo.FsUserComplaintVo">
         select c.id, u.nick_name,c.title, c.content, c.images, c.type, c.link_id, c.create_time, c.create_by, c.update_time, c.update_by,
-               c.remark,c.complaint_type,c.is_handle_store,c.is_handle_platform,c.is_read_user,c.is_read_store,c.is_read_platform
+               c.remark,c.complaint_type,c.is_handle_store,c.is_handle_platform,c.is_read_user,c.is_read_store,c.is_read_platform,c.store_id
         from fs_user_complaint c
         left join fs_user u on c.fs_user_id = u.user_id
         <where>
@@ -69,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isReadUser != null "> and c.is_read_user = #{isReadUser}</if>
             <if test="isReadStore != null "> and c.is_read_store = #{isReadStore}</if>
             <if test="isReadPlatform != null "> and c.is_read_platform = #{isReadPlatform}</if>
+            <if test="storeId != null "> and c.store_id = #{storeId}</if>
         </where>
         order by id desc
     </select>
@@ -80,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectFsUserComplaintVoById" parameterType="Long" resultType="com.fs.user.domain.vo.FsUserComplaintVo">
         select c.id, u.nick_name,c.title, c.content, c.images, c.type, c.link_id, c.create_time, c.create_by, c.update_time, c.update_by,
-               c.remark,c.complaint_type,c.is_handle_store,c.is_handle_platform,c.is_read_user,c.is_read_store,c.is_read_platform
+               c.remark,c.complaint_type,c.is_handle_store,c.is_handle_platform,c.is_read_user,c.is_read_store,c.is_read_platform,c.store_id
         from fs_user_complaint c
                  left join fs_user u on c.fs_user_id = u.user_id
         where c.id = #{id}
@@ -107,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isReadUser != null">is_read_user,</if>
             <if test="isReadStore != null">is_read_store,</if>
             <if test="isReadPlatform != null">is_read_platform,</if>
+            <if test="storeId != null">store_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fsUserId != null">#{fsUserId},</if>
@@ -126,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isReadUser != null">#{isReadUser},</if>
             <if test="isReadStore != null">#{isReadStore},</if>
             <if test="isReadPlatform != null">#{isReadPlatform},</if>
+            <if test="storeId != null">#{storeId},</if>
          </trim>
     </insert>
 
@@ -149,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isReadUser != null">is_read_user = #{isReadUser},</if>
             <if test="isReadStore != null">is_read_store = #{isReadStore},</if>
             <if test="isReadPlatform != null">is_read_platform = #{isReadPlatform},</if>
+            <if test="storeId != null">store_id = #{storeId},</if>
         </trim>
         where id = #{id}
     </update>

+ 82 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/FsUserComplaintController.java

@@ -0,0 +1,82 @@
+package com.fs.hisStore.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.utils.UserUtil;
+import com.fs.user.domain.FsUserComplaint;
+import com.fs.user.domain.param.FsUserComplaintParam;
+import com.fs.user.domain.vo.FsUserComplaintVo;
+import com.fs.user.service.IFsUserComplaintService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 用户投诉Controller
+ *
+ * @author fs
+ * @date 2025-08-27
+ */
+@RestController
+@RequestMapping("/store/complaint")
+public class FsUserComplaintController extends BaseController
+{
+    @Autowired
+    private IFsUserComplaintService fsUserComplaintService;
+
+    /**
+     * 查询用户投诉列表
+     */
+    @PostMapping("/list")
+    public TableDataInfo list(@RequestBody FsUserComplaintParam param)
+    {
+        param.setStoreId(UserUtil.getLoginUserStoreID());
+        param.setComplaintType(1); //店铺仅能看咨询的
+        startPage();
+        List<FsUserComplaintVo> list = fsUserComplaintService.selectFsUserComplaintVoList(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户投诉列表
+     */
+    @Log(title = "用户投诉", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserComplaint fsUserComplaint)
+    {
+        fsUserComplaint.setStoreId(UserUtil.getLoginUserStoreID());
+        List<FsUserComplaint> list = fsUserComplaintService.selectFsUserComplaintList(fsUserComplaint);
+        ExcelUtil<FsUserComplaint> util = new ExcelUtil<FsUserComplaint>(FsUserComplaint.class);
+        return util.exportExcel(list, "用户投诉数据");
+    }
+
+    /**
+     * 获取用户投诉详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsUserComplaintService.selectFsUserComplaintVoById(id));
+    }
+
+
+
+    /**
+     * 修改用户投诉
+     */
+    @PreAuthorize("@ss.hasPermi('user:complaint:edit')")
+    @Log(title = "用户投诉", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsUserComplaint fsUserComplaint)
+    {
+        return toAjax(fsUserComplaintService.updateFsUserComplaint(fsUserComplaint));
+    }
+
+
+}

+ 98 - 0
fs-store/src/main/java/com/fs/hisStore/controller/store/FsUserComplaintMsgController.java

@@ -0,0 +1,98 @@
+package com.fs.hisStore.controller.store;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.hisStore.utils.UserUtil;
+import com.fs.user.domain.FsUserComplaintMsg;
+import com.fs.user.service.IFsUserComplaintMsgService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 投诉消息记录Controller
+ *
+ * @author fs
+ * @date 2025-09-08
+ */
+@RestController
+@RequestMapping("/store/msg")
+public class FsUserComplaintMsgController extends BaseController
+{
+    @Autowired
+    private IFsUserComplaintMsgService fsUserComplaintMsgService;
+
+    /**
+     * 查询投诉消息记录列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(FsUserComplaintMsg fsUserComplaintMsg)
+    {
+        startPage();
+        List<FsUserComplaintMsg> list = fsUserComplaintMsgService.selectFsUserComplaintMsgList(fsUserComplaintMsg);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出投诉消息记录列表
+     */
+    @Log(title = "投诉消息记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserComplaintMsg fsUserComplaintMsg)
+    {
+        List<FsUserComplaintMsg> list = fsUserComplaintMsgService.selectFsUserComplaintMsgList(fsUserComplaintMsg);
+        ExcelUtil<FsUserComplaintMsg> util = new ExcelUtil<FsUserComplaintMsg>(FsUserComplaintMsg.class);
+        return util.exportExcel(list, "投诉消息记录数据");
+    }
+
+    /**
+     * 获取投诉消息记录详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsUserComplaintMsgService.selectFsUserComplaintMsgById(id));
+    }
+
+    /**
+     * 新增投诉消息记录
+     */
+    @Log(title = "投诉消息记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsUserComplaintMsg fsUserComplaintMsg)
+    {
+        if (fsUserComplaintMsg.getComplaintId() == null){
+            return AjaxResult.error("未查询到相关投诉!");
+        }
+        Long storeId = UserUtil.getLoginUserStoreID();
+        fsUserComplaintMsg.setUserId(storeId);
+        fsUserComplaintMsg.setSendType(3); //店铺
+        return toAjax(fsUserComplaintMsgService.insertFsUserComplaintMsg(fsUserComplaintMsg));
+    }
+
+    /**
+     * 修改投诉消息记录
+     */
+    @Log(title = "投诉消息记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsUserComplaintMsg fsUserComplaintMsg)
+    {
+        return toAjax(fsUserComplaintMsgService.updateFsUserComplaintMsg(fsUserComplaintMsg));
+    }
+
+    /**
+     * 删除投诉消息记录
+     */
+    @Log(title = "投诉消息记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsUserComplaintMsgService.deleteFsUserComplaintMsgByIds(ids));
+    }
+}