From 4ab5801effd47a22ae50d474e7884767284856ba Mon Sep 17 00:00:00 2001
From: liushaowen <565850092@qq.com>
Date: Thu, 5 Nov 2020 14:54:04 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=BB=BA=E8=AE=AEinit?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mine/dto/from/MyAdviceListFormDTO.java | 10 ++
.../mine/dto/from/SubmitAdviceFormDTO.java | 13 ++
.../advice/controller/AdviceController.java | 53 +++++++++
.../modules/advice/service/AdviceService.java | 11 ++
.../service/impl/AdviceServiceImpl.java | 41 +++++++
.../java/com/epmet/dto/UserAdviceDTO.java | 111 ++++++++++++++++++
.../java/com/epmet/dto/UserAdviceImgDTO.java | 81 +++++++++++++
.../controller/UserAdviceController.java | 94 +++++++++++++++
.../controller/UserAdviceImgController.java | 94 +++++++++++++++
.../java/com/epmet/dao/UserAdviceDao.java | 33 ++++++
.../java/com/epmet/dao/UserAdviceImgDao.java | 33 ++++++
.../com/epmet/entity/UserAdviceEntity.java | 81 +++++++++++++
.../com/epmet/entity/UserAdviceImgEntity.java | 51 ++++++++
.../java/com/epmet/excel/UserAdviceExcel.java | 80 +++++++++++++
.../com/epmet/excel/UserAdviceImgExcel.java | 62 ++++++++++
.../com/epmet/redis/UserAdviceImgRedis.java | 47 ++++++++
.../java/com/epmet/redis/UserAdviceRedis.java | 47 ++++++++
.../epmet/service/UserAdviceImgService.java | 95 +++++++++++++++
.../com/epmet/service/UserAdviceService.java | 95 +++++++++++++++
.../impl/UserAdviceImgServiceImpl.java | 104 ++++++++++++++++
.../service/impl/UserAdviceServiceImpl.java | 104 ++++++++++++++++
.../main/resources/mapper/UserAdviceDao.xml | 25 ++++
.../resources/mapper/UserAdviceImgDao.xml | 19 +++
23 files changed, 1384 insertions(+)
create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyAdviceListFormDTO.java
create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/SubmitAdviceFormDTO.java
create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java
create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java
create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java
create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java
create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceImgController.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceImgDao.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java
create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java
create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml
create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml
diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyAdviceListFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyAdviceListFormDTO.java
new file mode 100644
index 0000000000..b8cf057c5c
--- /dev/null
+++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyAdviceListFormDTO.java
@@ -0,0 +1,10 @@
+package com.epmet.resi.mine.dto.from;
+
+/**
+ * @description: 我的建议列表DTO
+ * @author: liushaowen
+ * @date: 2020/11/5 10:38
+ */
+
+public class MyAdviceListFormDTO {
+}
diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/SubmitAdviceFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/SubmitAdviceFormDTO.java
new file mode 100644
index 0000000000..8ea37f2603
--- /dev/null
+++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/SubmitAdviceFormDTO.java
@@ -0,0 +1,13 @@
+package com.epmet.resi.mine.dto.from;
+
+import lombok.Data;
+
+/**
+ * @description: 提交建议DTO
+ * @author: liushaowen
+ * @date: 2020/11/5 10:35
+ */
+
+@Data
+public class SubmitAdviceFormDTO {
+}
diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java
new file mode 100644
index 0000000000..b06c7b3592
--- /dev/null
+++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java
@@ -0,0 +1,53 @@
+package com.epmet.modules.advice.controller;
+
+import com.epmet.commons.tools.security.user.LoginUserUtil;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.modules.advice.service.AdviceService;
+import com.epmet.resi.mine.dto.from.MyAdviceListFormDTO;
+import com.epmet.resi.mine.dto.from.SubmitAdviceFormDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @description: 用户建议controller
+ * @author: liushaowen
+ * @date: 2020/11/5 9:34
+ */
+@RestController
+@RequestMapping("advice")
+public class AdviceController {
+ @Autowired
+ private AdviceService adviceService;
+
+ @Autowired
+ private LoginUserUtil loginUserUtil;
+
+ /**
+ * @Description 提交建议
+ * @param dto
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author liushaowen
+ * @Date 2020/11/5 10:37
+ */
+ @PostMapping("submitadvice")
+ public Result submitAdvice(SubmitAdviceFormDTO dto){
+ ValidatorUtils.validateEntity(dto);
+ return adviceService.submitAdvice(dto);
+ }
+
+ /**
+ * @Description 我的建议列表
+ * @param dto
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author liushaowen
+ * @Date 2020/11/5 13:26
+ */
+ @PostMapping("myadvicelist")
+ public Result getMyAdviceList(MyAdviceListFormDTO dto){
+ ValidatorUtils.validateEntity(dto);
+ return adviceService.getMyAdviceList(dto);
+ }
+}
diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java
new file mode 100644
index 0000000000..af9eabd547
--- /dev/null
+++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java
@@ -0,0 +1,11 @@
+package com.epmet.modules.advice.service;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.resi.mine.dto.from.MyAdviceListFormDTO;
+import com.epmet.resi.mine.dto.from.SubmitAdviceFormDTO;
+
+public interface AdviceService {
+ Result submitAdvice(SubmitAdviceFormDTO dto);
+
+ Result getMyAdviceList(MyAdviceListFormDTO dto);
+}
diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java
new file mode 100644
index 0000000000..6f751622b1
--- /dev/null
+++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java
@@ -0,0 +1,41 @@
+package com.epmet.modules.advice.service.impl;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.feign.EpmetUserOpenFeignClient;
+import com.epmet.modules.advice.service.AdviceService;
+import com.epmet.resi.mine.dto.from.MyAdviceListFormDTO;
+import com.epmet.resi.mine.dto.from.SubmitAdviceFormDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @description:
+ * @author: liushaowen
+ * @date: 2020/11/5 10:27
+ */
+@Service
+public class AdviceServiceImpl implements AdviceService {
+ @Autowired
+ private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
+ /***
+ * 提交建议
+ * @param dto
+ * @return
+ */
+ @Override
+ public Result submitAdvice(SubmitAdviceFormDTO dto) {
+ return null;
+ }
+
+ /**
+ * @Description 我的建议列表
+ * @param dto
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author liushaowen
+ * @Date 2020/11/5 10:40
+ */
+ @Override
+ public Result getMyAdviceList(MyAdviceListFormDTO dto) {
+ return null;
+ }
+}
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
new file mode 100644
index 0000000000..5521fa02c4
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java
@@ -0,0 +1,111 @@
+/**
+ * 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.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 用户建议
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-11-04
+ */
+@Data
+public class UserAdviceDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * userid
+ */
+ private String userId;
+
+ /**
+ * 建议描述
+ */
+ private String adviceContent;
+
+ /**
+ * 手机号
+ */
+ private String phone;
+
+ /**
+ * 问题分类(gov政府software软件,逗号分隔)
+ */
+ private String adviceType;
+
+ /**
+ * 回复内容
+ */
+ private String replyContent;
+
+ /**
+ * 回复人
+ */
+ private String replyUser;
+
+ /**
+ * 回复时间
+ */
+ private Date replyTime;
+
+ /**
+ * 删除标志
+ */
+ 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/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.java
new file mode 100644
index 0000000000..37a50e3df6
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.java
@@ -0,0 +1,81 @@
+/**
+ * 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.epmet.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 用户建议图片
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-11-04
+ */
+@Data
+public class UserAdviceImgDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 建议id
+ */
+ private String adviceId;
+
+ /**
+ * 图片url
+ */
+ private String imgUrl;
+
+ /**
+ * 删除标志
+ */
+ 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/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
new file mode 100644
index 0000000000..8237057e85
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.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.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+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.excel.UserAdviceExcel;
+import com.epmet.service.UserAdviceService;
+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-11-04
+ */
+@RestController
+@RequestMapping("useradvice")
+public class UserAdviceController {
+
+ @Autowired
+ private UserAdviceService userAdviceService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = userAdviceService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ UserAdviceDTO data = userAdviceService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody UserAdviceDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ userAdviceService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody UserAdviceDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ userAdviceService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ userAdviceService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = userAdviceService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceExcel.class);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceImgController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceImgController.java
new file mode 100644
index 0000000000..2be0871e68
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceImgController.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.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+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.UserAdviceImgDTO;
+import com.epmet.excel.UserAdviceImgExcel;
+import com.epmet.service.UserAdviceImgService;
+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-11-04
+ */
+@RestController
+@RequestMapping("useradviceimg")
+public class UserAdviceImgController {
+
+ @Autowired
+ private UserAdviceImgService userAdviceImgService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = userAdviceImgService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ UserAdviceImgDTO data = userAdviceImgService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody UserAdviceImgDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ userAdviceImgService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody UserAdviceImgDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ userAdviceImgService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ userAdviceImgService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = userAdviceImgService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceImgExcel.class);
+ }
+
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..6ee2c40017
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.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.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.UserAdviceEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 用户建议
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-11-04
+ */
+@Mapper
+public interface UserAdviceDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceImgDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceImgDao.java
new file mode 100644
index 0000000000..2990eed0d9
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceImgDao.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.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.UserAdviceImgEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 用户建议图片
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-11-04
+ */
+@Mapper
+public interface UserAdviceImgDao extends BaseDao {
+
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..720692b778
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java
@@ -0,0 +1,81 @@
+/**
+ * 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.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpdcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 用户建议
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-11-04
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("user_advice")
+public class UserAdviceEntity extends BaseEpdcEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * userid
+ */
+ private String userId;
+
+ /**
+ * 建议描述
+ */
+ private String adviceContent;
+
+ /**
+ * 手机号
+ */
+ private String phone;
+
+ /**
+ * 问题分类(gov政府software软件,逗号分隔)
+ */
+ private String adviceType;
+
+ /**
+ * 回复内容
+ */
+ private String replyContent;
+
+ /**
+ * 回复人
+ */
+ private String replyUser;
+
+ /**
+ * 回复时间
+ */
+ private Date replyTime;
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java
new file mode 100644
index 0000000000..c899502c84
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java
@@ -0,0 +1,51 @@
+/**
+ * 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.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpdcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 用户建议图片
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-11-04
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("user_advice_img")
+public class UserAdviceImgEntity extends BaseEpdcEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 建议id
+ */
+ private String adviceId;
+
+ /**
+ * 图片url
+ */
+ private String imgUrl;
+
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..31581f4373
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java
@@ -0,0 +1,80 @@
+/**
+ * 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.epmet.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-11-04
+ */
+@Data
+public class UserAdviceExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "客户ID")
+ private String customerId;
+
+ @Excel(name = "userid")
+ private String userId;
+
+ @Excel(name = "建议描述")
+ private String adviceContent;
+
+ @Excel(name = "手机号")
+ private String phone;
+
+ @Excel(name = "问题分类(gov政府software软件,逗号分隔)")
+ private String adviceType;
+
+ @Excel(name = "回复内容")
+ private String replyContent;
+
+ @Excel(name = "回复人")
+ private String replyUser;
+
+ @Excel(name = "回复时间")
+ private Date replyTime;
+
+ @Excel(name = "删除标志")
+ 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/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java
new file mode 100644
index 0000000000..55b27a6b7e
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java
@@ -0,0 +1,62 @@
+/**
+ * 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.epmet.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-11-04
+ */
+@Data
+public class UserAdviceImgExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "建议id")
+ private String adviceId;
+
+ @Excel(name = "图片url")
+ private String imgUrl;
+
+ @Excel(name = "删除标志")
+ 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/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java
new file mode 100644
index 0000000000..5c409ddb94
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.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.epmet.redis;
+
+import com.epmet.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-11-04
+ */
+@Component
+public class UserAdviceImgRedis {
+ @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/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
new file mode 100644
index 0000000000..ab047022e7
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.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.epmet.redis;
+
+import com.epmet.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-11-04
+ */
+@Component
+public class UserAdviceRedis {
+ @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/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.java
new file mode 100644
index 0000000000..0e5cd1d5b5
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.UserAdviceImgDTO;
+import com.epmet.entity.UserAdviceImgEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 用户建议图片
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-11-04
+ */
+public interface UserAdviceImgService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2020-11-04
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2020-11-04
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return UserAdviceImgDTO
+ * @author generator
+ * @date 2020-11-04
+ */
+ UserAdviceImgDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-11-04
+ */
+ void save(UserAdviceImgDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-11-04
+ */
+ void update(UserAdviceImgDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2020-11-04
+ */
+ void delete(String[] ids);
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..4e42bc095e
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.UserAdviceDTO;
+import com.epmet.entity.UserAdviceEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 用户建议
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2020-11-04
+ */
+public interface UserAdviceService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2020-11-04
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2020-11-04
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return UserAdviceDTO
+ * @author generator
+ * @date 2020-11-04
+ */
+ UserAdviceDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-11-04
+ */
+ void save(UserAdviceDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2020-11-04
+ */
+ void update(UserAdviceDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2020-11-04
+ */
+ void delete(String[] ids);
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java
new file mode 100644
index 0000000000..bb0828b9a2
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.dao.UserAdviceImgDao;
+import com.epmet.dto.UserAdviceImgDTO;
+import com.epmet.entity.UserAdviceImgEntity;
+import com.epmet.redis.UserAdviceImgRedis;
+import com.epmet.service.UserAdviceImgService;
+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-11-04
+ */
+@Service
+public class UserAdviceImgServiceImpl extends BaseServiceImpl implements UserAdviceImgService {
+
+ @Autowired
+ private UserAdviceImgRedis userAdviceImgRedis;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, UserAdviceImgDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, UserAdviceImgDTO.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 UserAdviceImgDTO get(String id) {
+ UserAdviceImgEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, UserAdviceImgDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(UserAdviceImgDTO dto) {
+ UserAdviceImgEntity entity = ConvertUtils.sourceToTarget(dto, UserAdviceImgEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(UserAdviceImgDTO dto) {
+ UserAdviceImgEntity entity = ConvertUtils.sourceToTarget(dto, UserAdviceImgEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
\ No newline at end of file
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
new file mode 100644
index 0000000000..41e1465a41
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.page.PageData;
+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.entity.UserAdviceEntity;
+import com.epmet.redis.UserAdviceRedis;
+import com.epmet.service.UserAdviceService;
+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-11-04
+ */
+@Service
+public class UserAdviceServiceImpl extends BaseServiceImpl implements UserAdviceService {
+
+ @Autowired
+ private UserAdviceRedis userAdviceRedis;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, UserAdviceDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, UserAdviceDTO.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 UserAdviceDTO get(String id) {
+ UserAdviceEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, UserAdviceDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(UserAdviceDTO dto) {
+ UserAdviceEntity entity = ConvertUtils.sourceToTarget(dto, UserAdviceEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(UserAdviceDTO dto) {
+ UserAdviceEntity entity = ConvertUtils.sourceToTarget(dto, UserAdviceEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml
new file mode 100644
index 0000000000..87d8addf9b
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml
new file mode 100644
index 0000000000..2af36ffe33
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From b9121b2cb0f1dc917f7ea9a1311b12ba6d79def3 Mon Sep 17 00:00:00 2001
From: zxc <1272811460@qq.com>
Date: Thu, 5 Nov 2020 15:13:55 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7?=
=?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E7=BC=93=E5=AD=98=E5=BE=BD=E7=AB=A0?=
=?UTF-8?q?=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/com/epmet/dao/UserBadgeDao.java | 2 +-
.../java/com/epmet/redis/UserBadgeRedis.java | 14 ++++-
.../com/epmet/service/UserBadgeService.java | 8 +++
.../service/impl/UserBadgeServiceImpl.java | 53 +++++++++++--------
4 files changed, 53 insertions(+), 24 deletions(-)
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java
index a100a80ec2..65910f22cd 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java
@@ -34,7 +34,7 @@ public interface UserBadgeDao {
* @author zxc
* @date 2020/11/3 3:11 下午
*/
- List selectAllBadge(UserBadgeListFormDTO userBadgeListFormDTO);
+ List selectAllBadge(@Param("customerId") String customerId);
/**
* @Description 查询徽章认证记录
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java
index 5bc394a6ec..c9eaee4367 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java
@@ -22,7 +22,7 @@ public class UserBadgeRedis {
private RedisUtils redisUtils;
/**
- * @Description 获取徽章信息
+ * @Description 获取客户徽章信息
* @Param customerId
* @author zxc
* @date 2020/11/3 2:50 下午
@@ -33,7 +33,7 @@ public class UserBadgeRedis {
}
/**
- * @Description 存放徽章信息
+ * @Description 存放客户徽章信息
* @Param userBadge
* @Param customerId
* @author zxc
@@ -43,6 +43,16 @@ public class UserBadgeRedis {
redisUtils.hSet(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(),-1);
}
+ /**
+ * @Description 删除客户徽章信息
+ * @Param customerId
+ * @author zxc
+ * @date 2020/11/5 3:06 下午
+ */
+ public void delCustomerBadge(String customerId){
+ redisUtils.hDel(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE);
+ }
+
/**
* @Description 存放徽章审核 手机验证码
* @Param mobile
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java
index 227584a101..81213550b9 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java
@@ -73,4 +73,12 @@ public interface UserBadgeService {
*/
void openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO);
+ /**
+ * @Description 客户徽章缓存初始化
+ * @Param customerId
+ * @author zxc
+ * @date 2020/11/5 3:12 下午
+ */
+ void reloadCustomerBadge(String customerId);
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
index f7ed9f2266..c4f09a941a 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
@@ -58,27 +58,8 @@ public class UserBadgeServiceImpl implements UserBadgeService {
public List selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) {
Object userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId());
if (null == userBadge){
- List resultUserBadge = new ArrayList<>();
- List userBadgeListResultDTOS = userBadgeDao.selectAllBadge(userBadgeListFormDTO);
- if (!CollectionUtils.isEmpty(userBadgeListResultDTOS)){
- Map> groupByCustomer = userBadgeListResultDTOS.stream().collect(Collectors.groupingBy(UserBadgeListResultDTO::getCustomerId));
- resultUserBadge.addAll(groupByCustomer.get(BadgeConstant.DEFAULT_CUSTOMER));
- List badgeByCustomer = groupByCustomer.get(userBadgeListFormDTO.getCustomerId());
- if (!CollectionUtils.isEmpty(badgeByCustomer)) {
- resultUserBadge.forEach(r -> {
- badgeByCustomer.forEach(b -> {
- if (r.getBadgeId().equals(b.getBadgeId())) {
- BeanUtils.copyProperties(b, r);
- }
- });
- });
- userBadgeRedis.setCustomerBadge(resultUserBadge, userBadgeListFormDTO.getCustomerId());
- userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId());
- }else {
- userBadgeRedis.setCustomerBadge(resultUserBadge, userBadgeListFormDTO.getCustomerId());
- userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId());
- }
- }
+ this.reloadCustomerBadge(userBadgeListFormDTO.getCustomerId());
+ userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId());
}
List redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class);
List userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO);
@@ -241,4 +222,34 @@ public class UserBadgeServiceImpl implements UserBadgeService {
userBadgeDao.updateIsOpen(openedOrClosedFormDTO);
}
+ /**
+ * @Description 客户徽章缓存初始化
+ * @Param customerId
+ * @author zxc
+ * @date 2020/11/5 3:12 下午
+ */
+ @Override
+ public void reloadCustomerBadge(String customerId){
+ userBadgeRedis.delCustomerBadge(customerId);
+ List resultUserBadge = new ArrayList<>();
+ List userBadgeListResultDTOS = userBadgeDao.selectAllBadge(customerId);
+ if (!CollectionUtils.isEmpty(userBadgeListResultDTOS)){
+ Map> groupByCustomer = userBadgeListResultDTOS.stream().collect(Collectors.groupingBy(UserBadgeListResultDTO::getCustomerId));
+ resultUserBadge.addAll(groupByCustomer.get(BadgeConstant.DEFAULT_CUSTOMER));
+ List badgeByCustomer = groupByCustomer.get(customerId);
+ if (!CollectionUtils.isEmpty(badgeByCustomer)) {
+ resultUserBadge.forEach(r -> {
+ badgeByCustomer.forEach(b -> {
+ if (r.getBadgeId().equals(b.getBadgeId())) {
+ BeanUtils.copyProperties(b, r);
+ }
+ });
+ });
+ userBadgeRedis.setCustomerBadge(resultUserBadge, customerId);
+ }else {
+ userBadgeRedis.setCustomerBadge(resultUserBadge, customerId);
+ }
+ }
+ }
+
}