diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/constant/ImageConstant.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/constant/ImageConstant.java new file mode 100644 index 0000000..60a334d --- /dev/null +++ b/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"; + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/CustomImgController.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/CustomImgController.java new file mode 100644 index 0000000..558946a --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestParam Map params){ + PageData page = customImgService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomImgDTO data = customImgService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = customImgService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomImgExcel.class); + } + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionFeedbackController.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionFeedbackController.java new file mode 100644 index 0000000..2c5aa32 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestParam Map params){ + PageData page = suggestionFeedbackService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + SuggestionFeedbackDTO data = suggestionFeedbackService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = suggestionFeedbackService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, SuggestionFeedbackExcel.class); + } + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionMakeController.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionMakeController.java new file mode 100644 index 0000000..a24ce29 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestParam Map params){ + PageData page = suggestionMakeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + SuggestionMakeDTO data = suggestionMakeService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List 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> + * @Author zhangyong + * @Date 15:58 2021-09-14 + **/ + @GetMapping("mySuggestion") + public Result> mySuggestion(@RequestBody MySuggestionFormDTO formDTO) { + return suggestionMakeService.getMySuggestion(formDTO); + } + + /** + * 建议详情 + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:37 2021-09-15 + **/ + @GetMapping("detailSuggestion/{id}") + public Result detailSuggestion(@PathVariable String id) { + return suggestionMakeService.getDetailSuggestion(id); + } +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionTypeController.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/controller/SuggestionTypeController.java new file mode 100644 index 0000000..529665e --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestParam Map params){ + PageData page = suggestionTypeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + SuggestionTypeDTO data = suggestionTypeService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = suggestionTypeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, SuggestionTypeExcel.class); + } + + /** + * 获取 建议类别 树结构 + * + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:15 2021-09-14 + **/ + @GetMapping("getSuggestionTypeTree") + public Result> getSuggestionTypeTree() { + return suggestionTypeService.getSuggestionTypeTree(); + } + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/CustomImgDao.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/CustomImgDao.java new file mode 100644 index 0000000..c158c9c --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 删除 + * + * @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); +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionFeedbackDao.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionFeedbackDao.java new file mode 100644 index 0000000..e732577 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 查询反馈内容 + * + * @param suggestionId + * @return java.util.List + * @Author zhangyong + * @Date 17:00 2021-09-14 + **/ + List selectListMyFeedbackContent(@Param("suggestionId") String suggestionId); +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionMakeDao.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionMakeDao.java new file mode 100644 index 0000000..d8ea1b2 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 我提出的所有建议 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 16:29 2021-09-14 + **/ + List selectListMySuggestion(MySuggestionFormDTO formDTO); +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionTypeDao.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/dao/SuggestionTypeDao.java new file mode 100644 index 0000000..069ae4d --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 查询启用的 建议类别 + * + * @param + * @return java.util.List + * @Author zhangyong + * @Date 14:23 2021-09-14 + **/ + List selectListSuggestionTypeTree(); +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/CustomImgEntity.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/CustomImgEntity.java new file mode 100644 index 0000000..eaf4c34 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionFeedbackEntity.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionFeedbackEntity.java new file mode 100644 index 0000000..69cd010 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionMakeEntity.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionMakeEntity.java new file mode 100644 index 0000000..b8049a9 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionTypeEntity.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/entity/SuggestionTypeEntity.java new file mode 100644 index 0000000..c54ae5d --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/CustomImgExcel.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/CustomImgExcel.java new file mode 100644 index 0000000..64a078b --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionFeedbackExcel.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionFeedbackExcel.java new file mode 100644 index 0000000..259d72d --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionMakeExcel.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionMakeExcel.java new file mode 100644 index 0000000..44323cd --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionTypeExcel.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/excel/SuggestionTypeExcel.java new file mode 100644 index 0000000..633b193 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/CustomImgRedis.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/CustomImgRedis.java new file mode 100644 index 0000000..dfab826 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + } + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionFeedbackRedis.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionFeedbackRedis.java new file mode 100644 index 0000000..6f6f945 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + } + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionMakeRedis.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionMakeRedis.java new file mode 100644 index 0000000..a91fbac --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + } + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionTypeRedis.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/redis/SuggestionTypeRedis.java new file mode 100644 index 0000000..254fc01 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + } + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/CustomImgService.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/CustomImgService.java new file mode 100644 index 0000000..7d57e07 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-14 + */ + List list(Map 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 images, String referenceId, String imgType); +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionFeedbackService.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionFeedbackService.java new file mode 100644 index 0000000..cc3a8c4 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-14 + */ + List list(Map 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); +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionMakeService.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionMakeService.java new file mode 100644 index 0000000..4d7acf0 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-14 + */ + List list(Map 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> + * @Author zhangyong + * @Date 15:58 2021-09-14 + **/ + Result> getMySuggestion( MySuggestionFormDTO formDTO); + + /** + * 建议详情 + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:37 2021-09-15 + **/ + Result getDetailSuggestion(String id); +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionTypeService.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/SuggestionTypeService.java new file mode 100644 index 0000000..7549635 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-14 + */ + List list(Map 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 + * @Author zhangyong + * @Date 14:15 2021-09-14 + **/ + Result> getSuggestionTypeTree(); +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/CustomImgServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/CustomImgServiceImpl.java new file mode 100644 index 0000000..3c0c432 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements CustomImgService { + + @Autowired + private CustomImgRedis customImgRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomImgDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomImgDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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 images, String referenceId, String imgType) { + if (null == images || images.isEmpty()) { + return true; + } + List 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); + } +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionFeedbackServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionFeedbackServiceImpl.java new file mode 100644 index 0000000..264c5ec --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements SuggestionFeedbackService { + + @Autowired + private SuggestionFeedbackRedis suggestionFeedbackRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SuggestionFeedbackDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SuggestionFeedbackDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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)); + } + +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionMakeServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionMakeServiceImpl.java new file mode 100644 index 0000000..8ba6037 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements SuggestionMakeService { + + @Autowired + private SuggestionMakeRedis suggestionMakeRedis; + @Autowired + private CustomImgService customImgService; + @Autowired + private CustomImgDao customImgDao; + @Autowired + private SuggestionFeedbackDao suggestionFeedbackDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SuggestionMakeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SuggestionMakeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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> getMySuggestion(MySuggestionFormDTO formDTO) { + formDTO.setPageIndex((formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize()); + // 查询我提出的所有建议 + List 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>().ok(mySuggestionList); + } + + @Override + public Result 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().ok(result); + } +} diff --git a/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionTypeServiceImpl.java b/epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionTypeServiceImpl.java new file mode 100644 index 0000000..ac9b701 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements SuggestionTypeService { + + @Autowired + private SuggestionTypeRedis suggestionTypeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SuggestionTypeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SuggestionTypeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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> getSuggestionTypeTree() { + List nodes = baseDao.selectListSuggestionTypeTree(); + Map> 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 result = nodes.stream().filter(node -> node.getPid().equals(NumConstant.ZERO_STR)).collect(Collectors.toList()); + return new Result>().ok(result); + } +} diff --git a/epdc-cloud-custom/src/main/resources/mapper/suggestion/CustomImgDao.xml b/epdc-cloud-custom/src/main/resources/mapper/suggestion/CustomImgDao.xml new file mode 100644 index 0000000..7bb52dd --- /dev/null +++ b/epdc-cloud-custom/src/main/resources/mapper/suggestion/CustomImgDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + update epdc_custom_img set DEL_FLAG = '1' where REFERENCE_ID = #{referenceId} + + + + diff --git a/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionFeedbackDao.xml b/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionFeedbackDao.xml new file mode 100644 index 0000000..7713e79 --- /dev/null +++ b/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionFeedbackDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionMakeDao.xml b/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionMakeDao.xml new file mode 100644 index 0000000..dd5d6ca --- /dev/null +++ b/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionMakeDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionTypeDao.xml b/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionTypeDao.xml new file mode 100644 index 0000000..72b2dbe --- /dev/null +++ b/epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionTypeDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + +