Browse Source

我要提建议,接口开发

origin/epidemic_user
zhangyongzhangyong 4 years ago
parent
commit
04bc66c91a
  1. 15
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/constant/ImageConstant.java
  2. 94
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/CustomImgController.java
  3. 94
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionFeedbackController.java
  4. 149
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionMakeController.java
  5. 108
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionTypeController.java
  6. 53
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/CustomImgDao.java
  7. 46
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionFeedbackDao.java
  8. 46
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionMakeDao.java
  9. 45
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionTypeDao.java
  10. 56
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/CustomImgEntity.java
  11. 61
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionFeedbackEntity.java
  12. 121
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionMakeEntity.java
  13. 66
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionTypeEntity.java
  14. 65
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/CustomImgExcel.java
  15. 68
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionFeedbackExcel.java
  16. 104
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionMakeExcel.java
  17. 71
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionTypeExcel.java
  18. 47
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/CustomImgRedis.java
  19. 47
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionFeedbackRedis.java
  20. 47
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionMakeRedis.java
  21. 47
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionTypeRedis.java
  22. 117
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/CustomImgService.java
  23. 95
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionFeedbackService.java
  24. 138
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionMakeService.java
  25. 107
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionTypeService.java
  26. 127
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/CustomImgServiceImpl.java
  27. 104
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionFeedbackServiceImpl.java
  28. 186
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionMakeServiceImpl.java
  29. 117
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionTypeServiceImpl.java
  30. 30
      epdc-cloud-custom/src/main/resources/mapper/suggestion/CustomImgDao.xml
  31. 34
      epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionFeedbackDao.xml
  32. 55
      epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionMakeDao.xml
  33. 32
      epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionTypeDao.xml

15
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/constant/ImageConstant.java

@ -0,0 +1,15 @@
package com.elink.esua.epdc.constant;
/**
* 图片常量
* @Author zy
* @Date 2019/9/8 17:07
*/
public interface ImageConstant {
/**
* 图片类型-提建议
*/
public final static String TYPE_IMAGE_SUGGESTION_MAKE = "suggestion";
}

94
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/CustomImgController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.suggestion.CustomImgDTO;
import com.elink.esua.epdc.modules.suggestion.excel.CustomImgExcel;
import com.elink.esua.epdc.modules.suggestion.service.CustomImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* customer 库共用图片表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@RestController
@RequestMapping("customimg")
public class CustomImgController {
@Autowired
private CustomImgService customImgService;
@GetMapping("page")
public Result<PageData<CustomImgDTO>> page(@RequestParam Map<String, Object> params){
PageData<CustomImgDTO> page = customImgService.page(params);
return new Result<PageData<CustomImgDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<CustomImgDTO> get(@PathVariable("id") String id){
CustomImgDTO data = customImgService.get(id);
return new Result<CustomImgDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody CustomImgDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
customImgService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody CustomImgDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
customImgService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
customImgService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<CustomImgDTO> list = customImgService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, CustomImgExcel.class);
}
}

94
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionFeedbackController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.suggestion.SuggestionFeedbackDTO;
import com.elink.esua.epdc.modules.suggestion.excel.SuggestionFeedbackExcel;
import com.elink.esua.epdc.modules.suggestion.service.SuggestionFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 建议反馈表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@RestController
@RequestMapping("suggestionfeedback")
public class SuggestionFeedbackController {
@Autowired
private SuggestionFeedbackService suggestionFeedbackService;
@GetMapping("page")
public Result<PageData<SuggestionFeedbackDTO>> page(@RequestParam Map<String, Object> params){
PageData<SuggestionFeedbackDTO> page = suggestionFeedbackService.page(params);
return new Result<PageData<SuggestionFeedbackDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<SuggestionFeedbackDTO> get(@PathVariable("id") String id){
SuggestionFeedbackDTO data = suggestionFeedbackService.get(id);
return new Result<SuggestionFeedbackDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody SuggestionFeedbackDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
suggestionFeedbackService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody SuggestionFeedbackDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
suggestionFeedbackService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
suggestionFeedbackService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SuggestionFeedbackDTO> list = suggestionFeedbackService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, SuggestionFeedbackExcel.class);
}
}

149
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionMakeController.java

@ -0,0 +1,149 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.suggestion.SuggestionMakeDTO;
import com.elink.esua.epdc.dto.suggestion.form.MySuggestionFormDTO;
import com.elink.esua.epdc.dto.suggestion.form.SuggestionMakeFormDTO;
import com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO;
import com.elink.esua.epdc.modules.suggestion.excel.SuggestionMakeExcel;
import com.elink.esua.epdc.modules.suggestion.service.SuggestionMakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 我有建议要提
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@RestController
@RequestMapping("suggestionmake")
public class SuggestionMakeController {
@Autowired
private SuggestionMakeService suggestionMakeService;
@GetMapping("page")
public Result<PageData<SuggestionMakeDTO>> page(@RequestParam Map<String, Object> params){
PageData<SuggestionMakeDTO> page = suggestionMakeService.page(params);
return new Result<PageData<SuggestionMakeDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<SuggestionMakeDTO> get(@PathVariable("id") String id){
SuggestionMakeDTO data = suggestionMakeService.get(id);
return new Result<SuggestionMakeDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody SuggestionMakeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
suggestionMakeService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody SuggestionMakeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
suggestionMakeService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
suggestionMakeService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SuggestionMakeDTO> list = suggestionMakeService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, SuggestionMakeExcel.class);
}
/**
* 新增建议
*
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 15:21 2021-09-14
**/
@PostMapping("insertSuggestion")
public Result insertSuggestion(@RequestBody SuggestionMakeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return suggestionMakeService.insertSuggestion(formDTO);
}
/**
* 修改建议
*
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 15:21 2021-09-14
**/
@PostMapping("updateSuggestion")
public Result updateSuggestion(@RequestBody SuggestionMakeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return suggestionMakeService.updateSuggestion(formDTO);
}
/**
* 我提出的建议
*
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO>>
* @Author zhangyong
* @Date 15:58 2021-09-14
**/
@GetMapping("mySuggestion")
public Result<List<MySuggestionResultDTO>> mySuggestion(@RequestBody MySuggestionFormDTO formDTO) {
return suggestionMakeService.getMySuggestion(formDTO);
}
/**
* 建议详情
* @param id
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO>
* @Author zhangyong
* @Date 09:37 2021-09-15
**/
@GetMapping("detailSuggestion/{id}")
public Result<MySuggestionResultDTO> detailSuggestion(@PathVariable String id) {
return suggestionMakeService.getDetailSuggestion(id);
}
}

108
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionTypeController.java

@ -0,0 +1,108 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.TypeNode;
import com.elink.esua.epdc.dto.suggestion.SuggestionTypeDTO;
import com.elink.esua.epdc.modules.suggestion.excel.SuggestionTypeExcel;
import com.elink.esua.epdc.modules.suggestion.service.SuggestionTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 建议类别表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@RestController
@RequestMapping("suggestiontype")
public class SuggestionTypeController {
@Autowired
private SuggestionTypeService suggestionTypeService;
@GetMapping("page")
public Result<PageData<SuggestionTypeDTO>> page(@RequestParam Map<String, Object> params){
PageData<SuggestionTypeDTO> page = suggestionTypeService.page(params);
return new Result<PageData<SuggestionTypeDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<SuggestionTypeDTO> get(@PathVariable("id") String id){
SuggestionTypeDTO data = suggestionTypeService.get(id);
return new Result<SuggestionTypeDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody SuggestionTypeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
suggestionTypeService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody SuggestionTypeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
suggestionTypeService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
suggestionTypeService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SuggestionTypeDTO> list = suggestionTypeService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, SuggestionTypeExcel.class);
}
/**
* 获取 建议类别 树结构
*
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.TypeOption>
* @Author zhangyong
* @Date 14:15 2021-09-14
**/
@GetMapping("getSuggestionTypeTree")
public Result<List<TypeNode>> getSuggestionTypeTree() {
return suggestionTypeService.getSuggestionTypeTree();
}
}

53
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/CustomImgDao.java

@ -0,0 +1,53 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.suggestion.entity.CustomImgEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* customer 库共用图片表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Mapper
public interface CustomImgDao extends BaseDao<CustomImgEntity> {
/**
* 删除
*
* @param referenceId
* @return void
* @Author zhangyong
* @Date 17:51 2021-09-14
**/
void deleteByReferenceId(@Param("referenceId") String referenceId);
/**
* 根据 referenceId查询图片路径
*
* @param referenceId
* @return java.lang.String[]
* @Author zhangyong
* @Date 16:51 2021-09-14
**/
String[] selectListImgUrlsByIds(@Param("referenceId") String referenceId);
}

46
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionFeedbackDao.java

@ -0,0 +1,46 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.FeedbackInfoDTO;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionFeedbackEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 建议反馈表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Mapper
public interface SuggestionFeedbackDao extends BaseDao<SuggestionFeedbackEntity> {
/**
* 查询反馈内容
*
* @param suggestionId
* @return java.util.List<com.elink.esua.epdc.dto.FeedbackInfoDTO>
* @Author zhangyong
* @Date 17:00 2021-09-14
**/
List<FeedbackInfoDTO> selectListMyFeedbackContent(@Param("suggestionId") String suggestionId);
}

46
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionMakeDao.java

@ -0,0 +1,46 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.suggestion.form.MySuggestionFormDTO;
import com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionMakeEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 我有建议要提
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Mapper
public interface SuggestionMakeDao extends BaseDao<SuggestionMakeEntity> {
/**
* 我提出的所有建议
*
* @param formDTO
* @return java.util.List<com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO>
* @Author zhangyong
* @Date 16:29 2021-09-14
**/
List<MySuggestionResultDTO> selectListMySuggestion(MySuggestionFormDTO formDTO);
}

45
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionTypeDao.java

@ -0,0 +1,45 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.TypeNode;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionTypeEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 建议类别表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Mapper
public interface SuggestionTypeDao extends BaseDao<SuggestionTypeEntity> {
/**
* 查询启用的 建议类别
*
* @param
* @return java.util.List<com.elink.esua.epdc.dto.TypeNode>
* @Author zhangyong
* @Date 14:23 2021-09-14
**/
List<TypeNode> selectListSuggestionTypeTree();
}

56
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/CustomImgEntity.java

@ -0,0 +1,56 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* customer 库共用图片表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_custom_img")
public class CustomImgEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 引用ID
*/
private String referenceId;
/**
* 图片地址
*/
private String imgUrl;
/**
* 图片类型
*/
private String imgType;
}

61
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionFeedbackEntity.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 建议反馈表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_suggestion_feedback")
public class SuggestionFeedbackEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 建议反馈内容
*/
private String feedbackContent;
/**
* 提建议表主键 关联epdc_suggestion_make
*/
private String suggestionId;
/**
* 反馈部门ID
*/
private Long deptId;
/**
* 反馈部门名称
*/
private String deptName;
}

121
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionMakeEntity.java

@ -0,0 +1,121 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 我有建议要提
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_suggestion_make")
public class SuggestionMakeEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 建议类别 关联epdc_suggestion_type
*/
private String suggestionTypeId;
/**
* 所有 建议类别ID
*/
private String allSuggestionTypeId;
/**
* 建议标题
*/
private String suggestionTitle;
/**
* 建议内容
*/
private String suggestionContent;
/**
* 提意见的用户ID
*/
private String userId;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户头像
*/
private String faceImg;
/**
* 手机号
*/
private String mobile;
/**
* 是否是党员(0-1-)
*/
private String partyFlag;
/**
* 居住网格id
*/
private Long deptId;
/**
* 居住网格名称
*/
private String deptName;
/**
* 父所有部门id
*/
private String parentDeptIds;
/**
* 父所有部门名称
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
/**
* 是否反馈 0-1-
*/
private String isFeedback;
}

66
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionTypeEntity.java

@ -0,0 +1,66 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 建议类别表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_suggestion_type")
public class SuggestionTypeEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 建议类别名称
*/
private String suggestionName;
/**
* 上级ID
*/
private String pid;
/**
* 所有上级ID用逗号分开
*/
private String pids;
/**
* 排序
*/
private Integer sort;
/**
* 启用标识0-1-
*/
private String enableFlag;
}

65
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/CustomImgExcel.java

@ -0,0 +1,65 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* customer 库共用图片表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Data
public class CustomImgExcel {
@Excel(name = "ID")
private String id;
@Excel(name = "引用ID")
private String referenceId;
@Excel(name = "图片地址")
private String imgUrl;
@Excel(name = "图片类型")
private String imgType;
@Excel(name = "删除标识 0:未删除,1:删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

68
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionFeedbackExcel.java

@ -0,0 +1,68 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 建议反馈表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Data
public class SuggestionFeedbackExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "建议,反馈内容")
private String feedbackContent;
@Excel(name = "提建议表主键 关联:epdc_suggestion_make")
private String suggestionId;
@Excel(name = "反馈部门ID")
private Long deptId;
@Excel(name = "反馈部门名称")
private String deptName;
@Excel(name = "删除标识 0-否,1-是")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

104
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionMakeExcel.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 我有建议要提
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Data
public class SuggestionMakeExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "建议类别 关联:epdc_suggestion_type")
private String suggestionTypeId;
@Excel(name = "建议标题")
private String suggestionTitle;
@Excel(name = "建议内容")
private String suggestionContent;
@Excel(name = "建议图片 关联:epdc_custom_img 表;最多三张,逗号分隔")
private String suggestionPic;
@Excel(name = "提意见的用户ID")
private String userId;
@Excel(name = "用户昵称")
private String nickname;
@Excel(name = "用户头像")
private String faceImg;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "是否是党员(0-否,1-是)")
private String partyFlag;
@Excel(name = "居住网格id")
private Long deptId;
@Excel(name = "居住网格名称")
private String deptName;
@Excel(name = "父所有部门id")
private String parentDeptIds;
@Excel(name = "父所有部门名称")
private String parentDeptNames;
@Excel(name = "所有部门ID")
private String allDeptIds;
@Excel(name = "所有部门名称")
private String allDeptNames;
@Excel(name = "是否反馈 0-否,1-是")
private String isFeedback;
@Excel(name = "删除标识 0-否,1-是")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

71
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionTypeExcel.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 建议类别表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Data
public class SuggestionTypeExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "建议类别名称")
private String suggestionName;
@Excel(name = "上级ID")
private String pid;
@Excel(name = "所有上级ID,用逗号分开")
private String pids;
@Excel(name = "排序")
private Integer sort;
@Excel(name = "启用标识(0-否,1-是)")
private String enableFlag;
@Excel(name = "删除标识 0-否,1-是")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/CustomImgRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* customer 库共用图片表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Component
public class CustomImgRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionFeedbackRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 建议反馈表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Component
public class SuggestionFeedbackRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionMakeRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 我有建议要提
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Component
public class SuggestionMakeRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionTypeRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 建议类别表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Component
public class SuggestionTypeRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

117
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/CustomImgService.java

@ -0,0 +1,117 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.suggestion.CustomImgDTO;
import com.elink.esua.epdc.modules.suggestion.entity.CustomImgEntity;
import java.util.List;
import java.util.Map;
/**
* customer 库共用图片表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
public interface CustomImgService extends BaseService<CustomImgEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CustomImgDTO>
* @author generator
* @date 2021-09-14
*/
PageData<CustomImgDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CustomImgDTO>
* @author generator
* @date 2021-09-14
*/
List<CustomImgDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return CustomImgDTO
* @author generator
* @date 2021-09-14
*/
CustomImgDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-09-14
*/
void save(CustomImgDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-09-14
*/
void update(CustomImgDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-09-14
*/
void delete(String[] ids);
/**
* 删除
*
* @param referenceId
* @return void
* @Author zhangyong
* @Date 17:51 2021-09-14
**/
void deleteByReferenceId(String referenceId);
/**
* 保存图片
*
* @Params: [images, eventId, imgType]
* @Return: boolean
* @Author: zy
* @Date: 2019/9/8 17:12
*/
boolean saveImages(List<String> images, String referenceId, String imgType);
}

95
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionFeedbackService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.suggestion.SuggestionFeedbackDTO;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionFeedbackEntity;
import java.util.List;
import java.util.Map;
/**
* 建议反馈表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
public interface SuggestionFeedbackService extends BaseService<SuggestionFeedbackEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<SuggestionFeedbackDTO>
* @author generator
* @date 2021-09-14
*/
PageData<SuggestionFeedbackDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<SuggestionFeedbackDTO>
* @author generator
* @date 2021-09-14
*/
List<SuggestionFeedbackDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return SuggestionFeedbackDTO
* @author generator
* @date 2021-09-14
*/
SuggestionFeedbackDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-09-14
*/
void save(SuggestionFeedbackDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-09-14
*/
void update(SuggestionFeedbackDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-09-14
*/
void delete(String[] ids);
}

138
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionMakeService.java

@ -0,0 +1,138 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.suggestion.SuggestionMakeDTO;
import com.elink.esua.epdc.dto.suggestion.form.MySuggestionFormDTO;
import com.elink.esua.epdc.dto.suggestion.form.SuggestionMakeFormDTO;
import com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionMakeEntity;
import java.util.List;
import java.util.Map;
/**
* 我有建议要提
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
public interface SuggestionMakeService extends BaseService<SuggestionMakeEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<SuggestionMakeDTO>
* @author generator
* @date 2021-09-14
*/
PageData<SuggestionMakeDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<SuggestionMakeDTO>
* @author generator
* @date 2021-09-14
*/
List<SuggestionMakeDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return SuggestionMakeDTO
* @author generator
* @date 2021-09-14
*/
SuggestionMakeDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-09-14
*/
void save(SuggestionMakeDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-09-14
*/
void update(SuggestionMakeDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-09-14
*/
void delete(String[] ids);
/**
* 新增建议
*
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 15:21 2021-09-14
**/
Result insertSuggestion(SuggestionMakeFormDTO formDTO);
/**
* 修改建议
*
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @Author zhangyong
* @Date 15:21 2021-09-14
**/
Result updateSuggestion(SuggestionMakeFormDTO formDTO);
/**
* 我提出的建议
*
* @param formDTO
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO>>
* @Author zhangyong
* @Date 15:58 2021-09-14
**/
Result<List<MySuggestionResultDTO>> getMySuggestion( MySuggestionFormDTO formDTO);
/**
* 建议详情
* @param id
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO>
* @Author zhangyong
* @Date 09:37 2021-09-15
**/
Result<MySuggestionResultDTO> getDetailSuggestion(String id);
}

107
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionTypeService.java

@ -0,0 +1,107 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.TypeNode;
import com.elink.esua.epdc.dto.suggestion.SuggestionTypeDTO;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionTypeEntity;
import java.util.List;
import java.util.Map;
/**
* 建议类别表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
public interface SuggestionTypeService extends BaseService<SuggestionTypeEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<SuggestionTypeDTO>
* @author generator
* @date 2021-09-14
*/
PageData<SuggestionTypeDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<SuggestionTypeDTO>
* @author generator
* @date 2021-09-14
*/
List<SuggestionTypeDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return SuggestionTypeDTO
* @author generator
* @date 2021-09-14
*/
SuggestionTypeDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-09-14
*/
void save(SuggestionTypeDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-09-14
*/
void update(SuggestionTypeDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-09-14
*/
void delete(String[] ids);
/**
* 获取 建议类别 树结构
*
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.TypeOption>
* @Author zhangyong
* @Date 14:15 2021-09-14
**/
Result<List<TypeNode>> getSuggestionTypeTree();
}

127
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/CustomImgServiceImpl.java

@ -0,0 +1,127 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.dto.suggestion.CustomImgDTO;
import com.elink.esua.epdc.modules.suggestion.dao.CustomImgDao;
import com.elink.esua.epdc.modules.suggestion.entity.CustomImgEntity;
import com.elink.esua.epdc.modules.suggestion.redis.CustomImgRedis;
import com.elink.esua.epdc.modules.suggestion.service.CustomImgService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* customer 库共用图片表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Service
public class CustomImgServiceImpl extends BaseServiceImpl<CustomImgDao, CustomImgEntity> implements CustomImgService {
@Autowired
private CustomImgRedis customImgRedis;
@Override
public PageData<CustomImgDTO> page(Map<String, Object> params) {
IPage<CustomImgEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CustomImgDTO.class);
}
@Override
public List<CustomImgDTO> list(Map<String, Object> params) {
List<CustomImgEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CustomImgDTO.class);
}
private QueryWrapper<CustomImgEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CustomImgEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public CustomImgDTO get(String id) {
CustomImgEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, CustomImgDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(CustomImgDTO dto) {
CustomImgEntity entity = ConvertUtils.sourceToTarget(dto, CustomImgEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(CustomImgDTO dto) {
CustomImgEntity entity = ConvertUtils.sourceToTarget(dto, CustomImgEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void deleteByReferenceId(String referenceId) {
baseDao.deleteByReferenceId(referenceId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveImages(List<String> images, String referenceId, String imgType) {
if (null == images || images.isEmpty()) {
return true;
}
List<CustomImgEntity> imgEntities = new ArrayList<>(images.size());
CustomImgEntity entity = null;
for (int i = 0; i < images.size(); i++) {
entity = new CustomImgEntity();
entity.setReferenceId(referenceId);
entity.setImgUrl(images.get(i));
entity.setImgType(imgType);
imgEntities.add(entity);
}
return insertBatch(imgEntities);
}
}

104
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionFeedbackServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.dto.suggestion.SuggestionFeedbackDTO;
import com.elink.esua.epdc.modules.suggestion.dao.SuggestionFeedbackDao;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionFeedbackEntity;
import com.elink.esua.epdc.modules.suggestion.redis.SuggestionFeedbackRedis;
import com.elink.esua.epdc.modules.suggestion.service.SuggestionFeedbackService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 建议反馈表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Service
public class SuggestionFeedbackServiceImpl extends BaseServiceImpl<SuggestionFeedbackDao, SuggestionFeedbackEntity> implements SuggestionFeedbackService {
@Autowired
private SuggestionFeedbackRedis suggestionFeedbackRedis;
@Override
public PageData<SuggestionFeedbackDTO> page(Map<String, Object> params) {
IPage<SuggestionFeedbackEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, SuggestionFeedbackDTO.class);
}
@Override
public List<SuggestionFeedbackDTO> list(Map<String, Object> params) {
List<SuggestionFeedbackEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, SuggestionFeedbackDTO.class);
}
private QueryWrapper<SuggestionFeedbackEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<SuggestionFeedbackEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public SuggestionFeedbackDTO get(String id) {
SuggestionFeedbackEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, SuggestionFeedbackDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(SuggestionFeedbackDTO dto) {
SuggestionFeedbackEntity entity = ConvertUtils.sourceToTarget(dto, SuggestionFeedbackEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(SuggestionFeedbackDTO dto) {
SuggestionFeedbackEntity entity = ConvertUtils.sourceToTarget(dto, SuggestionFeedbackEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

186
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionMakeServiceImpl.java

@ -0,0 +1,186 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.constant.StrConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.ImageConstant;
import com.elink.esua.epdc.dto.suggestion.SuggestionMakeDTO;
import com.elink.esua.epdc.dto.suggestion.form.MySuggestionFormDTO;
import com.elink.esua.epdc.dto.suggestion.form.SuggestionMakeFormDTO;
import com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO;
import com.elink.esua.epdc.modules.suggestion.dao.CustomImgDao;
import com.elink.esua.epdc.modules.suggestion.dao.SuggestionFeedbackDao;
import com.elink.esua.epdc.modules.suggestion.dao.SuggestionMakeDao;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionMakeEntity;
import com.elink.esua.epdc.modules.suggestion.redis.SuggestionMakeRedis;
import com.elink.esua.epdc.modules.suggestion.service.CustomImgService;
import com.elink.esua.epdc.modules.suggestion.service.SuggestionMakeService;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 我有建议要提
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Service
public class SuggestionMakeServiceImpl extends BaseServiceImpl<SuggestionMakeDao, SuggestionMakeEntity> implements SuggestionMakeService {
@Autowired
private SuggestionMakeRedis suggestionMakeRedis;
@Autowired
private CustomImgService customImgService;
@Autowired
private CustomImgDao customImgDao;
@Autowired
private SuggestionFeedbackDao suggestionFeedbackDao;
@Override
public PageData<SuggestionMakeDTO> page(Map<String, Object> params) {
IPage<SuggestionMakeEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, SuggestionMakeDTO.class);
}
@Override
public List<SuggestionMakeDTO> list(Map<String, Object> params) {
List<SuggestionMakeEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, SuggestionMakeDTO.class);
}
private QueryWrapper<SuggestionMakeEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<SuggestionMakeEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public SuggestionMakeDTO get(String id) {
SuggestionMakeEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, SuggestionMakeDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(SuggestionMakeDTO dto) {
SuggestionMakeEntity entity = ConvertUtils.sourceToTarget(dto, SuggestionMakeEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(SuggestionMakeDTO dto) {
SuggestionMakeEntity entity = ConvertUtils.sourceToTarget(dto, SuggestionMakeEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public Result insertSuggestion(SuggestionMakeFormDTO formDTO) {
SuggestionMakeEntity entity = ConvertUtils.sourceToTarget(formDTO, SuggestionMakeEntity.class);
entity.setSuggestionTypeId(formDTO.getSuggestionTypeIds()[formDTO.getSuggestionTypeIds().length - NumConstant.ONE]);
entity.setAllSuggestionTypeId(StringUtils.join(formDTO.getSuggestionTypeIds(), StrConstant.COMMA));
entity.setIsFeedback(NumConstant.ZERO_STR);
insert(entity);
if (null != formDTO.getSuggestionPics() && NumConstant.ZERO < formDTO.getSuggestionPics().length) {
customImgService.saveImages(Arrays.asList(formDTO.getSuggestionPics()), entity.getId(), ImageConstant.TYPE_IMAGE_SUGGESTION_MAKE);
}
return new Result();
}
@Override
public Result updateSuggestion(SuggestionMakeFormDTO formDTO) {
SuggestionMakeEntity entity = ConvertUtils.sourceToTarget(formDTO, SuggestionMakeEntity.class);
entity.setSuggestionTypeId(formDTO.getSuggestionTypeIds()[formDTO.getSuggestionTypeIds().length - NumConstant.ONE]);
entity.setAllSuggestionTypeId(StringUtils.join(formDTO.getSuggestionTypeIds(), StrConstant.COMMA));
entity.setIsFeedback(NumConstant.ZERO_STR);
updateById(entity);
customImgService.deleteByReferenceId(formDTO.getId());
if (null != formDTO.getSuggestionPics() && NumConstant.ZERO < formDTO.getSuggestionPics().length) {
customImgService.saveImages(Arrays.asList(formDTO.getSuggestionPics()), entity.getId(), ImageConstant.TYPE_IMAGE_SUGGESTION_MAKE);
}
return new Result();
}
@Override
public Result<List<MySuggestionResultDTO>> getMySuggestion(MySuggestionFormDTO formDTO) {
formDTO.setPageIndex((formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize());
// 查询我提出的所有建议
List<MySuggestionResultDTO> mySuggestionList = baseDao.selectListMySuggestion(formDTO);
for (MySuggestionResultDTO dto : mySuggestionList) {
dto.setSuggestionTypeIds(dto.getAllSuggestionTypeId().split(StrConstant.COMMA));
// 查询建议图片URL
dto.setSuggestionPics(customImgDao.selectListImgUrlsByIds(dto.getId()));
// 查询反馈记录
if (NumConstant.ONE_STR.equals(dto.getIsFeedback())) {
dto.setFeedbackList(suggestionFeedbackDao.selectListMyFeedbackContent(dto.getId()));
}
}
return new Result<List<MySuggestionResultDTO>>().ok(mySuggestionList);
}
@Override
public Result<MySuggestionResultDTO> getDetailSuggestion(String id) {
SuggestionMakeEntity makeEntity = baseDao.selectById(id);
MySuggestionResultDTO result = ConvertUtils.sourceToTarget(makeEntity, MySuggestionResultDTO.class);
result.setSuggestionTypeIds(result.getAllSuggestionTypeId().split(StrConstant.COMMA));
// 查询建议图片URL
result.setSuggestionPics(customImgDao.selectListImgUrlsByIds(result.getId()));
// 查询反馈记录
if (NumConstant.ONE_STR.equals(result.getIsFeedback())) {
result.setFeedbackList(suggestionFeedbackDao.selectListMyFeedbackContent(result.getId()));
}
return new Result<MySuggestionResultDTO>().ok(result);
}
}

117
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionTypeServiceImpl.java

@ -0,0 +1,117 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.suggestion.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.TypeNode;
import com.elink.esua.epdc.dto.suggestion.SuggestionTypeDTO;
import com.elink.esua.epdc.modules.suggestion.dao.SuggestionTypeDao;
import com.elink.esua.epdc.modules.suggestion.entity.SuggestionTypeEntity;
import com.elink.esua.epdc.modules.suggestion.redis.SuggestionTypeRedis;
import com.elink.esua.epdc.modules.suggestion.service.SuggestionTypeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 建议类别表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2021-09-14
*/
@Service
public class SuggestionTypeServiceImpl extends BaseServiceImpl<SuggestionTypeDao, SuggestionTypeEntity> implements SuggestionTypeService {
@Autowired
private SuggestionTypeRedis suggestionTypeRedis;
@Override
public PageData<SuggestionTypeDTO> page(Map<String, Object> params) {
IPage<SuggestionTypeEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, SuggestionTypeDTO.class);
}
@Override
public List<SuggestionTypeDTO> list(Map<String, Object> params) {
List<SuggestionTypeEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, SuggestionTypeDTO.class);
}
private QueryWrapper<SuggestionTypeEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<SuggestionTypeEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public SuggestionTypeDTO get(String id) {
SuggestionTypeEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, SuggestionTypeDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(SuggestionTypeDTO dto) {
SuggestionTypeEntity entity = ConvertUtils.sourceToTarget(dto, SuggestionTypeEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(SuggestionTypeDTO dto) {
SuggestionTypeEntity entity = ConvertUtils.sourceToTarget(dto, SuggestionTypeEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public Result<List<TypeNode>> getSuggestionTypeTree() {
List<TypeNode> nodes = baseDao.selectListSuggestionTypeTree();
Map<String, List<TypeNode>> children = nodes.stream().filter(node -> !(node.getPid().equals(NumConstant.ZERO_STR)))
.collect(Collectors.groupingBy(node -> node.getPid()));
nodes.forEach(node -> node.setChildren(children.get(node.getValue())));
List<TypeNode> result = nodes.stream().filter(node -> node.getPid().equals(NumConstant.ZERO_STR)).collect(Collectors.toList());
return new Result<List<TypeNode>>().ok(result);
}
}

30
epdc-cloud-custom/src/main/resources/mapper/suggestion/CustomImgDao.xml

@ -0,0 +1,30 @@
<?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.elink.esua.epdc.modules.suggestion.dao.CustomImgDao">
<resultMap type="com.elink.esua.epdc.modules.suggestion.entity.CustomImgEntity" id="customImgMap">
<result property="id" column="ID"/>
<result property="referenceId" column="REFERENCE_ID"/>
<result property="imgUrl" column="IMG_URL"/>
<result property="imgType" column="IMG_TYPE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="deleteByReferenceId">
update epdc_custom_img set DEL_FLAG = '1' where REFERENCE_ID = #{referenceId}
</update>
<select id="selectListImgUrlsByIds" resultType="java.lang.String">
SELECT
IMG_URL
FROM epdc_custom_img
WHERE DEL_FLAG ='0'
AND REFERENCE_ID = #{referenceId}
</select>
</mapper>

34
epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionFeedbackDao.xml

@ -0,0 +1,34 @@
<?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.elink.esua.epdc.modules.suggestion.dao.SuggestionFeedbackDao">
<resultMap type="com.elink.esua.epdc.modules.suggestion.entity.SuggestionFeedbackEntity" id="suggestionFeedbackMap">
<result property="id" column="ID"/>
<result property="feedbackContent" column="FEEDBACK_CONTENT"/>
<result property="suggestionId" column="SUGGESTION_ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListMyFeedbackContent" resultType="com.elink.esua.epdc.dto.FeedbackInfoDTO">
SELECT
ID,
FEEDBACK_CONTENT,
DEPT_ID,
DEPT_NAME
FROM epdc_suggestion_feedback
WHERE DEL_FLAG ='0'
<if test="suggestionId != null and suggestionId != ''">
AND SUGGESTION_ID = #{suggestionId}
</if>
ORDER BY CREATED_TIME DESC
</select>
</mapper>

55
epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionMakeDao.xml

@ -0,0 +1,55 @@
<?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.elink.esua.epdc.modules.suggestion.dao.SuggestionMakeDao">
<resultMap type="com.elink.esua.epdc.modules.suggestion.entity.SuggestionMakeEntity" id="suggestionMakeMap">
<result property="id" column="ID"/>
<result property="suggestionTypeId" column="SUGGESTION_TYPE_ID"/>
<result property="allSuggestionTypeId" column="ALL_SUGGESTION_TYPE_ID"/>
<result property="suggestionTitle" column="SUGGESTION_TITLE"/>
<result property="suggestionContent" column="SUGGESTION_CONTENT"/>
<result property="userId" column="USER_ID"/>
<result property="nickname" column="NICKNAME"/>
<result property="faceImg" column="FACE_IMG"/>
<result property="mobile" column="MOBILE"/>
<result property="partyFlag" column="PARTY_FLAG"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="isFeedback" column="IS_FEEDBACK"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListMySuggestion" resultType="com.elink.esua.epdc.dto.suggestion.result.MySuggestionResultDTO">
SELECT
m.ID,
m.SUGGESTION_TYPE_ID,
m.ALL_SUGGESTION_TYPE_ID,
m.SUGGESTION_TITLE,
m.SUGGESTION_CONTENT,
m.USER_ID,
m.NICKNAME,
m.FACE_IMG,
m.MOBILE,
m.PARTY_FLAG,
m.IS_FEEDBACK,
t.SUGGESTION_NAME suggestionTypeName
FROM epdc_suggestion_make m
LEFT JOIN epdc_suggestion_type t ON m.SUGGESTION_TYPE_ID = t.ID AND t.DEL_FLAG = '0'
WHERE m.DEL_FLAG = '0'
<if test="userId != null and userId != ''">
AND USER_ID = #{userId}
</if>
ORDER BY m.CREATED_TIME DESC
LIMIT #{pageIndex},#{pageSize}
</select>
</mapper>

32
epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionTypeDao.xml

@ -0,0 +1,32 @@
<?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.elink.esua.epdc.modules.suggestion.dao.SuggestionTypeDao">
<resultMap type="com.elink.esua.epdc.modules.suggestion.entity.SuggestionTypeEntity" id="suggestionTypeMap">
<result property="id" column="ID"/>
<result property="suggestionName" column="SUGGESTION_NAME"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="sort" column="SORT"/>
<result property="enableFlag" column="ENABLE_FLAG"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!--获取所有部门tree-->
<select id="selectListSuggestionTypeTree" resultType="com.elink.esua.epdc.dto.TypeNode">
SELECT
ID `value`,
SUGGESTION_NAME label,
PID pid
FROM epdc_suggestion_type
WHERE DEL_FLAG = '0'
AND ENABLE_FLAG ='1'
ORDER BY SORT
</select>
</mapper>
Loading…
Cancel
Save