diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java index d825fc71..79456217 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppActInfoController.java @@ -114,4 +114,17 @@ public class ApiAppActInfoController { public Result> bannerList(EpdcAppBannerFormDTO dto) { return actInfoService.getBannerList(dto); } + + /** + * 志愿者banner详情 + * + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/11/5 10:57 + */ + @GetMapping("banner/detail/{id}") + public Result bannerDetail(@PathVariable String id) { + return actInfoService.getBannerDetail(id); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java index c834f262..b8059f26 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java @@ -1,16 +1,14 @@ package com.elink.esua.epdc.controller; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.service.CustomService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -103,4 +101,48 @@ public class ApiCustomInfoController { public Result getArchiveDetail(@PathVariable("id") String id) { return customService.getArchiveDetail(id); } + + /** + * 用户举报问题提交 + * + * @param formDto 提交信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/22 17:58 + */ + @PostMapping("reportissue/submit") + public Result reportIssueSubmit(@RequestBody ReportIssueSubmitFormDTO formDto, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(formDto); + + return customService.reportIssueSubmit(formDto, tokenDto); + } + + /** + * 用户举报问题列表 + * + * @param formDto 参数 + * @param tokenDto 用户信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2020/10/23 11:03 + */ + @GetMapping("reportissue/list") + public Result> reportIssueList(ReportIssueListFormDTO formDto, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(formDto); + + return customService.listReportIssue(formDto, tokenDto); + } + + /** + * 举报问题详情 + * + * @param id 记录ID + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/23 10:39 + */ + @GetMapping("reportissue/detail/{id}") + public Result reportIssueDetail(@PathVariable("id") String id) { + return customService.getReportIssueById(id); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java index 3c5a250a..a77da9ac 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java @@ -62,7 +62,7 @@ public interface ActInfoFeignClient { @GetMapping(value = "heart/appactinfo/canceldetail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) Result getCancelDetail(@PathVariable String id); - @GetMapping(value = "heart/actbanner/bannerlist", consumes = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "heart/epdc-app/actbanner/list", consumes = MediaType.APPLICATION_JSON_VALUE) Result> getBannerList(EpdcAppBannerFormDTO dto); /** @@ -76,4 +76,15 @@ public interface ActInfoFeignClient { @GetMapping(value = "heart/appactinfo/unreadactnums", consumes = MediaType.APPLICATION_JSON_VALUE) Result getUserUnreadSignUpActCount(String userId); + /** + * 志愿者banner详情 + * + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2020/11/5 10:34 + */ + @GetMapping(value = "heart/epdc-app/actbanner/detail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getBannerDetail(@PathVariable("id") String id); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java index cb232f86..8bc22d70 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java @@ -1,5 +1,7 @@ package com.elink.esua.epdc.feign; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -125,4 +127,37 @@ public interface CustomFeignClient { **/ @PostMapping(value = "custom/screenSpecialUser/selectMonthlySubsidy", consumes = MediaType.APPLICATION_JSON_VALUE) Result> selectMonthlySubsidy(@RequestBody SpecialUserMonthlySubsidyFormDTO dto); + + /** + * 用户举报问题提交 + * + * @param formDto 提交信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/22 18:04 + */ + @PostMapping(value = "custom/epdc-app/reportissue/submit", consumes = MediaType.APPLICATION_JSON_VALUE) + Result reportIssueSubmit(ReportIssueSubmitFormDTO formDto); + + /** + * 用户举报问题列表 + * + * @param formDto 参数 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2020/10/23 10:06 + */ + @GetMapping(value = "custom/epdc-app/reportissue/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> reportIssueList(ReportIssueListFormDTO formDto); + + /** + * 举报问题详情 + * + * @param id 记录ID + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/23 10:39 + */ + @GetMapping(value = "custom/epdc-app/reportissue/detail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result reportIssueDetail(@PathVariable("id") String id); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java index 157e85c8..8d96daa1 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java @@ -52,4 +52,9 @@ public class ActInfoFeignClientFallback implements ActInfoFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getUserUnreadSignUpActCount", userId); } + @Override + public Result getBannerDetail(String id) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "getBannerDetail", id); + } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java index 678e8dfe..5eaf2dc3 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java @@ -78,4 +78,19 @@ public class CustomFeignClientFallback implements CustomFeignClient { public Result> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "selectMonthlySubsidy", dto); } + + @Override + public Result reportIssueSubmit(ReportIssueSubmitFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "reportIssueSubmit", formDto); + } + + @Override + public Result> reportIssueList(ReportIssueListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "reportIssueList", formDto); + } + + @Override + public Result reportIssueDetail(String id) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "reportIssueDetail", id); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java index 28d7417c..8d5164b8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java @@ -48,5 +48,14 @@ public interface ActInfoService { Result> getBannerList(EpdcAppBannerFormDTO dto); + /** + * 志愿者banner详情 + * + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/11/5 10:56 + */ + Result getBannerDetail(String id); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java index 0ed38ba1..9f2cc5d0 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java @@ -1,6 +1,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.DeptOption; import com.elink.esua.epdc.dto.form.*; @@ -129,4 +130,36 @@ public interface CustomService { * @return com.elink.esua.epdc.commons.tools.utils.Result> **/ Result> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto); + + /** + * 用户举报问题提交 + * + * @param formDto 提交信息 + * @param tokenDto 用户信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/22 18:01 + */ + Result reportIssueSubmit(ReportIssueSubmitFormDTO formDto, TokenDto tokenDto); + + /** + * 用户举报问题列表 + * + * @param formDto 参数 + * @param tokenDto 用户信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2020/10/23 11:03 + */ + Result> listReportIssue(ReportIssueListFormDTO formDto, TokenDto tokenDto); + + /** + * 举报问题详情 + * + * @param id 记录ID + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/23 10:40 + */ + Result getReportIssueById(String id); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java index b84de781..ffdca3b6 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java @@ -51,4 +51,9 @@ public class ActInfoServiceImpl implements ActInfoService { public Result> getBannerList(EpdcAppBannerFormDTO dto) { return actInfoFeignClient.getBannerList(dto); } + + @Override + public Result getBannerDetail(String id) { + return actInfoFeignClient.getBannerDetail(id); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java index 3728528c..af682a66 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java @@ -1,7 +1,9 @@ package com.elink.esua.epdc.service.impl; +import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.exception.RenException; 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.utils.Result; import com.elink.esua.epdc.dto.DeptOption; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; @@ -136,4 +138,43 @@ public class CustomServiceImpl implements CustomService { public Result> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto) { return customFeignClient.selectMonthlySubsidy(dto); } + + @Override + public Result reportIssueSubmit(ReportIssueSubmitFormDTO formDto, TokenDto tokenDto) { + if (null == tokenDto) { + return new Result().error("无效的token"); + } + + // 用户信息 + formDto.setUserId(tokenDto.getUserId()); + formDto.setRealName(tokenDto.getRealName()); + formDto.setUserFace(tokenDto.getFaceImg()); + formDto.setNickname(tokenDto.getNickname()); + formDto.setMobile(tokenDto.getMobile()); + + // 机构信息 + Result dtoResult = adminFeignClient.getParentAndAllDept(tokenDto.getGridId()); + ParentAndAllDeptDTO deptDTO = dtoResult.getData(); + // 父所有部门 + formDto.setParentDeptIds(deptDTO.getParentDeptIds()); + formDto.setParentDeptNames(deptDTO.getParentDeptNames()); + // 所有部门 + formDto.setAllDeptIds(deptDTO.getAllDeptIds()); + formDto.setAllDeptNames(deptDTO.getAllDeptNames()); + // 网格 + formDto.setDeptName(deptDTO.getGrid()); + formDto.setDeptId(deptDTO.getGridId()); + return customFeignClient.reportIssueSubmit(formDto); + } + + @Override + public Result> listReportIssue(ReportIssueListFormDTO formDto, TokenDto tokenDto) { + formDto.setUserId(tokenDto.getUserId()); + return customFeignClient.reportIssueList(formDto); + } + + @Override + public Result getReportIssueById(String id) { + return customFeignClient.reportIssueDetail(id); + } } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java new file mode 100644 index 00000000..11192027 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/constant/CustomImageConstant.java @@ -0,0 +1,15 @@ +package com.elink.esua.epdc.constant; + +/** + * 定制模块图片常量 + * + * @author Liuchuang + * @since 2020/10/22 17:51 + */ +public interface CustomImageConstant { + + /** + * 一键服务-锦水清风-举报问题 + */ + String IMAGE_TYPE_YJFW_JSQF_JBWT = "yjfw_jsqf_jbwt"; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/CustomImgDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/CustomImgDTO.java new file mode 100644 index 00000000..a64130d7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/CustomImgDTO.java @@ -0,0 +1,86 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 定制模块图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@Data +public class CustomImgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 图片类型 yjfw_jsqf_wyjb:一键服务-锦水清风-我要举报 + */ + private String imgType; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ReportIssueDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ReportIssueDTO.java new file mode 100644 index 00000000..6da72d86 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/ReportIssueDTO.java @@ -0,0 +1,156 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户举报问题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@Data +public class ReportIssueDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 问题描述 + */ + private String content; + + /** + * 举报人 + */ + private String reportUser; + + /** + * 举报人联系电话 + */ + private String reportUserMobile; + + /** + * 是否匿名 0-否,1-是 + */ + private String anonymousFlag; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userFace; + + /** + * 用户电话 + */ + private String mobile; + + /** + * 屏蔽标识 0:未屏蔽,1:已屏蔽 + */ + private String shieldFlag; + + /** + * 屏蔽原因 + */ + private String shieldReason; + + /** + * 所属部门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 delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueListFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueListFormDTO.java new file mode 100644 index 00000000..76cb0f06 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueListFormDTO.java @@ -0,0 +1,39 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 举报问题列表查询参数 + * + * @author Liuchuang + * @since 2020/10/23 10:59 + */ +@Data +public class ReportIssueListFormDTO implements Serializable { + private static final long serialVersionUID = 2105013928295376961L; + + /** + * 页码 + */ + @NotNull(message = "页码不能为空") + private Integer pageIndex; + + /** + * 页容量 + */ + @NotNull(message = "页容量不能为空") + private Integer pageSize; + + /** + * 用户ID + */ + private String userId; + + /** + * 图片类型 + */ + private String imgType; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueShieldFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueShieldFormDTO.java new file mode 100644 index 00000000..e6617757 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueShieldFormDTO.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + * 屏蔽用户举报问题表单 + * + * @author Liuchuang + * @since 2020/10/23 17:01 + */ +@Data +public class ReportIssueShieldFormDTO implements Serializable { + private static final long serialVersionUID = -3686477439903152467L; + + /** + * 举报问题ID + */ + @NotBlank(message = "记录ID不能为空") + private String id; + + /** + * 屏蔽原因 + */ + @NotBlank(message = "屏蔽原因不能为空") + @Size(min = 1, max = 100, message = "屏蔽原因不能为空且在100个字以内") + private String shieldReason; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueSubmitFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueSubmitFormDTO.java new file mode 100644 index 00000000..d8761d09 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueSubmitFormDTO.java @@ -0,0 +1,100 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + * 用户举报问题提交表单 + * + * @author Liuchuang + * @since 2020/10/22 17:12 + */ +@Data +public class ReportIssueSubmitFormDTO implements Serializable { + private static final long serialVersionUID = -4805817350334564137L; + + /** + * 问题描述(500字符以内) + */ + @NotBlank(message = "问题描述不能为空") + @Size(min = 1, max = 500, message = "问题描述不能为空且在500个字以内") + private String content; + + /** + * 是否匿名(0-否,1-是) + */ + @NotBlank(message = "是否匿名不能为空") + private String anonymousFlag; + + /** + * 举报人 + */ + @Size(max = 20, message = "举报人信息超出字数限制") + private String reportUser; + + /** + * 举报人电话 + */ + @Size(max = 20, message = "举报人电话超出字数限制") + private String reportUserMobile; + + /** + * 图片 + */ + private List images; + + /** + * 用户ID + */ + private String userId; + + /** + * 昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userFace; + + /** + * 手机号 + */ + private String mobile; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 部门名称 + */ + private String deptName; + /** + * 部门ID + */ + private Long deptId; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + /** + * 父所有部门 + */ + private String parentDeptNames; + /** + * 所有部门ID + */ + private String allDeptIds; + /** + * 所有部门 + */ + private String allDeptNames; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/ReportIssueResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/ReportIssueResultDTO.java new file mode 100644 index 00000000..3e8f9fd3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/ReportIssueResultDTO.java @@ -0,0 +1,50 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 用户举报问题 + * + * @author Liuchuang + * @since 2020/10/22 17:12 + */ +@Data +public class ReportIssueResultDTO implements Serializable { + private static final long serialVersionUID = -4805817350334564137L; + + private String id; + + /** + * 问题描述 + */ + private String content; + + /** + * 是否匿名 + */ + private String anonymousFlag; + + /** + * 举报人 + */ + private String reportUser; + + /** + * 举报人电话 + */ + private String reportUserMobile; + + /** + * 提交时间 + */ + private Date createdTime; + + /** + * 图片 + */ + private List images; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/controller/AppReportIssueController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/controller/AppReportIssueController.java new file mode 100644 index 00000000..dcb64e1b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/controller/AppReportIssueController.java @@ -0,0 +1,71 @@ +package com.elink.esua.epdc.modules.reportissue.controller; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.form.ReportIssueListFormDTO; +import com.elink.esua.epdc.dto.form.ReportIssueSubmitFormDTO; +import com.elink.esua.epdc.dto.result.ReportIssueResultDTO; +import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 用户举报问题-移动端接口 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@RestController +@RequestMapping(Constant.EPDC_APP + "reportissue") +public class AppReportIssueController { + + @Autowired + private ReportIssueService reportIssueService; + + /** + * 用户举报问题提交 + * + * @param formDto 提交信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/22 17:28 + */ + @PostMapping("submit") + public Result reportIssueSubmit(@RequestBody ReportIssueSubmitFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + + return reportIssueService.saveReportIssue(formDto); + } + + /** + * 用户举报问题列表 + * + * @param formDto 参数 + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2020/10/23 10:06 + */ + @GetMapping("list") + public Result> reportIssueList(@RequestBody ReportIssueListFormDTO formDto) { + List data = reportIssueService.listReportIssue(formDto); + return new Result>().ok(data); + } + + /** + * 举报问题详情 + * + * @param id 记录ID + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/23 10:39 + */ + @GetMapping("detail/{id}") + public Result reportIssueDetail(@PathVariable("id") String id) { + ReportIssueResultDTO data = reportIssueService.getReportIssueById(id); + return new Result().ok(data); + } +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/controller/CustomImgController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/controller/CustomImgController.java new file mode 100644 index 00000000..d82366b8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/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.reportissue.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.CustomImgDTO; +import com.elink.esua.epdc.modules.reportissue.excel.CustomImgExcel; +import com.elink.esua.epdc.modules.reportissue.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; + + +/** + * 定制模块图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@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); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/controller/ReportIssueController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/controller/ReportIssueController.java new file mode 100644 index 00000000..4e45c0f6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/controller/ReportIssueController.java @@ -0,0 +1,109 @@ +/** + * 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.reportissue.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.ReportIssueDTO; +import com.elink.esua.epdc.dto.form.ReportIssueShieldFormDTO; +import com.elink.esua.epdc.modules.reportissue.excel.ReportIssueExcel; +import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService; +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 2020-10-22 + */ +@RestController +@RequestMapping("reportissue") +public class ReportIssueController { + + @Autowired + private ReportIssueService reportIssueService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = reportIssueService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ReportIssueDTO data = reportIssueService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ReportIssueDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + reportIssueService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ReportIssueDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + reportIssueService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + reportIssueService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = reportIssueService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ReportIssueExcel.class); + } + + /** + * 屏蔽举报问题 + * + * @param formDto 屏蔽提交信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/23 16:41 + */ + @PostMapping("shield") + public Result shieldReportIssue(@RequestBody ReportIssueShieldFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return reportIssueService.modifyReportIssueShieldFlag(formDto); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java new file mode 100644 index 00000000..483e87df --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/CustomImgDao.java @@ -0,0 +1,33 @@ +/** + * 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.reportissue.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.reportissue.entity.CustomImgEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 定制模块图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@Mapper +public interface CustomImgDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/ReportIssueDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/ReportIssueDao.java new file mode 100644 index 00000000..b6af2d3b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/ReportIssueDao.java @@ -0,0 +1,57 @@ +/** + * 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.reportissue.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.form.ReportIssueListFormDTO; +import com.elink.esua.epdc.dto.result.ReportIssueResultDTO; +import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 用户举报问题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@Mapper +public interface ReportIssueDao extends BaseDao { + + /** + * 用户举报问题列表 + * + * @param formDto 参数 + * @return java.util.List + * @author Liuchuang + * @since 2020/10/23 11:08 + */ + List selectListReportIssue(ReportIssueListFormDTO formDto); + + /** + * 举报问题详情 + * + * @param id 记录ID + * @return com.elink.esua.epdc.dto.result.ReportIssueResultDTO + * @author Liuchuang + * @since 2020/10/23 16:23 + */ + ReportIssueResultDTO selectOneReportIssue(String id); + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/entity/CustomImgEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/entity/CustomImgEntity.java new file mode 100644 index 00000000..04b283d4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/entity/CustomImgEntity.java @@ -0,0 +1,54 @@ +/** + * 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.reportissue.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 定制模块图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@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; + + /** + * 图片类型 yjfw_jsqf_wyjb:一键服务-锦水清风-我要举报 + */ + private String imgType; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/entity/ReportIssueEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/entity/ReportIssueEntity.java new file mode 100644 index 00000000..98893cad --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/entity/ReportIssueEntity.java @@ -0,0 +1,124 @@ +/** + * 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.reportissue.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户举报问题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_report_issue") +public class ReportIssueEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 问题描述 + */ + private String content; + + /** + * 举报人 + */ + private String reportUser; + + /** + * 举报人联系电话 + */ + private String reportUserMobile; + + /** + * 是否匿名 0-否,1-是 + */ + private String anonymousFlag; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userFace; + + /** + * 用户电话 + */ + private String mobile; + + /** + * 屏蔽标识 0:未屏蔽,1:已屏蔽 + */ + private String shieldFlag; + + /** + * 屏蔽原因 + */ + private String shieldReason; + + /** + * 所属部门ID + */ + private Long deptId; + + /** + * 所属部门名称 + */ + private String deptName; + + /** + * 父所有部门ID + */ + private String parentDeptIds; + + /** + * 父所有部门名称 + */ + private String parentDeptNames; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/excel/CustomImgExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/excel/CustomImgExcel.java new file mode 100644 index 00000000..076145e8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/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.reportissue.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 2020-10-22 + */ +@Data +public class CustomImgExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "引用ID") + private String referenceId; + + @Excel(name = "图片地址") + private String imgUrl; + + @Excel(name = "图片类型 yjfw_jsqf_wyjb:一键服务-锦水清风-我要举报") + private String imgType; + + @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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/excel/ReportIssueExcel.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/excel/ReportIssueExcel.java new file mode 100644 index 00000000..4969129a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/excel/ReportIssueExcel.java @@ -0,0 +1,101 @@ +/** + * 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.reportissue.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 2020-10-22 + */ +@Data +public class ReportIssueExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "问题描述") + private String content; + + @Excel(name = "举报人") + private String reportUser; + + @Excel(name = "举报人联系电话") + private String reportUserMobile; + + @Excel(name = "是否匿名 0-否,1-是") + private String anonymousFlag; + + @Excel(name = "真实姓名") + private String realName; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "用户昵称") + private String nickname; + + @Excel(name = "用户头像") + private String userFace; + + @Excel(name = "用户电话") + private String mobile; + + @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 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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/redis/CustomImgRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/redis/CustomImgRedis.java new file mode 100644 index 00000000..f29272d6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/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.reportissue.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 2020-10-22 + */ +@Component +public class CustomImgRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/redis/ReportIssueRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/redis/ReportIssueRedis.java new file mode 100644 index 00000000..3eda17f8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/redis/ReportIssueRedis.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.reportissue.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 2020-10-22 + */ +@Component +public class ReportIssueRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.java new file mode 100644 index 00000000..0622d5be --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/CustomImgService.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.reportissue.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.CustomImgDTO; +import com.elink.esua.epdc.modules.reportissue.entity.CustomImgEntity; + +import java.util.List; +import java.util.Map; + +/** + * 定制模块图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +public interface CustomImgService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-10-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-10-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomImgDTO + * @author generator + * @date 2020-10-22 + */ + CustomImgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-22 + */ + void save(CustomImgDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-22 + */ + void update(CustomImgDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-10-22 + */ + void delete(String[] ids); + + /** + * 保存图片 + * + * @param images 图片 + * @param referenceId 引用ID + * @param imgType 图片类型 + * @return boolean + * @author Liuchuang + * @since 2020/10/22 17:42 + */ + boolean saveImages(List images, String referenceId, String imgType); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/ReportIssueService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/ReportIssueService.java new file mode 100644 index 00000000..4c771650 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/ReportIssueService.java @@ -0,0 +1,140 @@ +/** + * 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.reportissue.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.ReportIssueDTO; +import com.elink.esua.epdc.dto.form.ReportIssueListFormDTO; +import com.elink.esua.epdc.dto.form.ReportIssueShieldFormDTO; +import com.elink.esua.epdc.dto.form.ReportIssueSubmitFormDTO; +import com.elink.esua.epdc.dto.result.ReportIssueResultDTO; +import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户举报问题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +public interface ReportIssueService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-10-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-10-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ReportIssueDTO + * @author generator + * @date 2020-10-22 + */ + ReportIssueDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-22 + */ + void save(ReportIssueDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-10-22 + */ + void update(ReportIssueDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-10-22 + */ + void delete(String[] ids); + + /** + * 保存用户举报问题 + * + * @param formDto 提交信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/22 17:32 + */ + Result saveReportIssue(ReportIssueSubmitFormDTO formDto); + + /** + * 用户举报问题列表 + * + * @param formDto 参数 + * @return java.util.List + * @author Liuchuang + * @since 2020/10/23 10:06 + */ + List listReportIssue(ReportIssueListFormDTO formDto); + + /** + * 举报问题详情 + * + * @param id 记录ID + * @return com.elink.esua.epdc.dto.result.ReportIssueResultDTO + * @author Liuchuang + * @since 2020/10/23 10:40 + */ + ReportIssueResultDTO getReportIssueById(String id); + + /** + * 屏蔽举报问题 + * + * @param formDto 屏蔽提交信息 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/10/23 16:41 + */ + Result modifyReportIssueShieldFlag(ReportIssueShieldFormDTO formDto); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java new file mode 100644 index 00000000..d6469fea --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/CustomImgServiceImpl.java @@ -0,0 +1,119 @@ +/** + * 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.reportissue.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.CustomImgDTO; +import com.elink.esua.epdc.modules.reportissue.dao.CustomImgDao; +import com.elink.esua.epdc.modules.reportissue.entity.CustomImgEntity; +import com.elink.esua.epdc.modules.reportissue.service.CustomImgService; +import org.apache.commons.lang3.StringUtils; +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; + +/** + * 定制模块图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-10-22 + */ +@Service +public class CustomImgServiceImpl extends BaseServiceImpl implements CustomImgService { + + @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 + @Transactional(rollbackFor = Exception.class) + public boolean saveImages(List images, String referenceId, String imgType) { + if (images.isEmpty()) { + return true; + } + List entities = new ArrayList<>(); + for (String imgUrl: + images) { + CustomImgEntity entity = new CustomImgEntity(); + entity.setReferenceId(referenceId); + entity.setImgType(imgType); + entity.setImgUrl(imgUrl); + entities.add(entity); + } + + return insertBatch(entities); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java new file mode 100644 index 00000000..9ded775f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java @@ -0,0 +1,164 @@ +/** + * 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.reportissue.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.constant.CustomImageConstant; +import com.elink.esua.epdc.dto.ReportIssueDTO; +import com.elink.esua.epdc.dto.form.ReportIssueListFormDTO; +import com.elink.esua.epdc.dto.form.ReportIssueShieldFormDTO; +import com.elink.esua.epdc.dto.form.ReportIssueSubmitFormDTO; +import com.elink.esua.epdc.dto.result.ReportIssueResultDTO; +import com.elink.esua.epdc.modules.reportissue.dao.ReportIssueDao; +import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity; +import com.elink.esua.epdc.modules.reportissue.service.CustomImgService; +import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService; +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 2020-10-22 + */ +@Service +public class ReportIssueServiceImpl extends BaseServiceImpl implements ReportIssueService { + + @Autowired + private CustomImgService customImgService; + + @Override + public PageData page(Map params) { + // 检索条件 + String content = ""; + if (null != params && null != params.get("content")) { + content = (String)params.get("content"); + } + + String anonymousFlag = (String)params.get("anonymousFlag"); + String startTime = (String)params.get("startTime"); + String endTime = (String)params.get("endTime"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(content), "CONTENT", content.trim()); + wrapper.eq(StringUtils.isNotBlank(anonymousFlag), "ANONYMOUS_FLAG", anonymousFlag); + wrapper.ge(StringUtils.isNotBlank(startTime), "DATE_FORMAT(CREATED_TIME, '%Y-%m-%d' )", startTime); + wrapper.le(StringUtils.isNotBlank(endTime), "DATE_FORMAT(CREATED_TIME, '%Y-%m-%d' )", endTime); + wrapper.eq(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR); + + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + wrapper + ); + return getPageData(page, ReportIssueDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ReportIssueDTO.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 ReportIssueDTO get(String id) { + ReportIssueEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ReportIssueDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ReportIssueDTO dto) { + ReportIssueEntity entity = ConvertUtils.sourceToTarget(dto, ReportIssueEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ReportIssueDTO dto) { + ReportIssueEntity entity = ConvertUtils.sourceToTarget(dto, ReportIssueEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result saveReportIssue(ReportIssueSubmitFormDTO formDto) { + ReportIssueEntity entity = ConvertUtils.sourceToTarget(formDto, ReportIssueEntity.class); + if (insert(entity)) { + // 保存图片 + customImgService.saveImages(formDto.getImages(), entity.getId(), CustomImageConstant.IMAGE_TYPE_YJFW_JSQF_JBWT); + } + + return new Result(); + } + + @Override + public List listReportIssue(ReportIssueListFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + return baseDao.selectListReportIssue(formDto); + } + + @Override + public ReportIssueResultDTO getReportIssueById(String id) { + return baseDao.selectOneReportIssue(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyReportIssueShieldFlag(ReportIssueShieldFormDTO formDto) { + ReportIssueEntity entity = new ReportIssueEntity(); + entity.setId(formDto.getId()); + entity.setShieldReason(formDto.getShieldReason()); + entity.setShieldFlag(NumConstant.ONE_STR); + updateById(entity); + + return new Result(); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml new file mode 100644 index 00000000..fe8a1f35 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/CustomImgDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/ReportIssueDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/ReportIssueDao.xml new file mode 100644 index 00000000..9d167567 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/ReportIssueDao.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java index 1bfff225..a85f1d21 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java @@ -102,4 +102,9 @@ public class ActBannerDTO implements Serializable { * banner排序 */ private String sort; + + /** + * 内容 + */ + private String content; } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java index cbb560ce..00a2d8d2 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/EpdcActBannerController.java @@ -17,7 +17,9 @@ package com.elink.esua.epdc.modules.activity.controller; +import com.elink.esua.epdc.activity.ActBannerDTO; import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.form.EpdcAppBannerFormDTO; import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -26,7 +28,9 @@ import com.elink.esua.epdc.modules.activity.service.ActBannerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.HashMap; import java.util.List; +import java.util.Map; @RestController @@ -44,9 +48,38 @@ public class EpdcActBannerController { * @Author zhangyong * @Date 18:27 2020-05-25 **/ + @Deprecated @GetMapping("banner/list") public Result> bannerList(@RequestBody EpdcAppActBannerFormDTO formDto) { ValidatorUtils.validateEntity(formDto); return actBannerService.getBannerList(formDto); } + + /** + * 志愿者banner列表 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author Liuchuang + * @since 2020/11/5 10:20 + */ + @GetMapping("list") + public Result> getBannerList(@RequestBody EpdcAppBannerFormDTO formDto){ + List data = actBannerService.listBanners(formDto); + return new Result>().ok(data); + } + + /** + * 志愿者banner详情 + * + * @param id + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/11/5 10:33 + */ + @GetMapping("detail/{id}") + public Result getBannerDetail(@PathVariable("id") String id){ + ActBannerDTO data = actBannerService.get(id); + return new Result().ok(data); + } } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java index da247f7d..aa987971 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java @@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.activity.dao; import com.elink.esua.epdc.activity.ActBannerDTO; import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.form.EpdcAppBannerFormDTO; import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; @@ -107,4 +108,14 @@ public interface ActBannerDao extends BaseDao { * @return void */ void rejectActBannerInfo(@Param("relationId") String relationId); + + /** + * 志愿者banner列表 + * + * @param formDto + * @return java.util.List + * @author Liuchuang + * @since 2020/11/5 10:23 + */ + List selectListBanners(EpdcAppBannerFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java index 7e895f91..736bf1ad 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java @@ -91,4 +91,9 @@ public class ActBannerEntity extends BaseEpdcEntity { * banner排序 */ private String sort; + + /** + * 内容 + */ + private String content; } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java index a87cdfbf..3c370891 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java @@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.activity.service; import com.elink.esua.epdc.activity.ActBannerDTO; import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.form.EpdcAppBannerFormDTO; import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; @@ -153,4 +154,14 @@ public interface ActBannerService extends BaseService { * @Date 15:13 2020-06-02 **/ Result> getListSimpleDictInfo(String dictType); + + /** + * 志愿者banner列表 + * + * @param formDto + * @return java.util.List + * @author Liuchuang + * @since 2020/11/5 10:22 + */ + List listBanners(EpdcAppBannerFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java index 68d27f40..8ff880c9 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.activity.ActBannerDTO; import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; +import com.elink.esua.epdc.activity.form.EpdcAppBannerFormDTO; import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; @@ -183,4 +184,9 @@ public class ActBannerServiceImpl extends BaseServiceImpl> getListSimpleDictInfo(String dictType) { return adminFeignClient.getListSimpleDictInfo(dictType); } + + @Override + public List listBanners(EpdcAppBannerFormDTO formDto) { + return baseDao.selectListBanners(formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml index 0368ea4e..37ed0053 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml @@ -138,4 +138,28 @@ UPDATE epdc_act_banner SET DEL_FLAG = 1,UPDATED_TIME=NOW() where ACT_ID=#{relationId} + +