Ver Fonte

1.添加意见反馈

yuanliang há 1 ano atrás
pai
commit
8a77624a49
18 ficheiros alterados com 1232 adições e 253 exclusões
  1. 157 27
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/SysSuggestionController.java
  2. 147 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/SysSuggestionTypeController.java
  3. 55 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/io/request/SysSuggestionTypeVo.java
  4. 119 0
      cooleshow-app/src/main/java/com/yonge/cooleshow/admin/io/request/SysSuggestionVo.java
  5. 1 1
      cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/SysSuggestionController.java
  6. 71 117
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/SysSuggestion.java
  7. 51 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/SysSuggestionType.java
  8. 28 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/SysSuggestionMapper.java
  9. 27 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/SysSuggestionTypeMapper.java
  10. 40 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/SysSuggestionService.java
  11. 44 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/SysSuggestionTypeService.java
  12. 88 13
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/SysSuggestionServiceImpl.java
  13. 65 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/SysSuggestionTypeServiceImpl.java
  14. 89 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/SysSuggestionTypeWrapper.java
  15. 161 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/SysSuggestionWrapper.java
  16. 62 92
      cooleshow-user/user-biz/src/main/resources/config/mybatis/SysSuggestionMapper.xml
  17. 26 0
      cooleshow-user/user-biz/src/main/resources/config/mybatis/SysSuggestionTypeMapper.xml
  18. 1 1
      cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/SysSuggestionController.java

+ 157 - 27
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/SysSuggestionController.java

@@ -1,19 +1,43 @@
 package com.yonge.cooleshow.admin.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.microsvc.toolkit.common.response.paging.PageInfo;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.common.response.template.R;
+import com.yonge.cooleshow.admin.io.request.SysSuggestionVo;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
-import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.entity.SysSuggestion;
-import com.yonge.cooleshow.biz.dal.queryInfo.SysSuggestionQueryInfo;
+import com.yonge.cooleshow.biz.dal.entity.SysSuggestionType;
+import com.yonge.cooleshow.biz.dal.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 import com.yonge.cooleshow.biz.dal.service.SysSuggestionService;
+import com.yonge.cooleshow.biz.dal.service.SysSuggestionTypeService;
+import com.yonge.cooleshow.biz.dal.service.SysUserService;
+import com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionWrapper;
 import com.yonge.cooleshow.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
 @Api(tags = "意见反馈")
 @RestController
 @RequestMapping("${app-config.url.admin:}/")
@@ -21,39 +45,145 @@ public class SysSuggestionController extends BaseController {
 
     @Autowired
     private SysSuggestionService sysSuggestionService;
-    @Autowired
+    @Resource
     private SysUserFeignService sysUserFeignService;
 
-    @ApiOperation(value = "新增")
-    @RequestMapping("sysSuggestion/add")
-    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/add')")
-    public Object add(SysSuggestion sysSuggestion) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            return failed("用户信息获取失败");
+    @Autowired
+    private SysUserService sysUserService;
+
+    @Autowired
+    private SysSuggestionTypeService sysSuggestionTypeService;
+
+    /**
+     * 查询单条
+     *
+     * @param id 详情ID
+     * @return R<SysSuggestionVo.SysSuggestion>
+     */
+    @ApiOperation(value = "详情", notes = "传入id")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/detail')")
+    @GetMapping("/detail/{id}")
+    public R<SysSuggestionWrapper.SysSuggestion> detail(@PathVariable("id") Long id) {
+
+        // 建议详情
+        SysSuggestion wrapper = sysSuggestionService.detail(id);
+        SysSuggestionWrapper.SysSuggestion suggestion =
+                SysSuggestionWrapper.SysSuggestion.from(JSON.toJSONString(wrapper));
+        if (wrapper != null && wrapper.getSuggestionTypeId() != null) {
+            SysSuggestionType suggestionType = sysSuggestionTypeService.getById(wrapper.getSuggestionTypeId());
+            if (suggestionType != null) {
+                suggestion.setSuggestionTypeName(suggestionType.getName());
+            }
+            com.yonge.cooleshow.auth.api.entity.SysUser createUser = sysUserService.getByUserId(wrapper.getUserId());
+            String clientType = wrapper.getClientType();
+            if (ClientEnum.STUDENT.getCode().equals(clientType) || ClientEnum.TENANT_STUDENT.getCode().equals(clientType)) {
+                suggestion.setNickname(createUser.getUsername());
+            } else {
+                suggestion.setNickname(createUser.getRealName());
+            }
+            Long handleBy = wrapper.getHandleBy();
+            if (handleBy != null) {
+                com.yonge.cooleshow.auth.api.entity.SysUser sysUser = sysUserService.getByUserId(handleBy);
+                suggestion.setHandleName(sysUser.getUsername());
+            }
         }
-        sysSuggestion.setUserId(sysUser.getId().longValue());
-        sysSuggestion.setClientType("TEACHER");
-        if(StringUtils.isEmpty(sysSuggestion.getMobileNo())){
-            sysSuggestion.setMobileNo(sysUser.getPhone());
+        return R.from(suggestion);
+    }
+
+
+    /**
+     * 查询分页
+     *
+     * @param query SysSuggestionWrapper.SysSuggestionQuery
+     * @return R<PageInfo < SysSuggestionWrapper.SysSuggestion>>
+     */
+    @ApiOperation(value = "查询分页")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/queryPage')")
+    @PostMapping("/queryPage")
+    public R<PageInfo<SysSuggestionWrapper.SysSuggestion>> page(@RequestBody SysSuggestionWrapper.SysSuggestionQuery query) {
+
+        IPage<SysSuggestionWrapper.SysSuggestion> pages = sysSuggestionService.selectPage(QueryInfo.getPage(query), query);
+
+        List<SysSuggestionWrapper.SysSuggestion> records = pages.getRecords();
+
+        if (CollectionUtils.isNotEmpty(records)) {
+            List<Long> handlerList = records.stream().map(SysSuggestionWrapper.SysSuggestion::getHandleBy).filter(Objects::nonNull).distinct().collect(Collectors.toList());
+            Map<Long, SysUser> mapByIds = new HashMap<>();
+            if (CollectionUtils.isNotEmpty(handlerList)) {
+                mapByIds.putAll(sysUserService.getMapByIds(handlerList));
+            }
+            for (SysSuggestionWrapper.SysSuggestion item : records) {
+                Long handleBy = item.getHandleBy();
+                if (handleBy != null && mapByIds.containsKey(handleBy)) {
+                    item.setHandleName(mapByIds.getOrDefault(handleBy, new SysUser()).getUsername());
+                }
+            }
         }
-        sysSuggestionService.insert(sysSuggestion);
-        return succeed();
+        return R.from(QueryInfo.pageInfo(pages, records));
+    }
+
+    /**
+     * 新增
+     *
+     * @param suggestion SysSuggestionVo.SysSuggestion
+     * @return R<Boolean>
+     */
+    @ApiOperation(value = "新增", notes = "传入sysSuggestion")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/page')")
+    @PostMapping("/add")
+    public R<Boolean> add(@Validated @RequestBody SysSuggestionVo.SysSuggestion suggestion,
+                          @RequestHeader(name = "user-agent") String userAgent) {
+        com.yonge.cooleshow.auth.api.entity.SysUser sysUser = sysUserFeignService.queryUserInfo();
+        suggestion.setUserId(sysUser.getId());
+        suggestion.setClientType(sysUser.getUserType());
+        suggestion.setUserAgent(userAgent);
+
+        return R.from(sysSuggestionService.save(JSON.parseObject(suggestion.jsonString(), SysSuggestion.class)));
     }
 
-    @ApiOperation(value = "删除")
-    @RequestMapping("sysSuggestion/del")
+    /**
+     * 修改
+     *
+     * @param suggestion SysSuggestionVo.SysSuggestion
+     * @return R<Boolean>
+     */
+    @ApiOperation(value = "修改", notes = "传入sysSuggestion")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/update')")
+//    @PostMapping("/update")
+    public R<Boolean> update(@Validated @RequestBody SysSuggestionVo.SysSuggestion suggestion) {
+        return R.from(sysSuggestionService.update(JSON.parseObject(suggestion.jsonString(), SysSuggestionWrapper.SysSuggestion.class)));
+    }
+
+    /**
+     * 删除
+     *
+     * @param id 详情ID
+     * @return R<Boolean>
+     */
+    @ApiOperation(value = "删除", notes = "传入id")
     @PreAuthorize("@pcs.hasPermissions('sysSuggestion/del')")
-    public Object del(Long id) {
-        sysSuggestionService.delete(id);
-        return succeed();
+//    @PostMapping("/del")
+    public R<Boolean> remove(@RequestParam Long id) {
+        return R.from(sysSuggestionService.removeById(id));
     }
 
-    @ApiOperation(value = "分页查询")
-    @RequestMapping("sysSuggestion/queryPage")
-    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/queryPage')")
-    public Object queryPage(SysSuggestionQueryInfo queryInfo) {
-        return succeed(sysSuggestionService.queryPage(queryInfo));
+    @ApiOperation(value = "修改")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/handleSuggestion')")
+    @PostMapping("/handleSuggestion")
+    public R<Boolean> handleSuggestion(@Validated @RequestBody SysSuggestionWrapper.HandleSuggestion handleSuggestion) {
+        com.yonge.cooleshow.auth.api.entity.SysUser sysUser = sysUserFeignService.queryUserInfo();
+        handleSuggestion.setHandleBy(sysUser.getId());
+        return R.from(sysSuggestionService.handleSuggestion(handleSuggestion));
+    }
+
+    @ApiOperation(value = "查询未处理的建议数量")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestion/queryUnHandleNum')")
+    @GetMapping("/queryUnHandleNum")
+    public R<Integer> queryUnHandleNum() {
+        Integer count = sysSuggestionService.lambdaQuery()
+                .eq(SysSuggestion::getHandleStatus, false)
+                .count();
+        return R.from(count);
     }
 
 }

+ 147 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/SysSuggestionTypeController.java

@@ -0,0 +1,147 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.microsvc.toolkit.common.response.paging.PageInfo;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.common.response.template.R;
+import com.microsvc.toolkit.common.webportal.exception.BizException;
+import com.yonge.cooleshow.admin.io.request.SysSuggestionTypeVo;
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.entity.SysSuggestionType;
+import com.yonge.cooleshow.biz.dal.service.SysSuggestionTypeService;
+import com.yonge.cooleshow.biz.dal.service.SysUserService;
+import com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionTypeWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("/sysSuggestionType")
+@Api(tags = "平台建议类型表")
+public class SysSuggestionTypeController {
+
+    @Autowired
+    private SysSuggestionTypeService sysSuggestionTypeService;
+
+    @Resource
+    private SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    private SysUserService sysUserService;
+
+    @ApiOperation(value = "详情", notes = "平台建议类型表-根据详情ID查询单条, 传入id")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestionType/detail', {'BACKEND'})")
+    @GetMapping("/detail/{id}")
+    public R<SysSuggestionType> detail(@PathVariable("id") Long id) {
+
+        SysSuggestionType wrapper = sysSuggestionTypeService.detail(id);
+
+        return R.from(wrapper);
+    }
+
+    @ApiOperation(value = "查询分页", notes = "平台建议类型表- 传入 SysSuggestionTypeWrapper.SysSuggestionTypeQuery")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestionType/page', {'BACKEND'})")
+    @PostMapping("/page")
+    public R<PageInfo<SysSuggestionTypeWrapper.SysSuggestionType>> page(@RequestBody SysSuggestionTypeWrapper.SysSuggestionTypeQuery query) {
+
+        IPage<SysSuggestionType> pages = sysSuggestionTypeService.selectPage(QueryInfo.getPage(query), query);
+
+        Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> idEmpMap = new HashMap<>();
+        List<Long> updateIds = pages.getRecords().stream().map(SysSuggestionType::getUpdateBy)
+                .filter(Objects::nonNull).distinct().collect(Collectors.toList());
+        if (!updateIds.isEmpty()) {
+            idEmpMap.putAll(sysUserService.getMapByIds(updateIds));
+        }
+        List<SysSuggestionTypeWrapper.SysSuggestionType> rows = pages.getRecords().stream().map(next -> {
+            SysSuggestionTypeWrapper.SysSuggestionType type =
+                    JSON.parseObject(JSON.toJSONString(next), SysSuggestionTypeWrapper.SysSuggestionType.class);
+            if (type.getUpdateBy() != null) {
+                type.setOperator(idEmpMap.getOrDefault(type.getUpdateBy(), new com.yonge.cooleshow.biz.dal.entity.SysUser()).getUsername());
+            }
+            return type;
+        }).collect(Collectors.toList());
+        return R.from(QueryInfo.pageInfo(pages, rows));
+    }
+
+    @ApiOperation(value = "新增", notes = "平台建议类型表- 传入 SysSuggestionTypeWrapper.SysSuggestionType")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestionType/save', {'BACKEND'})")
+    @PostMapping("/save")
+    public R<JSONObject> add(@Validated @RequestBody SysSuggestionTypeVo.SysSuggestionType sysSuggestionType) {
+        Integer count = sysSuggestionTypeService.lambdaQuery()
+                .eq(SysSuggestionType::getName, sysSuggestionType.getName())
+                .eq(SysSuggestionType::getDelFlag, false)
+                .count();
+        if (count > 0) {
+            throw new BizException("建议类型已存在");
+        }
+        SysUser userInfo = sysUserFeignService.queryUserInfo();
+        SysSuggestionType suggestionType = new SysSuggestionType();
+        suggestionType.setName(sysSuggestionType.getName());
+        suggestionType.setCreateBy(userInfo.getId());
+        suggestionType.setUpdateBy(userInfo.getId());
+        suggestionType.setDelFlag(false);
+        // 新增数据
+        sysSuggestionTypeService.save(suggestionType);
+
+        return R.defaultR();
+    }
+
+    @ApiOperation(value = "修改", notes = "平台建议类型表- 传入 SysSuggestionTypeWrapper.SysSuggestionType")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestionType/update', {'BACKEND'})")
+    @PostMapping("/update")
+    public R<JSONObject> update(@Validated @RequestBody SysSuggestionTypeVo.SysSuggestionType sysSuggestionType) {
+        SysUser userInfo = sysUserFeignService.queryUserInfo();
+        Integer count = sysSuggestionTypeService.lambdaQuery()
+                .eq(SysSuggestionType::getName, sysSuggestionType.getName())
+                .eq(SysSuggestionType::getDelFlag, false)
+                .ne(SysSuggestionType::getId, sysSuggestionType.getId())
+                .count();
+        if (count > 0) {
+            throw new BizException("建议类型已存在");
+        }
+
+        SysSuggestionType suggestionType = new SysSuggestionType();
+        suggestionType.setId(sysSuggestionType.getId());
+        suggestionType.setName(sysSuggestionType.getName());
+        suggestionType.setUpdateBy(userInfo.getId());
+        suggestionType.setDelFlag(false);
+        // 更新数据
+        sysSuggestionTypeService.updateById(suggestionType);
+
+        return R.defaultR();
+    }
+
+    @ApiOperation(value = "删除", notes = "平台建议类型表- 传入id")
+    @PreAuthorize("@pcs.hasPermissions('sysSuggestionType/remove', {'BACKEND'})")
+    @PostMapping("/remove")
+    public R<JSONObject> remove(@RequestParam Long id) {
+        sysSuggestionTypeService.lambdaUpdate()
+                .set(SysSuggestionType::getDelFlag, true)
+                .eq(SysSuggestionType::getId, id)
+                .update();
+        return R.defaultR();
+    }
+}

+ 55 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/io/request/SysSuggestionTypeVo.java

@@ -0,0 +1,55 @@
+package com.yonge.cooleshow.admin.io.request;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 平台建议类型表
+ * 2023-08-30 11:26:33
+ */
+@ApiModel(value = "SysSuggestionTypeVo对象", description = "平台建议类型表查询视图对象")
+public class SysSuggestionTypeVo {
+
+    @Data
+    @ApiModel(" SysSuggestionTypeQuery-平台建议类型表")
+    public static class SysSuggestionTypeQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static SysSuggestionTypeQuery from(String json) {
+            return JSON.parseObject(json, SysSuggestionTypeQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" SysSuggestionType-平台建议类型表")
+    public static class SysSuggestionType {
+
+
+        @ApiModelProperty("编号")
+        private Long id;
+
+        @ApiModelProperty("名称")
+        private String name;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static SysSuggestionType from(String json) {
+            return JSON.parseObject(json, SysSuggestionType.class);
+        }
+    }
+
+}

+ 119 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/io/request/SysSuggestionVo.java

@@ -0,0 +1,119 @@
+package com.yonge.cooleshow.admin.io.request;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * 平台建议表
+ * 2023-12-20 11:27:10
+ */
+@ApiModel(value = "SysSuggestionVo对象", description = "平台建议表查询视图对象")
+public class SysSuggestionVo {
+
+    @Data
+    @ApiModel(" SysSuggestionQuery-平台建议表")
+    public static class SysSuggestionQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static SysSuggestionQuery from(String json) {
+            return JSON.parseObject(json, SysSuggestionQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" SysSuggestion-平台建议表")
+    public static class SysSuggestion {
+
+
+        @ApiModelProperty("编号")
+        private Long id;
+
+
+        @ApiModelProperty("联系方式")
+        private String mobileNo;
+
+
+        @ApiModelProperty("标题")
+        private String title;
+
+
+        @ApiModelProperty("内容")
+        private String content;
+
+
+        @ApiModelProperty("")
+        private String url;
+
+
+        @ApiModelProperty("用户编号")
+        private Long userId;
+
+
+        @ApiModelProperty("提交时间")
+        private Date createTime;
+
+
+        @ApiModelProperty("")
+        private String clientId;
+
+
+        @ApiModelProperty("建议类型")
+        private String type;
+
+
+        @ApiModelProperty("")
+        private String clientType;
+
+
+        @ApiModelProperty("建议类型ID")
+        private Long suggestionTypeId;
+
+
+        @ApiModelProperty("客户端信息")
+        private String userAgent;
+
+
+        @ApiModelProperty("处理状态:true:已处理,false:待处理")
+        private Boolean handleStatus;
+
+
+        @ApiModelProperty("处理时间")
+        private Date handleTime;
+
+
+        @ApiModelProperty("处理人")
+        private Long handleBy;
+
+
+        @ApiModelProperty("是否反馈用户,true:是,false:否")
+        private Boolean feedback;
+
+
+        @ApiModelProperty("反馈内容")
+        private String feedbackContent;
+
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static SysSuggestion from(String json) {
+            return JSON.parseObject(json, SysSuggestion.class);
+        }
+    }
+
+}

+ 1 - 1
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/SysSuggestionController.java

@@ -34,7 +34,7 @@ public class SysSuggestionController extends BaseController {
         if(StringUtils.isEmpty(sysSuggestion.getMobileNo())){
             sysSuggestion.setMobileNo(sysUser.getPhone());
         }
-        sysSuggestionService.insert(sysSuggestion);
+        sysSuggestionService.save(sysSuggestion);
         return succeed();
     }
 

+ 71 - 117
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/SysSuggestion.java

@@ -1,135 +1,89 @@
 package com.yonge.cooleshow.biz.dal.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
+import java.io.Serializable;
+import java.util.Date;
 
-import com.yonge.cooleshow.biz.dal.enums.SuggestionType;
-import com.yonge.cooleshow.common.entity.BaseEntity;
 
 /**
- * 对应数据库表(sys_suggestion):
+ * 平台建议表
+ * 2023-12-20 11:27:10
  */
-public class SysSuggestion extends BaseEntity {
+@Data
+@ApiModel(" SysSuggestion-平台建议表")
+@TableName("sys_suggestion")
+public class SysSuggestion implements Serializable {
 
-	/** 编号 */
+	@ApiModelProperty("编号")
+	@TableId(value = "id_")
 	private Long id;
-	
-	/** 联系方式 */
-	@ApiModelProperty(value = "联系方式",required = false)
+
+	@ApiModelProperty("联系方式")
+	@TableField(value = "mobile_no_")
 	private String mobileNo;
-	
-	/** 标题 */
-	@ApiModelProperty(value = "标题",required = false)
+
+	@ApiModelProperty("标题")
+	@TableField(value = "title_")
 	private String title;
-	
-	/** 内容 */
-	@ApiModelProperty(value = "内容",required = false)
+
+	@ApiModelProperty("内容")
+	@TableField(value = "content_")
 	private String content;
 
-	/** 媒体 */
-	@ApiModelProperty(value = "媒体",required = false)
+	@TableField(value = "url_")
 	private String url;
-	
-	/** 用户编号 */
-	@ApiModelProperty(value = "用户编号",required = false)
+
+	@ApiModelProperty("用户编号")
+	@TableField(value = "user_id_")
 	private Long userId;
-	
-	@ApiModelProperty(value = "客户端类型",required = false)
+
+	@ApiModelProperty("提交时间")
+	@TableField(value = "create_time_")
+	private Date createTime;
+
+	@TableField(value = "client_id_")
+	private String clientId;
+
+	@ApiModelProperty("建议类型")
+	@TableField(value = "type_")
+	private String type;
+
+	@TableField(value = "client_type_")
 	private String clientType;
 
-	@ApiModelProperty(value = "建议类型")
-	private SuggestionType type = SuggestionType.APP;
-
-	@ApiModelProperty(value = "用户名",required = false)
-	private String username;
-	
-	/** 提交时间 */
-	private java.util.Date createTime;
-
-	public String getUrl() {
-		return url;
-	}
-
-	public void setUrl(String url) {
-		this.url = url;
-	}
-
-	public String getUsername() {
-		return username;
-	}
-
-	public void setUsername(String username) {
-		this.username = username;
-	}
-
-	public void setId(Long id){
-		this.id = id;
-	}
-	
-	public Long getId(){
-		return this.id;
-	}
-			
-	public void setMobileNo(String mobileNo){
-		this.mobileNo = mobileNo;
-	}
-	
-	public String getMobileNo(){
-		return this.mobileNo;
-	}
-			
-	public void setTitle(String title){
-		this.title = title;
-	}
-	
-	public String getTitle(){
-		return this.title;
-	}
-			
-	public void setContent(String content){
-		this.content = content;
-	}
-	
-	public String getContent(){
-		return this.content;
-	}
-			
-	public void setUserId(Long userId){
-		this.userId = userId;
-	}
-	
-	public Long getUserId(){
-		return this.userId;
-	}
-			
-	public String getClientType() {
-		return clientType;
-	}
-
-	public void setClientType(String clientType) {
-		this.clientType = clientType;
-	}
-
-	public SuggestionType getType() {
-		return type;
-	}
-
-	public void setType(SuggestionType type) {
-		this.type = type;
-	}
-
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-			
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
-
-}
+	@ApiModelProperty("建议类型ID")
+	@TableField(value = "suggestion_type_id_")
+	private Long suggestionTypeId;
+
+	@ApiModelProperty("客户端信息")
+	@TableField(value = "user_agent_")
+	private String userAgent;
+
+	@ApiModelProperty("处理状态:true:已处理,false:待处理")
+	@TableField(value = "handle_status_")
+	private Boolean handleStatus;
+
+	@ApiModelProperty("处理时间")
+	@TableField(value = "handle_time_")
+	private Date handleTime;
+
+	@ApiModelProperty("处理人")
+	@TableField(value = "handle_by_")
+	private Long handleBy;
+
+	@ApiModelProperty("是否反馈用户,true:是,false:否")
+	@TableField(value = "feedback_")
+	private Boolean feedback;
+
+	@ApiModelProperty("反馈内容")
+	@TableField(value = "feedback_content_")
+	private String feedbackContent;
+
+}

+ 51 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/SysSuggestionType.java

@@ -0,0 +1,51 @@
+package com.yonge.cooleshow.biz.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 平台建议类型表
+ * 2023-08-30 11:26:33
+ */
+@Data
+@ApiModel(" SysSuggestionType-平台建议类型表")
+@TableName("sys_suggestion_type")
+public class SysSuggestionType implements Serializable {
+
+    @ApiModelProperty("编号")
+    @TableId(value = "id_")
+    private Long id;
+
+    @ApiModelProperty("名称")
+    @TableField(value = "name_")
+    private String name;
+
+    @ApiModelProperty("删除标识(0-正常,1-删除)")
+    @TableField(value = "del_flag_")
+    private Boolean delFlag;
+
+    @ApiModelProperty("创建人")
+    @TableField(value = "create_by_")
+    private Long createBy;
+
+    @ApiModelProperty("修改人")
+    @TableField(value = "update_by_")
+    private Long updateBy;
+
+    @ApiModelProperty("更新时间")
+    @TableField(value = "update_time_")
+    private Date updateTime;
+
+    @ApiModelProperty("创建时间")
+    @TableField(value = "create_time_")
+    private Date createTime;
+
+}

+ 28 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/SysSuggestionMapper.java

@@ -0,0 +1,28 @@
+package com.yonge.cooleshow.biz.dal.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.entity.SysSuggestion;
+import com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionWrapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 平台建议表
+ * 2023-12-20 11:27:10
+ */
+@Repository
+public interface SysSuggestionMapper extends BaseMapper<SysSuggestion> {
+
+    /**
+     * 分页查询
+     * @param page IPage<SysSuggestionWrapper.SysSuggestion>
+     * @param param SysSuggestionWrapper.SysSuggestionQuery
+     * @return List<SysSuggestionWrapper.SysSuggestion>
+     */
+    List<SysSuggestionWrapper.SysSuggestion> selectPage(@Param("page") IPage<SysSuggestionWrapper.SysSuggestion> page, @Param("param") SysSuggestionWrapper.SysSuggestionQuery param);
+
+}

+ 27 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/mapper/SysSuggestionTypeMapper.java

@@ -0,0 +1,27 @@
+package com.yonge.cooleshow.biz.dal.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yonge.cooleshow.biz.dal.entity.SysSuggestionType;
+import com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionTypeWrapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 平台建议类型表
+ * 2023-08-30 11:26:33
+ */
+@Repository
+public interface SysSuggestionTypeMapper extends BaseMapper<SysSuggestionType> {
+
+    /**
+     * 分页查询
+     * @param page IPage<SysSuggestionTypeWrapper.SysSuggestionType>
+     * @param param SysSuggestionTypeWrapper.SysSuggestionTypeQuery
+     * @return List<SysSuggestionTypeWrapper.SysSuggestionType>
+     */
+    List<SysSuggestionType> selectPage(@Param("page") IPage<SysSuggestionType> page, @Param("param") SysSuggestionTypeWrapper.SysSuggestionTypeQuery param);
+
+}

+ 40 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/SysSuggestionService.java

@@ -1,8 +1,46 @@
 package com.yonge.cooleshow.biz.dal.service;
 
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.yonge.cooleshow.biz.dal.entity.SysSuggestion;
-import com.yonge.toolset.mybatis.service.BaseService;
+import com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionWrapper;
+
+/**
+ * 平台建议表
+ * 2023-12-20 11:27:10
+ */
+public interface SysSuggestionService extends IService<SysSuggestion> {
+
+    /**
+     * 查询详情
+     * @param id 详情ID
+     * @return SysSuggestion
+     */
+    SysSuggestion detail(Long id);
+
+    /**
+     * 分页查询
+     * @param page IPage<SysSuggestion>
+     * @param query SysSuggestionWrapper.SysSuggestionQuery
+     * @return IPage<SysSuggestion>
+     */
+    IPage<SysSuggestionWrapper.SysSuggestion> selectPage(IPage<SysSuggestionWrapper.SysSuggestion> page, SysSuggestionWrapper.SysSuggestionQuery query);
+
+    /**
+     * 添加
+     * @param sysSuggestion SysSuggestionWrapper.SysSuggestion
+     * @return Boolean
+     */
+    Boolean add(SysSuggestionWrapper.SysSuggestion sysSuggestion);
+
+    /**
+     * 更新
+     * @param sysSuggestion SysSuggestionWrapper.SysSuggestion
+     * @return Boolean
+     */
+    Boolean update(SysSuggestionWrapper.SysSuggestion sysSuggestion);
 
-public interface SysSuggestionService extends BaseService<Long, SysSuggestion> {
+    Boolean handleSuggestion(SysSuggestionWrapper.HandleSuggestion handleSuggestion);
 
 }

+ 44 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/SysSuggestionTypeService.java

@@ -0,0 +1,44 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.entity.SysSuggestionType;
+import com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionTypeWrapper;
+
+/**
+ * 平台建议类型表
+ * 2023-08-30 11:26:33
+ */
+public interface SysSuggestionTypeService extends IService<SysSuggestionType> {
+
+    /**
+     * 查询详情
+     * @param id 详情ID
+     * @return SysSuggestionType
+     */
+    SysSuggestionType detail(Long id);
+
+    /**
+     * 分页查询
+     * @param page IPage<SysSuggestionType>
+     * @param query SysSuggestionTypeWrapper.SysSuggestionTypeQuery
+     * @return IPage<SysSuggestionType>
+     */
+    IPage<SysSuggestionType> selectPage(IPage<SysSuggestionType> page, SysSuggestionTypeWrapper.SysSuggestionTypeQuery query);
+
+    /**
+     * 添加
+     * @param sysSuggestionType SysSuggestionTypeWrapper.SysSuggestionType
+     * @return Boolean
+     */
+    Boolean add(SysSuggestionTypeWrapper.SysSuggestionType sysSuggestionType);
+
+    /**
+     * 更新
+     * @param sysSuggestionType SysSuggestionTypeWrapper.SysSuggestionType
+     * @return Boolean
+     */
+    Boolean update(SysSuggestionTypeWrapper.SysSuggestionType sysSuggestionType);
+
+}

+ 88 - 13
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/SysSuggestionServiceImpl.java

@@ -1,23 +1,98 @@
 package com.yonge.cooleshow.biz.dal.service.impl;
 
-import com.yonge.toolset.mybatis.service.impl.BaseServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.yonge.cooleshow.biz.dal.dao.SysSuggestionDao;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.microsvc.toolkit.common.webportal.exception.BizException;
 import com.yonge.cooleshow.biz.dal.entity.SysSuggestion;
+import com.yonge.cooleshow.biz.dal.mapper.SysSuggestionMapper;
 import com.yonge.cooleshow.biz.dal.service.SysSuggestionService;
-import com.yonge.toolset.mybatis.dal.BaseDAO;
+import com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionWrapper;
+import org.springframework.stereotype.Service;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
+
+/**
+ * 平台建议表
+ * 2023-12-20 11:27:10
+ */
+@Slf4j
 @Service
-public class SysSuggestionServiceImpl extends BaseServiceImpl<Long, SysSuggestion> implements SysSuggestionService {
-	
-	@Autowired
-	private SysSuggestionDao sysSuggestionDao;
+public class SysSuggestionServiceImpl extends ServiceImpl<SysSuggestionMapper, SysSuggestion> implements SysSuggestionService {
+
+	/**
+	 * 查询详情
+	 * @param id 详情ID
+	 * @return SysSuggestion
+	 */
+	@Override
+	public SysSuggestion detail(Long id) {
+
+		return baseMapper.selectById(id);
+	}
+
+	/**
+	 * 分页查询
+	 * @param page IPage<SysSuggestion>
+	 * @param query SysSuggestionWrapper.SysSuggestionQuery
+	 * @return IPage<SysSuggestion>
+	 */
+	@Override
+	public IPage<SysSuggestionWrapper.SysSuggestion> selectPage(IPage<SysSuggestionWrapper.SysSuggestion> page, SysSuggestionWrapper.SysSuggestionQuery query) {
+
+		return page.setRecords(baseMapper.selectPage(page, query));
+	}
+
+	/**
+	 * 添加
+	 * @param sysSuggestion SysSuggestionWrapper.SysSuggestion
+	 * @return Boolean
+	 */
+	@Override
+	public Boolean add(SysSuggestionWrapper.SysSuggestion sysSuggestion) {
+
+		return this.save(JSON.parseObject(sysSuggestion.jsonString(), SysSuggestion.class));
+	}
+
+	/**
+	 * 更新
+	 * @param sysSuggestion SysSuggestionWrapper.SysSuggestion
+	 * @return Boolean
+	 */
+	@Override
+	public Boolean update(SysSuggestionWrapper.SysSuggestion sysSuggestion){
+
+		return this.updateById(JSON.parseObject(sysSuggestion.jsonString(), SysSuggestion.class));
+	}
 
+	/**
+	 * 处理反馈意见
+	 * @param handleSuggestion handleSuggestion
+	 * @return true/false
+	 */
+	@Transactional(rollbackFor = Exception.class)
 	@Override
-	public BaseDAO<Long, SysSuggestion> getDAO() {
-		return sysSuggestionDao;
+	public Boolean handleSuggestion(SysSuggestionWrapper.HandleSuggestion handleSuggestion) {
+		Long id = handleSuggestion.getId();
+		SysSuggestion suggestion = this.getById(id);
+		if (suggestion == null) {
+			throw new BizException("反馈意见不存在");
+		}
+		Boolean handleStatus = suggestion.getHandleStatus();
+		if (Boolean.TRUE.equals(handleStatus)) {
+			throw new BizException("反馈意见已经处理");
+		}
+		this.lambdaUpdate()
+				.set(SysSuggestion::getHandleStatus, true)
+				.set(SysSuggestion::getHandleTime, new Date())
+				.set(SysSuggestion::getFeedback, handleSuggestion.getFeedback())
+				.set(SysSuggestion::getFeedbackContent, handleSuggestion.getFeedbackContent())
+				.set(SysSuggestion::getHandleBy,handleSuggestion.getHandleBy())
+				.eq(SysSuggestion::getId, handleSuggestion.getId())
+				.eq(SysSuggestion::getHandleStatus, false)
+				.update();
+		return true;
 	}
-	
 }

+ 65 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/SysSuggestionTypeServiceImpl.java

@@ -0,0 +1,65 @@
+package com.yonge.cooleshow.biz.dal.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yonge.cooleshow.biz.dal.entity.SysSuggestionType;
+import com.yonge.cooleshow.biz.dal.mapper.SysSuggestionTypeMapper;
+import com.yonge.cooleshow.biz.dal.service.SysSuggestionTypeService;
+import com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionTypeWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * 平台建议类型表
+ * 2023-08-30 11:26:33
+ */
+@Slf4j
+@Service
+public class SysSuggestionTypeServiceImpl extends ServiceImpl<SysSuggestionTypeMapper, SysSuggestionType> implements SysSuggestionTypeService {
+
+    /**
+     * 查询详情
+     * @param id 详情ID
+     * @return SysSuggestionType
+     */
+    @Override
+    public SysSuggestionType detail(Long id) {
+
+        return baseMapper.selectById(id);
+    }
+
+    /**
+     * 分页查询
+     * @param page IPage<SysSuggestionType>
+     * @param query SysSuggestionTypeWrapper.SysSuggestionTypeQuery
+     * @return IPage<SysSuggestionType>
+     */
+    @Override
+    public IPage<SysSuggestionType> selectPage(IPage<SysSuggestionType> page, SysSuggestionTypeWrapper.SysSuggestionTypeQuery query) {
+
+        return page.setRecords(baseMapper.selectPage(page, query));
+    }
+
+    /**
+     * 添加
+     * @param sysSuggestionType SysSuggestionTypeWrapper.SysSuggestionType
+     * @return Boolean
+     */
+    @Override
+    public Boolean add(SysSuggestionTypeWrapper.SysSuggestionType sysSuggestionType) {
+
+        return this.save(JSON.parseObject(sysSuggestionType.jsonString(), SysSuggestionType.class));
+    }
+
+    /**
+     * 更新
+     * @param sysSuggestionType SysSuggestionTypeWrapper.SysSuggestionType
+     * @return Boolean
+     */
+    @Override
+    public Boolean update(SysSuggestionTypeWrapper.SysSuggestionType sysSuggestionType){
+
+        return this.updateById(JSON.parseObject(sysSuggestionType.jsonString(), SysSuggestionType.class));
+    }
+}

+ 89 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/SysSuggestionTypeWrapper.java

@@ -0,0 +1,89 @@
+package com.yonge.cooleshow.biz.dal.wrapper;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.Date;
+import java.util.Optional;
+
+/**
+ * 平台建议类型表
+ * 2023-08-30 11:26:33
+ */
+@ApiModel(value = "SysSuggestionTypeWrapper对象", description = "平台建议类型表查询对象")
+public class SysSuggestionTypeWrapper {
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" SysSuggestionTypeQuery-平台建议类型表")
+    public static class SysSuggestionTypeQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("关键字匹配")
+        private String keyword;
+
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static SysSuggestionTypeQuery from(String json) {
+            return JSON.parseObject(json, SysSuggestionTypeQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" SysSuggestionType-平台建议类型表")
+    public static class SysSuggestionType {
+
+        @ApiModelProperty("编号")
+        private Long id;
+
+        @ApiModelProperty("名称")
+        private String name;
+
+        @ApiModelProperty("删除标识(0-正常,1-删除)")
+        private Boolean delFlag;
+
+        @ApiModelProperty("创建人")
+        private Long createBy;
+
+        @ApiModelProperty("修改人")
+        private Long updateBy;
+
+        @ApiModelProperty("修改人名称")
+        private String operator;
+
+        @ApiModelProperty("更新时间")
+        private Date updateTime;
+
+        @ApiModelProperty("创建时间")
+        private Date createTime;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static SysSuggestionType from(String json) {
+            return JSON.parseObject(json, SysSuggestionType.class);
+        }
+    }
+
+}

+ 161 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/SysSuggestionWrapper.java

@@ -0,0 +1,161 @@
+package com.yonge.cooleshow.biz.dal.wrapper;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.yonge.cooleshow.biz.dal.enums.SuggestionType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+import java.util.Optional;
+
+/**
+ * 平台建议表
+ * 2023-12-20 11:27:10
+ */
+@ApiModel(value = "SysSuggestionWrapper对象", description = "平台建议表查询对象")
+public class SysSuggestionWrapper {
+
+    @Data
+    @Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" SysSuggestionQuery-平台建议表")
+    public static class SysSuggestionQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("关键字匹配")
+        private String keyword;
+
+        @ApiModelProperty(value = "建议类型")
+        private SuggestionType type;
+
+        private String startTime;
+
+        private String endTime;
+
+        @ApiModelProperty(value = "客户端类型")
+        private String clientType;
+
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static SysSuggestionQuery from(String json) {
+            return JSON.parseObject(json, SysSuggestionQuery.class);
+        }
+    }
+
+    @Data
+    @ApiModel(" SysSuggestion-平台建议表")
+    public static class SysSuggestion {
+
+        @ApiModelProperty("编号")
+        private Long id;
+
+        @ApiModelProperty("联系方式")
+        private String mobileNo;
+
+        @ApiModelProperty("标题")
+        private String title;
+
+        @ApiModelProperty("内容")
+        private String content;
+
+        @ApiModelProperty("链接")
+        private String url;
+
+        @ApiModelProperty("用户编号")
+        private Long userId;
+
+        @ApiModelProperty("提交时间")
+        private Date createTime;
+
+        @ApiModelProperty("客户端类型")
+        private String clientId;
+
+        @ApiModelProperty("建议类型")
+        private SuggestionType type;
+
+        @ApiModelProperty("客户端类型")
+        private String clientType;
+
+        @ApiModelProperty("建议类型ID")
+        private Long suggestionTypeId;
+
+        @ApiModelProperty("客户端信息")
+        private String userAgent;
+
+        @ApiModelProperty("处理状态:true:已处理,false:待处理")
+        private Boolean handleStatus;
+
+        @ApiModelProperty("处理时间")
+        private Date handleTime;
+
+        @ApiModelProperty("处理人")
+        private Long handleBy;
+
+        @ApiModelProperty("是否反馈用户,true:是,false:否")
+        private Boolean feedback;
+
+        @ApiModelProperty("反馈内容")
+        private String feedbackContent;
+
+//        @ApiModelProperty(value = "用户名")
+//        private String username;
+
+        @ApiModelProperty(value = "处理人姓名")
+        private String handleName;
+
+        @ApiModelProperty("建议类型名称")
+        private String suggestionTypeName;
+
+        @ApiModelProperty("用户名")
+        private String nickname;
+
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static SysSuggestion from(String json) {
+            return JSON.parseObject(json, SysSuggestion.class);
+        }
+    }
+
+    @ApiModel("处理反馈意见模型")
+    @Data
+    public static class HandleSuggestion {
+
+        @ApiModelProperty("id")
+        @NotNull
+        private Long id;
+
+        @ApiModelProperty("是否反馈用户,true:是,false:否")
+        @NotNull
+        private Boolean feedback;
+
+        @ApiModelProperty("反馈内容")
+        @NotNull
+        private String feedbackContent;
+
+        @ApiModelProperty(value = "处理人", hidden = true)
+        private Long handleBy;
+
+    }
+
+}

+ 62 - 92
cooleshow-user/user-biz/src/main/resources/config/mybatis/SysSuggestionMapper.xml

@@ -1,112 +1,82 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<!--
-这个文件是自动生成的。
-不要修改此文件。所有改动将在下次重新自动生成时丢失。
--->
-<mapper namespace="com.yonge.cooleshow.biz.dal.dao.SysSuggestionDao">
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.biz.dal.mapper.SysSuggestionMapper">
 
-    <resultMap type="com.yonge.cooleshow.biz.dal.entity.SysSuggestion" id="SysSuggestion">
-        <result column="id_" property="id"/>
-        <result column="mobile_no_" property="mobileNo"/>
-        <result column="title_" property="title"/>
-        <result column="content_" property="content"/>
-        <result column="url_" property="url"/>
-        <result column="user_id_" property="userId"/>
-        <result column="username_" property="username"/>
-        <result column="create_time_" property="createTime"/>
-        <result column="client_type_" property="clientType"/>
-        <result column="type_" property="type" typeHandler="com.yonge.toolset.mybatis.dal.CustomEnumTypeHandler"/>
-    </resultMap>
 
-    <!-- 根据主键查询一条记录 -->
-    <select id="get" resultMap="SysSuggestion">
-		SELECT * FROM sys_suggestion WHERE id_ = #{id}
-	</select>
 
-    <!-- 全查询 -->
-    <select id="findAll" resultMap="SysSuggestion">
-		SELECT * FROM sys_suggestion ORDER BY id_
-	</select>
-
-    <!-- 向数据库增加一条记录 -->
-    <insert id="insert" parameterType="com.yonge.cooleshow.biz.dal.entity.SysSuggestion" useGeneratedKeys="true" keyColumn="id"
-            keyProperty="id">
-        INSERT INTO sys_suggestion (mobile_no_,title_,content_,user_id_,create_time_,client_type_,type_,url_)
-        VALUES(#{mobileNo},#{title},#{content},#{userId},now(),#{clientType},#{type, typeHandler=com.yonge.toolset.mybatis.dal.CustomEnumTypeHandler},#{url})
-    </insert>
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+        t.id_ AS id
+        , t.mobile_no_ AS mobileNo
+        , t.title_ AS title
+        , t.content_ AS content
+        , t.url_ AS url
+        , t.user_id_ AS userId
+        , t.create_time_ AS createTime
+        , t.client_id_ AS clientId
+        , t.type_ AS type
+        , t.client_type_ AS clientType
+        , t.suggestion_type_id_ AS suggestionTypeId
+        , t.user_agent_ AS userAgent
+        , t.handle_status_ AS handleStatus
+        , t.handle_time_ AS handleTime
+        , t.handle_by_ AS handleBy
+        , t.feedback_ AS feedback
+        , t.feedback_content_ AS feedbackContent
+    </sql>
 
-    <!-- 根据主键查询一条记录 -->
-    <update id="update" parameterType="com.yonge.cooleshow.biz.dal.entity.SysSuggestion">
-        UPDATE sys_suggestion
-        <set>
-            <if test="url != null">
-                url_ = #{url},
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.SysSuggestionWrapper$SysSuggestion">
+        SELECT
+        <include refid="baseColumns" />
+        ,CASE WHEN (t.client_type_='STUDENT' or t.client_type_ = 'TENANT_STUDENT') THEN su.username_ ELSE su.real_name_ END nickname
+        ,sst.name_ as suggestionTypeName
+        FROM sys_suggestion t
+        LEFT JOIN sys_user su ON su.id_ = t.user_id_
+        LEFT JOIN sys_suggestion_type sst on t.suggestion_type_id_ = sst.id_
+        <where>
+            su.del_flag_ = 0
+            <if test="param.keyword!=null and param.keyword.trim()!=''">
+                AND (
+                su.real_name_ LIKE CONCAT('%', #{param.keyword}, '%')
+                OR su.username_ LIKE CONCAT('%', #{search}, '%')
+<!--                OR t.user_id_=#{search} OR su.phone_=#{search}-->
+                )
             </if>
-            <if test="clientType != null">
-                client_type_ = #{clientType},
+            <if test="param.type != null">
+                AND t.type_ = #{param.type}
             </if>
-            <if test="userId != null">
-                user_id_ = #{userId},
+            <if test="param.clientType != null">
+                AND t.client_type_ = #{param.clientType}
             </if>
-            <if test="title != null">
-                title_ = #{title},
+            <if test="param.startTime!=null">
+                AND t.create_time_ >= #{param.startTime}
             </if>
-            <if test="content != null">
-                content_ = #{content},
+            <if test="param.endTime!=null">
+                AND #{param.endTime} >= t.create_time_
             </if>
-            <if test="mobileNo != null">
-                mobile_no_ = #{mobileNo},
+            <if test="param.suggestionTypeId != null">
+                AND t.suggestion_type_id_ = #{param.suggestionTypeId}
             </if>
-            <if test="type != null">
-                type_ = #{type, typeHandler=com.yonge.toolset.mybatis.dal.CustomEnumTypeHandler},
+            <if test="param.suggestionTypeName != null and param.suggestionTypeName.trim() != ''">
+                AND sst.name_ = #{param.suggestionTypeName}
             </if>
-        </set>
-        WHERE id_ = #{id} 
-    </update>
-
-    <!-- 根据主键删除一条记录 -->
-    <delete id="delete">
-		DELETE FROM sys_suggestion WHERE id_ = #{id} 
-	</delete>
-
-    <sql id="queryCondition">
-        <where>
-            su.del_flag_ = 0
-            <if test="type!=null">
-                AND ss.type_ = #{type, typeHandler=com.yonge.toolset.mybatis.dal.CustomEnumTypeHandler}
+            <if test="param.handleStatus != null">
+                AND t.handle_status_ = #{param.handleStatus}
             </if>
-            <if test="clientType!=null">
-                AND ss.client_type_ = #{clientType}
+            <if test="param.handleBy != null">
+                AND t.handle_by_ = #{param.handleBy}
             </if>
-            <if test="startTime!=null and startTime!=''">
-                AND DATE_FORMAT(ss.create_time_,'%Y-%m-%d') &gt;= #{startTime}
+            <if test="param.handStartTime != null">
+                AND t.handle_time_ >= #{param.handStartTime}
             </if>
-            <if test="endTime!=null and endTime!=''">
-                AND DATE_FORMAT(ss.create_time_,'%Y-%m-%d') &lt;= #{endTime}
+            <if test="param.handEndTime != null">
+                AND #{param.handEndTime} >= t.handle_time_
             </if>
-            <if test="search!=null and search!=''">
-                AND (su.real_name_ LIKE CONCAT('%', #{search}, '%') OR su.username_ LIKE CONCAT('%', #{search}, '%') OR ss.user_id_=#{search} OR su.phone_=#{search})
+            <if test="param.feedback != null">
+                AND t.feedback_ = #{param.feedback}
             </if>
         </where>
-    </sql>
-
-    <!-- 分页查询 -->
-    <select id="queryPage" resultMap="SysSuggestion" parameterType="map">
-        SELECT ss.*,
-        CASE WHEN (ss.client_type_='STUDENT' or ss.client_type_ = 'TENANT_STUDENT') THEN su.username_ ELSE su.real_name_ END
-        username_
-        FROM sys_suggestion ss
-        LEFT JOIN sys_user su ON su.id_ = ss.user_id_
-        <include refid="queryCondition" />
-        ORDER BY ss.id_ DESC
-        <include refid="global.limit"/>
+        ORDER BY t.id_ DESC
     </select>
 
-    <!-- 查询当前表的总记录数 -->
-    <select id="queryCount" resultType="int">
-		SELECT COUNT(ss.id_) FROM sys_suggestion ss
-        LEFT JOIN sys_user su ON su.id_ = ss.user_id_
-        <include refid="queryCondition" />
-	</select>
-</mapper>
+</mapper>

+ 26 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/SysSuggestionTypeMapper.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.biz.dal.mapper.SysSuggestionTypeMapper">
+
+
+
+    <!-- 表字段 -->
+    <sql id="baseColumns">
+        t.id_ AS id
+        , t.name_ AS `name`
+        , t.del_flag_ AS delFlag
+        , t.create_by_ AS createBy
+        , t.update_by_ AS updateBy
+        , t.update_time_ AS updateTime
+        , t.create_time_ AS createTime
+    </sql>
+
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.entity.SysSuggestionType">
+        SELECT
+        <include refid="baseColumns"/>
+        FROM sys_suggestion_type t
+        where del_flag_ = 0
+        order by t.create_time_ desc
+    </select>
+
+</mapper>

+ 1 - 1
cooleshow-user/user-student/src/main/java/com/yonge/cooleshow/student/controller/SysSuggestionController.java

@@ -48,7 +48,7 @@ public class SysSuggestionController extends BaseController {
             sysSuggestion.setClientType(ClientEnum.TENANT_STUDENT.getCode());
         }
 
-        sysSuggestionService.insert(sysSuggestion);
+        sysSuggestionService.save(sysSuggestion);
         return succeed();
     }