| 
					
				 | 
			
			
				@@ -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); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |