diff --git a/epmet-auth/src/main/java/com/epmet/controller/WxController.java b/epmet-auth/src/main/java/com/epmet/controller/WxController.java new file mode 100644 index 0000000000..3ea0b091a5 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/WxController.java @@ -0,0 +1,142 @@ + +package com.epmet.controller; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.Enumeration; + + +/** + * desc:微信配置测试 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-08 + */ +@RestController +@RequestMapping("wechat") +public class WxController { + private static Logger log = LoggerFactory.getLogger(WxController.class); + + + @RequestMapping("check") + public void get(HttpServletRequest request, HttpServletResponse response) throws Exception { + System.out.println("========WechatController========= "); + Enumeration pNames = request.getParameterNames(); + while (pNames.hasMoreElements()) { + String name = (String) pNames.nextElement(); + String value = request.getParameter(name); + // out.print(name + "=" + value); + + String log = "name =" + name + " value =" + value; + } + + String signature = request.getParameter("signature");/// 微信加密签名 + String timestamp = request.getParameter("timestamp");/// 时间戳 + String nonce = request.getParameter("nonce"); /// 随机数 + String echostr = request.getParameter("echostr"); // 随机字符串 + response.reset(); + PrintWriter out = response.getWriter(); + +// if (this.checkSignature(signature, timestamp, nonce)) { +// out.print(echostr); +// } + out.close(); + out = null; + } + + + /** + * 校验签名 + */ + public static boolean checkSignature(String signature, String timestamp, String nonce) { + System.out.println("signature:" + signature + "timestamp:" + timestamp + "nonc:" + nonce); + String WECHAT_TOKEN = "1jkoyyih83nj8"; + String[] arr = new String[]{WECHAT_TOKEN, timestamp, nonce}; + // 将token、timestamp、nonce三个参数进行字典序排序 + Arrays.sort(arr); + StringBuilder content = new StringBuilder(); + for (int i = 0; i < arr.length; i++) { + content.append(arr[i]); + } + MessageDigest md = null; + String tmpStr = null; + + try { + md = MessageDigest.getInstance("SHA-1"); + // 将三个参数字符串拼接成一个字符串进行sha1加密 + byte[] digest = md.digest(content.toString().getBytes()); + tmpStr = byteToStr(digest); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + + content = null; + // 将sha1加密后的字符串可与signature对比,标识该请求来源于微信 + System.out.println(tmpStr.equals(signature.toUpperCase())); + return tmpStr != null ? tmpStr.equals(signature.toUpperCase()) : false; + } + + /** + * 将字节数组转换为十六进制字符串 + * + * @param byteArray + * @return + */ + private static String byteToStr(byte[] byteArray) { + String strDigest = ""; + for (int i = 0; i < byteArray.length; i++) { + strDigest += byteToHexStr(byteArray[i]); + } + return strDigest; + } + + /** + * 将字节转换为十六进制字符串 + * + * @param mByte + * @return + */ + private static String byteToHexStr(byte mByte) { + char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + char[] tempArr = new char[2]; + tempArr[0] = Digit[(mByte >>> 4) & 0X0F]; + tempArr[1] = Digit[mByte & 0X0F]; + + String s = new String(tempArr); + return s; + } + + + /** + * 打开开发者模式签名认证 + * @param signature + * @param timestamp + * @param nonce + * @param echostr + * @return + */ + @ResponseBody + @RequestMapping(value = "/service", method = RequestMethod.GET) + public Object defaultView(String signature, String timestamp, String nonce, String echostr) { + if (echostr == null || echostr.isEmpty()) { + return nonce; + } + if (this.checkSignature(signature, timestamp, nonce)) { + return echostr; + } + return nonce; + } + + +} diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index d8073505ce..ae545279f9 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -163,6 +163,12 @@ com.squareup.okhttp3 okhttp + + io.github.wnjustdoit + pinyin4j + 2.6.0 + compile + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 29a7dcda6b..400e3893e4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -160,4 +160,15 @@ public interface Constant { // resi_footbar_highlight_num // gov_footbar_highlight_num String FOOTBAR_HIGHLIGHT_NUM="_footbar_highlight_num"; + + + /** + * 未被禁用标识 + * */ + String ENABLE = "enable"; + + /** + * 被禁用标识 + * */ + String DISABLE = "disable"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index aa74cd8e2a..5efb12edb9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -74,6 +74,8 @@ public enum EpmetErrorCode { AREA_CODE_ALREADY_EXISTS(8208,"组织区划已被占用,请重新选择"), AGENCY_NAME_ALREADY_EXISTS(8209,"当前组织名称已存在,请重新修改"), SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"), + HAVE_GUIDE_CANNOT_DEL(8211,"当前分类已经存在办事指南,不允许删除"), + GUIDE_CATEGORY_NAME_EXITS(8212,"分类已存在"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), @@ -155,7 +157,8 @@ public enum EpmetErrorCode { EXISTED_SPECIAL_PROJECT(8807, "已经添加过此专题"), CAN_NOT_DEL_SPECIAL_PROJECT(8808, "您没有权限删除此专题"), TAG_NOT_EXIST(8809,"标签不存在"), - + GUIDE_IS_NULL(8810,"指南内容不能为空"), + GUIDE_IS_NOT_YOURS(8811,"只能删除自己创建的指南"), //公众号 865..开头的码 PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"), SELECT_CUSTOMER_ERROR(8652,"未查询到注册客户信息"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index bcbded2bd6..0196f02f44 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -522,4 +522,16 @@ public class RedisKeys { public static String getCustomerStaffInfoKey(String customerId, String staffId) { return rootPrefix.concat("gov:staff:").concat(customerId).concat(StrConstant.COLON).concat(staffId); } + + /** + * @description 网格信息 + * + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 11:03:48 + */ + public static String getGridInfoKey(String gridId) { + return rootPrefix.concat("gov:grid:").concat(gridId); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java new file mode 100644 index 0000000000..2900180581 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java @@ -0,0 +1,12 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +@Data +public class GridInfoCache { + private String gridId; + private String gridNamePath; + private String customerId; + private String pid; + private String pids; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java index 2ac6af82a5..773291dfcc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelUtils.java @@ -14,11 +14,13 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.BeanUtils; +import org.springframework.util.CollectionUtils; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -80,4 +82,44 @@ public class ExcelUtils { exportExcel(response, fileName, targetList, targetClass); } + + public static void exportExcelToTargetDisposeAll(HttpServletResponse response, String fileName, Collection sourceList, + Class targetClass) throws Exception { + if (!CollectionUtils.isEmpty(sourceList)){ + List targetList = new ArrayList<>(sourceList.size()); + for(Object source : sourceList){ + Object target = targetClass.newInstance(); + BeanUtils.copyProperties(source, target); + targetList.add(target); + } + exportExcelDispose(response, fileName, targetList, targetClass); + }else { + exportExcelDispose(response, fileName, new ArrayList<>(), targetClass); + } + + + } + + public static void exportExcelDispose(HttpServletResponse response, String fileName, Collection list, + Class pojoClass) throws IOException { + if(StringUtils.isBlank(fileName)){ + //当前日期 + fileName = DateUtils.format(new Date()); + } + ExportParams params = new ExportParams(fileName,fileName); + Workbook workbook = ExcelExportUtil.exportExcel(params, pojoClass, list); + Sheet sheet1 = workbook.getSheetAt(0); + sheet1.setDefaultColumnWidth(50*256); + sheet1.setDefaultRowHeight((short)(2*256)); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-Type", "application/vnd.ms-excel"); + fileName = fileName + ".xls"; + response.setHeader("Content-Disposition", + "attachment;filename=" +fileName); + ServletOutputStream out = response.getOutputStream(); + workbook.write(out); + out.flush(); + out.close(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java similarity index 97% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java index 8d392a2c21..331febcfe9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Pinyin4jUtil.java @@ -1,4 +1,4 @@ -package com.epmet.util; +package com.epmet.commons.tools.utils; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; @@ -31,6 +31,7 @@ public class Pinyin4jUtil { duoyinMap.put('均',new String[]{"jun"}); duoyinMap.put('会', new String[]{"hui"}); duoyinMap.put('属', new String[]{"shu"}); + duoyinMap.put('调', new String[]{"diao"}); } /** @@ -42,7 +43,6 @@ public class Pinyin4jUtil { */ public static String getFirstSpellPinYin(String src, boolean isFullSpell) { String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1)); - System.out.println(targetStr); String[] split = targetStr.split(","); if (split.length > 1) { targetStr = split[0]; @@ -59,7 +59,6 @@ public class Pinyin4jUtil { */ public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) { String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont)); - System.out.println(targetStr); String[] split = targetStr.split(","); if (split.length > 1) { targetStr = split[0]; @@ -139,8 +138,8 @@ public class Pinyin4jUtil { } else if (((int) c >= 65 && (int) c <= 90) || ((int) c >= 97 && (int) c <= 122)) {//英文 temp[i] = new String[]{String.valueOf(srcChar[i])}; - } else { - temp[i] = new String[]{""}; + } else {//非汉字全盘返回即可 + temp[i] = new String[]{String.valueOf(srcChar[i])}; } } String[] pingyinArray = exchange(temp); diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/CustomerDataManageFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/CustomerDataManageFormDTO.java new file mode 100644 index 0000000000..e707ef6d6c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/CustomerDataManageFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/10 11:04 上午 + * @DESC + */ +@Data +public class CustomerDataManageFormDTO implements Serializable { + + private static final long serialVersionUID = 6462094914874831738L; + + public interface CustomerDataManageForm{} + + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空",groups = CustomerDataManageForm.class) + private String customerId; + + /** + * 组织ID + */ + @NotBlank(message = "组织ID不能为空",groups = CustomerDataManageForm.class) + private String agencyId; + + /** + * 区间:Interval 截止:end + */ + @NotBlank(message = "type不能为空",groups = CustomerDataManageForm.class) + private String type; + + /** + * 开始时间【yyyymmdd】 + */ + private String startTime; + + /** + * 结束时间【yyyymmdd】 + */ + @NotBlank(message = "结束时间不能为空",groups = CustomerDataManageForm.class) + private String endTime; + + private Integer pageNo = 1; + + private Integer pageSize = 20; + + /** + * 是否分页【true分 false不分】 + */ + @NotNull(message = "是否分页不能为空",groups = CustomerDataManageForm.class) + private Boolean isPage; + + //组织或网格Id集合 + private List idList; + //按起始时间还是结束时间查数据【start end】 + private String sourceType; + //数据类型【组织agency 网格grid】 + private String dataType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/CustomerDataManageResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/CustomerDataManageResultDTO.java new file mode 100644 index 0000000000..e736309945 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/CustomerDataManageResultDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 运营情况数据导出-接口返参 + * @Auth sun + */ +@Data +public class CustomerDataManageResultDTO { + + List list = new ArrayList<>(); + private Integer total; + + @Data + public static class CustomerDataManage { + //组织、网格Id + private String orgId; + //组织、网格名称 + private String orgName; + //用户数 + private Integer userCount = 0; + //居民数 + private Integer residentCount = 0; + //党员数 + private Integer partyMemberCount = 0; + //小组数 + private Integer groupCount = 0; + //话题数 + private Integer topicCount = 0; + //议题数 + private Integer issueCount = 0; + //项目数 + private Integer projectCount = 0; + //结案项目数 + private Integer closedProjectCount = 0; + //巡查人数 + private Integer patrolPeopleCount = 0; + //巡查次数 + private Integer patrolCount = 0; + //巡查时长 + private String patrolDuration; + //未转换前的巡查时长 + private Integer patrolDurationInteger = 0; + //数据对应dateId + @JsonIgnore + private String dateId; + @JsonIgnore + private String staffId; + } + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java new file mode 100644 index 0000000000..02c5c9cbc8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenAgencyOrGridListDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.dto.evaluationindex; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author sun + * @Description 根据组织Id判断查询直属下级组织/网格列表,组织存在子客户的查询包含子客户组织数据 + */ +@Data +public class ScreenAgencyOrGridListDTO implements Serializable { + private static final long serialVersionUID = 6328123559936824470L; + //组织级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city,省级:province) + private String level; + //直属下级组织或网格集合 + private List agencyGridList; + + @Data + public static class AgencyGrid { + //组织id + private String orgId; + //组织名称 + private String orgName; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java index 7d0ed2f595..391fe968c9 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java @@ -45,6 +45,8 @@ public class OrgStaffListFormDTO implements Serializable { private List staffIds; //token中用户Id private String staffId; + //人员是否禁用【未禁用enable,已禁用disabled】 + private String enableFlag = "enable"; public interface OrgStaff extends CustomerClientShowGroup {} } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index a56d769119..9e1929056d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -1,18 +1,21 @@ package com.epmet.dataaggre.controller; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.*; import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.excel.CustomerDataManageExcel; import com.epmet.dataaggre.service.datastats.DataStatsService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * @Author sun @@ -215,4 +218,28 @@ public class DataStatsController { return new Result().ok(dataStatsService.governRatio(formDTO)); } + /** + * @Description 客户数据管理导出 + * @Param formDTO + * @Param response + * @author zxc + * @date 2021/9/10 3:52 下午 + */ + @PostMapping("operateexport") + public void CustomerDataManage(@RequestBody CustomerDataManageFormDTO formDTO, HttpServletResponse response) throws Exception { + ValidatorUtils.validateEntity(formDTO, CustomerDataManageFormDTO.CustomerDataManageForm.class); + dataStatsService.CustomerDataManage(formDTO,response); + } + + /** + * @Param formDTO + * @Description 运营情况数据查询 + * @author sun + */ + @PostMapping("operatedata") + public Result operatedata(@RequestBody CustomerDataManageFormDTO formDTO) throws ParseException { + ValidatorUtils.validateEntity(formDTO, CustomerDataManageFormDTO.CustomerDataManageForm.class); + return new Result().ok(dataStatsService.operateExport(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 9cf5a3a6e1..8db54dd03b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -18,6 +18,7 @@ package com.epmet.dataaggre.dao.datastats; import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; +import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; @@ -308,4 +309,30 @@ public interface DataStatsDao { * @author sun */ List selectGirdMemberPatrol(GridMemberPatrolListFormDTO formDTO); + + /** + * @Description 直属组织或网格下注册用户数据 + * @author sun + */ + List regUserList(CustomerDataManageFormDTO formDTO); + /** + * @Description 直属组织或网格下群组数据 + * @author sun + */ + List groupList(CustomerDataManageFormDTO formDTO); + /** + * @Description 直属组织或网格下话题数据 + * @author sun + */ + List topicList(CustomerDataManageFormDTO formDTO); + /** + * @Description 直属组织或网格下议题数据 + * @author sun + */ + List issueList(CustomerDataManageFormDTO formDTO); + /** + * @Description 直属组织或网格下项目数据 + * @author sun + */ + List projectList(CustomerDataManageFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java index c7e68c410e..11ed072080 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java @@ -19,6 +19,8 @@ package com.epmet.dataaggre.dao.epmetuser; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO; +import com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -43,4 +45,10 @@ public interface StatsStaffPatrolRecordDailyDao extends BaseDao getPatrolSumList(@Param("agencyFullIdList") List agencyFullIdList, @Param("startDateId") String startDateId, @Param("endDateId") String endDateId); + + /** + * @Description 直属组织或网格下巡查数据 + * @author sun + */ + List patrolList(CustomerDataManageFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java index 197b4e05e6..138ff3d449 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -95,4 +95,12 @@ public interface EvaluationIndexDao { */ List getSubAgencyListByAgency(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List list); + /** + * @Description 根据组织ID查询组织名 + * @Param agencyId + * @author zxc + * @date 2021/9/10 3:54 下午 + */ + String selectAgencyNameByAgencyId(@Param("agencyId")String agencyId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java new file mode 100644 index 0000000000..821a11426f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/CustomerDataManageExcel.java @@ -0,0 +1,55 @@ +package com.epmet.dataaggre.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2021/9/10 10:15 上午 + * @DESC + */ +@Data +public class CustomerDataManageExcel { + + @Excel(name = "组织") + private String orgName; + + @Excel(name = "用户数") + private Integer userCount; + + @Excel(name = "居民数") + private Integer residentCount; + + @Excel(name = "党员数") + private Integer partyMemberCount; + + @Excel(name = "小组数") + private Integer groupCount; + + @Excel(name = "话题数") + private Integer topicCount; + + @Excel(name = "议题数") + private Integer issueCount; + + @Excel(name = "项目数") + private Integer projectCount; + + @Excel(name = "结案项目数") + private Integer closedProjectCount; + + @Excel(name = "巡查人数") + private Integer patrolPeopleCount; + + @Excel(name = "巡查次数") + private Integer patrolCount; + + @Excel(name = "巡查时长") + private String patrolDuration; + + /** + * 未转换前的巡查时长 + */ + private Integer patrolDurationInteger; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index d4756648a0..36fa24c7b2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -9,6 +9,8 @@ import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; +import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; import java.util.List; /** @@ -229,4 +231,20 @@ public interface DataStatsService { * @author sun */ List getGirdMemberPatrol(GridMemberPatrolListFormDTO formDTO); + + /** + * @Description 客户数据管理导出 + * @Param formDTO + * @Param response + * @author zxc + * @date 2021/9/10 3:52 下午 + */ + void CustomerDataManage(CustomerDataManageFormDTO formDTO, HttpServletResponse response) throws Exception; + + /** + * @Description 运营情况数据查询 + * @author sun + */ + CustomerDataManageResultDTO operateExport(CustomerDataManageFormDTO formDTO) throws ParseException; + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 1002b8c34a..497ab52715 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -2,47 +2,53 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.tools.constant.NumConstant; + import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.enums.OrgLevelEnum; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dataaggre.constant.DataSourceConstant; -import com.epmet.dataaggre.constant.OrgConstant; -import com.epmet.dataaggre.dao.datastats.DataStatsDao; -import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; -import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; -import com.epmet.dataaggre.dto.datastats.form.*; -import com.epmet.dataaggre.dto.datastats.result.*; + import com.epmet.commons.tools.exception.RenException; + import com.epmet.commons.tools.utils.DateUtils; + import com.epmet.commons.tools.utils.ExcelUtils; + import com.epmet.dataaggre.constant.DataSourceConstant; + import com.epmet.dataaggre.constant.OrgConstant; + import com.epmet.dataaggre.dao.datastats.DataStatsDao; + import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; + import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; + import com.epmet.dataaggre.dto.datastats.form.*; + import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; -import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; -import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; -import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; -import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; -import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; -import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; -import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; -import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; -import com.epmet.dataaggre.service.datastats.DataStatsService; -import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; -import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; -import com.epmet.dataaggre.service.opercrm.CustomerRelation; -import com.github.pagehelper.PageHelper; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.NumberFormat; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Collectors; + import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; + import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; + import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; + import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; + import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; + import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; + import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; + import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; + import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; + import com.epmet.dataaggre.excel.CustomerDataManageExcel; + import com.epmet.dataaggre.service.datastats.DataStatsService; + import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; + import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; + import com.epmet.dataaggre.service.opercrm.CustomerRelation; + import com.github.pagehelper.PageHelper; + import lombok.extern.slf4j.Slf4j; + import org.apache.commons.collections4.CollectionUtils; + import org.apache.commons.lang3.StringUtils; + import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Service; + + import javax.servlet.http.HttpServletResponse; + import java.math.BigDecimal; + import java.math.RoundingMode; + import java.text.NumberFormat; + import java.text.ParseException; + import java.text.SimpleDateFormat; + import java.util.*; + import java.util.concurrent.atomic.AtomicInteger; + import java.util.concurrent.atomic.AtomicReference; + import java.util.stream.Collectors; /** * @Author sun @@ -1841,4 +1847,264 @@ public class DataStatsServiceImpl implements DataStatsService { return dataStatsDao.selectGirdMemberPatrol(formDTO); } + /** + * @Description 客户数据管理导出 + * @Param formDTO + * @Param response + * @author zxc + * @date 2021/9/10 3:52 下午 + */ + @Override + public void CustomerDataManage(CustomerDataManageFormDTO formDTO, HttpServletResponse response) throws Exception { + List result = operateExport(formDTO).getList(); + if (!CollectionUtils.isEmpty(result)){ + CustomerDataManageResultDTO.CustomerDataManage c = new CustomerDataManageResultDTO.CustomerDataManage(); + c.setOrgName("合计"); + c.setUserCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getUserCount))); + c.setResidentCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getResidentCount))); + c.setPartyMemberCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPartyMemberCount))); + c.setGroupCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getGroupCount))); + c.setTopicCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getTopicCount))); + c.setIssueCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getIssueCount))); + c.setProjectCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getProjectCount))); + c.setClosedProjectCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getClosedProjectCount))); + c.setPatrolPeopleCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolPeopleCount))); + c.setPatrolCount(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolCount))); + c.setPatrolDurationInteger(result.stream().collect(Collectors.summingInt(CustomerDataManageResultDTO.CustomerDataManage::getPatrolDurationInteger))); + c.setPatrolDuration(getHm(c.getPatrolDurationInteger())); + result.add(c); + } + String fileName = excelName(formDTO); + ExcelUtils.exportExcelToTargetDisposeAll(response,fileName,result, CustomerDataManageExcel.class); + } + + /** + * @Description 秒转换时分 + * @Param seconds + * @author zxc + * @date 2021/9/13 10:03 上午 + */ + public String getHm(Integer seconds){ + String result = "0分钟"; + if (seconds >= NumConstant.SIXTY) { + Integer hours = seconds / 3600; + Integer minutes = seconds % 3600 / 60; + result = (hours < NumConstant.ONE ? "" : hours + "小时") + (minutes < NumConstant.ONE ? "" : minutes + "分钟"); + }else if (seconds < NumConstant.SIXTY && seconds > NumConstant.ZERO){ + result = "1分钟"; + } + return result; + } + + /** + * @Description 表头获取 + * @Param formDTO + * @author zxc + * @date 2021/9/13 10:02 上午 + */ + public String excelName(CustomerDataManageFormDTO formDTO){ + StringBuffer s = new StringBuffer(); + String agencyName = indexService.selectAgencyNameByAgencyId(formDTO.getAgencyId()); + s.append(agencyName); + if (StringUtils.isNotBlank(formDTO.getStartTime())){ + String startTime = formDTO.getStartTime(); + String sYear = startTime.substring(0, 4); + String sMonth = startTime.substring(4, 6); + String sDay = startTime.substring(6, 8); + String endTime = formDTO.getEndTime(); + String eYear = endTime.substring(0, 4); + String eMonth = endTime.substring(4, 6); + String eDay = endTime.substring(6, 8); + s.append(sYear).append("年").append(sMonth).append("月").append(sDay).append("日-") + .append(eYear).append("年").append(eMonth).append("月").append(eDay).append("日区间新增值"); + }else { + String endTime = formDTO.getEndTime(); + String eYear = endTime.substring(0, 4); + String eMonth = endTime.substring(4, 6); + String eDay = endTime.substring(6, 8); + s.append(eYear).append("年").append(eMonth).append("月").append(eDay).append("日截止累计值"); + } + return s.toString(); + } + + /** + * @Param formDTO + * @Description 运营情况数据查询 + * @author sun + */ + @Override + public CustomerDataManageResultDTO operateExport(CustomerDataManageFormDTO formDTO) throws ParseException { + CustomerDataManageResultDTO resultDTO = new CustomerDataManageResultDTO(); + List dataManageList = new ArrayList<>(); + //1.必要参数校验及处理 + if ("Interval".equals(formDTO.getType()) && StringUtils.isEmpty(formDTO.getStartTime())) { + throw new RenException("请选择开始时间或查询累计值"); + } + //入参有开始时间的则需要减去一天 + if (StringUtils.isNotBlank(formDTO.getStartTime())) { + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + Date date = format.parse(formDTO.getStartTime()); + Date yesterday = DateUtils.addDateDays(date, -1); + formDTO.setStartTime(format.format(yesterday)); + } + + //2.查询组织信息,判断查询下级组织还是网格数据 + ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId()); + if (null == agencyGrid) { + return new CustomerDataManageResultDTO(); + } + //组织或网格Id集合 + List idList = agencyGrid.getAgencyGridList().stream().map(ScreenAgencyOrGridListDTO.AgencyGrid::getOrgId).collect(Collectors.toList()); + formDTO.setDataType(!"community".equals(agencyGrid.getLevel()) ? "agency" : "grid"); + formDTO.setIdList(idList); + resultDTO.setTotal(idList.size()); + + //3.查询截止日期用户、群组、话题、议题、项目、巡查数据 + formDTO.setSourceType("end"); + List userEnd = dataStatsDao.regUserList(formDTO); + HashMap uEndMap = new HashMap<>(); + userEnd.stream().forEach(u->uEndMap.put(u.getOrgId(),u)); + List groupEnd = dataStatsDao.groupList(formDTO); + HashMap gEndMap = new HashMap<>(); + groupEnd.stream().forEach(u->gEndMap.put(u.getOrgId(),u)); + List topicEnd = dataStatsDao.topicList(formDTO); + HashMap tEndMap = new HashMap<>(); + topicEnd.stream().forEach(u->tEndMap.put(u.getOrgId(),u)); + List issueEnd = dataStatsDao.issueList(formDTO); + HashMap iEndMap = new HashMap<>(); + issueEnd.stream().forEach(u->iEndMap.put(u.getOrgId(),u)); + List projectEnd = dataStatsDao.projectList(formDTO); + HashMap pEndMap = new HashMap<>(); + projectEnd.stream().forEach(u->pEndMap.put(u.getOrgId(),u)); + //巡查数据不区分区间差值,只计算累计值,人员做去重处理且是有巡查记录的人员 + List patrolEnd = statsStaffPatrolRecordDailyService.patrolList(formDTO); + + //4.判断是否需要查询起始日期用户、群组、话题、议题、项目、巡查数据 + HashMap uStartMap = new HashMap<>(); + HashMap gStartMap = new HashMap<>(); + HashMap tStartMap = new HashMap<>(); + HashMap iStartMap = new HashMap<>(); + HashMap pStartMap = new HashMap<>(); + if ("Interval".equals(formDTO.getType())) { + formDTO.setSourceType("start"); + List userStart = dataStatsDao.regUserList(formDTO); + userStart.stream().forEach(u->uStartMap.put(u.getOrgId(),u)); + List groupStart = dataStatsDao.groupList(formDTO); + groupStart.stream().forEach(u->gStartMap.put(u.getOrgId(),u)); + List topicStart = dataStatsDao.topicList(formDTO); + topicStart.stream().forEach(u->tStartMap.put(u.getOrgId(),u)); + List issueStart = dataStatsDao.issueList(formDTO); + issueStart.stream().forEach(u->iStartMap.put(u.getOrgId(),u)); + List projectStart = dataStatsDao.projectList(formDTO); + projectStart.stream().forEach(u->pStartMap.put(u.getOrgId(),u)); + } + + //5.封装数据 + agencyGrid.getAgencyGridList().forEach(org -> { + CustomerDataManageResultDTO.CustomerDataManage dto = new CustomerDataManageResultDTO.CustomerDataManage(); + dto.setOrgId(org.getOrgId()); + dto.setOrgName(org.getOrgName()); + int user = 0; + int resi = 0; + int part = 0; + if(uEndMap.containsKey(org.getOrgId())){ + user = uEndMap.get(org.getOrgId()).getUserCount(); + resi = uEndMap.get(org.getOrgId()).getResidentCount(); + part = uEndMap.get(org.getOrgId()).getPartyMemberCount(); + if ("Interval".equals(formDTO.getType())&&uStartMap.containsKey(org.getOrgId())) { + user = user - uStartMap.get(org.getOrgId()).getUserCount(); + resi = resi - uStartMap.get(org.getOrgId()).getResidentCount(); + part = part - uStartMap.get(org.getOrgId()).getPartyMemberCount(); + } + } + int group = 0; + if(gEndMap.containsKey(org.getOrgId())){ + group = gEndMap.get(org.getOrgId()).getGroupCount(); + if ("Interval".equals(formDTO.getType())&&gStartMap.containsKey(org.getOrgId())) { + group = group - gStartMap.get(org.getOrgId()).getGroupCount(); + } + } + int topic = 0; + if(tEndMap.containsKey(org.getOrgId())){ + topic = tEndMap.get(org.getOrgId()).getTopicCount(); + if ("Interval".equals(formDTO.getType())&&tStartMap.containsKey(org.getOrgId())) { + topic = topic - tStartMap.get(org.getOrgId()).getTopicCount(); + } + } + int issue = 0; + if(iEndMap.containsKey(org.getOrgId())){ + issue = iEndMap.get(org.getOrgId()).getIssueCount(); + if ("Interval".equals(formDTO.getType())&&iStartMap.containsKey(org.getOrgId())) { + issue = issue - iStartMap.get(org.getOrgId()).getIssueCount(); + } + } + int project = 0; + int closed = 0; + if(pEndMap.containsKey(org.getOrgId())){ + project = pEndMap.get(org.getOrgId()).getProjectCount(); + closed = pEndMap.get(org.getOrgId()).getClosedProjectCount(); + if ("Interval".equals(formDTO.getType())&&pStartMap.containsKey(org.getOrgId())) { + project = project - pStartMap.get(org.getOrgId()).getProjectCount(); + closed = closed - pStartMap.get(org.getOrgId()).getClosedProjectCount(); + } + } + int patro = 0; + int patroCount = 0; + String patrolDuration = ""; + int patrolDurationInteger = 0; + HashSet set = new HashSet(); + for (CustomerDataManageResultDTO.CustomerDataManage u : patrolEnd) { + if ("community".equals(agencyGrid.getLevel()) && org.getOrgId().equals(u.getOrgId())) { + patroCount += u.getPatrolCount(); + patrolDurationInteger += u.getPatrolDurationInteger(); + set.add(u.getStaffId()); + } + if (!"community".equals(agencyGrid.getLevel()) && u.getOrgId().contains(org.getOrgId())) { + patroCount += u.getPatrolCount(); + patrolDurationInteger += u.getPatrolDurationInteger(); + set.add(u.getStaffId()); + } + + } + patro = set.size(); + Integer minutes = patrolDurationInteger / 60; + patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟"); + + dto.setUserCount(user); + dto.setResidentCount(resi); + dto.setPartyMemberCount(part); + dto.setGroupCount(group); + dto.setTopicCount(topic); + dto.setIssueCount(issue); + dto.setProjectCount(project); + dto.setClosedProjectCount(closed); + dto.setPatrolPeopleCount(patro); + dto.setPatrolCount(patroCount); + dto.setPatrolDuration(patrolDuration); + dto.setPatrolDurationInteger(patrolDurationInteger); + + dataManageList.add(dto); + }); + + //6.默认按用户总数降序 + Collections.sort(dataManageList, new Comparator() { + @Override + public int compare(CustomerDataManageResultDTO.CustomerDataManage o1, CustomerDataManageResultDTO.CustomerDataManage o2) { + return o2.getUserCount().compareTo(o1.getUserCount()); + } + }); + + //7.物理分页并返回 + if (formDTO.getIsPage()) { + int firstIndex = (formDTO.getPageNo() - 1) * formDTO.getPageSize(); + int lastIndex = formDTO.getPageNo() * formDTO.getPageSize(); + List list = dataManageList.subList((firstIndex > dataManageList.size() ? dataManageList.size() : firstIndex), (lastIndex > dataManageList.size() ? dataManageList.size() : lastIndex)); + resultDTO.setList(list); + return resultDTO; + } + resultDTO.setList(dataManageList); + return resultDTO; + } + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java index e8ec143b3c..ce49c18f73 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java @@ -18,6 +18,8 @@ package com.epmet.dataaggre.service.epmetuser; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO; +import com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity; @@ -40,4 +42,9 @@ public interface StatsStaffPatrolRecordDailyService extends BaseService getPatrolSumList(List agencyList, String startDateId, String endDateId); + /** + * @Description 直属组织或网格下巡查数据 + * @author sun + */ + List patrolList(CustomerDataManageFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 92a02290bd..649ab17806 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -598,6 +598,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { log.error("getStaffInfo have any agency staffId:{}",staffId); return null; } + result.setAgencyId(agencyDTO.getId()); result.setAgencyName(agencyDTO.getOrganizationName()); StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId); String fromOrgType = OrgTypeEnum.AGENCY.getCode(); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java index aad90034f3..d24dcbe10c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java @@ -4,6 +4,8 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetuser.StatsStaffPatrolRecordDailyDao; +import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO; +import com.epmet.dataaggre.dto.datastats.result.CustomerDataManageResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity; import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; @@ -36,4 +38,13 @@ public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl patrolList(CustomerDataManageFormDTO formDTO) { + return baseDao.patrolList(formDTO); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java index 43be38a84f..67468e32de 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java @@ -2,6 +2,7 @@ package com.epmet.dataaggre.service.evaluationindex; import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; @@ -71,4 +72,18 @@ public interface EvaluationIndexService { */ List getSubAgencyListByAgency(String agencyId); + /** + * @Description 根据组织ID查询组织名 + * @Param agencyId + * @author zxc + * @date 2021/9/10 3:54 下午 + */ + String selectAgencyNameByAgencyId(String agencyId); + + /** + * @Description 根据组织Id判断查询直属下级组织/网格列表,组织存在子客户的查询包含子客户组织数据 + * @author sun + */ + ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java index f8c7eb301a..ea95c436a8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -2,10 +2,12 @@ package com.epmet.dataaggre.service.evaluationindex.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao; import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; +import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; @@ -143,4 +145,65 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { } } + /** + * @Description 根据组织ID查询组织名 + * @Param agencyId + * @author zxc + * @date 2021/9/10 3:54 下午 + */ + @Override + public String selectAgencyNameByAgencyId(String agencyId) { + return evaluationIndexDao.selectAgencyNameByAgencyId(agencyId); + } + + /** + * @Description 根据组织Id判断查询直属下级组织/网格列表,组织存在子客户的查询包含子客户组织数据 + * @author sun + */ + @Override + public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId) { + ScreenAgencyOrGridListDTO resultDTO = new ScreenAgencyOrGridListDTO(); + List agencyGridList = new ArrayList<>(); + //1.查询组织信息 + ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId); + if (dto == null) { + log.error(String.format("组织信息不存在,组织Id->%s"), agencyId); + return new ScreenAgencyOrGridListDTO(); + } + //2.根据组织级别判断查询直属组织或网格列表 + List agencyList = new ArrayList<>(); + List gridList = new ArrayList<>(); + List finalAgencyGridList = agencyGridList; + if (!"community".equals(dto.getLevel())) { + //2-1.直属下级组织列表 + //2.判断客户是否存在子客户 + List list = customerRelation.haveSubCustomer(dto.getCustomerId()); + if (!CollectionUtils.isNotEmpty(list)) { + agencyList = evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null); + } else { + list.add(dto.getCustomerId()); + agencyList = evaluationIndexDao.getSubAgencyListByAgency(null, dto.getAreaCode(), list); + } + agencyList.forEach(gr->{ + ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); + org.setOrgId(gr.getAgencyId()); + org.setOrgName(gr.getAgencyName()); + finalAgencyGridList.add(org); + }); + } else { + //2-2.直属下级网格列表 + gridList = evaluationIndexDao.getSubGridList(agencyId); + gridList.forEach(gr->{ + ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid(); + org.setOrgId(gr.getGridId()); + org.setOrgName(gr.getGridName()); + finalAgencyGridList.add(org); + }); + } + + resultDTO.setLevel(dto.getLevel()); + resultDTO.setAgencyGridList(agencyGridList); + return resultDTO; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index b7b23299ab..8142f4a728 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -3,8 +3,10 @@ package com.epmet.dataaggre.service.govorg.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.govorg.*; @@ -28,10 +30,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -393,6 +392,13 @@ public class GovOrgServiceImpl implements GovOrgService { staffIds.removeIf(s->s.equals(formDTO.getStaffId())); } + //是否具有超级管理员或管理员角色 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + Map roleMap = staffInfoCache.getRoleMap(); + if (roleMap.containsKey("root_manager") || roleMap.containsKey("manager")) { + formDTO.setEnableFlag("disabled"); + } + //2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】 List staffList = epmetUserService.getStaffInfoList(formDTO); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 9f99415f2b..5c25d1edee 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -797,4 +797,205 @@ GROUP BY staff_id + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml index 07039eeed0..a4ebcae961 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml @@ -61,7 +61,7 @@ SELECT DISTINCT sr.staff_id, cs.created_time, - case when gsr.role_key = + case when cs.enable_flag = 'enable' AND gsr.role_key = 'agency_leader' @@ -73,9 +73,14 @@ 'grid_manager' - then 1 else 0 end is_first + then 0 + when cs.enable_flag = 'enable' AND gsr.role_key != 'agency_leader' + then 1 else 2 end is_first FROM staff_role sr INNER JOIN customer_staff cs ON sr.staff_id = cs.user_id + + AND cs.enable_flag = 'enable' + INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id AND gsr.customer_id = #{customerId} WHERE sr.del_flag = '0' @@ -100,7 +105,7 @@ ) t GROUP BY t.staff_id - ORDER BY t.is_first ]]> 1, t.created_time desc + ORDER BY t.is_first ]]> 0, t.is_first asc, t.created_time desc LIMIT #{pageNo}, #{pageSize} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml index 5642d17f40..b3f6e59aa9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml @@ -15,4 +15,45 @@ + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml index 7ad70627dc..afa7e56c2d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -175,4 +175,11 @@ + + + diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java index b6eeff0053..d189574ef3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java @@ -21,6 +21,7 @@ public class ScreenProjectDistributionFormDTO implements Serializable { /** * 如果为空返回全部;可选值:1:红色事件;2:黄色事件;3:绿色事件 + * all:全部 */ @NotBlank(message = "level不能为空") private String level; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java index ec2c9e5219..a45acf622c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java @@ -37,4 +37,10 @@ public class ScreenProjectDistributionResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date projectCreateTime; + + + /** + * 分类名称 add 21.09.9 + */ + private String categoryName; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 8b45ddb6ef..0c27cbc878 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -464,6 +464,8 @@ public class AgencyServiceImpl implements AgencyService { pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON)); }else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){ pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA)); + } else if (customerAgencyDTO.getPid().equals(customerAgencyDTO.getPids())) { + pidList.add(customerAgencyDTO.getPids()); } if(!CollectionUtils.isEmpty(pidList)){ //单客户,存在上级时查询... diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index c740aa4c5e..a23152697e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; @@ -11,6 +12,7 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.dto.UserDTO; import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.form.screen.ColorProjectTotalFormDTO; @@ -23,7 +25,6 @@ import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.project.CustomerProjectCategoryDTO; import com.epmet.project.dto.form.CategoryTopAppealFormDTO; import com.epmet.project.dto.result.CategoryTopAppealResultDTO; @@ -60,8 +61,6 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { @Autowired private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; @Autowired - private OperCrmOpenFeignClient operCrmOpenFeignClient; - @Autowired private EpmetUserOpenFeignClient userOpenFeignClient; /** @@ -85,6 +84,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { /** * @Description 中央区事件分析-项目分布 * 【2021-06-03 修改查询红黄绿事件事件范围为一个月】 + * 【2021-09-09】大屏新增普通事件列表:首次查询平阴整个客户下,近30天内的项目,展示分类名称(前端截取第一个-之前的文字)、颜色等级、项目标题。点击8个街道,联动。 * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author liushaowen @@ -117,9 +117,13 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { CustomerAgencyUserRoleFormDTO userRoleFormDTO = new CustomerAgencyUserRoleFormDTO(); userRoleFormDTO.setCustomerId(formDTO.getCustomerId()); userRoleFormDTO.setStaffId(item.getReportUserId()); - Map staffRoleMap = CustomerStaffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId()); - if (!CollectionUtils.isEmpty(staffRoleMap)){ - item.setReportUserRoleSet(staffRoleMap.keySet()); + //只有工作端的用户才调用此接口 + Result userDTOResult = userOpenFeignClient.queryUserClient(item.getReportUserId()); + if (userDTOResult.success() && null != userDTOResult.getData() && AppClientConstant.APP_GOV.equals(userDTOResult.getData().getFromApp())) { + Map staffRoleMap = CustomerStaffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId()); + if (!CollectionUtils.isEmpty(staffRoleMap)) { + item.setReportUserRoleSet(staffRoleMap.keySet()); + } } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 3e058e209a..16c1b42383 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -282,6 +282,7 @@ screen_customer_agency sca WHERE sca.DEL_FLAG = '0' + and sca.IS_DISPLAY='1' AND sca.PARENT_AREA_CODE = #{areaCode} @@ -296,6 +297,7 @@ FROM screen_customer_grid m where m.DEL_FLAG = '0' + and m.IS_DISPLAY='1' and m.AREA_CODE=#{areaCode} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index 543b9d3eb4..e890e36389 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -12,13 +12,14 @@ longitude AS longitude, latitude AS latitude, PROJECT_CREATE_TIME AS projectCreateTime, - CUSTOMER_ID AS customerId + CUSTOMER_ID AS customerId, + ALL_CATEGORY_NAME as categoryName FROM screen_project_data WHERE del_flag = '0' AND UNIX_TIMESTAMP(CREATED_TIME) >= UNIX_TIMESTAMP(DATE_SUB(NOW(),INTERVAL 1 MONTH)) - + and project_level = #{level} @@ -30,26 +31,23 @@ and org_id = #{agencyId} - - - - and PROJECT_STATUS_CODE ='pending' - - - and PROJECT_STATUS_CODE ='pending' - - - and PROJECT_STATUS_CODE !='pending' - and DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(PROJECT_CREATE_TIME) - - - and PROJECT_STATUS_CODE ='pending' - - + + and PROJECT_STATUS_CODE ='pending' + + + and PROJECT_STATUS_CODE ='pending' + + + and PROJECT_STATUS_CODE !='pending' + and DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(PROJECT_CREATE_TIME) + order by PROJECT_CREATE_TIME desc LIMIT #{pageSize} + + LIMIT #{pageSize} + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml index d49ca80396..156860259b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -184,4 +184,94 @@ ORDER BY P.point DESC LIMIT #{pageNo}, #{pageSize} + + + + + + + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 1a131bb685..7ca7b0551c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.IssueConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.IssueDao; import com.epmet.dao.IssueProcessDao; import com.epmet.dao.IssueProjectRelationDao; @@ -755,6 +756,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp msgDTO.setMessageContent(messageContent); msgDTO.setReadFlag(ReadFlagConstant.UN_READ); msgDTO.setUserId(topicDTO.getCreatedBy()); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_CLOSE_ISSUE); + msgDTO.setTargetId(entity.getId()); + msgList.add(msgDTO); //话题人和议题人是同一个人时则只发送一条居民消息 if (!topicDTO.getCreatedBy().equals(entity.getCreatedBy())) { @@ -1067,11 +1073,21 @@ public class IssueServiceImpl extends BaseServiceImpl imp msgDTO.setMessageContent(topicIssueMessage); msgDTO.setReadFlag(ReadFlagConstant.UN_READ); msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(entity.getId()); + msgList.add(msgDTO); //话题人和议题人是同一个人时则只发送一条居民消息 if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class); msgIssue.setUserId(entity.getCreatedBy()); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(entity.getId()); + msgList.add(msgIssue); } //2:创建项目工作人员消息对象 @@ -1088,6 +1104,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp msg.setMessageContent(projectStaffMessage); msg.setReadFlag(ReadFlagConstant.UN_READ); msg.setUserId(staff.getStaffId()); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(issueProjectResultDTO.getProjectId()); + msgList.add(msg); map.put(staff.getStaffId(),staff.getStaffId()); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java new file mode 100644 index 0000000000..0d97988fd7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/13 3:20 下午 + * @DESC + */ +@Data +public class GetAgencyListFormDTO implements Serializable { + + private static final long serialVersionUID = -5846836779036328298L; + + private String customerId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgFormDTO.java new file mode 100644 index 0000000000..6975477321 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 15:41 + */ +@Data +public class OrgFormDTO implements Serializable { + private static final long serialVersionUID = -5975063766883885089L; + private String orgId; + private String orgType; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java new file mode 100644 index 0000000000..896ebfb57c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/8 15:06 + */ +@Data +public class AgencyTreeResultDTO implements Serializable { + private static final long serialVersionUID = -311212619121062367L; + /** + * 机关组织Id + */ + private String agencyId; + + /** + * 机关组织名称 + */ + private String agencyName; + + private String pid; + /** + * 下级机关组织 + */ + private List subAgencyList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java new file mode 100644 index 0000000000..2473c623fd --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgListResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/8 15:11 + */ +@Data +public class StaffOrgListResultDTO implements Serializable { + private static final long serialVersionUID = -7717333635633000120L; + /** + * 组织ID + */ + private String orgId; + /** + * 组织名称 + */ + private String orgName; + /** + * 组织类型机关agency 网格grid 部门dept + */ + private String orgType; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index e6af374fe2..7e7de0e4b2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -417,4 +417,14 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/customerstaffagency/queryOrgStaffs") Result> queryOrgStaffs(@RequestBody OrgStaffFormDTO formDTO); + + /** + * @Description 根据组织或网格或吧部门获取组织信息 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 15:27 + */ + @PostMapping("/gov/org/customeragency/getAgencyInfo") + Result getAgencyInfo(@RequestBody OrgFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index b517c20344..38f5df4626 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -248,6 +248,19 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "queryOrgStaffs", formDTO); } + /** + * @param formDTO + * @Description 根据组织或网格或吧部门获取组织信息 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 15:27 + */ + @Override + public Result getAgencyInfo(OrgFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyInfo", formDTO); + } + @Override public Result selectPidsByGridId(String gridId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 963c8b7b95..c3937127ba 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -312,4 +312,31 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.staffPermissionExt(tokenDto.getUserId())); } + /** + * @Description 根据组织或网格或吧部门获取组织信息 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 15:27 + */ + @PostMapping("getAgencyInfo") + public Result getAgencyInfo(@RequestBody OrgFormDTO formDTO) { + return new Result().ok(customerAgencyService.getAgencyInfo(formDTO)); + } + + /** + * @Description 获取客户下组织树 + * @Param tokenDTO + * @Return {@link Result< AgencyTreeResultDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 15:20 + */ + @PostMapping("agencylist") + public Result getAgencyList(@LoginUser TokenDto tokenDTO,@RequestBody GetAgencyListFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getCustomerId())){ + formDTO.setCustomerId(tokenDTO.getCustomerId()); + } + return new Result().ok(customerAgencyService.getAgencyList(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index b95b96c0b9..6d3b50b408 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -195,4 +195,16 @@ public class StaffController { return staffService.addStaffV2(fromDTO); } + /** + * @Description 用户所属组织 + * @Param tokenDto + * @Return {@link Result< StaffOrgListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 16:55 + */ + @PostMapping("orgList") + public Result> staffOrgList(@LoginUser TokenDto tokenDto) { + return new Result>().ok(staffService.staffOrgList(tokenDto)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index b0149c28d8..145178f50f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -239,4 +239,8 @@ public interface CustomerAgencyDao extends BaseDao { * @author sun */ OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType); + + AgencyTreeResultDTO getAllAgency(@Param("customerId") String customerId); + + List getSubAgencyList(@Param("pid") String pid); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index fda2f4d09e..b13bae23e7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -19,6 +19,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; @@ -236,4 +237,22 @@ public interface CustomerAgencyService extends BaseService OrganizeTreeResultDTO organizeTree(String agencyId); void checkAgencyName(String agencyName,String customerId,String agencyId,String parentAgencyId); + + /** + * 根据组织或网格或吧部门获取组织信息 + * @Param formDTO + * @Return {@link OrgResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/7 15:28 + */ + OrgResultDTO getAgencyInfo(OrgFormDTO formDTO); + + /** + * @Description 获取客户下组织树 + * @Param tokenDTO + * @Return {@link AgencyTreeResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 15:21 + */ + AgencyTreeResultDTO getAgencyList(GetAgencyListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index d88298dfbf..ccd998c0fc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -129,4 +129,13 @@ public interface StaffService { * @author sun */ Result addStaffV2(AddStaffV2FromDTO fromDTO); + + /** + * @Description 工作人员所属组织 + * @Param tokenDto + * @Return {@link StaffOrgListResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 16:57 + */ + List staffOrgList(TokenDto tokenDto); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 38c0fc85b0..fc9f181a20 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -1075,4 +1075,53 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyList) { + for (AgencyTreeResultDTO dto : agencyList) { + if (CollectionUtils.isEmpty(dto.getSubAgencyList())) { + dto.setSubAgencyList(null); + } else { + setAgencyList(dto.getSubAgencyList()); + } + } + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 9d6504d673..f0cc95c409 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -11,9 +11,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.OrgInfoConstant; -import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dto.*; import com.epmet.dto.form.*; @@ -21,6 +19,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.*; import com.epmet.service.*; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -566,5 +566,52 @@ public class StaffServiceImpl implements StaffService { return new Result(); } + /** + * @param tokenDto + * @Description 工作人员所属组织 + * @Param tokenDto + * @Return {@link StaffOrgListResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 16:57 + */ + @Override + public List staffOrgList(TokenDto tokenDto) { + //redis获取工作人员信息 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfoCache) { + return Collections.emptyList(); + } + List list = new ArrayList<>(); + //工作人员所在组织 + StaffOrgListResultDTO agency = new StaffOrgListResultDTO(); + agency.setOrgId(staffInfoCache.getAgencyId()); + agency.setOrgName(staffInfoCache.getAgencyName()); + agency.setOrgType(OrgInfoConstant.AGENCY); + list.add(agency); + //工作人员所在部门 + if(CollectionUtils.isNotEmpty(staffInfoCache.getDeptList())) { + List deptList = staffInfoCache.getDeptList().stream().map(item -> { + StaffOrgListResultDTO dto = new StaffOrgListResultDTO(); + dto.setOrgId(item.getId()); + dto.setOrgName(item.getName()); + dto.setOrgType(OrgInfoConstant.DEPT); + return dto; + }).collect(Collectors.toList()); + list.addAll(deptList); + } + //工作人员所在网格 + if(CollectionUtils.isNotEmpty(staffInfoCache.getGridList())) { + List gridList = staffInfoCache.getGridList().stream().map(item -> { + StaffOrgListResultDTO dto = new StaffOrgListResultDTO(); + dto.setOrgId(item.getId()); + dto.setOrgName(item.getName()); + dto.setOrgType(OrgInfoConstant.GRID); + return dto; + }).collect(Collectors.toList()); + list.addAll(gridList); + } + return list; + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index a30207d922..89a5df87f4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -503,5 +503,40 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index ad3fec6959..de0a8347f4 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -36,10 +36,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; -import com.epmet.constant.ProjectConstant; -import com.epmet.constant.ReadFlagConstant; -import com.epmet.constant.SmsTemplateConstant; -import com.epmet.constant.UserMessageConstant; +import com.epmet.constant.*; import com.epmet.dao.ProjectOrgRelationDao; import com.epmet.dao.ProjectDao; import com.epmet.dao.ProjectProcessDao; @@ -451,6 +448,11 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl implements ProjectTraceS //4.推送站内信、微信、短信消息 //4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息 - if (!shiftProjectMessage(formDTO).success()) { + if (!shiftProjectMessage(formDTO,projectEntity.getId()).success()) { throw new RenException("项目立项,推送站内信失败"); } @@ -565,7 +562,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS * @Description 项目立项给勾选的工作人员推送站内信消息 * @author sun */ - private Result shiftProjectMessage(ProjectApprovalFormDTO formDTO) { + private Result shiftProjectMessage(ProjectApprovalFormDTO formDTO,String projectId) { List msgList = new ArrayList<>(); //1.创建项目工作人员消息对象 String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, formDTO.getTitle()); @@ -581,6 +578,11 @@ public class ProjectTraceServiceImpl implements ProjectTraceS msg.setMessageContent(projectStaffMessage); msg.setReadFlag(ReadFlagConstant.UN_READ); msg.setUserId(staff.getStaffId()); + + //21.09.10:记录消息类型和对应的业务id + msg.setMessageType(UserMessageTypeConstant.PROJECT_APPROVAL); + msg.setTargetId(projectId); + msgList.add(msg); map.put(staff.getStaffId(),staff.getStaffId()); } @@ -789,7 +791,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS //4.推送站内信、微信、短信消息 //4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息 - if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle()).success()) { + if (!shiftProjectMessage(formDTO.getStaffList(),formDTO.getCustomerId(),formDTO.getTitle(),projectEntity.getId()).success()) { throw new RenException("事件转为项目,推送站内信失败"); } @@ -919,7 +921,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS * @Description 项目立项给勾选的工作人员推送站内信消息 * @author yinzuomei */ - private Result shiftProjectMessage(List staffList,String customerId,String title) { + private Result shiftProjectMessage(List staffList,String customerId,String title,String projectId) { List msgList = new ArrayList<>(); //1.创建项目工作人员消息对象 String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, title); @@ -935,6 +937,11 @@ public class ProjectTraceServiceImpl implements ProjectTraceS msg.setMessageContent(projectStaffMessage); msg.setReadFlag(ReadFlagConstant.UN_READ); msg.setUserId(staff.getStaffId()); + + //21.09.10:记录消息类型和对应的业务id + msg.setTargetId(projectId); + msg.setMessageType(UserMessageTypeConstant.PROJECT_FROM_RESI_EVENT); + msgList.add(msg); map.put(staff.getStaffId(),staff.getStaffId()); } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/AttachmentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/AttachmentDTO.java new file mode 100644 index 0000000000..08fc2f7cc5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/AttachmentDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 16:21 + */ +@Data +public class AttachmentDTO implements Serializable { + private static final long serialVersionUID = 6505979559566901869L; + private String name; + private String format; + private String type; + private String url; + private Integer size; + private Integer duration; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ExternalLinkDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ExternalLinkDTO.java new file mode 100644 index 0000000000..e298d31648 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ExternalLinkDTO.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ExternalLinkDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 链接说明 + */ + private String description; + + /** + * 外部链接 + */ + private String externalLink; + + /** + * 外部链接 + */ + private Integer sort; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java new file mode 100644 index 0000000000..212e9bc369 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 办事指南ID + */ + private String guideId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件大小 单位byte + */ + private Integer attachmentSize; + + /** + * 文件格式 word、excel、pdf + */ + private String attachmentFormat; + + /** + * 类型 + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer 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-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java new file mode 100644 index 0000000000..7d0ed1eef4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.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.dto; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-08 + */ +@Data +public class GuideCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id,产品默认配置此列存储default + */ + private String customerId; + + /** + * 分类名,客户内唯一 + */ + private String categoryName; + + /** + * 分类编码:分类名的全拼; eg:gongjijin + */ + private String categoryCode; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 0未删除、1已删除 + */ + @JsonIgnore + private String delFlag; + + /** + * 乐观锁 + */ + @JsonIgnore + private Integer revision; + + /** + * 创建人 + */ + @JsonIgnore + private String createdBy; + + /** + * 创建时间 + */ + @JsonIgnore + private Date createdTime; + + /** + * 更新人 + */ + @JsonIgnore + private String updatedBy; + + /** + * 更新时间 + */ + @JsonIgnore + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java new file mode 100644 index 0000000000..6b9dbfaeee --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java @@ -0,0 +1,91 @@ +/** + * 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 generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideCollectionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户所属客户端 居民端resi 工作端gov + */ + private String app; + + /** + * 删除标识 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/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java new file mode 100644 index 0000000000..f5fe57d143 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java @@ -0,0 +1,112 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 发布单位类型 机关agency 网格grid 部门dept + */ + private String orgType; + + /** + * 发布单位ID + */ + private String orgId; + + /** + * 发布单位名称 + */ + private String orgName; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String pid; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 标题 + */ + private String title; + + /** + * 分类ID + */ + private String categoryCode; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer 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-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java new file mode 100644 index 0000000000..39612bb4ff --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java @@ -0,0 +1,96 @@ +/** + * 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 generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideExternalLinkDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 链接说明 + */ + private String description; + + /** + * 外部链接 + */ + private String externalLink; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 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/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java new file mode 100644 index 0000000000..40e4fed74e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java @@ -0,0 +1,91 @@ +/** + * 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 generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 模块ID + */ + private String moduleId; + + /** + * + */ + private String moduleContent; + + /** + * 删除标识 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/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java new file mode 100644 index 0000000000..938e7b211a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java @@ -0,0 +1,96 @@ +/** + * 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 generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 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/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java new file mode 100644 index 0000000000..6c59d906f9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java @@ -0,0 +1,91 @@ +/** + * 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 generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDictDefaultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 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/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ModuleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ModuleDTO.java new file mode 100644 index 0000000000..548395fd96 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ModuleDTO.java @@ -0,0 +1,58 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; + + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ModuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private String guideModuleId; + /** + * 主键 + */ + private String moduleId; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 模块内容 + */ + private String moduleContent; +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java new file mode 100644 index 0000000000..79286ba45f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/EditGuideCategoryFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 编辑、禁用、删除统一入参 + * @Author yinzuomei + * @Date 2021/9/8 4:15 下午 + */ +@Data +public class EditGuideCategoryFormDTO implements Serializable { + private static final long serialVersionUID = -6853534660181580456L; + + public interface AddUserInternalGroup { + } + + public interface StatusGroup { + } + + public interface UpdateInfoGroup extends CustomerClientShowGroup { + } + public interface SaveInfoGroup extends CustomerClientShowGroup { + } + + public interface DelGroup { + } + @NotBlank(message = "当前操作人id不能为空", groups = AddUserInternalGroup.class) + private String staffId; + + @NotBlank(message = "客户id不能为空",groups = {DelGroup.class,UpdateInfoGroup.class,SaveInfoGroup.class}) + private String customerId; + + @NotBlank(message = "id不能为空", groups = {StatusGroup.class,DelGroup.class,UpdateInfoGroup.class}) + private String id; + + @NotBlank(message = "status不能为空", groups = StatusGroup.class) + private String status; + + @NotBlank(message = "分类名称不能为空不能为空", groups = {UpdateInfoGroup.class,SaveInfoGroup.class}) + @Length(max = 10, message = "分类名称最多填入10个字", groups = {UpdateInfoGroup.class,SaveInfoGroup.class}) + private String categoryName; + +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideAddFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideAddFormDTO.java new file mode 100644 index 0000000000..dd74b3fac6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideAddFormDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.form; + +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.ModuleDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:24 + */ +@NoArgsConstructor +@Data +public class GuideAddFormDTO implements Serializable { + + private static final long serialVersionUID = -7750999102010191460L; + /** + * 标题 + */ + @NotBlank(message = "标题不能为空") + private String title; + /** + * 标题 + */ + @NotBlank(message = "分类不能为空") + private String categoryCode; + /** + * 机关类型 机关agency 网格grid 部门dept + */ + @NotBlank(message = "所属机关类型不能为空") + private String orgType; + /** + * 所属机关 + */ + @NotBlank(message = "所属机关ID不能为空") + private String orgId; + /** + * 所属机关 + */ + @NotBlank(message = "所属机关名不能为空") + private String orgName; + /** + * 外部链接 + */ + private List externalLinks; + /** + * 内容模块 + */ + private List moduleList; + /** + * 附件 + */ + private List attachmentList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java new file mode 100644 index 0000000000..6b66e9f7c5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCateOrderFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 分类排序入参DTO + * @Author yinzuomei + * @Date 2021/9/8 4:03 下午 + */ +@Data +public class GuideCateOrderFormDTO implements Serializable { + private static final long serialVersionUID = 8671295475212569124L; + + public interface AddUserInternalGroup { + } + + @NotBlank(message = "当前操作人id不能为空", groups = AddUserInternalGroup.class) + private String staffId; + + + @NotEmpty(message = "顺序不能为空", groups = {AddUserInternalGroup.class}) + private List orderList; + + /** + * 排序索引号dto + */ + public static class OrderIndexDTO { + private String id; + private Integer orderIndex; + + public OrderIndexDTO() { + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getOrderIndex() { + return orderIndex; + } + + public void setOrderIndex(Integer orderIndex) { + this.orderIndex = orderIndex; + } + } +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java new file mode 100644 index 0000000000..a92e1c2e09 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryDropDownFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 发布指南、编辑指南、查询指南列表 分类下拉框 + * @Author yinzuomei + * @Date 2021/9/8 2:57 下午 + */ +@Data +public class GuideCategoryDropDownFormDTO implements Serializable { + private static final long serialVersionUID = 9122708701080412461L; + public interface AddUserInternalGroup { + } + /** + * 新增指南:saveorupdate;查询指南列表:query + */ + @NotBlank(message = "新增指南:saveorupdate;查询指南列表:query",groups = AddUserInternalGroup.class) + private String queryOrigin; + + @NotBlank(message = "当前工作人员所属客户id不能为空",groups = AddUserInternalGroup.class) + private String customerId; + +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java new file mode 100644 index 0000000000..b67686e451 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideCategoryPageFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 工作端PC或者运营端分页 + * @Author yinzuomei + * @Date 2021/9/8 1:35 下午 + */ +@Data +public class GuideCategoryPageFormDTO implements Serializable { + private static final long serialVersionUID = -7551388716349439643L; + public interface AddUserInternalGroup { + } + @NotBlank(message = "客户id不能为空,运营端传default", groups = AddUserInternalGroup.class) + private String customerId; +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideEditFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideEditFormDTO.java new file mode 100644 index 0000000000..a589c4c1ec --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideEditFormDTO.java @@ -0,0 +1,70 @@ +package com.epmet.dto.form; + +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.ModuleDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:24 + */ +@NoArgsConstructor +@Data +public class GuideEditFormDTO implements Serializable { + + private static final long serialVersionUID = -7750999102010191460L; + /** + * 工作人员ID + */ + private String staffId; + /** + * 指南ID + */ + @NotBlank(message = "指南id不能为空") + private String guideId; + /** + * 标题 + */ + @NotBlank(message = "标题不能为空") + private String title; + /** + * 标题 + */ + @NotBlank(message = "分类不能为空") + private String categoryCode; + /** + * 机关类型 机关agency 网格grid 部门dept + */ + @NotBlank(message = "所属机关类型不能为空") + private String orgType; + /** + * 所属机关 + */ + @NotBlank(message = "所属机关ID不能为空") + private String orgId; + /** + * 所属机关 + */ + @NotBlank(message = "所属机关名不能为空") + private String orgName; + /** + * 外部链接 + */ + private List externalLinks; + /** + * 内容模块 + */ + private List moduleList; + /** + * 附件 + */ + private List attachmentList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideFormDTO.java new file mode 100644 index 0000000000..48bfde8f04 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form; + +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.GuideAttachmentDTO; +import com.epmet.dto.ModuleDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:24 + */ +@NoArgsConstructor +@Data +public class GuideFormDTO implements Serializable { + + private static final long serialVersionUID = -7750999102010191460L; + /** + * 标题 + */ + @NotBlank(message = "指南id不能为空") + private String guideId; + + /** + * 工作人员 + */ + private String staffId; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java new file mode 100644 index 0000000000..d8edcf1308 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 9:38 + */ +@NoArgsConstructor +@Data +public class GuideListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -4471422632936288213L; + private String customerId; + /** + * 组织ID + */ + private String agencyId; + /** + * 分类 + */ + private String categoryCode; + /** + * 标题 + */ + private String guideTitle; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java new file mode 100644 index 0000000000..6bf568d65d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:52 + */ +@Data +public class GetCategoryResultDTO implements Serializable { + private static final long serialVersionUID = 3527239091132653541L; + private String categoryId; + private String categoryName; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDetailResultDTO.java new file mode 100644 index 0000000000..88844f301c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDetailResultDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.result; + +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.ModuleDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/7 10:24 + */ +@NoArgsConstructor +@Data +public class GuideDetailResultDTO implements Serializable { + + private static final long serialVersionUID = -7750999102010191460L; + /** + * 标题 + */ + private String guideId; + /** + * 标题 + */ + private String title; + /** + * 分类ID + */ + private String categoryCode; + /** + * 分类名 + */ + private String categoryName; + /** + * 机关类型 机关agency 网格grid 部门dept + */ + private String orgType; + /** + * 所属机关 + */ + private String orgId; + /** + * 所属机关名 + */ + private String orgName; + /** + * 是否收藏 1是, 0否 + */ + private String collectionFlag; + /** + * 外部链接 + */ + private List externalLinks; + /** + * 内容模块 + */ + private List moduleList; + /** + * 附件 + */ + private List attachmentList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java new file mode 100644 index 0000000000..00f56ad3f9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideDictResDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * @Author yinzuomei + * @Date 2021/9/8 2:44 下午 + */ +@Data +public class GuideDictResDTO implements Serializable { + + /** + * 分类名,客户内唯一 + */ + private String categoryName; + + /** + * 分类编码:分类名的全拼; eg:gongjijin + */ + private String categoryCode; + + /** + * 排序 + */ + @JsonIgnore + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + @JsonIgnore + private String status; +} + + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java new file mode 100644 index 0000000000..7cd2400afa --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author Administrator + */ +@Data +public class GuideListResultDTO implements Serializable { + private static final long serialVersionUID = -1360741408368601140L; + private String guideId; + /** + * 标题 + */ + private String title; + /** + * 分类 + */ + private String categoryName; + /** + * 创建人ID + */ + private String createdId; + /** + * 创建人姓名 + */ + private String createdName; + /** + * 更新时间 + */ + private Date updatedTime; +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java new file mode 100644 index 0000000000..b1e8824223 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java @@ -0,0 +1,171 @@ +/** + * 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.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.dto.form.EditGuideCategoryFormDTO; +import com.epmet.dto.form.GuideCateOrderFormDTO; +import com.epmet.dto.form.GuideCategoryDropDownFormDTO; +import com.epmet.dto.form.GuideCategoryPageFormDTO; +import com.epmet.dto.result.GuideDictResDTO; +import com.epmet.service.GuideCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidecategory") +public class GuideCategoryController { + + @Autowired + private GuideCategoryService guideCategoryService; + + /** + * 【办事指南】分类列表-工作端PC和运营端用不分页 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/9/8 1:33 下午 + */ + @PostMapping("page") + public Result> page(@RequestBody GuideCategoryPageFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GuideCategoryPageFormDTO.AddUserInternalGroup.class); + PageData page = guideCategoryService.page(formDTO); + return new Result>().ok(page); + } + + /** + * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/9/8 2:47 下午 + */ + @PostMapping("getcategory") + public Result> getCategory(@LoginUser TokenDto tokenDto,@RequestBody GuideCategoryDropDownFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,GuideCategoryDropDownFormDTO.AddUserInternalGroup.class); + return new Result>().ok(guideCategoryService.getCategory(formDTO)); + } + + + /** + * 保存排序 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 4:09 下午 + */ + @PostMapping("saveorder") + public Result saveOrder(@LoginUser TokenDto tokenDto,@RequestBody GuideCateOrderFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,GuideCateOrderFormDTO.AddUserInternalGroup.class); + guideCategoryService.saveOrder(formDTO); + return new Result(); + } + + /** + * 禁用或者启用分类 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 4:19 下午 + */ + @PostMapping("disable") + public Result disable(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.StatusGroup.class,EditGuideCategoryFormDTO.AddUserInternalGroup.class); + guideCategoryService.disableGuideCategory(formDTO); + return new Result(); + } + + /** + * 删除分类,已经存在指南的不允许删除,给予提示 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 4:45 下午 + */ + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.DelGroup.class); + guideCategoryService.delete(formDTO); + return new Result(); + } + + + /** + * 新增分类,名称和编码客户内唯一 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 5:11 下午 + */ + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.SaveInfoGroup.class); + return new Result().ok(guideCategoryService.save(formDTO)); + } + + + /** + * 编辑名称 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/8 5:37 下午 + */ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto,@RequestBody EditGuideCategoryFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO,EditGuideCategoryFormDTO.AddUserInternalGroup.class,EditGuideCategoryFormDTO.UpdateInfoGroup.class); + return new Result().ok(guideCategoryService.update(formDTO)); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java new file mode 100644 index 0000000000..5c6ffe5019 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java @@ -0,0 +1,102 @@ +/** + * 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.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.service.GuideCollectionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidecollection") +public class GuideCollectionController { + + @Autowired + private GuideCollectionService guideCollectionService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideCollectionService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideCollectionDTO data = guideCollectionService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideCollectionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideCollectionService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideCollectionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideCollectionService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideCollectionService.delete(ids); + return new Result(); + } + + /** + * @Description 收藏指南 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/9 9:46 + */ + @PostMapping("collection") + public Result collection(@LoginUser TokenDto tokenDto, @RequestBody GuideFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + guideCollectionService.collection(tokenDto, formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java new file mode 100644 index 0000000000..88d8115216 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java @@ -0,0 +1,180 @@ +/** + * 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.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideDTO; +import com.epmet.dto.form.GuideAddFormDTO; +import com.epmet.dto.form.GuideEditFormDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.dto.form.GuideListFormDTO; +import com.epmet.dto.result.GuideDetailResultDTO; +import com.epmet.dto.result.GuideListResultDTO; +import com.epmet.service.GuideService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guide") +public class GuideController { + + @Autowired + private GuideService guideService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = guideService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + GuideDTO data = guideService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideService.delete(ids); + return new Result(); + } + + /** + * @Description 办事指南列表 + * @Param formDTO + * @Return {@link Result< PageData< GuideListResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/9/7 13:59 + */ + @PostMapping("list") + public Result> guideList(@LoginUser TokenDto tokenDto, @RequestBody GuideListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + PageData page = guideService.guideList(tokenDto, formDTO); + return new Result>().ok(page); + } + + + /** + * @Description 添加指南 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 14:13 + */ + @PostMapping("add") + public Result guideAdd(@LoginUser TokenDto tokenDto, @RequestBody GuideAddFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + guideService.guideAdd(tokenDto, formDTO); + return new Result(); + } + + /** + * @Description 修改指南 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 14:13 + */ + @PostMapping("edit") + public Result guideEdit(@LoginUser TokenDto tokenDto, @RequestBody GuideEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + formDTO.setStaffId(tokenDto.getUserId()); + guideService.guideEdit(formDTO); + return new Result(); + } + + /** + * @Description 删除指南 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/7 14:13 + */ + @PostMapping("del") + public Result guideDel(@LoginUser TokenDto tokenDto, @RequestBody GuideFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + formDTO.setStaffId(tokenDto.getUserId()); + guideService.guideDel(formDTO); + return new Result(); + } + + /** + * @Description 指南详情 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< GuideDetailResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/7 14:13 + */ + @PostMapping("detail") + public Result guideDetail(@LoginUser TokenDto tokenDto, @RequestBody GuideFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + formDTO.setCustomerId(tokenDto.getCustomerId()); + GuideDetailResultDTO result = guideService.guideDetail(tokenDto, formDTO); + return new Result().ok(result); + } + + + @PostMapping("collectionlist") + public Result> collectionList(@LoginUser TokenDto tokenDto, @RequestBody PageFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + PageData page = guideService.collectionList(tokenDto, formDTO); + return new Result>().ok(page); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java new file mode 100644 index 0000000000..dcaad21808 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java @@ -0,0 +1,93 @@ +/** + * 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.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.service.GuideModuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidemodule") +public class GuideModuleController { + + @Autowired + private GuideModuleService guideModuleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideModuleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideModuleDTO data = guideModuleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideModuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideModuleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideModuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideModuleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideModuleService.delete(ids); + return new Result(); + } + + @PostMapping("list") + public Result> getModuleList(@LoginUser TokenDto tokenDto) { + return new Result>().ok(guideModuleService.getModuleList(tokenDto.getCustomerId())); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java new file mode 100644 index 0000000000..a8a59b6b8b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java @@ -0,0 +1,84 @@ +/** + * 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.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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideModuleDictDTO; +import com.epmet.service.GuideModuleDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidemoduledict") +public class GuideModuleDictController { + + @Autowired + private GuideModuleDictService guideModuleDictService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideModuleDictService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideModuleDictDTO data = guideModuleDictService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideModuleDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideModuleDictService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideModuleDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideModuleDictService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideModuleDictService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java new file mode 100644 index 0000000000..01e5baddd7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.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.GuideAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java new file mode 100644 index 0000000000..71f757fd23 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java @@ -0,0 +1,98 @@ +/** + * 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.dto.GuideCategoryDTO; +import com.epmet.dto.result.GuideDictResDTO; +import com.epmet.entity.GuideCategoryEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideCategoryDao extends BaseDao { + + /** + * 工作端PC或者运营端分类列表查询,不分页 + * + * @param customerId + * @return java.util.List + * @author yinzuomei + * @date 2021/9/8 1:57 下午 + */ + List selectPageByCid(String customerId); + + /** + * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * + * @param customerId + * @param queryOrigin + * @return java.util.List + * @author yinzuomei + * @date 2021/9/8 3:15 下午 + */ + List selectCategoryDict(@Param("customerId") String customerId, @Param("queryOrigin") String queryOrigin); + + /** + * 保存排序 + * + * @param id + * @param orderIndex + * @param staffId + * @return int + * @author yinzuomei + * @date 2021/9/8 4:11 下午 + */ + int updateOrder(@Param("id") String id, @Param("orderIndex") Integer orderIndex, @Param("staffId") String staffId); + + /** + * 启用或者禁用 + * + * @param id + * @param status + * @param staffId + * @return int + * @author yinzuomei + * @date 2021/9/8 4:22 下午 + */ + int updateStatus(@Param("id") String id, @Param("status")String status, @Param("staffId")String staffId); + + /** + * 查询这个分类下的项目数 + * + * @param id + * @return int + * @author yinzuomei + * @date 2021/9/8 4:36 下午 + */ + int selectGuideTotal(@Param("id") String id,@Param("customerId") String customerId); + + int selectCategoryName(@Param("categoryName") String categoryName, @Param("customerId")String customerId, @Param("excludeId") String excludeId); + + int selectCurrentOrder(String customerId); + + int selectCategoryCode(@Param("categoryCode") String categoryCode, @Param("customerId")String customerId, @Param("excludeId") String excludeId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java new file mode 100644 index 0000000000..905dfb9f3e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.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.GuideCollectionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideCollectionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java new file mode 100644 index 0000000000..18644f0249 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.GuideListFormDTO; +import com.epmet.dto.result.GuideDetailResultDTO; +import com.epmet.dto.result.GuideListResultDTO; +import com.epmet.entity.GuideEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideDao extends BaseDao { + + /** + * 指南列表 + * + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/9/7 14:21 + */ + List getGuideList(GuideListFormDTO formDTO); + + /** + * 指南详情 + * + * @Param customerId + * @Param guideId + * @Return {@link GuideDetailResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 9:59 + */ + GuideDetailResultDTO getGuideDetail(@Param("customerId") String customerId, @Param("guideId") String guideId); + + /** + * 收藏列表 + * + * @Param tokenDto + * @Return {@link List< GuideListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 10:09 + */ + List getCollectionList(TokenDto tokenDto); + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java new file mode 100644 index 0000000000..f766b71680 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.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.GuideExternalLinkEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideExternalLinkDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java new file mode 100644 index 0000000000..07518e24eb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDao extends BaseDao { + /** + * @Description 获取指南的内容模块 + * @Param guideId + * @Return {@link List< ModuleDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 10:18 + */ + List selectByGuideId(@Param("customerId") String customerId, @Param("guideId") String guideId); + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java new file mode 100644 index 0000000000..8af7910511 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.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.GuideModuleDictEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDictDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java new file mode 100644 index 0000000000..071c7ed2c1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.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.GuideModuleDictDefaultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDictDefaultDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java new file mode 100644 index 0000000000..192f52b306 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java @@ -0,0 +1,83 @@ +/** + * 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.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_attachment") +public class GuideAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 办事指南ID + */ + private String guideId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件大小 单位byte + */ + private Integer attachmentSize; + + /** + * 文件格式 word、excel、pdf + */ + private String attachmentFormat; + + /** + * 类型 + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java new file mode 100644 index 0000000000..c13a7a3df9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java @@ -0,0 +1,63 @@ +/** + * 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.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_category") +public class GuideCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id,产品默认配置此列存储default + */ + private String customerId; + + /** + * 分类名,客户内唯一 + */ + private String categoryName; + + /** + * 分类编码:分类名的全拼; eg:gongjijin + */ + private String categoryCode; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java new file mode 100644 index 0000000000..f522884f79 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_collection") +public class GuideCollectionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户所属客户端 居民端resi 工作端gov + */ + private String app; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java new file mode 100644 index 0000000000..5909729866 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java @@ -0,0 +1,78 @@ +/** + * 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.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide") +public class GuideEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 发布单位类型 机关agency 网格grid 部门dept + */ + private String orgType; + + /** + * 发布单位ID + */ + private String orgId; + + /** + * 发布单位名称 + */ + private String orgName; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String pid; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 标题 + */ + private String title; + + /** + * 分类ID + */ + private String categoryCode; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java new file mode 100644 index 0000000000..3773c6acea --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java @@ -0,0 +1,63 @@ +/** + * 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.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_external_link") +public class GuideExternalLinkEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 链接说明 + */ + private String description; + + /** + * 外部链接 + */ + private String externalLink; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java new file mode 100644 index 0000000000..f01788acdc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module_dict_default") +public class GuideModuleDictDefaultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java new file mode 100644 index 0000000000..2816effef0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module_dict") +public class GuideModuleDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java new file mode 100644 index 0000000000..35d602602e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module") +public class GuideModuleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 模块ID + */ + private String moduleId; + + /** + * + */ + private String moduleContent; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java new file mode 100644 index 0000000000..4b297fed10 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java @@ -0,0 +1,114 @@ +/** + * 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.AttachmentDTO; +import com.epmet.dto.GuideAttachmentDTO; +import com.epmet.entity.GuideAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + GuideAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 删除指南附件 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:16 + */ + void deleteByGuideId(String guideId); + + /** + * @Description 获取指南附件 + * @Param guideId + * @Return {@link List< AttachmentDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 10:49 + */ + List getByGuideId(String guideId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java new file mode 100644 index 0000000000..5bde4619e6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java @@ -0,0 +1,110 @@ +/** + * 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.GuideCategoryDTO; +import com.epmet.dto.form.EditGuideCategoryFormDTO; +import com.epmet.dto.form.GuideCateOrderFormDTO; +import com.epmet.dto.form.GuideCategoryDropDownFormDTO; +import com.epmet.dto.form.GuideCategoryPageFormDTO; +import com.epmet.dto.result.GuideDictResDTO; +import com.epmet.entity.GuideCategoryEntity; + +import java.util.List; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideCategoryService extends BaseService { + + /** + * 【办事指南】分类列表-工作端PC和运营端用不分页 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/9/8 1:33 下午 + */ + PageData page(GuideCategoryPageFormDTO formDTO); + + /** + * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @date 2021/9/8 3:06 下午 + */ + List getCategory(GuideCategoryDropDownFormDTO formDTO); + + /** + * 保存排序 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/9/8 4:09 下午 + */ + void saveOrder(GuideCateOrderFormDTO formDTO); + + + /** + * 启用或者禁用分类 + * + * @param formDTO + * @return int + * @author yinzuomei + * @date 2021/9/8 4:20 下午 + */ + void disableGuideCategory(EditGuideCategoryFormDTO formDTO); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + GuideCategoryDTO save(EditGuideCategoryFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + GuideCategoryDTO update(EditGuideCategoryFormDTO dto); + + /** + * 删除分类,存在办事指南的不允许删除,给予提示 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/9/8 4:34 下午 + */ + void delete(EditGuideCategoryFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java new file mode 100644 index 0000000000..bd2e97c482 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.entity.GuideCollectionEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideCollectionService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideCollectionDTO + * @author generator + * @date 2021-09-06 + */ + GuideCollectionDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideCollectionDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideCollectionDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 收藏指南 + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/9 9:46 + */ + void collection(TokenDto tokenDto, GuideFormDTO formDTO); + + /** + * @Description 获取收藏信息 + * @Param tokenDto + * @Param guideId + * @Return {@link GuideCollectionDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 9:52 + */ + GuideCollectionDTO getCollection(TokenDto tokenDto, String guideId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java new file mode 100644 index 0000000000..e54c0d4675 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java @@ -0,0 +1,114 @@ +/** + * 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.ExternalLinkDTO; +import com.epmet.dto.GuideExternalLinkDTO; +import com.epmet.entity.GuideExternalLinkEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideExternalLinkService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideExternalLinkDTO + * @author generator + * @date 2021-09-06 + */ + GuideExternalLinkDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideExternalLinkDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideExternalLinkDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 删除指南外链 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:20 + */ + void deleteByGuideId(String guideId); + + /** + * @Description 获取指南外链 + * @Param guideId + * @Return {@link List< ExternalLinkDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 11:05 + */ + List getByGuideId(String guideId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java new file mode 100644 index 0000000000..2bf1b3aac7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideModuleDictDefaultDTO; +import com.epmet.entity.GuideModuleDictDefaultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleDictDefaultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDictDefaultDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDictDefaultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDictDefaultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDictDefaultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * 获取默认配置 + * @Param + * @Return {@link List< GuideModuleDictDefaultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 17:44 + */ + List getList(); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java new file mode 100644 index 0000000000..7f1ae4a0e4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java @@ -0,0 +1,105 @@ +/** + * 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.GuideModuleDictDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleDictService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDictDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDictDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 获取模块列表 + * @Param customerId + * @Return {@link List< ModuleDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 17:50 + */ + List getModuleList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.java new file mode 100644 index 0000000000..dc7857f8f9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Description 删除指南的内容模块 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:01 + */ + void deleteByGuideId(String guideId); + + /** + * @Description + * @Param customerId + * @Param guideId + * @Return {@link ModuleDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 10:13 + */ + List getByGuideId(String customerId, String guideId); + + /** + * @Description 获取模块列表 + * @Param customerId + * @Return {@link List< ModuleDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 14:46 + */ + List getModuleList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java new file mode 100644 index 0000000000..a2493a88ac --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java @@ -0,0 +1,165 @@ +/** + * 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.dto.form.PageFormDTO; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.GuideDTO; +import com.epmet.dto.form.GuideAddFormDTO; +import com.epmet.dto.form.GuideEditFormDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.dto.form.GuideListFormDTO; +import com.epmet.dto.result.GuideDetailResultDTO; +import com.epmet.dto.result.GuideListResultDTO; +import com.epmet.entity.GuideEntity; + +import java.util.List; +import java.util.Map; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideDTO + * @author generator + * @date 2021-09-06 + */ + GuideDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * 办事指南列表 + * + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2021/9/7 14:00 + */ + PageData guideList(TokenDto tokenDto, GuideListFormDTO formDTO); + + /** + * 添加指南 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + void guideAdd(TokenDto tokenDto, GuideAddFormDTO formDTO); + + /** + * 修改指南 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + void guideEdit(GuideEditFormDTO formDTO); + + /** + * 删除指南 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + void guideDel(GuideFormDTO formDTO); + + /** + * 指南详情 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link GuideDetailResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + GuideDetailResultDTO guideDetail(TokenDto tokenDto, GuideFormDTO formDTO); + + /** + * @Description 收藏列表 + * @Param tokenDto + * @Param formDTO + * @Return {@link PageData< GuideListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 10:07 + */ + PageData collectionList(TokenDto tokenDto, PageFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 62274c346b..1d95335423 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -976,7 +976,8 @@ public class ArticleServiceImpl extends BaseServiceImpl + * 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.LambdaQueryWrapper; +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideAttachmentDao; +import com.epmet.dto.AttachmentDTO; +import com.epmet.dto.GuideAttachmentDTO; +import com.epmet.entity.GuideAttachmentEntity; +import com.epmet.service.GuideAttachmentService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideAttachmentServiceImpl extends BaseServiceImpl implements GuideAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideAttachmentDTO.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 GuideAttachmentDTO get(String id) { + GuideAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideAttachmentDTO dto) { + GuideAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, GuideAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideAttachmentDTO dto) { + GuideAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, GuideAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param guideId + * @Description 删除指南附件 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:16 + */ + @Override + public void deleteByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideAttachmentEntity::getGuideId, guideId); + baseDao.delete(wrapper); + } + + /** + * @param guideId + * @Description 获取指南附件 + * @Param guideId + * @Return {@link List< AttachmentDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 10:49 + */ + @Override + public List getByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideAttachmentEntity::getGuideId, guideId); + wrapper.orderByAsc(GuideAttachmentEntity::getSort); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + AttachmentDTO dto = new AttachmentDTO(); + dto.setName(item.getAttachmentName()); + dto.setType(item.getAttachmentType()); + dto.setUrl(item.getAttachmentUrl()); + dto.setSize(item.getAttachmentSize()); + dto.setFormat(item.getAttachmentFormat()); + dto.setDuration(item.getDuration()); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java new file mode 100644 index 0000000000..6f3f7a082a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java @@ -0,0 +1,225 @@ +/** + * 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.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Pinyin4jUtil; +import com.epmet.dao.GuideCategoryDao; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.dto.form.EditGuideCategoryFormDTO; +import com.epmet.dto.form.GuideCateOrderFormDTO; +import com.epmet.dto.form.GuideCategoryDropDownFormDTO; +import com.epmet.dto.form.GuideCategoryPageFormDTO; +import com.epmet.dto.result.GuideDictResDTO; +import com.epmet.entity.GuideCategoryEntity; +import com.epmet.service.GuideCategoryService; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideCategoryServiceImpl extends BaseServiceImpl implements GuideCategoryService { + + + /** + * 【办事指南】分类列表-工作端PC和运营端用不分页 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/9/8 1:33 下午 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public PageData page(GuideCategoryPageFormDTO formDTO) { + List list = baseDao.selectPageByCid(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(list) && !formDTO.getCustomerId().equals(Constant.DEFAULT_CUSTOMER)) { + //初始化默认的给客户 + initCustomerGuideCategory(formDTO.getCustomerId()); + list = baseDao.selectPageByCid(formDTO.getCustomerId()); + } + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 产品默认分类同步给客户,已经禁用的不同步 + * + * @param customerId + * @return void + * @author yinzuomei + * @date 2021/9/8 2:17 下午 + */ + private void initCustomerGuideCategory(String customerId) { + List list = baseDao.selectPageByCid(Constant.DEFAULT_CUSTOMER); + int sort = 0; + for (GuideCategoryDTO dto : list) { + // 已经禁用的,不同步给客户 + if (Constant.DISABLE.equals(dto.getStatus())) { + continue; + } + dto.setCustomerId(customerId); + //清空主键 + dto.setId(null); + dto.setSort(sort); + GuideCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryEntity.class); + insert(entity); + sort++; + } + } + + + /** + * 办事指南】可用分类列表 新增、编辑指南时的下拉框:展示未禁用的分类; 查询指南列表:如果禁用的分类下存在指南列表,则展示,不存在直接不展示 + * + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @date 2021/9/8 3:06 下午 + */ + @Override + public List getCategory(GuideCategoryDropDownFormDTO formDTO) { + List list=baseDao.selectCategoryDict(formDTO.getCustomerId(),formDTO.getQueryOrigin()); + if (CollectionUtils.isEmpty(list) && !formDTO.getCustomerId().equals(Constant.DEFAULT_CUSTOMER)) { + //初始化默认的给客户 + initCustomerGuideCategory(formDTO.getCustomerId()); + list=baseDao.selectCategoryDict(formDTO.getCustomerId(),formDTO.getQueryOrigin()); + } + return list; + } + + /** + * 保存排序 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/9/8 4:09 下午 + */ + @Transactional + @Override + public void saveOrder(GuideCateOrderFormDTO formDTO) { + for (GuideCateOrderFormDTO.OrderIndexDTO idx : formDTO.getOrderList()) { + baseDao.updateOrder(idx.getId(), idx.getOrderIndex(),formDTO.getStaffId()); + } + } + + /** + * 启用或者禁用分类 + * + * @param formDTO + * @return int + * @author yinzuomei + * @date 2021/9/8 4:20 下午 + */ + @Override + public void disableGuideCategory(EditGuideCategoryFormDTO formDTO) { + baseDao.updateStatus(formDTO.getId(), formDTO.getStatus(),formDTO.getStaffId()); + } + + 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; + } + + /** + * 新增分类,名称和编码客户内唯一 + * + * @param dto + * @return void + * @author yinzuomei + * @date 2021/9/8 5:12 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public GuideCategoryDTO save(EditGuideCategoryFormDTO dto) { + if (baseDao.selectCategoryName(dto.getCategoryName().trim(), dto.getCustomerId(), null) > 0) { + throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); + } + String categoryCode = Pinyin4jUtil.getFirstSpellPinYin(dto.getCategoryName(), true); + if (baseDao.selectCategoryCode(categoryCode, dto.getCustomerId(), null) > 0) { + throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); + } + GuideCategoryEntity entity = new GuideCategoryEntity(); + entity.setCustomerId(dto.getCustomerId()); + entity.setCategoryName(dto.getCategoryName()); + entity.setCategoryCode(categoryCode); + int currentMax = baseDao.selectCurrentOrder(dto.getCustomerId()); + entity.setSort(currentMax == 0 ? currentMax : currentMax + 1); + entity.setStatus(Constant.ENABLE); + insert(entity); + return ConvertUtils.sourceToTarget(entity,GuideCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public GuideCategoryDTO update(EditGuideCategoryFormDTO dto) { + if (baseDao.selectCategoryName(dto.getCategoryName().trim(), dto.getCustomerId(), dto.getId()) > 0) { + throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); + } + String categoryCode = Pinyin4jUtil.getFirstSpellPinYin(dto.getCategoryName(), true); + if (baseDao.selectCategoryCode(categoryCode, dto.getCustomerId(), dto.getId()) > 0) { + throw new RenException(EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getCode(), EpmetErrorCode.GUIDE_CATEGORY_NAME_EXITS.getMsg()); + } + GuideCategoryEntity origin=baseDao.selectById(dto.getId()); + origin.setCategoryCode(categoryCode); + origin.setCategoryName(dto.getCategoryName()); + updateById(origin); + return ConvertUtils.sourceToTarget(origin,GuideCategoryDTO.class); + } + /** + * 删除分类,存在办事指南的不允许删除,给予提示 + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/9/8 4:34 下午 + */ + @Override + public void delete(EditGuideCategoryFormDTO formDTO) { + // 存在指南的分类不允许删除 + if(baseDao.selectGuideTotal(formDTO.getId(),formDTO.getCustomerId())>0){ + throw new RenException(EpmetErrorCode.HAVE_GUIDE_CANNOT_DEL.getCode(),EpmetErrorCode.HAVE_GUIDE_CANNOT_DEL.getMsg()); + } + baseDao.deleteById(formDTO.getId()); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java new file mode 100644 index 0000000000..ef0696fa12 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java @@ -0,0 +1,157 @@ +/** + * 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.LambdaQueryWrapper; +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideCollectionDao; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.dto.form.GuideFormDTO; +import com.epmet.entity.GuideCollectionEntity; +import com.epmet.service.GuideCollectionService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideCollectionServiceImpl extends BaseServiceImpl implements GuideCollectionService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideCollectionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideCollectionDTO.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 GuideCollectionDTO get(String id) { + GuideCollectionEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideCollectionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideCollectionDTO dto) { + GuideCollectionEntity entity = ConvertUtils.sourceToTarget(dto, GuideCollectionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideCollectionDTO dto) { + GuideCollectionEntity entity = ConvertUtils.sourceToTarget(dto, GuideCollectionEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param tokenDto + * @param formDTO + * @Description 收藏指南 + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/9 9:46 + */ + @Override + public void collection(TokenDto tokenDto, GuideFormDTO formDTO) { + //获取指南收藏信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideCollectionEntity::getGuideId, formDTO.getGuideId()); + wrapper.eq(GuideCollectionEntity::getUserId, tokenDto.getUserId()); + wrapper.eq(GuideCollectionEntity::getApp, tokenDto.getApp()); + wrapper.eq(GuideCollectionEntity::getCustomerId, tokenDto.getCustomerId()); + GuideCollectionEntity entity = baseDao.selectOne(wrapper); + //如果没有收藏记录,则添加收藏,有就删除收藏 + if (null == entity) { + entity = new GuideCollectionEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setUserId(tokenDto.getUserId()); + entity.setGuideId(formDTO.getGuideId()); + entity.setApp(tokenDto.getApp()); + insert(entity); + } else { + deleteById(entity.getId()); + } + } + + /** + * @param tokenDto + * @param guideId + * @Description 获取收藏信息 + * @Param tokenDto + * @Param guideId + * @Return {@link GuideCollectionDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 9:52 + */ + @Override + public GuideCollectionDTO getCollection(TokenDto tokenDto, String guideId) { + //获取指南收藏信息 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideCollectionEntity::getGuideId, guideId); + wrapper.eq(GuideCollectionEntity::getUserId, tokenDto.getUserId()); + wrapper.eq(GuideCollectionEntity::getApp, tokenDto.getApp()); + wrapper.eq(GuideCollectionEntity::getCustomerId, tokenDto.getCustomerId()); + GuideCollectionEntity entity = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(entity, GuideCollectionDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java new file mode 100644 index 0000000000..bd45d0b2a8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java @@ -0,0 +1,145 @@ +/** + * 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.LambdaQueryWrapper; +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideExternalLinkDao; +import com.epmet.dto.ExternalLinkDTO; +import com.epmet.dto.GuideExternalLinkDTO; +import com.epmet.entity.GuideExternalLinkEntity; +import com.epmet.service.GuideExternalLinkService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideExternalLinkServiceImpl extends BaseServiceImpl implements GuideExternalLinkService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideExternalLinkDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideExternalLinkDTO.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 GuideExternalLinkDTO get(String id) { + GuideExternalLinkEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideExternalLinkDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideExternalLinkDTO dto) { + GuideExternalLinkEntity entity = ConvertUtils.sourceToTarget(dto, GuideExternalLinkEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideExternalLinkDTO dto) { + GuideExternalLinkEntity entity = ConvertUtils.sourceToTarget(dto, GuideExternalLinkEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param guideId + * @Description 删除指南外链 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:20 + */ + @Override + public void deleteByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideExternalLinkEntity::getGuideId, guideId); + baseDao.delete(wrapper); + } + + /** + * @param guideId + * @Description 获取指南外链 + * @Param guideId + * @Return {@link List< ExternalLinkDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 11:05 + */ + @Override + public List getByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideExternalLinkEntity::getGuideId, guideId); + wrapper.orderByAsc(GuideExternalLinkEntity::getSort); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + ExternalLinkDTO dto = new ExternalLinkDTO(); + dto.setExternalLink(item.getExternalLink()); + dto.setDescription(item.getDescription()); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java new file mode 100644 index 0000000000..ecc0fff0bb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java @@ -0,0 +1,114 @@ +/** + * 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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDictDefaultDao; +import com.epmet.dto.GuideModuleDictDefaultDTO; +import com.epmet.entity.GuideModuleDictDefaultEntity; +import com.epmet.service.GuideModuleDictDefaultService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleDictDefaultServiceImpl extends BaseServiceImpl implements GuideModuleDictDefaultService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDictDefaultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDictDefaultDTO.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 GuideModuleDictDefaultDTO get(String id) { + GuideModuleDictDefaultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDictDefaultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDictDefaultDTO dto) { + GuideModuleDictDefaultEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictDefaultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDictDefaultDTO dto) { + GuideModuleDictDefaultEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictDefaultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取默认配置 + * + * @Param + * @Return {@link List< GuideModuleDictDefaultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 17:44 + */ + @Override + public List getList() { + QueryWrapper wrapper = new QueryWrapper<>(); + return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), GuideModuleDictDefaultDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java new file mode 100644 index 0000000000..e3fa3ea17b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java @@ -0,0 +1,144 @@ +/** + * 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.LambdaQueryWrapper; +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDictDao; +import com.epmet.dto.GuideModuleDictDTO; +import com.epmet.dto.GuideModuleDictDefaultDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleDictEntity; +import com.epmet.service.GuideModuleDictDefaultService; +import com.epmet.service.GuideModuleDictService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleDictServiceImpl extends BaseServiceImpl implements GuideModuleDictService { + + @Resource + private GuideModuleDictDefaultService guideModuleDictDefaultService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDictDTO.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 GuideModuleDictDTO get(String id) { + GuideModuleDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDictDTO dto) { + GuideModuleDictEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDictDTO dto) { + GuideModuleDictEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param customerId + * @Description 获取模块列表 + * @Param customerId + * @Return {@link List< ModuleDTO >} + * @Author zhaoqifeng + * @Date 2021/9/8 17:50 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public List getModuleList(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideModuleDictEntity::getCustomerId, customerId); + wrapper.orderByAsc(GuideModuleDictEntity::getSort); + List list = baseDao.selectList(wrapper); + //结果为空,初始化默认配置 + if (CollectionUtils.isEmpty(list)) { + List defaultList = guideModuleDictDefaultService.getList(); + List moduleList = ConvertUtils.sourceToTarget(defaultList, GuideModuleDictEntity.class); + moduleList.forEach(item -> { + item.setId(null); + item.setCustomerId(customerId); + }); + insertBatch(moduleList); + list = moduleList; + } + return list.stream().map(item -> { + ModuleDTO dto = new ModuleDTO(); + dto.setModuleId(item.getId()); + dto.setModuleValue(item.getModuleValue()); + dto.setModuleName(item.getModuleName()); + return dto; + }).collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java new file mode 100644 index 0000000000..0ccf158036 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java @@ -0,0 +1,147 @@ +/** + * 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.LambdaQueryWrapper; +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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDao; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.dto.ModuleDTO; +import com.epmet.entity.GuideModuleEntity; +import com.epmet.service.GuideModuleDictService; +import com.epmet.service.GuideModuleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleServiceImpl extends BaseServiceImpl implements GuideModuleService { + + @Resource + private GuideModuleDictService guideModuleDictService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDTO.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 GuideModuleDTO get(String id) { + GuideModuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDTO dto) { + GuideModuleEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDTO dto) { + GuideModuleEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param guideId + * @Description 删除指南的内容模块 + * @Param guideId + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 17:01 + */ + @Override + public void deleteByGuideId(String guideId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(GuideModuleEntity::getGuideId, guideId); + baseDao.delete(wrapper); + } + + /** + * @param guideId + * @Description 获取指南的内容模块 + * @Param guideId + * @Return {@link ModuleDTO} + * @Author zhaoqifeng + * @Date 2021/9/8 10:13 + */ + @Override + public List getByGuideId(String customerId, String guideId) { + return baseDao.selectByGuideId(customerId, guideId); + } + + /** + * @param customerId + * @Description 获取模块列表 + * @Param customerId + * @Return {@link List< ModuleDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 14:46 + */ + @Override + public List getModuleList(String customerId) { + return guideModuleDictService.getModuleList(customerId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java new file mode 100644 index 0000000000..d93f21b2af --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java @@ -0,0 +1,423 @@ +/** + * 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.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.OrgInfoConstant; +import com.epmet.dao.GuideDao; +import com.epmet.dto.GuideDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.GuideDetailResultDTO; +import com.epmet.dto.result.GuideListResultDTO; +import com.epmet.dto.result.OrgResultDTO; +import com.epmet.entity.GuideAttachmentEntity; +import com.epmet.entity.GuideEntity; +import com.epmet.entity.GuideExternalLinkEntity; +import com.epmet.entity.GuideModuleEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.*; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideServiceImpl extends BaseServiceImpl implements GuideService { + + @Resource + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Resource + private GuideModuleService guideModuleService; + @Resource + private GuideAttachmentService guideAttachmentService; + @Resource + private GuideExternalLinkService guideExternalLinkService; + @Resource + private GuideCollectionService guideCollectionService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideDTO.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 GuideDTO get(String id) { + GuideEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideDTO dto) { + GuideEntity entity = ConvertUtils.sourceToTarget(dto, GuideEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideDTO dto) { + GuideEntity entity = ConvertUtils.sourceToTarget(dto, GuideEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 办事指南列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData< GuideListResultDTO >} + * @Author zhaoqifeng + * @Date 2021/9/7 14:00 + */ + @Override + public PageData guideList(TokenDto tokenDto, GuideListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + List list = baseDao.getGuideList(formDTO); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); + if (null == staffInfoCache) { + item.setCategoryName(""); + } else { + item.setCreatedName(staffInfoCache.getRealName()); + } + }); + } + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 添加指南 + * + * @param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void guideAdd(TokenDto tokenDto, GuideAddFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getModuleList()) && CollectionUtils.isEmpty(formDTO.getAttachmentList()) && + CollectionUtils.isEmpty(formDTO.getExternalLinks())) { + throw new RenException(EpmetErrorCode.GUIDE_IS_NULL.getCode()); + } + //保存办事指南表 + GuideEntity guideDTO = new GuideEntity(); + guideDTO.setCustomerId(tokenDto.getCustomerId()); + guideDTO.setOrgId(formDTO.getOrgId()); + guideDTO.setOrgType(formDTO.getOrgType()); + guideDTO.setOrgName(formDTO.getOrgName()); + guideDTO.setCategoryCode(formDTO.getCategoryCode()); + guideDTO.setTitle(formDTO.getTitle()); + OrgFormDTO orgFormDTO = new OrgFormDTO(); + orgFormDTO.setOrgId(formDTO.getOrgId()); + orgFormDTO.setOrgType(formDTO.getOrgType()); + //获取组织的pId和pIds + Result result = govOrgOpenFeignClient.getAgencyInfo(orgFormDTO); + if (!result.success() || null == result.getData()) { + throw new RenException(result.getCode(), result.getMsg()); + } + if (OrgInfoConstant.AGENCY.equals(formDTO.getOrgType())) { + guideDTO.setPid(result.getData().getPid()); + } else { + guideDTO.setPid(result.getData().getAgencyId()); + } + guideDTO.setPids(result.getData().getPids().concat(":").concat(result.getData().getAgencyId())); + insert(guideDTO); + //保存办事指南内容模块 + if (CollectionUtils.isNotEmpty(formDTO.getModuleList())) { + List guideModuleList = formDTO.getModuleList().stream().map(item -> { + GuideModuleEntity entity = new GuideModuleEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setModuleId(item.getModuleId()); + entity.setModuleContent(item.getModuleContent()); + return entity; + }).collect(Collectors.toList()); + guideModuleService.insertBatch(guideModuleList); + } + //保存附件 + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())) { + AtomicInteger i = new AtomicInteger(1); + List attachmentList = formDTO.getAttachmentList().stream().map(item -> { + GuideAttachmentEntity entity = new GuideAttachmentEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setAttachmentName(item.getName()); + entity.setAttachmentFormat(item.getFormat()); + entity.setAttachmentSize(item.getSize()); + entity.setAttachmentType(item.getType()); + entity.setAttachmentUrl(item.getUrl()); + entity.setDuration(item.getDuration()); + entity.setSort(i.getAndIncrement()); + return entity; + }).collect(Collectors.toList()); + guideAttachmentService.insertBatch(attachmentList); + } + //保存外链地址 + if (CollectionUtils.isNotEmpty(formDTO.getExternalLinks())) { + AtomicInteger i = new AtomicInteger(1); + List linkList = formDTO.getExternalLinks().stream().map(item -> { + GuideExternalLinkEntity entity = new GuideExternalLinkEntity(); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setExternalLink(item.getExternalLink()); + entity.setDescription(item.getDescription()); + entity.setSort(i.getAndIncrement()); + return entity; + + }).collect(Collectors.toList()); + guideExternalLinkService.insertBatch(linkList); + } + + } + + /** + * 修改指南 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void guideEdit(GuideEditFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getModuleList()) && CollectionUtils.isEmpty(formDTO.getAttachmentList()) && + CollectionUtils.isEmpty(formDTO.getExternalLinks())) { + throw new RenException(EpmetErrorCode.GUIDE_IS_NULL.getCode()); + } + //保存办事指南表 + GuideDTO guideDTO = get(formDTO.getGuideId()); + if (!formDTO.getStaffId().equals(guideDTO.getCreatedBy())) { + throw new RenException(EpmetErrorCode.GUIDE_IS_NOT_YOURS.getCode()); + } + guideDTO.setOrgId(formDTO.getOrgId()); + guideDTO.setOrgType(formDTO.getOrgType()); + guideDTO.setCategoryCode(formDTO.getCategoryCode()); + guideDTO.setTitle(formDTO.getTitle()); + OrgFormDTO orgFormDTO = new OrgFormDTO(); + orgFormDTO.setOrgId(formDTO.getOrgId()); + orgFormDTO.setOrgType(formDTO.getOrgType()); + guideDTO.setOrgName(formDTO.getOrgName()); + //获取组织的pId和pIds + Result result = govOrgOpenFeignClient.getAgencyInfo(orgFormDTO); + if (!result.success() || null == result.getData()) { + throw new RenException(result.getCode(), result.getMsg()); + } + if (OrgInfoConstant.AGENCY.equals(formDTO.getOrgType())) { + guideDTO.setPid(result.getData().getPid()); + } else { + guideDTO.setPid(result.getData().getAgencyId()); + } + guideDTO.setPids(result.getData().getPids().concat(":").concat(result.getData().getAgencyId())); + update(guideDTO); + //保存办事指南内容模块 + if (CollectionUtils.isNotEmpty(formDTO.getModuleList())) { + List guideModuleList = formDTO.getModuleList().stream().map(item -> { + GuideModuleEntity entity = new GuideModuleEntity(); + entity.setCustomerId(guideDTO.getCustomerId()); + entity.setId(item.getGuideModuleId()); + entity.setGuideId(guideDTO.getId()); + entity.setModuleId(item.getModuleId()); + entity.setModuleContent(item.getModuleContent()); + return entity; + }).collect(Collectors.toList()); + guideModuleService.insertBatch(guideModuleList.stream().filter(item -> null == item.getId()).collect(Collectors.toList())); + guideModuleService.updateBatchById(guideModuleList.stream().filter(item -> null != item.getId()).collect(Collectors.toList())); + } + //保存附件 + guideAttachmentService.deleteByGuideId(formDTO.getGuideId()); + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())) { + AtomicInteger i = new AtomicInteger(1); + List attachmentList = formDTO.getAttachmentList().stream().map(item -> { + GuideAttachmentEntity entity = new GuideAttachmentEntity(); + entity.setCustomerId(guideDTO.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setAttachmentName(item.getName()); + entity.setAttachmentFormat(item.getFormat()); + entity.setAttachmentSize(item.getSize()); + entity.setAttachmentType(item.getType()); + entity.setAttachmentUrl(item.getUrl()); + entity.setDuration(item.getDuration()); + entity.setSort(i.getAndIncrement()); + return entity; + }).collect(Collectors.toList()); + guideAttachmentService.insertBatch(attachmentList); + } + //保存外链地址 + guideExternalLinkService.deleteByGuideId(formDTO.getGuideId()); + if (CollectionUtils.isNotEmpty(formDTO.getExternalLinks())) { + AtomicInteger i = new AtomicInteger(1); + List linkList = formDTO.getExternalLinks().stream().map(item -> { + GuideExternalLinkEntity entity = new GuideExternalLinkEntity(); + entity.setCustomerId(guideDTO.getCustomerId()); + entity.setGuideId(guideDTO.getId()); + entity.setExternalLink(item.getExternalLink()); + entity.setDescription(item.getDescription()); + entity.setSort(i.getAndIncrement()); + return entity; + + }).collect(Collectors.toList()); + guideExternalLinkService.insertBatch(linkList); + } + } + + /** + * 删除指南 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void guideDel(GuideFormDTO formDTO) { + GuideDTO guide = get(formDTO.getGuideId()); + if (!formDTO.getStaffId().equals(guide.getCreatedBy())) { + throw new RenException(EpmetErrorCode.GUIDE_IS_NOT_YOURS.getCode()); + } + //删除主表 + baseDao.deleteById(formDTO.getGuideId()); + //删除内容模块 + guideModuleService.deleteByGuideId(formDTO.getGuideId()); + //删除附件 + guideAttachmentService.deleteByGuideId(formDTO.getGuideId()); + //删除外链 + guideExternalLinkService.deleteByGuideId(formDTO.getGuideId()); + } + + /** + * 指南详情 + * + * @param formDTO + * @Param formDTO + * @Return {@link GuideDetailResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/7 14:12 + */ + @Override + public GuideDetailResultDTO guideDetail(TokenDto tokenDto, GuideFormDTO formDTO) { + //获取指南详情 + GuideDetailResultDTO result = baseDao.getGuideDetail(formDTO.getCustomerId(), formDTO.getGuideId()); + if (null == result) { + result = new GuideDetailResultDTO(); + } + //获取指南内容模块 + result.setModuleList(guideModuleService.getByGuideId(formDTO.getCustomerId(), formDTO.getGuideId())); + //获取指南附件 + result.setAttachmentList(guideAttachmentService.getByGuideId(formDTO.getGuideId())); + //获取指南外链地址 + result.setExternalLinks(guideExternalLinkService.getByGuideId(formDTO.getGuideId())); + //是否收藏 + result.setCollectionFlag(NumConstant.ZERO_STR); + if (null != guideCollectionService.getCollection(tokenDto, formDTO.getGuideId())) { + result.setCollectionFlag(NumConstant.ONE_STR); + } + return result; + } + + /** + * @param tokenDto + * @Description 收藏列表 + * @Param tokenDto + * @Param formDTO + * @Return {@link PageData< GuideListResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/9 10:03 + */ + @Override + public PageData collectionList(TokenDto tokenDto, PageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getCollectionList(tokenDto); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId()); + if (null == staffInfoCache) { + item.setCategoryName(""); + } else { + item.setCreatedName(staffInfoCache.getRealName()); + } + }); + } + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.7__create_guide_table.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.7__create_guide_table.sql new file mode 100644 index 0000000000..af177ee0d7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.7__create_guide_table.sql @@ -0,0 +1,139 @@ +CREATE TABLE `guide` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `ORG_TYPE` varchar(255) DEFAULT NULL COMMENT '机关agency 网格grid 部门dept', + `ORG_ID` varchar(64) NOT NULL COMMENT '发布单位ID', + `ORG_NAME` varchar(128) DEFAULT NULL COMMENT '发布单位名', + `PID` varchar(64) NOT NULL COMMENT '所属组织机构ID(customer_agency.id)', + `PIDS` varchar(1024) NOT NULL COMMENT '所有上级组织ID,英文:隔开', + `TITLE` varchar(128) NOT NULL COMMENT '标题', + `CATEGORY_CODE` varchar(32) NOT NULL COMMENT '分类ID', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='办事指南表 '; + + +CREATE TABLE `guide_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '办事指南ID', + `ATTACHMENT_NAME` varchar(128) DEFAULT NULL COMMENT '附件名', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小 单位byte', + `ATTACHMENT_FORMAT` varchar(32) DEFAULT NULL COMMENT '文件格式 word、excel、pdf', + `ATTACHMENT_TYPE` varchar(32) DEFAULT NULL COMMENT '类型 ', + `ATTACHMENT_URL` varchar(256) DEFAULT NULL COMMENT '附件地址', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` int(1) NOT NULL COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='办事指南附件'; + + +CREATE TABLE `guide_category` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id,产品默认配置此列存储default', + `CATEGORY_NAME` varchar(64) NOT NULL COMMENT '分类名,客户内唯一', + `CATEGORY_CODE` varchar(64) NOT NULL COMMENT '分类编码:分类名的全拼; eg:gongjijin', + `SORT` int(11) NOT NULL COMMENT '排序', + `STATUS` varchar(10) NOT NULL COMMENT '状态 禁用disable 启用enable', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南分类'; + + +CREATE TABLE `guide_collection` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '指南ID', + `USER_ID` varchar(64) NOT NULL COMMENT '用户ID', + `APP` varchar(64) NOT NULL COMMENT '用户所属客户端 居民端resi 工作端gov', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南收藏表'; + + +CREATE TABLE `guide_external_link` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '指南ID', + `DESCRIPTION` varchar(64) NOT NULL COMMENT '链接说明', + `EXTERNAL_LINK` varchar(255) NOT NULL COMMENT '外部链接', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南外链表'; + + +CREATE TABLE `guide_module` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GUIDE_ID` varchar(64) NOT NULL COMMENT '指南ID', + `MODULE_ID` varchar(64) NOT NULL COMMENT '模块ID', + `MODULE_CONTENT` longtext, + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南模块关联表'; + + +CREATE TABLE `guide_module_dict` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `MODULE_VALUE` varchar(64) NOT NULL COMMENT '模块key', + `MODULE_NAME` varchar(64) NOT NULL COMMENT '模块名', + `SORT` int(11) NOT NULL COMMENT '排序', + `STATUS` varchar(10) NOT NULL COMMENT '状态 禁用disable 启用enable', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南模块字典表'; + + +CREATE TABLE `guide_module_dict_default` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `MODULE_VALUE` varchar(64) NOT NULL COMMENT '模块key', + `MODULE_NAME` varchar(64) NOT NULL COMMENT '模块名', + `SORT` int(11) NOT NULL COMMENT '排序', + `STATUS` varchar(10) NOT NULL COMMENT '状态 禁用disable 启用enable', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='指南模块默认字典表'; + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.8__insert_default_guidecategory.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.8__insert_default_guidecategory.sql new file mode 100644 index 0000000000..8a95feaad8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.8__insert_default_guidecategory.sql @@ -0,0 +1,12 @@ +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', '社保', 'shebao', 0, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', '驾驶行驶', 'jiashixingshi', 1, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', '公积金', 'gongjijin', 2, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', '出入境', 'churujing', 3, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', '婚育收养', 'hunyushouyang', 4, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', '户政', 'huzheng', 5, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7', 'default', '教育培训', 'jiaoyupeixun', 6, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('8', 'default', '劳动就业', 'laodongjiuye', 7, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('9', 'default', '办税指南', 'banshuizhinan', 8, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10', 'default', '人才', 'rencai', 9, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('11', 'default', '职业资格', 'zhiyezige', 10, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); +INSERT INTO `epmet_gov_voice`.`guide_category` (`ID`, `CUSTOMER_ID`, `CATEGORY_NAME`, `CATEGORY_CODE`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('12', 'default', '医疗健康', 'yiliaojiankang', 11, 'enable', '0', 0, 'default', '2021-09-08 14:21:09', 'default', '2021-09-08 14:21:19'); \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.9__insert_default_guide_module.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.9__insert_default_guide_module.sql new file mode 100644 index 0000000000..d6a28ecaf4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.9__insert_default_guide_module.sql @@ -0,0 +1,10 @@ +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10001', 'basic_info', '基本信息', 1, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10002', 'handling_info', '办理信息', 2, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10003', 'setting_basis', '设定依据', 3, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10004', 'handling_process', '办理流程', 4, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10005', 'legal_remedy', '法律救济', 5, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10006', 'accept_condition', '受理条件', 6, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10007', 'material_catalog', '材料目录', 7, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10008', 'consultation_method', '咨询方式', 8, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10009', 'complaint_method', '投诉方式', 9, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); +INSERT INTO `epmet_gov_voice`.`guide_module_dict_default` (`ID`, `MODULE_VALUE`, `MODULE_NAME`, `SORT`, `STATUS`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10010', 'charging_info', '收费信息', 10, 'enable', '0', 0, '1', '2021-09-08 17:33:07', '1', '2021-09-08 17:33:15'); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml new file mode 100644 index 0000000000..7c34e2d2f2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml new file mode 100644 index 0000000000..7bd2f78df8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + update guide_category + set SORT=#{orderIndex}, + UPDATED_BY=#{staffId}, + UPDATED_TIME=NOW() + where id=#{id} + and del_flag='0' + + + + + update guide_category + set status=#{status}, + UPDATED_BY=#{staffId}, + UPDATED_TIME=NOW() + where id=#{id} + and del_flag='0' + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml new file mode 100644 index 0000000000..69f598adf7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml new file mode 100644 index 0000000000..a850719121 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml new file mode 100644 index 0000000000..e570f994b4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml new file mode 100644 index 0000000000..3d329b642d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml new file mode 100644 index 0000000000..be18e67c5d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml new file mode 100644 index 0000000000..89cc9ac2e3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index f66c547f6c..3b31e4feac 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -215,6 +215,10 @@ public class CustomerServiceImpl extends BaseServiceImpl getCustomerInfo(CustomerDTO dto) { CustomerEntity entity = baseDao.selectById(dto.getId()); + if (null == entity) { + log.warn(String.format("当前客户id:%s,已删除", dto.getId())); + return new Result(); + } List customerIds=customerRelationService.getAllSubCustomerIds(dto.getId()); CustomerDTO customerDTO=ConvertUtils.sourceToTarget(entity, CustomerDTO.class); if(CollectionUtils.isEmpty(customerIds)){ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java new file mode 100644 index 0000000000..30f06ebaf6 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java @@ -0,0 +1,17 @@ +package com.epmet.resi.group.constant; + +/** + * @Author zxc + * @DateTime 2021/9/3 4:39 下午 + * @DESC + */ +public interface ActConstant { + + /** + * 类型【组织活动次数:orgAct,应参加活动次数:joinAct,活动签到次数:signAct】 + */ + String ORG_ACT = "orgAct"; + String JOIN_ACT = "joinAct"; + String SIGN_ACT = "signAct"; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java new file mode 100644 index 0000000000..5326d3783d --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * 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.resi.group.dto.act; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ActCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 活动Id[group_act_info.id] + */ + private String groupActId; + + /** + * 评论Id + */ + private String actCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 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/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java new file mode 100644 index 0000000000..94ac78be16 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.group.dto.act; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/18 9:37 上午 + * @DESC + */ +@Data +public class LineChartDTO implements Serializable { + + private static final long serialVersionUID = -8479227864670104465L; + + private Integer value; + + private String month; + + public LineChartDTO() { + this.value = NumConstant.ZERO; + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java new file mode 100644 index 0000000000..ad5dca0bba --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java @@ -0,0 +1,44 @@ +package com.epmet.resi.group.dto.act; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/3 3:35 下午 + * @DESC + */ +@Data +public class OrganizationalLifeLineChartDTO implements Serializable { + + private static final long serialVersionUID = -4224453421929580053L; + + /** + * 月份 + */ + private String month; + + /** + * 组织活动次数 + */ + private Integer organizationalActCount; + + /** + * 应参加活动次数 + */ + private Integer shouldJoinActCount; + + /** + * 活动签到次数 + */ + private Integer actSignCount; + + public OrganizationalLifeLineChartDTO() { + this.month = ""; + this.organizationalActCount = NumConstant.ZERO; + this.shouldJoinActCount = NumConstant.ZERO; + this.actSignCount = NumConstant.ZERO; + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java index 92fce732ae..6645dce753 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java @@ -1,11 +1,13 @@ package com.epmet.resi.group.dto.act.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * 005、评论活动 @@ -24,9 +26,13 @@ public class CommentFormDTO implements Serializable { @NotBlank(message = "groupActId不能为空", groups = AddUserInternalGroup.class) private String groupActId; - @NotBlank(message = "评论内容不能为空", groups = AddUserShowGroup.class) - @Length(max = 500, message = "评论内容最多输入500字", groups = AddUserShowGroup.class) + //@NotBlank(message = "评论内容不能为空", groups = AddUserShowGroup.class) + @Length(max = 500, message = "评论内容最多输入500字") private String commentContent; + /** + * 图片附件集合 + */ + private List imageList; /** * 当前用户id diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java new file mode 100644 index 0000000000..3e515c2c75 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.dto.act.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/3 2:52 下午 + * @DESC + */ +@Data +public class OrganizationalLifeFormDTO implements Serializable { + + private static final long serialVersionUID = -8611679719504666547L; + + private String yearId; + + private String userId; + + private String customerId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java index efb8066f28..a6053ffc39 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java @@ -1,10 +1,13 @@ package com.epmet.resi.group.dto.act.result; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * 006、活动评论列表查询 @@ -27,4 +30,11 @@ public class CommentResultDTO implements Serializable { private Date commentTime; private String commentUserId; + + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); + + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java new file mode 100644 index 0000000000..e68cbd02be --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.resi.group.dto.act.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/3 2:35 下午 + * @DESC + */ +@Data +public class OrganizationalLifeResultDTO implements Serializable { + + private static final long serialVersionUID = 6991638491754890967L; + + /** + * 组织活动次数 + */ + private Integer organizationalActCount; + + /** + * 应参加活动次数 + */ + private Integer shouldJoinActCount; + + /** + * 活动签到次数 + */ + private Integer actSignCount; + + /** + * 折线图 + */ + private List lineChart; + + public OrganizationalLifeResultDTO() { + this.organizationalActCount = NumConstant.ZERO; + this.shouldJoinActCount = NumConstant.ZERO; + this.actSignCount = NumConstant.ZERO; + this.lineChart = new ArrayList<>(); + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java index c28985e054..57ae73c471 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java @@ -1,11 +1,14 @@ package com.epmet.resi.group.dto.comment.result; import com.alibaba.fastjson.annotation.JSONField; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * @Description @@ -54,4 +57,9 @@ public class ResiCommentResultDTO implements Serializable { * 评论状态 * */ private String commentStatus; + + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java index 2fc8ba7b9a..96295879f1 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java @@ -1,8 +1,10 @@ package com.epmet.resi.group.dto.group.form; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import lombok.Data; - +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.util.List; /** * @author zhaoqifeng @@ -11,7 +13,77 @@ import java.io.Serializable; */ @Data public class GroupFormDTO implements Serializable { + private static final long serialVersionUID = 5330629771935235995L; + + /** 排除某些指定id之外的组列表 */ + public interface GroupDetailsExcludeGroupIds {} + private String groupId; + private String gridId; + + /** 小组所属范围:grid网格,customer客户 */ + @NotNull(message = "搜索范围类型不能为空", groups = { GroupDetailsExcludeGroupIds.class }) + private SearchScopeTypeEnum searchScopeType; + + @NotNull(message = "搜索范围对象的ID不能为空", groups = { GroupDetailsExcludeGroupIds.class }) + private String searchScopeObjectId; + + private List excludeGroupIds; + + /** 从第几条开始取 */ + private Integer startRow = 0; + + /** 取几条数据 */ + private Integer rowCount = 10; + + @NotNull(message = "排序字段不能为空", groups = { GroupDetailsExcludeGroupIds.class }) + private SortTypeEnum sort; + + @NotNull(message = "排序方式不能为空", groups = { GroupDetailsExcludeGroupIds.class }) + private OrderTypeEnum order; + + /** + * @Description 排序类型 + * @author wxz + * @date 2021.09.07 17:00:24 + */ + public enum SortTypeEnum { + + CREATE_TIME("create_time"); + + private String sortField; + + SortTypeEnum(String sortField) { + this.sortField = sortField; + } + + public String getSortField() { + return sortField; + } + } + + /** + * @Description 排序方式 + * @author wxz + * @date 2021.09.07 17:02:05 + */ + public enum OrderTypeEnum { + + ASC("asc"), + DESC("desc"); + + private String orderType; + + OrderTypeEnum(String orderType) { + this.orderType = orderType; + } + + public String getOrderType() { + return orderType; + } + } + + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupsByMemberFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupsByMemberFormDTO.java new file mode 100644 index 0000000000..806b07629e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupsByMemberFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.resi.group.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @Description 根据成员查询组列表form + * @author wxz + * @date 2021.09.08 14:12:44 +*/ +@Data +public class GroupsByMemberFormDTO { + private String gridId; + @NotNull(message = "成员用户ID不能为空") + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java index d31e01cab8..3ddbd344d2 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java @@ -47,4 +47,8 @@ public class AllGroupListResultDTO implements Serializable { */ private String groupType; + /** + * 群介绍 + */ + private String groupIntroduction = ""; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java new file mode 100644 index 0000000000..dfec88238a --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java @@ -0,0 +1,28 @@ +package com.epmet.resi.group.dto.group.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 话题、通知、活动评论附件 + */ +@NoArgsConstructor +@Data +public class CommentFileDTO implements Serializable { + + private static final long serialVersionUID = -3930520724652521552L; + private String name; + private String url; + private String type; + private String format; + private Integer size; + private Integer duration; + @JsonIgnore + private String commentId; + @JsonIgnore + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java index c7767054d4..7d08176f31 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java @@ -9,7 +9,9 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class GroupDetailResultDTO { + private String gridId; private String groupHeadPhoto; + private String groupId; private String groupName; private String groupIntroduction; private Integer editNumLimit; @@ -17,5 +19,11 @@ public class GroupDetailResultDTO { private String auditStatus; private Boolean editable; private String remark; - + /** 群组类型:branch:支部小组,ordinary:楼院小组 */ + private String groupType; + private String customerId; + /** 组长ID */ + private String leaderId; + /** 当前用户是否是群主 */ + private String groupLeaderFlag; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java index dbf681b90d..28755fffe8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java @@ -69,6 +69,14 @@ public class GroupSummarizeResultDTO implements Serializable { * 进组审核open开启;close关闭 */ private String auditSwitch; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + /** + * 小组类型名称 + */ + private String groupTypeName; private String level; public GroupSummarizeResultDTO(){ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RankingResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RankingResultDTO.java new file mode 100644 index 0000000000..99357eb400 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RankingResultDTO.java @@ -0,0 +1,11 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +@Data +public class RankingResultDTO { + + private Integer gridRanking; + private Integer customerRanking; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java index 72de523d2a..ff080a5864 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java @@ -48,4 +48,9 @@ public class RecommendGroupResultDTO implements Serializable { */ private String groupType; + /** + * 群介绍 + */ + private String groupIntroduction = ""; + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java index 47fbf7d9be..4e9834470a 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java @@ -37,4 +37,9 @@ public class RecommendedListResultDTO implements Serializable { * 组长名 */ private String leaderName; + + /** + * 群介绍 + */ + private String groupIntroduction = ""; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java new file mode 100644 index 0000000000..6e7c7e336f --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * 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.resi.group.dto.notice; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class NoticeCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 通知Id + */ + private String noticeId; + + /** + * 评论Id + */ + private String noticeCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 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/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java index c543bf7222..4269e86262 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; +import java.util.List; /** * @Author sun @@ -21,8 +22,8 @@ public class NoticeCommentFormDTO { /** * 评论内容300 */ - @NotBlank(message = "评论内容不能为空",groups = {NoticeCommentFormDTO.UserShow.class}) - @Length(max = 20, message = "评论内容不能超过300个字符",groups = {NoticeCommentFormDTO.UserShow.class}) + //@NotBlank(message = "评论内容不能为空",groups = {NoticeCommentFormDTO.UserShow.class}) + @Length(max = 300, message = "评论内容不能超过300个字符") private String commentContent; /** @@ -30,6 +31,11 @@ public class NoticeCommentFormDTO { */ private String userId; + /** + * 图片附件集合 + */ + private List imageList; + public interface Comment{} public interface UserShow extends CustomerClientShowGroup {} } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java index 726289e144..45a9c9f694 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java @@ -1,11 +1,13 @@ package com.epmet.resi.group.dto.notice.result; -import com.alibaba.fastjson.annotation.JSONField; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * @Author sun @@ -42,4 +44,9 @@ public class NoticeCommentListResultDTO implements Serializable { * */ private String userId; + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java new file mode 100644 index 0000000000..acd1c4e381 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * 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.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ResiTopicCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 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/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java index 894364fe16..179c53c500 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java @@ -1,9 +1,11 @@ package com.epmet.resi.group.dto.topic.form; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * @Description @@ -19,6 +21,11 @@ public class ResiPublishCommentFormDTO implements Serializable { @NotBlank(message = "话题Id不能为空") private String topicId; - @NotBlank(message = "评论内容不能为空") + //@NotBlank(message = "评论内容不能为空") private String commentContent; + + /** + * 图片附件集合 + */ + private List imageList; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java new file mode 100644 index 0000000000..474a2662a1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.enums; + +/** + * @Description 搜索范围类型枚举 + * @author wxz + * @date 2021.09.07 20:14:21 + */ +public enum SearchScopeTypeEnum { + + CUSTOMER("customer"), + GRID("grid"); + + private String scopeType; + + SearchScopeTypeEnum(String scopeType) { + this.scopeType = scopeType; + } + + public String getScopeType() { + return scopeType; + } +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 16e1d8b0c8..1762b35d97 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -289,4 +289,36 @@ public interface ResiGroupOpenFeignClient { @PostMapping("resi/group/topic/gettopicinfos") Result> getTopicInfos(@RequestBody List issueIds); + /** + * @description 根据组id列表批量查询组信息列表 + * + * @param groupIds + * @return + * @author wxz + * @date 2021.09.07 15:33:58 + */ + @PostMapping("/resi/group/group/list-groupinfos-by-groupids") + Result> listGroupDetailsByGroupIds(@RequestBody List groupIds); + + /** + * @description 排除指定的组id之后,按照指定顺序取指定个数的组信息 + * + * @param form + * @return + * @author wxz + * @date 2021.09.07 17:15:55 + */ + @PostMapping("/resi/group/group/list-groupinfos-exclude-groupids") + Result> listGroupDetailsExcludeGroupIds(@RequestBody GroupFormDTO form); + + /** + * @description 根据组成员查询所在的小组列表。可选条件包括:grid + * + * @param formDTO + * @return + * @author wxz + * @date 2021.09.08 13:51:05 + */ + @PostMapping("/resi/group/group/list-groups-by-member") + Result> listGroupsByMember(@RequestBody GroupsByMemberFormDTO formDTO); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 94f03f3d41..8c2f5303ee 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -220,4 +220,19 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien public Result> getTopicInfos(List issueIds) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getTopicInfos", issueIds); } + + @Override + public Result> listGroupDetailsByGroupIds(List groupIds) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listGroupDetailsByGroupIds", groupIds); + } + + @Override + public Result> listGroupDetailsExcludeGroupIds(GroupFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listGroupDetailsExcludeGroupIds", form); + } + + @Override + public Result> listGroupsByMember(GroupsByMemberFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listGroupsByMember", formDTO); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java new file mode 100644 index 0000000000..e84a321e4b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java @@ -0,0 +1,85 @@ +/** + * 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.modules.act.controller; + +import com.epmet.commons.tools.page.PageData; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.act.service.ActCommentAttachmentService; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("actcommentattachment") +public class ActCommentAttachmentController { + + @Autowired + private ActCommentAttachmentService actCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActCommentAttachmentDTO data = actCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java index 4a1a973022..34fc73ec23 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java @@ -27,6 +27,7 @@ import com.epmet.resi.group.dto.act.GroupActIdDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -153,4 +154,16 @@ public class GroupActInfoController { return new Result(); } + /** + * @Description 组织生活 + * @Param formDTO + * @author zxc + * @date 2021/9/3 2:57 下午 + */ + @PostMapping("organizationallife") + public Result organizationalLife(@LoginUser TokenDto tokenDto, @RequestBody OrganizationalLifeFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(groupActInfoService.organizationalLife(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java new file mode 100644 index 0000000000..07f076a6f5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * 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.modules.act.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface ActCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectActComFile(@Param("groupActId") String groupActId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java index 85f243e608..db9e155e6a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java @@ -19,7 +19,14 @@ package com.epmet.modules.act.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.act.entity.GroupActInfoEntity; +import com.epmet.resi.group.dto.act.LineChartDTO; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; +import com.epmet.resi.group.dto.act.form.OrganizationalLifeFormDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 组织活动信息 @@ -29,5 +36,63 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface GroupActInfoDao extends BaseDao { - + + /** + * @Description 根据人查询支部小组,小组审核状态为 approved 的,小组类型为 branch 的,GROUP_LEADER_FLAG 为 leader 的,人员状态为 approved 的 + * @Param userId + * @Param leaderFlag 是否是组长标志 + * @author zxc + * @date 2021/9/3 3:48 下午 + */ + List selectBranchGroupByUserId(@Param("userId")String userId,@Param("leaderFlag")Boolean leaderFlag); + + /** + * @Description 按照yearId查询组织生活,组织活动次数、应参加活动次数、活动签到次数 + * @Param formDTO + * @Param groupIds + * @Param leaderFlag 是否是组长标志 + * @author zxc + * @date 2021/9/3 4:12 下午 + */ + OrganizationalLifeResultDTO selectOrgLife(@Param("userId")String userId, @Param("groupIds")List groupIds, + @Param("leaderFlag")Boolean leaderFlag,@Param("yearId")String yearId); + + /** + * @Description 组织生活折线图 + * @Param leaderGroupIds + * @Param memberGroupIds + * @Param yearId + * @author zxc + * @date 2021/9/6 10:24 上午 + */ + List selectLineChart(@Param("groupIds") List groupId,@Param("leaderFlag")Boolean leaderFlag, + @Param("yearId")String yearId); + + /** + * @Description 查询我创建的活动 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:23 上午 + */ + List selectMyCreateActTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + + /** + * @Description 查询应参与的活动 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:25 上午 + */ + List selectShouldJoinActTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + + /** + * @Description 查询活动签到次数 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:27 上午 + */ + List selectSignInTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java new file mode 100644 index 0000000000..1e290165ee --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * 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.modules.act.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_comment_attachment") +public class ActCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 活动Id[group_act_info.id] + */ + private String groupActId; + + /** + * 评论Id + */ + private String actCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java new file mode 100644 index 0000000000..c1faff4a04 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java @@ -0,0 +1,103 @@ +/** + * 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.modules.act.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; + +import java.util.List; +import java.util.Map; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface ActCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + ActCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(ActCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(ActCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询活动评论所有人员的附件信息 + **/ + List getActComFile(String groupActId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java index b815bb7358..9ed4a2b015 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java @@ -24,6 +24,7 @@ import com.epmet.resi.group.dto.act.GroupActInfoDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO; /** @@ -89,4 +90,13 @@ public interface GroupActInfoService extends BaseService { * @return */ void closeAct(CloseGroupActFormDTO formDTO); + + /** + * @Description 组织生活 + * @Param formDTO + * @author zxc + * @date 2021/9/3 2:57 下午 + */ + OrganizationalLifeResultDTO organizationalLife(OrganizationalLifeFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..916cf5bdda --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * 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.modules.act.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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.act.dao.ActCommentAttachmentDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.modules.act.service.ActCommentAttachmentService; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class ActCommentAttachmentServiceImpl extends BaseServiceImpl implements ActCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActCommentAttachmentDTO.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 ActCommentAttachmentDTO get(String id) { + ActCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActCommentAttachmentDTO dto) { + ActCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ActCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActCommentAttachmentDTO dto) { + ActCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ActCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getActComFile(String groupActId) { + return baseDao.selectActComFile(groupActId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java index c249c4ec28..562d1f1cd7 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.modules.act.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -28,23 +29,32 @@ import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.act.dao.ActCommentDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; import com.epmet.modules.act.entity.ActCommentEntity; +import com.epmet.modules.act.service.ActCommentAttachmentService; import com.epmet.modules.act.service.ActCommentService; import com.epmet.modules.act.service.GroupActInfoService; import com.epmet.modules.constant.GroupActConstant; +import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.resi.group.dto.act.GroupActInfoDTO; import com.epmet.resi.group.dto.act.form.CommentFormDTO; import com.epmet.resi.group.dto.act.form.CommentQueryFormDTO; import com.epmet.resi.group.dto.act.result.CommentResultDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -65,6 +75,10 @@ public class ActCommentServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()) { - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + if(StringUtils.isNotBlank(formDTO.getCommentContent())){ + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(formDTO.getCommentContent()); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); + } } } + //图片安全校验 + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getImageList())){ + List imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + noticeCommentService.safetyCheck(new ArrayList<>(), imageList); + } + //3、插入记录 ActCommentEntity actCommentEntity = new ActCommentEntity(); actCommentEntity.setCustomerId(formDTO.getCustomerId()); @@ -103,6 +129,33 @@ public class ActCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + formDTO.getImageList().forEach(img -> { + ActCommentAttachmentEntity attachment = new ActCommentAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setGroupActId(formDTO.getGroupActId()); + attachment.setActCommentId(actCommentEntity.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + actCommentAttachmentService.insertBatch(AttachmentEntityList); + } + } /** @@ -124,8 +177,12 @@ public class ActCommentServiceImpl extends BaseServiceImpl fileList = actCommentAttachmentService.getActComFile(formDTO.getGroupActId()); + if (!CollectionUtils.isEmpty(result.getData())) { - //3.遍历封装数据并返回 + //4.遍历封装数据并返回 list.forEach(l -> { result.getData().forEach(user -> { if (l.getCommentUserId().equals(user.getUserId())) { @@ -133,6 +190,14 @@ public class ActCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getCommentId().equals(f.getCommentId()) && l.getCommentUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); }); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java index 48334bac4e..f44543bac0 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; @@ -58,9 +59,12 @@ import com.epmet.modules.invitation.service.InvitationRecordService; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.resi.group.dto.act.GroupActIdDTO; import com.epmet.resi.group.dto.act.GroupActInfoDTO; +import com.epmet.resi.group.dto.act.LineChartDTO; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.group.GroupMessageDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.invitation.InvitationRecordDTO; @@ -75,6 +79,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -262,9 +267,17 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl leaderGroupIds = baseDao.selectBranchGroupByUserId(formDTO.getUserId(),true); + List chartResult = new ArrayList<>(); + if (!CollectionUtils.isEmpty(leaderGroupIds)){ + // 按照yearId查询组织生活【我创建的活动】,组织活动次数、应参加活动次数、活动签到次数 + OrganizationalLifeResultDTO dto = baseDao.selectOrgLife(formDTO.getUserId(), leaderGroupIds,true,formDTO.getYearId()); + result.setOrganizationalActCount(dto.getOrganizationalActCount()); + result.setActSignCount(dto.getActSignCount()); + // 当此人是组长,创建了几个活动就应参加几个活动 + result.setShouldJoinActCount(dto.getOrganizationalActCount()); + List chartDTOS = baseDao.selectLineChart(leaderGroupIds, true, formDTO.getYearId()); + if (!CollectionUtils.isEmpty(chartDTOS)){ + chartResult.addAll(chartDTOS); + } + } + // 查询此人不是组长,客户下所有支部小组 + List memberGroupIds = baseDao.selectBranchGroupByUserId(formDTO.getUserId(),false); + if (!CollectionUtils.isEmpty(memberGroupIds)){ + // 按照yearId查询组织生活【我所在支部组的活动】,组织活动次数、应参加活动次数、活动签到次数 + OrganizationalLifeResultDTO dto = baseDao.selectOrgLife(formDTO.getUserId(), memberGroupIds,false, formDTO.getYearId()); + result.setActSignCount(result.getActSignCount() + dto.getActSignCount()); + // 当此人不是组长,支部小组下有几个活动,应参加活动就是几 + result.setShouldJoinActCount(result.getShouldJoinActCount() + dto.getOrganizationalActCount()); + // 此人不是组长,我组织的活动这就不加了 + + List chartDTOS = baseDao.selectLineChart(memberGroupIds, false, formDTO.getYearId()); + if (!CollectionUtils.isEmpty(chartDTOS)){ + chartResult.addAll(chartDTOS); + } + } + // 折线图组装 + List lineChart = lineChart(formDTO.getYearId()); + if (!CollectionUtils.isEmpty(chartResult)){ + Map> groupByMonth = chartResult.stream().collect(Collectors.groupingBy(OrganizationalLifeLineChartDTO::getMonth)); + groupByMonth.forEach((month,list) -> { + lineChart.forEach(l -> { + if (month.equals(l.getMonth())){ + l.setOrganizationalActCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getOrganizationalActCount))); + l.setShouldJoinActCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getShouldJoinActCount))); + l.setActSignCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getActSignCount))); + } + }); + }); + } + result.setLineChart(lineChart); + return result; + }*/ + + @Override + public OrganizationalLifeResultDTO organizationalLife(OrganizationalLifeFormDTO formDTO) { + OrganizationalLifeResultDTO result = new OrganizationalLifeResultDTO(); + if (StringUtils.isBlank(formDTO.getYearId())) { + formDTO.setYearId(String.valueOf(LocalDate.now().getYear())); + } + List myActs = baseDao.selectMyCreateActTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + List joinActs = baseDao.selectShouldJoinActTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + List signInActs = baseDao.selectSignInTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + // 折线图组装 + List lineChart = lineChart(formDTO.getYearId()); + lineChart.forEach(l ->{ + if (!CollectionUtils.isEmpty(myActs)){ + myActs.forEach(m -> { + if (l.getMonth().equals(m.getMonth())){ + l.setOrganizationalActCount(m.getValue()); + } + }); + } + if (!CollectionUtils.isEmpty(joinActs)){ + joinActs.forEach(j -> { + if (l.getMonth().equals(j.getMonth())){ + l.setShouldJoinActCount(j.getValue()); + } + }); + } + if (!CollectionUtils.isEmpty(signInActs)){ + signInActs.forEach(s -> { + if (l.getMonth().equals(s.getMonth())){ + l.setActSignCount(s.getValue()); + } + }); + } + }); + result.setOrganizationalActCount(CollectionUtils.isEmpty(myActs) ? NumConstant.ZERO : myActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setShouldJoinActCount(CollectionUtils.isEmpty(joinActs) ? NumConstant.ZERO : joinActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setActSignCount(CollectionUtils.isEmpty(signInActs) ? NumConstant.ZERO : signInActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setLineChart(lineChart); + return result; + } + + /** + * @Description 折线图构造 + * 应前端要求,日期格式由 01月,02月 改为 2021-01,2021-02 + * @author zxc + * @date 2021/9/6 10:55 上午 + */ + public List lineChart(String yearId){ + String year = yearId.substring(NumConstant.ZERO,NumConstant.FOUR); + List lineChart = new ArrayList<>(); + for (int i = NumConstant.ONE; i <= NumConstant.TWELVE; i++) { + OrganizationalLifeLineChartDTO dto = new OrganizationalLifeLineChartDTO(); + if (i < NumConstant.TEN){ + dto.setMonth(year +"-"+NumConstant.ZERO + String.valueOf(i)); + }else { + dto.setMonth(year +"-"+ String.valueOf(i)); + } + lineChart.add(dto); + } + return lineChart; + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java index 86cb1a6ff2..831109fc67 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java @@ -29,6 +29,7 @@ public interface UserMessageConstant { */ String INVITED_JOIN_GROUP = "您的好友-【%s】通过邀请连接,加入了【%s】"; String SCANCODE_JOIN_GROUP = "您的好友-【%s】通过扫描二维码,加入了【%s】"; + String SHARABLELINK_JOIN_GROUP = "您的好友-【%s】通过分享链接,加入了【%s】"; /** * 组成员被禁言时会收到消息:您已被禁言,禁言时间2020.03.20 12:20-2020.03.27 12:20 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index 5fa0d56be9..e90adf8c14 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -33,6 +33,7 @@ import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; import com.epmet.resi.group.dto.member.form.ResiIdentityFormDTO; import com.epmet.resi.group.dto.member.result.AchievementResultDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.PostMapping; @@ -599,4 +600,58 @@ public class ResiGroupController { public Result initAchievement(@RequestParam String customerId) { return new Result().ok(statsAchievementService.initAllGroupAchievement(customerId)); } + + /** + * @description 根据组id列表批量查询组信息列表 + * + * @param groupIds + * @return + * @author wxz + * @date 2021.09.07 15:33:58 + */ + @PostMapping("list-groupinfos-by-groupids") + public Result> listGroupDetailsByGroupIds(@RequestBody List groupIds) { + List groupDetails = resiGroupService.listGroupsByGroupIds(groupIds); + return new Result>().ok(groupDetails); + } + + /** + * @description 排除指定的组id之后,按照指定顺序取指定个数的组信息 + * + * @param form + * @return + * @author wxz + * @date 2021.09.07 17:15:55 + */ + @PostMapping("list-groupinfos-exclude-groupids") + public Result> listGroupDetailsExcludeGroupIds(@RequestBody GroupFormDTO form) { + ValidatorUtils.validateEntity(form, GroupFormDTO.GroupDetailsExcludeGroupIds.class); + Integer startRow = form.getStartRow(); + Integer rowCount = form.getRowCount(); + List excludeGroupIds = form.getExcludeGroupIds(); + GroupFormDTO.SortTypeEnum sort = form.getSort(); + GroupFormDTO.OrderTypeEnum order = form.getOrder(); + SearchScopeTypeEnum searchScopeType = form.getSearchScopeType(); + String searchScopeObjectId = form.getSearchScopeObjectId(); + + List groups = resiGroupService.listGroupDetailsExcludeGroupIds(excludeGroupIds, startRow, rowCount, searchScopeType.getScopeType(), searchScopeObjectId, sort.getSortField(), order.getOrderType()); + return new Result>().ok(groups); + } + + /** + * @description 根据组成员查询所在的小组列表。可选条件包括:grid + * + * @param formDTO + * @return + * @author wxz + * @date 2021.09.08 13:51:05 + */ + @PostMapping("list-groups-by-member") + public Result> listGroupsByMember(@RequestBody GroupsByMemberFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + String gridId = formDTO.getGridId(); + String userId = formDTO.getUserId(); + List groups = resiGroupService.listGroupsByMember(userId, gridId); + return new Result>().ok(groups); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index 44f8312d9c..3a0b47c336 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -335,4 +335,15 @@ public interface ResiGroupDao extends BaseDao { * @return java.util.List */ List selectRecentGroupAchievements(@Param("userId") String userId, @Param("gridId") String gridId); + + /** + * @description 根据组成员查询所在组列表。如有需要,可以增加其他if条件,或者增加排序参数 + * + * @param memberUserId + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 14:00:52 + */ + List listGroupsByMember(@Param("memberUserId") String memberUserId, @Param("gridId") String gridId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index d7761738d8..122083cceb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -435,4 +435,41 @@ public interface ResiGroupService extends BaseService { * @return com.epmet.resi.group.dto.group.ResiGroupDTO */ ResiGroupDTO getGroupInfoAndGroupMember(String groupId); + + /** + * @description 根据id列表查询组信息 + * + * @param groupIds + * @return + * @author wxz + * @date 2021.09.07 15:27:35 + */ + List listGroupsByGroupIds(List groupIds); + + /** + * @description 排除指定的组id之后,按照指定顺序取指定个数的组信息 + * + * @param excludeGroupIds 排序的组id列表 + * @param startRow + * @param rowCount + * @param searchScopeObjectId 小组所属的范围对象id,如果是网格,那就是网格id,如果是客户那就是客户id + * @param searchScopeType 小组所属的范围,grid网格,customer客户 + * @param sortType 排序字段 + * @param orderType 排序类型 + * @return + * @author wxz + * @date 2021.09.07 17:17:09 + */ + List listGroupDetailsExcludeGroupIds(List excludeGroupIds, Integer startRow, Integer rowCount, String searchScopeType,String searchScopeObjectId, String sortType, String orderType); + + /** + * @description 根据成员查询组列表 + * + * @param memberUserId + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 13:59:31 + */ + List listGroupsByMember(String memberUserId, String gridId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 122fafce0d..ee2f844d04 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -18,11 +18,14 @@ package com.epmet.modules.group.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; import com.epmet.commons.tools.constant.*; +import com.epmet.commons.tools.enums.AchievementTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -38,6 +41,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.form.*; import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; @@ -45,7 +49,6 @@ import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.constant.UserMessageConstant; -import com.epmet.commons.tools.enums.AchievementTypeEnum; import com.epmet.modules.feign.EpmetMessageFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; @@ -79,6 +82,7 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; import com.epmet.resi.group.dto.member.result.AchievementResultDTO; import com.epmet.resi.group.dto.member.result.GroupAchievementDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import com.epmet.send.SendMqMsgUtil; import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; @@ -521,7 +525,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl listGroupsByGroupIds(List groupIds) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.in(ResiGroupEntity::getId, groupIds); + query.orderByDesc(ResiGroupEntity::getCreatedTime); + query.eq(ResiGroupEntity::getDelFlag, 0); + List groupEntities = baseDao.selectList(query); + List groupDtos = groupEntities.stream().map(ge -> { + ResiGroupMemberDTO leader = resiGroupMemberDao.selectLeaderMember(ge.getId()); + + GroupDetailResultDTO dto = new GroupDetailResultDTO(); + dto.setGroupId(ge.getId()); + dto.setGroupName(ge.getGroupName()); + dto.setGroupHeadPhoto(ge.getGroupHeadPhoto()); + dto.setGroupIntroduction(ge.getGroupIntroduction()); + dto.setGroupType(ge.getGroupType()); + dto.setLeaderId(leader.getCustomerUserId()); + return dto; + }).collect(Collectors.toList()); + return groupDtos; + } + + @Override + public List listGroupDetailsExcludeGroupIds(List excludeGroupIds, Integer startRow, Integer rowCount, String searchScopeType, String searchScopeObjectId, String sortType, String orderType) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + if (CollectionUtils.isNotEmpty(excludeGroupIds)) { + query.notIn(ResiGroupEntity::getId, excludeGroupIds); + } + query.last(String.format("limit %s, %s", startRow, rowCount)); + + // 只显示审核通过且可用的小组 + query.eq(ResiGroupEntity::getState, "approved"); + + SFunction sortFieldFun = null; + if (GroupFormDTO.SortTypeEnum.CREATE_TIME.getSortField().equals(sortType)) { + sortFieldFun = ResiGroupEntity::getCreatedTime; + } + + if (SearchScopeTypeEnum.GRID.getScopeType().equals(searchScopeType)) { + query.eq(ResiGroupEntity::getGridId, searchScopeObjectId); + } else if (SearchScopeTypeEnum.CUSTOMER.getScopeType().equals(searchScopeType)) { + query.eq(ResiGroupEntity::getCustomerId, searchScopeObjectId); + } + + if (GroupFormDTO.OrderTypeEnum.ASC.getOrderType().equals(orderType)) { + query.orderByAsc(sortFieldFun); + } else { + query.orderByDesc(sortFieldFun); + } + List groupList = baseDao.selectList(query); + return groupList.stream().map(ge -> { + // 查询组长id + ResiGroupMemberDTO leader = resiGroupMemberDao.selectLeaderMember(ge.getId()); + + GroupDetailResultDTO dto = new GroupDetailResultDTO(); + dto.setGroupId(ge.getId()); + dto.setGroupName(ge.getGroupName()); + dto.setGroupHeadPhoto(ge.getGroupHeadPhoto()); + dto.setGroupIntroduction(ge.getGroupIntroduction()); + dto.setGroupType(ge.getGroupType()); + dto.setGridId(ge.getGridId()); + dto.setLeaderId(leader.getCustomerUserId()); + return dto; + }).collect(Collectors.toList()); + } + + @Override + public List listGroupsByMember(String memberUserId, String gridId) { + return baseDao.listGroupsByMember(memberUserId, gridId); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java index 4c8897c5f1..8577aa2bd9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java @@ -21,7 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.invitation.entity.GroupInvitationEntity; -import com.epmet.resi.group.dto.UserRoleDTO; +import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.invitation.GroupInvitationDTO; import com.epmet.resi.group.dto.invitation.form.AccetInvitationFormDTO; import com.epmet.resi.group.dto.invitation.form.CreateGroupInvitationFormDTO; @@ -143,4 +143,11 @@ public interface GroupInvitationService extends BaseService page(Map params) { @@ -434,7 +434,11 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl + * 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.modules.notice.controller; + +import com.epmet.commons.tools.page.PageData; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("noticecommentattachment") +public class NoticeCommentAttachmentController { + + @Autowired + private NoticeCommentAttachmentService noticeCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = noticeCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + NoticeCommentAttachmentDTO data = noticeCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody NoticeCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + noticeCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody NoticeCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + noticeCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + noticeCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java new file mode 100644 index 0000000000..2ad57a60cd --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * 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.modules.notice.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface NoticeCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectNoticeComFile(@Param("noticeId") String noticeId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java new file mode 100644 index 0000000000..7ab97e6634 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * 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.modules.notice.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("notice_comment_attachment") +public class NoticeCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 通知Id + */ + private String noticeId; + + /** + * 评论Id + */ + private String noticeCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java new file mode 100644 index 0000000000..5baa7d553d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java @@ -0,0 +1,103 @@ +/** + * 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.modules.notice.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; + +import java.util.List; +import java.util.Map; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface NoticeCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return NoticeCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + NoticeCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(NoticeCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(NoticeCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List getNoticeComFile(String noticeId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java index 0ac50c21e7..6684e61d80 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java @@ -48,4 +48,11 @@ public interface NoticeCommentService extends BaseService { * @Description 通知评论列表查询 **/ List noticeCommentList(NoticeCommentListFormDTO formDTO); + + /** + * @Author sun + * @Description 文字、图片安全校验 + **/ + void safetyCheck(List wordList, List imageList); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..10c3710894 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * 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.modules.notice.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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.notice.dao.NoticeCommentAttachmentDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class NoticeCommentAttachmentServiceImpl extends BaseServiceImpl implements NoticeCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, NoticeCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, NoticeCommentAttachmentDTO.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 NoticeCommentAttachmentDTO get(String id) { + NoticeCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, NoticeCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(NoticeCommentAttachmentDTO dto) { + NoticeCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(NoticeCommentAttachmentDTO dto) { + NoticeCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getNoticeComFile(String noticeId) { + return baseDao.selectNoticeComFile(noticeId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java index 2ab3994891..cc56eb670d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java @@ -17,10 +17,13 @@ package com.epmet.modules.notice.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; @@ -30,18 +33,23 @@ import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.notice.dao.NoticeCommentDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; import com.epmet.modules.notice.entity.NoticeCommentEntity; import com.epmet.modules.notice.redis.NoticeCommentRedis; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.modules.notice.service.NoticeService; import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.notice.NoticeDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -53,6 +61,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -70,12 +79,16 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + safetyCheck(new ArrayList<>(), imageList); + } //2.判断当前用户是否被禁言、移除、非本组成员 NoticeDTO notice = noticeService.get(formDTO.getNoticeId()); @@ -139,6 +160,33 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (CollectionUtils.isNotEmpty(formDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + formDTO.getImageList().forEach(img -> { + NoticeCommentAttachmentEntity attachment = new NoticeCommentAttachmentEntity(); + attachment.setCustomerId(notice.getCustomerId()); + attachment.setNoticeId(formDTO.getNoticeId()); + attachment.setNoticeCommentId(entity.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + noticeCommentAttachmentService.insertBatch(AttachmentEntityList); + } + } /** @@ -165,7 +213,10 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl resultDTOList = result.getData(); - //3.封装数据并返回 + //3.查询通知评论所有人员的附件信息 + List fileList = noticeCommentAttachmentService.getNoticeComFile(formDTO.getNoticeId()); + + //4.封装数据并返回 resultList.forEach(l -> { StringBuffer name = new StringBuffer(); resultDTOList.forEach(user -> { @@ -175,9 +226,64 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getNoticeCommentId().equals(f.getCommentId()) && l.getUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); }); return resultList; } + /** + * @Author sun + * @Description 文字、图片安全校验 + **/ + public void safetyCheck(List wordList, List imageList) { + if (imageList.size() != NumConstant.ZERO) { + wordList.forEach(word -> { + //创建话题内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(word); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("safetyCheck textScan return failed,result:"+ JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.warn(EpmetErrorCode.TEXT_SCAN_FAILED.getMsg().concat(String.format(TopicConstant.CREATE_TOPIC, word))); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + }); + } + //创建话题图片审核 + if (imageList.size() != NumConstant.ZERO) { + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imageList.forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(url); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()) { + logger.error("safetyCheck imgScan return failed,result:"+ JSON.toJSONString(imgScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (!imgScanResult.getData().isAllPass()) { + logger.warn(EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + + } + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java index b21c69a4ae..afe0ce523d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java @@ -33,6 +33,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; @@ -58,7 +59,10 @@ import com.epmet.modules.notice.service.NoticeService; import com.epmet.resi.group.constant.TopicConstant; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.notice.NoticeDTO; -import com.epmet.resi.group.dto.notice.form.*; +import com.epmet.resi.group.dto.notice.form.AddNoticeFormDTO; +import com.epmet.resi.group.dto.notice.form.EditNoticeFormDTO; +import com.epmet.resi.group.dto.notice.form.NoticeDetailFormDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.epmet.resi.group.dto.notice.result.NoticeDetailResultDTO; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.logging.Log; @@ -272,6 +276,10 @@ public class NoticeServiceImpl extends BaseServiceImpl userMessageFormDTO.setTitle(UserMessageConstant.GROUP_TITLE); userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.GROUP_NOTICE_ADD, groupEntity.getGroupName(), formDTO.getTitle())); + + //21.09.10:记录消息类型和对应的业务id + userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_MESSAGE_PUBLISH); + userMessageFormDTO.setTargetId(messageEntity.getMessageId()); userMessageFormDTOS.add(userMessageFormDTO); } }); @@ -430,6 +438,11 @@ public class NoticeServiceImpl extends BaseServiceImpl userMessageFormDTO.setTitle(UserMessageConstant.GROUP_TITLE); userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); userMessageFormDTO.setMessageContent(String.format(UserMessageConstant.GROUP_NOTICE_EDIT, groupEntity.getGroupName(), formDTO.getTitle())); + + //21.09.10:记录消息类型和对应的业务id + userMessageFormDTO.setTargetId(entity.getId()); + userMessageFormDTO.setMessageType(UserMessageTypeConstant.GROUP_MESSAGE_EDIT); + userMessageFormDTOS.add(userMessageFormDTO); } }); @@ -503,7 +516,7 @@ public class NoticeServiceImpl extends BaseServiceImpl * @Description 文字、图片安全校验 **/ private void safetyCheck(List wordList, List imageList) { - if (imageList.size() != NumConstant.ZERO) { + if (wordList.size() != NumConstant.ZERO) { wordList.forEach(word -> { //创建话题内容审核 TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java new file mode 100644 index 0000000000..9c5dd8f841 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java @@ -0,0 +1,85 @@ +/** + * 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.modules.topic.controller; + +import com.epmet.commons.tools.page.PageData; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("resitopiccommentattachment") +public class ResiTopicCommentAttachmentController { + + @Autowired + private ResiTopicCommentAttachmentService resiTopicCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = resiTopicCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ResiTopicCommentAttachmentDTO data = resiTopicCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ResiTopicCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + resiTopicCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ResiTopicCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + resiTopicCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + resiTopicCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java new file mode 100644 index 0000000000..ab917a7ba5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * 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.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface ResiTopicCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectTopicComFile(@Param("topicId") String topicId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java new file mode 100644 index 0000000000..d4400a14df --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * 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.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_topic_comment_attachment") +public class ResiTopicCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java new file mode 100644 index 0000000000..d29f410d33 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java @@ -0,0 +1,102 @@ +/** + * 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.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface ResiTopicCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ResiTopicCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + ResiTopicCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(ResiTopicCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(ResiTopicCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询话题评论所有人员的附件信息 + **/ + List getTopicComFile(String topicId); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..e44dd792da --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * 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.modules.topic.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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.topic.dao.ResiTopicCommentAttachmentDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class ResiTopicCommentAttachmentServiceImpl extends BaseServiceImpl implements ResiTopicCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ResiTopicCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ResiTopicCommentAttachmentDTO.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 ResiTopicCommentAttachmentDTO get(String id) { + ResiTopicCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ResiTopicCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ResiTopicCommentAttachmentDTO dto) { + ResiTopicCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ResiTopicCommentAttachmentDTO dto) { + ResiTopicCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getTopicComFile(String topicId) { + return baseDao.selectTopicComFile(topicId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index dd02ae9142..523f81dc49 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -41,22 +41,25 @@ import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.CommonDataFilterResultDTO; +import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.comment.entity.ResiTopicCommentEntity; import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.constant.WxmpSubscribeConstant; import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.entity.ResiGroupEntity; -import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.group.redis.ResiGroupRedis; import com.epmet.modules.member.dao.ResiGroupMemberDao; import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.ResiGroupMemberService; +import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.modules.topic.dao.ResiTopicCommentDao; import com.epmet.modules.topic.dao.ResiTopicDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; import com.epmet.modules.topic.service.ResiTopicCommentService; import com.epmet.modules.topic.service.ResiTopicService; import com.epmet.modules.utils.ModuleConstant; @@ -64,11 +67,12 @@ import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.constant.TopicConstant; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; -import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; @@ -76,6 +80,7 @@ import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.google.common.base.CharMatcher; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -85,6 +90,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -99,32 +105,28 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl imageList = resiCommentFormDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + noticeCommentService.safetyCheck(new ArrayList<>(), imageList); + } + //1.判断当前用户是否被禁言 ResiTopicDTO topic = resiTopicService.get(resiCommentFormDTO.getTopicId()); if(null == topic){ @@ -314,6 +325,32 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (CollectionUtils.isNotEmpty(resiCommentFormDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + resiCommentFormDTO.getImageList().forEach(img -> { + ResiTopicCommentAttachmentEntity attachment = new ResiTopicCommentAttachmentEntity(); + attachment.setCustomerId(comment.getCustomerId()); + attachment.setTopicId(resiCommentFormDTO.getTopicId()); + attachment.setTopicCommentId(comment.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + resiTopicCommentAttachmentService.insertBatch(AttachmentEntityList); + } + //对所有关注这个话题的人发送微信订阅 resiTopicService.sendWxmpUpdateSubscribe(tokenDto,topic.getId(), WxmpSubscribeConstant.TYPE_COMMENT); return new Result(); @@ -372,6 +409,20 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl fileList = resiTopicCommentAttachmentService.getTopicComFile(commentFormDTO.getTopicId()); + //封装数据并返回 + comments.forEach(l -> { + //每一条评论的附件信息 + List imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getCommentId().equals(f.getCommentId()) && l.getUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); + }); + } return new Result>().ok(comments); diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.25__comment_attachment_.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.25__comment_attachment_.sql new file mode 100644 index 0000000000..9c60580ac9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.25__comment_attachment_.sql @@ -0,0 +1,65 @@ +CREATE TABLE `resi_topic_comment_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题Id', + `TOPIC_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='话题评论附件表'; + +CREATE TABLE `act_comment_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GROUP_ACT_ID` varchar(64) NOT NULL COMMENT '活动Id[group_act_info.id]', + `ACT_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='活动评论附件表'; + +CREATE TABLE `notice_comment_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `NOTICE_ID` varchar(64) NOT NULL COMMENT '通知Id', + `NOTICE_COMMENT_ID` varchar(64) NOT NULL COMMENT '评论Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='通知评论附件表'; \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml new file mode 100644 index 0000000000..b74e6adc02 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml index 70b86b20e5..dd6534f874 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml @@ -3,6 +3,108 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index 82d1531781..97f45b4369 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -77,12 +77,12 @@ AND rg.CUSTOMER_ID = #{customerId} AND rg.GRID_ID =#{gridId} AND rgm.CUSTOMER_USER_ID = #{userId} - AND rgm.STATUS IN ( 'approved', 'silent' ) - AND rg.STATE in('approved','hidden','closed') + AND rgm.STATUS IN ( 'approved', 'silent' ,'under_auditting') + AND rg.STATE in('approved','hidden','closed','under_auditting') AND rg.GROUP_TYPE = #{groupType} - order by rg.LATEST_TOPIC_PUBLISH_DATE desc + order by rg.CREATED_TIME desc LIMIT #{pageNo}, #{pageSize} @@ -108,41 +108,24 @@ topicContent, type FROM - ( - SELECT - a.ID AS textId, - a.TOPIC_CONTENT AS topicContent, - 'topic' AS type, - max( a.CREATED_TIME ) AS CREATED_TIME - FROM - resi_topic a - WHERE - a.GROUP_ID = #{groupId} - GROUP BY - a.GROUP_ID UNION ALL - SELECT - a.ID AS textId, - a.TITLE AS topicContent, - 'notice' AS type, - max( a.CREATED_TIME ) AS CREATED_TIME - FROM - notice a - WHERE - a.GROUP_ID = #{groupId} - GROUP BY - a.GROUP_ID UNION ALL - SELECT - a.ID AS textId, - a.TITLE AS topicContent, - 'activity' AS type, - max( a.CREATED_TIME ) AS CREATED_TIME - FROM - group_act_info a - WHERE - a.GROUP_ID = #{groupId} - GROUP BY - a.GROUP_ID - ) a + ( + SELECT + a.ID AS textId, + a.TOPIC_CONTENT AS topicContent, + 'topic' AS type, + a.CREATED_TIME + FROM + resi_topic a + INNER JOIN ( + SELECT max( CREATED_TIME ) AS CREATED_TIME + FROM resi_topic + WHERE GROUP_ID = #{groupId} + AND DEL_FLAG = '0' + ) b ON a.CREATED_TIME = b.CREATED_TIME + WHERE + a.DEL_FLAG = '0' + AND a.GROUP_ID = #{groupId} + ) a ORDER BY CREATED_TIME DESC LIMIT 1 @@ -157,7 +140,8 @@ rg.GROUP_NAME AS groupName, rg.GROUP_TYPE AS groupType, rgs.TOTAL_MEMBERS AS totalMember, - rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember + rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) @@ -246,14 +230,17 @@ AND gmo.OPERATE_STATUS = 'under_auditting' ) AS totalApplyingMember, rgs.TOTAL_TOPICS, - rg.AUDIT_SWITCH + rg.AUDIT_SWITCH, + rg.group_type groupType, + gs.`name` groupTypeName FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) LEFT JOIN resi_group_member rgm - ON ( rg.id = rgm.RESI_GROUP_ID - AND rgm.DEL_FLAG='0' - AND rgm.CUSTOMER_USER_ID =#{userId}) + ON ( rg.id = rgm.RESI_GROUP_ID + AND rgm.DEL_FLAG='0' + AND rgm.CUSTOMER_USER_ID =#{userId}) + LEFT JOIN resi_group_setup gs ON rg.GROUP_TYPE = gs.GROUP_TYPE AND gs.CUSTOMER_ID = 'default' WHERE rg.DEL_FLAG = '0' AND rgs.DEL_FLAG = '0' @@ -452,7 +439,8 @@ rg.GROUP_HEAD_PHOTO AS groupHeadPhoto, rg.GROUP_NAME AS groupName, rgs.TOTAL_MEMBERS AS totalMember, - rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember + rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) @@ -647,7 +635,8 @@ rg.group_name AS groupName, rg.group_type AS groupType, rgs.total_members AS totalMember, - rgs.total_party_members AS totalPartyMember + rgs.total_party_members AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON (rg.id = rgs.resi_group_id) @@ -1059,4 +1048,27 @@ ORDER BY releaseTime DESC + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml new file mode 100644 index 0000000000..d20f434692 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml new file mode 100644 index 0000000000..f4616d1913 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java index 38497917d8..61f1c0f8f5 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java @@ -73,4 +73,9 @@ public class ResiWarmheartedSubmitFormDTO implements Serializable { */ private String messageText; + /** + * 无需前端传入,此列用来数据传值 + */ + private String applyId; + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index 0eb5f2f018..0f320cf9be 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -95,4 +95,14 @@ public interface ResiPartyMemberOpenFeignClient { **/ @PostMapping(value = "/resi/partymember/partymemberinfo/getPartymemberInfoByGridId", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> getPartymemberInfoByGridId(@RequestBody List gridIdList); + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + @PostMapping(value = "/resi/partymember/partymemberinfo/getpartymemberinfobycustomerid") + Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId); + } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java index 9591f35234..953d5ca326 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -64,4 +64,9 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result> getPartymemberInfoByGridId(List gridIdList) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartymemberInfoByGridId", gridIdList); } + + @Override + public Result> getPartyMemberInfoByCustomerId(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartyMemberInfoByCustomerId", customerId); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java index 5d7d081e13..98b56b8475 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java @@ -157,4 +157,15 @@ public class PartymemberInfoController { List list = partymemberInfoService.listPartymemberInfoByGridId(gridIdList); return new Result>().ok(list); } + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + @PostMapping("getpartymemberinfobycustomerid") + public Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId){ + return new Result>().ok(partymemberInfoService.getPartyMemberInfoByCustomerId(customerId)); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java index f395beac8b..c363cd42a0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java @@ -95,4 +95,12 @@ public interface PartymemberInfoDao extends BaseDao { * @Date 2020/7/22 12:14 **/ List selectListPartymemberInfoByGridId(@Param("gridIdList") List gridIdList); + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + List selectListPartyMemberInfoByCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java index 4a25939dad..eed9482da3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java @@ -170,4 +170,12 @@ public interface PartymemberInfoService extends BaseService getPartyMemberInfoByCustomerId(String customerId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 1610de67c6..502a520dc3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -8,10 +8,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.PartyMemberConstant; -import com.epmet.constant.PartyMemberMessageConstant; -import com.epmet.constant.ReadFlagConstant; -import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.*; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -651,6 +648,11 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService userMessageFormDTO.setGridId(formDTO.getGridId()); userMessageFormDTO.setApp(AppClientConstant.APP_RESI); userMessageFormDTO.setTitle(PartyMemberMessageConstant.PARTY_AUTH_TITLE); + + //21.09.10:记录消息类型和对应的业务id + userMessageFormDTO.setMessageType(UserMessageTypeConstant.PARTY_CERTIFY_APPLY_RES); + userMessageFormDTO.setTargetId(formDTO.getId()); + //调用gov-org服务查询网格信息 CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); customerGridFormDTO.setGridId(formDTO.getGridId()); @@ -729,7 +731,12 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService msgDTO.setTitle(PartyMemberMessageConstant.PARTY_AUTH_TITLE); msgDTO.setMessageContent(message); msgDTO.setReadFlag(ReadFlagConstant.UN_READ); + + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.PARTY_CERTIFY_APPLY); + msgDTO.setTargetId(formDTO.getId()); msgList.add(msgDTO); + //微信订阅 WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO(); subscribeDTO.setClientType(AppClientConstant.APP_GOV); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 57e6a2922c..dfb4c42f71 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -248,4 +248,15 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl getPartyMemberInfoByCustomerId(String customerId) { + return baseDao.selectListPartyMemberInfoByCustomerId(customerId); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java index 549a5ce8af..553f20bae2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.UserRoleDTO; @@ -211,7 +212,8 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl + + + diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/readme b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme index 384fca6dfc..7957000efc 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/readme +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme @@ -4,4 +4,19 @@ sadd epmet:openapi:scan:whitelist "客户端ip地址" sadd epmet:openapi:scan:whitelist "\"192.168.1.1\"" #del -srem 'epmet:openapi:scan:whitelist' "\"116.179.32.197\"" "\"27.219.156.47\"" \ No newline at end of file +srem 'epmet:openapi:scan:whitelist' "\"116.179.32.197\"" "\"27.219.156.47\"" + +==========现有的IP白名单列表=========== +"118.190.232.100" +"47.104.208.104" +"219.146.91.110" +"47.104.205.48" +"47.104.202.209" +123.168.101.68 +"47.105.75.189" +"115.28.104.30" +"124.128.226.254" +"114.215.146.86" + + +2021-09-13 平阴私有化部署服务器 "124.128.226.254" \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java index 04962a5396..7de2636450 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * 获取pc工作端登陆用户信息 @@ -60,4 +61,10 @@ public class StaffBasicInfoResultDTO implements Serializable { * 状态 0:停用 1:正常 */ private Integer status; + + /** + * 工作人员的所有角色key,09.08新增:工作端PC端用到了 + */ + private List roleList; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 2c913bd585..cbec879b5b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -635,4 +635,15 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/statsstaffpatrolrecorddaily/patrolinfo") Result> patrolInfo(@RequestParam("agencyId")String agencyId); + + /** + * 根据userId查询用户所属终端,是居民端的用户还是工作人员,还是运营人员 + * + * @param userId + * @return + * @author yinzuomei + * @date 2021/9/10 8:56 上午 + */ + @GetMapping(value = "/epmetuser/user/queryUserClient/{userId}") + Result queryUserClient(@PathVariable("userId") String userId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index a68cab52f5..183196dad8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -450,4 +450,17 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> patrolInfo(String agencyId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "patrolInfo", agencyId); } + + /** + * 根据userId查询用户所属终端,是居民端的用户还是工作人员,还是运营人员 + * + * @param userId + * @return + * @author yinzuomei + * @date 2021/9/10 8:56 上午 + */ + @Override + public Result queryUserClient(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryUserClient", userId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index d4a4148450..f1cbcb114a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -12,11 +12,9 @@ import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.UserService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * @Description @@ -172,4 +170,19 @@ public class UserController { return new Result().ok(userService.saveUserInfo(formDTO)); } + /** + * 根据userId查询用户所属终端,是居民端的用户还是工作人员,还是运营人员 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/9/10 8:49 上午 + */ + @GetMapping("queryUserClient/{userId}") + public Result queryUserClient(@PathVariable String userId){ + if(StringUtils.isBlank(userId)){ + return new Result<>(); + } + return new Result().ok(userService.queryUserClient(userId)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index d0679eb2b6..97e4bf7424 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -213,4 +213,6 @@ public interface CustomerStaffDao extends BaseDao { * @return */ List listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List userIds); + + List selectStaffRoles(@Param("userId") String userId,@Param("customerId") String customerId); } 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 e861249258..0fed169769 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 @@ -65,7 +65,7 @@ public interface UserBadgeDao { * @author zxc * @date 2020/11/4 2:13 下午 */ - void insertUserBadgeCertificateRecord(UserBadgeCertificateRecordDTO userBadgeCertificateRecordDTO); + int insertUserBadgeCertificateRecord(UserBadgeCertificateRecordDTO userBadgeCertificateRecordDTO); /** * @Description 更新认证徽章记录最新 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java index 7dc2a768d8..e4c7a2cec5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java @@ -1,6 +1,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.UserDTO; import com.epmet.dto.form.CreatedTimeByUserIdFormDTO; import com.epmet.dto.form.UserBasicInfoFormDTO; import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; @@ -52,4 +53,14 @@ public interface UserDao extends BaseDao { * @Description 居民端-查询用户基础信息 **/ UserBasicInfo selectUserBasicInfo(UserBasicInfoFormDTO formDTO); + + /** + * 根据userId查询用户所属终端,是居民端的用户还是工作人员,还是运营人员 + * + * @param userId + * @return com.epmet.dto.UserDTO + * @author yinzuomei + * @date 2021/9/10 8:51 上午 + */ + UserDTO selectByUserId(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java index cc2fb1aecf..33e7b1c7ad 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java @@ -94,4 +94,14 @@ public interface UserService extends BaseService { * @date 2021/1/19 上午10:35 */ UserDTO saveUserInfo(UserInfoFormDTO formDTO); + + /** + * 根据userId查询用户所属终端,是居民端的用户还是工作人员,还是运营人员 + * + * @param userId + * @return com.epmet.dto.UserDTO + * @author yinzuomei + * @date 2021/9/10 8:50 上午 + */ + UserDTO queryUserClient(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 740b4b8d6e..989b86924d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -703,6 +703,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl selectStaffBasicInfo(String userId) { StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); + if(null!=resultDTO){ + resultDTO.setRoleList(baseDao.selectStaffRoles(userId,resultDTO.getCustomerId())); + } return new Result().ok(resultDTO); } 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 bdf908849f..3f189b5426 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 @@ -334,7 +334,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); - if (customerInfo.success()){ + if (customerInfo.success() && null != customerInfo.getData()) { userAdviceDTO.setCustomerName(customerInfo.getData().getCustomerName()); }else { logger.error("customerId:{},获取customerName失败",dto.getCustomerId()); 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 0716978c1c..7a70e3e651 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 @@ -12,6 +12,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.BadgeConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.UserMessageTypeConstant; import com.epmet.dao.*; import com.epmet.dto.ResiUserBadgeDTO; import com.epmet.dto.UserBadgeCertificateRecordDTO; @@ -53,8 +54,6 @@ public class UserBadgeServiceImpl implements UserBadgeService { @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Autowired - private EpmetMessageOpenFeignClient messageFeignClient; - @Autowired private UserRoleDao userRoleDao; @Autowired private ResiUserBadgeDao resiUserBadgeDao; @@ -278,11 +277,13 @@ public class UserBadgeServiceImpl implements UserBadgeService { form.setSurname(certificationAddFormDTO.getSurname()); log.info(JSON.toJSONString(form)); userBadgeDao.insertUserBadgeCertificateRecord(form); - //TODO 站内信发送 String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId()); String msg = String.format(BadgeConstant.MESSAGE_CONTENT, userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()), badgeName); - sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId()); + // 记录待审核id,和消息类型 + sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(), + UserMessageTypeConstant.BADGE_AUTH_APPLY, + form.getId()); return new Result(); } @@ -443,7 +444,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { * @author zxc * @date 2020/11/19 上午9:16 */ - public void sendMessage(String title,String msg,String gridId,String userId,String customerId){ + public void sendMessage(String title,String msg,String gridId,String userId,String customerId,String messageType,String userBadgeCertificateRecordId){ //1.查询加入当前网格下的人员 customer_staff_grid CommonGridIdFormDTO commonGridIdFormDTO = new CommonGridIdFormDTO(); commonGridIdFormDTO.setGridId(gridId); @@ -474,6 +475,11 @@ public class UserBadgeServiceImpl implements UserBadgeService { msgObj.setReadFlag(ReadFlagConstant.UN_READ); msgObj.setTitle(title); msgObj.setUserId(to); + + //21.09.10:记录消息类型和对应的业务id + msgObj.setMessageType(messageType); + msgObj.setTargetId(userBadgeCertificateRecordId); + msgList.add(msgObj); //微信订阅 WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 1ce80e7e61..acb101464e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -180,25 +180,30 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl { UserBaseInfoResultDTO baseInfo = userBaseInfoRedis.getUserInfo(id); - //为了保证传过来的user数量与返回的一致,就算查出的用户信息为空也要添加进集合里 - //if(null != baseInfo && StringUtils.isNotBlank(baseInfo.getId())){ - if (StringUtils.isNotBlank(baseInfo.getStreet()) && StringUtils.isNotBlank(baseInfo.getSurname())) { - if ("1".equals(baseInfo.getGender())) { - // 男 - baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("先生"))); - } else if ("2".equals(baseInfo.getGender())) { - // 女 - baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("女士"))); + if(null!=baseInfo){ + //为了保证传过来的user数量与返回的一致,就算查出的用户信息为空也要添加进集合里 + //if(null != baseInfo && StringUtils.isNotBlank(baseInfo.getId())){ + if (StringUtils.isNotBlank(baseInfo.getStreet()) && StringUtils.isNotBlank(baseInfo.getSurname())) { + if ("1".equals(baseInfo.getGender())) { + // 男 + baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("先生"))); + } else if ("2".equals(baseInfo.getGender())) { + // 女 + baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("女士"))); + } else { + // 0 未知 + baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("女士/先生"))); + } } else { - // 0 未知 - baseInfo.setUserShowName(baseInfo.getStreet().concat(StrConstant.HYPHEN).concat(baseInfo.getSurname().concat("女士/先生"))); + // 社会为微信昵称 + baseInfo.setUserShowName(baseInfo.getNickname()); } - } else { - // 社会为微信昵称 - baseInfo.setUserShowName(baseInfo.getNickname()); + userBaseInfoList.add(baseInfo); + //} + }else{ + logger.error(String.format("userId【%s】,构造UserBaseInfoResultDTO为空",id)); } - userBaseInfoList.add(baseInfo); - //} + }); return userBaseInfoList; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 515f2ccba9..6c56b705a8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -329,4 +329,17 @@ public class UserServiceImpl extends BaseServiceImpl implem return result; } + /** + * 根据userId查询用户所属终端,是居民端的用户还是工作人员,还是运营人员 + * + * @param userId + * @return com.epmet.dto.UserDTO + * @author yinzuomei + * @date 2021/9/10 8:50 上午 + */ + @Override + public UserDTO queryUserClient(String userId) { + return baseDao.selectByUserId(userId); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 9e3265747c..4448cb0566 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -416,4 +416,14 @@ ) + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 9e00787142..c42a648c62 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -170,7 +170,10 @@ - + + + select replace(uuid(),'-','') AS ID + INSERT INTO user_badge_certificate_record ( ID, CUSTOMER_ID, @@ -197,7 +200,7 @@ ) VALUES ( - REPLACE ( UUID(), '-', '' ), + #{id}, #{customerId}, #{gridId}, #{userId}, diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml index a46001c8c6..bbdaf024ba 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml @@ -67,4 +67,18 @@ AND u.id = #{userId} LIMIT 1 + + +