From 0c482e3c6ded0527a961b2bebbb0fc65776e4b85 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 17:12:11 +0800 Subject: [PATCH] =?UTF-8?q?user=5Fadvice=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/AgencyElementTreeResultDTO.java | 33 +++++++++++ .../java/com/epmet/dto/UserAdviceDTO.java | 55 ++++++++++++++++-- .../epmet/dto/form/OperAdviceListFormDTO.java | 33 +++++++++++ .../epmet/dto/form/ReplyAdviceFormDTO.java | 27 +++++++++ .../dto/result/AdviceDetailResultDTO.java | 55 ++++++++++++++++++ .../dto/result/OperAdviceListResultDTO.java | 44 +++++++++++++++ .../controller/UserAdviceController.java | 15 +++-- .../java/com/epmet/dao/UserAdviceDao.java | 12 ++-- .../com/epmet/entity/UserAdviceEntity.java | 56 +++++++++++++++++-- .../java/com/epmet/excel/UserAdviceExcel.java | 37 ++++++++++-- .../java/com/epmet/redis/UserAdviceRedis.java | 4 +- .../com/epmet/service/UserAdviceService.java | 29 +++++++--- .../service/impl/UserAdviceServiceImpl.java | 19 ++++++- .../main/resources/mapper/UserAdviceDao.xml | 25 ++++++++- 14 files changed, 404 insertions(+), 40 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java new file mode 100644 index 0000000000..90ee4f6f29 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Set; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/6 13:54 + */ +@Data +public class AgencyElementTreeResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private Set defaultKeys; + + private List list; + + @Data + public static class Agency{ + private String id; + + private String label; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + } + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java index 5521fa02c4..77e6494ee6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java @@ -23,10 +23,10 @@ import lombok.Data; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Data public class UserAdviceDTO implements Serializable { @@ -43,18 +43,53 @@ public class UserAdviceDTO implements Serializable { */ private String customerId; + /** + * 客户名 + */ + private String customerName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + /** * userid */ private String userId; + /** + * 用户姓名 + */ + private String userName; + + /** + * 用户注册手机号 + */ + private String regPhone; + /** * 建议描述 */ private String adviceContent; /** - * 手机号 + * 填写手机号 */ private String phone; @@ -69,15 +104,25 @@ public class UserAdviceDTO implements Serializable { private String replyContent; /** - * 回复人 + * 回复人id */ - private String replyUser; + private String replyUserId; + + /** + * 回复人姓名 + */ + private String replyUserName; /** * 回复时间 */ private Date replyTime; + /** + * 政府存证文字 + */ + private String govContent; + /** * 删除标志 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java new file mode 100644 index 0000000000..e4c046e53c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/5 17:25 + */ +@Data +public class OperAdviceListFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String customerId; + + private String isReply; + + private String adviceType; + + private String startTime; + + private String endTime; + + @Min(1) + private Integer pageNo; + + @Min(1) + private Integer pageSize; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java new file mode 100644 index 0000000000..f353919247 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @description:回复建议FormDTO + * @author: liushaowen + * @date: 2020/11/6 10:37 + */ +@Data +public class ReplyAdviceFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "adviceId不能为空") + private String adviceId; + + @NotBlank(message = "回复内容不能为空") + private String replyContent; + + private List govImgList; + + private String govContent; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java new file mode 100644 index 0000000000..462f053373 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/5 17:37 + */ +@Data +public class AdviceDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 建议id + */ + private String adviceId; + + /** + * 建议内容 + */ + private String adviceContent; + + /** + * 电话 + */ + private String phone; + + /** + * 建议时间 + */ + private String adviceTime; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复时间 + */ + private String replyTime; + + /** + * 回复人 + */ + private String replyUser; + + /** + * 建议图片列表 + */ + private List imgList; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java new file mode 100644 index 0000000000..82f5aba850 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/5 17:26 + */ +@Data +public class OperAdviceListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户名 + */ + private String customerName; + + /** + * 建议id + */ + private String adviceId; + + /** + * 是否回复 0否1是 + */ + private String isReply; + + /** + * 回复内容 + */ + private String adviceContent; + + /** + * 手机 空为* + */ + private String phone; + + /** + * 建议类型 空为* + */ + private String adviceType; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 8237057e85..b98d644940 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.UserAdviceDTO; +import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.excel.UserAdviceExcel; import com.epmet.service.UserAdviceService; import org.springframework.beans.factory.annotation.Autowired; @@ -37,15 +38,15 @@ import java.util.Map; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @RestController @RequestMapping("useradvice") public class UserAdviceController { - + @Autowired private UserAdviceService userAdviceService; @@ -91,4 +92,10 @@ public class UserAdviceController { ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceExcel.class); } -} \ No newline at end of file + @PostMapping("replyadvice") + public Result replyAdvice(ReplyAdviceFormDTO dto){ + ValidatorUtils.validateEntity(dto); + userAdviceService.replyAdvice(dto,loginUserUtil.getLoginUserId()); + return new Result(); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java index 6ee2c40017..e198ef4b82 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java @@ -20,14 +20,18 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.UserAdviceEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Mapper public interface UserAdviceDao extends BaseDao { - -} \ No newline at end of file + void replyAdvice(@Param("adviceId") String adviceId, + @Param("replyContent") String replyContent, + @Param("govContent") String govContent, + @Param("replyUserId") String loginUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java index dcf168cc2d..78c246fa15 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java @@ -19,7 +19,6 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -27,10 +26,10 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Data @EqualsAndHashCode(callSuper=false) @@ -44,18 +43,53 @@ public class UserAdviceEntity extends BaseEpmetEntity { */ private String customerId; + /** + * 客户名 + */ + private String customerName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + /** * userid */ private String userId; + /** + * 用户姓名 + */ + private String userName; + + /** + * 用户注册手机号 + */ + private String regPhone; + /** * 建议描述 */ private String adviceContent; /** - * 手机号 + * 填写手机号 */ private String phone; @@ -70,13 +104,23 @@ public class UserAdviceEntity extends BaseEpmetEntity { private String replyContent; /** - * 回复人 + * 回复人id + */ + private String replyUserId; + + /** + * 回复人姓名 */ - private String replyUser; + private String replyUserName; /** * 回复时间 */ private Date replyTime; + /** + * 政府存证文字 + */ + private String govContent; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java index 31581f4373..9e93cb6bfc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java @@ -23,10 +23,10 @@ import lombok.Data; import java.util.Date; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Data public class UserAdviceExcel { @@ -37,13 +37,34 @@ public class UserAdviceExcel { @Excel(name = "客户ID") private String customerId; + @Excel(name = "客户名") + private String customerName; + + @Excel(name = "组织ID") + private String agencyId; + + @Excel(name = "组织名") + private String agencyName; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "网格名") + private String gridName; + @Excel(name = "userid") private String userId; + @Excel(name = "用户姓名") + private String userName; + + @Excel(name = "用户注册手机号") + private String regPhone; + @Excel(name = "建议描述") private String adviceContent; - @Excel(name = "手机号") + @Excel(name = "填写手机号") private String phone; @Excel(name = "问题分类(gov政府software软件,逗号分隔)") @@ -52,12 +73,18 @@ public class UserAdviceExcel { @Excel(name = "回复内容") private String replyContent; - @Excel(name = "回复人") - private String replyUser; + @Excel(name = "回复人id") + private String replyUserId; + + @Excel(name = "回复人姓名") + private String replyUserName; @Excel(name = "回复时间") private Date replyTime; + @Excel(name = "政府存证文字") + private String govContent; + @Excel(name = "删除标志") private String delFlag; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java index ab047022e7..d35e8427b9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java @@ -22,10 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Component public class UserAdviceRedis { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java index 4e42bc095e..f13d6f9eda 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java @@ -20,16 +20,17 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserAdviceDTO; +import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.entity.UserAdviceEntity; import java.util.List; import java.util.Map; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ public interface UserAdviceService extends BaseService { @@ -39,7 +40,7 @@ public interface UserAdviceService extends BaseService { * @param params * @return PageData * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ PageData page(Map params); @@ -49,7 +50,7 @@ public interface UserAdviceService extends BaseService { * @param params * @return java.util.List * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ List list(Map params); @@ -59,7 +60,7 @@ public interface UserAdviceService extends BaseService { * @param id * @return UserAdviceDTO * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ UserAdviceDTO get(String id); @@ -69,7 +70,7 @@ public interface UserAdviceService extends BaseService { * @param dto * @return void * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ void save(UserAdviceDTO dto); @@ -79,7 +80,7 @@ public interface UserAdviceService extends BaseService { * @param dto * @return void * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ void update(UserAdviceDTO dto); @@ -89,7 +90,17 @@ public interface UserAdviceService extends BaseService { * @param ids * @return void * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * @Description 回复建议 + * @param dto + * @param loginUserId + * @return void + * @Author liushaowen + * @Date 2020/11/6 16:44 + */ + void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index 41e1465a41..ceae0d177c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.UserAdviceDao; import com.epmet.dto.UserAdviceDTO; +import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.entity.UserAdviceEntity; import com.epmet.redis.UserAdviceRedis; import com.epmet.service.UserAdviceService; @@ -38,10 +39,10 @@ import java.util.List; import java.util.Map; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Service public class UserAdviceServiceImpl extends BaseServiceImpl implements UserAdviceService { @@ -101,4 +102,16 @@ public class UserAdviceServiceImpl extends BaseServiceImpl + + + + + + + - + + + @@ -21,5 +30,17 @@ + + update user_advice + set + reply_content = #{replyContent}, + reply_user_id = #{replyUserId}, + reply_time = now(), + gov_content = #{govContent}, + reply_user_name = (select real_name from oper_user where user_id = #{replyUserId} and del_flag = 0), + updated_by = #{replyUserId}, + updated_time = now() + where id = #{adviceId} + - \ No newline at end of file +