Browse Source

管乐迷12月20号需求变更

zouxuan 1 year ago
parent
commit
eacd393763

+ 43 - 0
mec-application/src/main/java/com/ym/mec/student/controller/SysSuggestionTypeController.java

@@ -0,0 +1,43 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.entity.SysSuggestionType;
+import com.ym.mec.biz.service.SysSuggestionTypeService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.tenant.TenantContextHolder;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Api(tags = "意见反馈类型")
+@RestController
+@RequestMapping("${app-config.url.student:}/sysSuggestionType/")
+public class SysSuggestionTypeController extends BaseController {
+
+    @Autowired
+    private SysSuggestionTypeService sysSuggestionTypeService;
+
+    @ApiOperation(value = "查询所有")
+    @PostMapping("queryAll")
+    public HttpResponseResult<Map<Integer,String>> queryAll() {
+        Map<Integer,String> result = new HashMap<>();
+        List<SysSuggestionType> list = sysSuggestionTypeService.lambdaQuery()
+                .eq(SysSuggestionType::getTenantId, TenantContextHolder.getTenantId())
+                .orderByDesc(SysSuggestionType::getId).list();
+        if (CollectionUtils.isNotEmpty(list)) {
+            list.forEach(item -> {
+                result.put(item.getId(),item.getType());
+            });
+        }
+        return succeed(result);
+    }
+
+}

+ 43 - 0
mec-application/src/main/java/com/ym/mec/teacher/controller/SysSuggestionTypeController.java

@@ -0,0 +1,43 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.biz.dal.entity.SysSuggestionType;
+import com.ym.mec.biz.service.SysSuggestionTypeService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.tenant.TenantContextHolder;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Api(tags = "意见反馈类型")
+@RestController
+@RequestMapping("${app-config.url.teacher:}/sysSuggestionType/")
+public class SysSuggestionTypeController extends BaseController {
+
+    @Autowired
+    private SysSuggestionTypeService sysSuggestionTypeService;
+
+    @ApiOperation(value = "分页查询")
+    @PostMapping("queryAll")
+    public HttpResponseResult<Map<Integer,String>> queryAll() {
+        Map<Integer,String> result = new HashMap<>();
+        List<SysSuggestionType> list = sysSuggestionTypeService.lambdaQuery()
+                .eq(SysSuggestionType::getTenantId, TenantContextHolder.getTenantId())
+                .orderByDesc(SysSuggestionType::getId).list();
+        if (CollectionUtils.isNotEmpty(list)) {
+            list.forEach(item -> {
+                result.put(item.getId(),item.getType());
+            });
+        }
+        return succeed(result);
+    }
+
+}

+ 77 - 0
mec-application/src/main/java/com/ym/mec/web/controller/education/EduSysSuggestionController.java

@@ -0,0 +1,77 @@
+package com.ym.mec.web.controller.education;
+
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.SysSuggestion;
+import com.ym.mec.biz.dal.entity.SysSuggestionType;
+import com.ym.mec.biz.dal.page.SysSuggestionQueryInfo;
+import com.ym.mec.biz.service.SysSuggestionService;
+import com.ym.mec.biz.service.SysSuggestionTypeService;
+import com.ym.mec.biz.service.SysUserService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.tenant.TenantContextHolder;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Api(tags = "意见反馈")
+@RestController
+@RequestMapping("${app-config.url.web:}/eduSuggestion")
+public class EduSysSuggestionController extends BaseController {
+
+    @Autowired
+    private SysSuggestionService suggestionService;
+    @Autowired
+    private SysSuggestionTypeService sysSuggestionTypeService;
+    @Autowired
+    private SysUserService sysUserService;
+
+    @ApiOperation(value = "新增建议")
+    @PostMapping("add")
+    public Object add(SysSuggestion sysSuggestion) {
+        SysUser sysUser = sysUserService.getUser();
+    	sysSuggestion.setClientType("SYSTEM");
+        sysSuggestion.setUserId(sysUser.getId().longValue());
+        if(StringUtils.isEmpty(sysSuggestion.getMobileNo())){
+            sysSuggestion.setMobileNo(sysUser.getPhone());
+        }
+        suggestionService.insert(sysSuggestion);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @PostMapping("queryPage")
+    public Object queryPage(@RequestBody SysSuggestionQueryInfo queryInfo) {
+        queryInfo.setUserId(sysUserService.getUserId());
+        return succeed(suggestionService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "获取详情")
+    @GetMapping("detail")
+    public HttpResponseResult<SysSuggestion> detail(Long id) {
+        return succeed(suggestionService.getDetail(id));
+    }
+
+    @ApiOperation(value = "分页查询")
+    @PostMapping("queryAll")
+    public HttpResponseResult<Map<Integer,String>> queryAll() {
+        Map<Integer,String> result = new HashMap<>();
+        List<SysSuggestionType> list = sysSuggestionTypeService.lambdaQuery()
+                .eq(SysSuggestionType::getTenantId, TenantContextHolder.getTenantId())
+                .orderByDesc(SysSuggestionType::getId).list();
+        if (CollectionUtils.isNotEmpty(list)) {
+            list.forEach(item -> {
+                result.put(item.getId(),item.getType());
+            });
+        }
+        return succeed(result);
+    }
+
+}

+ 69 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SysSuggestionTypeWrapper.java

@@ -0,0 +1,69 @@
+package com.ym.mec.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.Optional;
+
+/**
+ * app版本信息管理
+ * 2023-11-03 13:55:54
+ */
+@ApiModel(value = "SysSuggestionTypeWrapper对象")
+public class SysSuggestionTypeWrapper {
+
+    @Data
+	@Builder
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @ApiModel(" AppVersionInfoQuery-app版本信息管理")
+    public static class AppVersionInfoQuery implements QueryInfo {
+    
+    	@ApiModelProperty("当前页")
+        private Integer page;
+        
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+        
+        @ApiModelProperty("关键字匹配")
+		private String keyword;
+
+        @ApiModelProperty("平台")
+        private String platform;
+
+        @ApiModelProperty("状态")
+        private String status;
+
+        public String getKeyword() {
+            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
+        }
+        
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static AppVersionInfoQuery from(String json) {
+            return JSON.parseObject(json, AppVersionInfoQuery.class);
+        }
+    }  
+
+	@ApiModel(" AppVersionInfo-app版本信息管理")
+    public static class AppVersionInfo {
+        
+        public String jsonString() {
+            return JSON.toJSONString(this);
+        }
+
+        public static AppVersionInfo from(String json) {
+            return JSON.parseObject(json, AppVersionInfo.class);
+        }
+	}
+
+}