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-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 94% 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..103baa6b0d 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; @@ -42,7 +42,7 @@ public class Pinyin4jUtil { */ public static String getFirstSpellPinYin(String src, boolean isFullSpell) { String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1)); - System.out.println(targetStr); + System.out.println("targetStr="+targetStr); String[] split = targetStr.split(","); if (split.length > 1) { targetStr = split[0]; @@ -59,7 +59,7 @@ 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); + System.out.println("targetStr="+targetStr); String[] split = targetStr.split(","); if (split.length > 1) { targetStr = split[0]; @@ -196,8 +196,9 @@ public class Pinyin4jUtil { } public static void main(String[] args) { - System.out.println(getFirstSpellPinYin("区直部门",false)); - System.out.println(getSpellPinYin("党员提出话题数",false,4)); - System.out.println(getSpellPinYin("社区超期项目数",false,4)); + //System.out.println(getSpellPinYin("社区超期项目数",true,0)); + System.out.println(getFirstSpellPinYin("区直部门",true)); + //System.out.println(getSpellPinYin("党员提出话题数",false,4)); + //System.out.println(getSpellPinYin("社区超期项目数",false,4)); } } 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-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java index 3fe392276f..690543f0d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -4,6 +4,7 @@ import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.Pinyin4jUtil; import com.epmet.commons.tools.utils.UniqueIdGenerator; import com.epmet.entity.evaluationindex.screen.IndexDictEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; @@ -13,7 +14,6 @@ import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; import com.epmet.support.normalizing.Correlation; -import com.epmet.util.Pinyin4jUtil; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java index cc1aed7759..b1860f8dfc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -2,7 +2,7 @@ package com.epmet.model; import com.alibaba.excel.annotation.ExcelProperty; import com.epmet.commons.tools.constant.StrConstant; -import com.epmet.util.Pinyin4jUtil; +import com.epmet.commons.tools.utils.Pinyin4jUtil; import lombok.Data; @Data diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 4fc64984c9..8ab04b8758 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -401,4 +401,35 @@ public class OssController { return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId); } + /** + * @Description 办事指南上传附件 + * @Param file + * @Param customerId + * @Return {@link Result< UploadImgResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/8 17:14 + */ + @PostMapping("upload-guide-file") + public Result uploadGuideFile(@RequestPart(value = "file") MultipartFile file, @RequestParam("customerId") String customerId) { + String fileName = file.getOriginalFilename(); + String format = "-" + fileName.substring(fileName.lastIndexOf(".") + NumConstant.ONE) + "-"; + format = format.toLowerCase(); + // 体积限制 + int sizeMb = 10; + // 大小限制10m + int sizeThreshold = sizeMb * 1024 * 1024; + if (file.getSize() > sizeThreshold) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(), + EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg().concat(",限制在").concat(String.valueOf(sizeMb)).concat("M以内")); + } + + // 格式限制,只允许png和jpeg + if (!ModuleConstant.GUIDE_FILE_DOC.contains(format)) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); + } + + return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java index 07a11d9ed7..71d5f177e2 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -43,6 +43,7 @@ public interface ModuleConstant extends Constant { * 项目附件-允许的文件类型 */ String PROJECT_FILE_DOC = "-pdf-ppt-pptx-doc-docx-xls-xlsx-"; + String GUIDE_FILE_DOC = "-pdf-doc-docx-xls-xlsx-"; /** * 项目附件-允许的音频类型 */ diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java index 3e5dc04f11..fde907f861 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/BizPointUserTotalDetailDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -103,4 +104,6 @@ public class BizPointUserTotalDetailDTO implements Serializable { */ private Date updatedTime; + private String rank; + } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java new file mode 100644 index 0000000000..ebfea4f918 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/6 3:13 下午 + * @DESC + */ +@Data +public class AllPartyFormDTO implements Serializable { + + private static final long serialVersionUID = -600409785611581009L; + + + /** + * 页码 + **/ + private Integer pageNo = NumConstant.ONE; + + /** + * 每页数据条数 + **/ + private Integer pageSize = NumConstant.TEN; + + /** + * 本月 monthly 总排行 all; + * */ + private String type; + + /** + * 认证成功的党员 的用户ID + * */ + private List userIds; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java index b727bb5d1b..a90e01a1de 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java @@ -17,8 +17,9 @@ public class GroupPointFormDTO implements Serializable { public interface GroupPoint extends CustomerClientShowGroup {} public interface GridRank extends CustomerClientShowGroup {} + public interface PointRank extends CustomerClientShowGroup {} @NotBlank(message = "小组Id不能为空", groups = {GroupPoint.class, GridRank.class}) private String groupId; - @NotBlank(message = "网格Id不能为空", groups = {GridRank.class}) + @NotBlank(message = "网格Id不能为空", groups = {GridRank.class, PointRank.class}) private String gridId; } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java new file mode 100644 index 0000000000..a8aabab703 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/6 3:12 下午 + * @DESC + */ +@Data +public class AllPartyResultDTO implements Serializable { + + private static final long serialVersionUID = -5889648842876122793L; + + /** + * 排序 + **/ + private Integer ranking; + + /** + * 积分 + **/ + private Integer point; + + /** + * 头像 + **/ + private String userHeadPhoto; + + /** + * 名称 + **/ + private String realName; + + /** + * 用户id + **/ + private String userId; + + public AllPartyResultDTO() { + this.point = NumConstant.ZERO; + this.userHeadPhoto = ""; + this.realName = ""; + this.userId = ""; + } +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GridPointRankResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GridPointRankResultDTO.java new file mode 100644 index 0000000000..2ef1819bcc --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GridPointRankResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/10 14:11 + */ +@NoArgsConstructor +@Data +public class GridPointRankResultDTO implements Serializable { + + private static final long serialVersionUID = 3288606889536923166L; + private String gridName; + private String agencyRank; + private String customerRank; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyPointRankResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyPointRankResultDTO.java new file mode 100644 index 0000000000..484c8f8055 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyPointRankResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/9/10 13:44 + */ +@NoArgsConstructor +@Data +public class MyPointRankResultDTO implements Serializable { + + private static final long serialVersionUID = -2438231097029179782L; + private String headPhoto; + private String gridRank; + private String customerRank; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index b52a602ede..795f557449 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -159,6 +159,18 @@ public class ResiPointController { return new Result>().ok(resultDTOS); } + /** + * @Description 全部党员积分排行 + * @Param formDTO + * @author zxc + * @date 2021/9/6 3:30 下午 + */ + @PostMapping("allparty") + public Result> allParty(@RequestBody AllPartyFormDTO formDTO,@LoginUser TokenDto tokenDto){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(userPointStatisticalDailyService.allParty(formDTO)); + } + /** * @return com.epmet.commons.tools.utils.Result> * @param tokenDto @@ -178,4 +190,34 @@ public class ResiPointController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(pointActionLogService.queryMyPointTaskList(formDTO)); } + + /** + * @Description 个人当月积分在网格和客户中的排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result< MyPointTaskResultDTO>} + * @Author zhaoqifeng + * @Date 2021/9/10 14:13 + */ + @PostMapping("mypointrank") + public Result myPointRank(@LoginUser TokenDto tokenDto, @RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.PointRank.class); + return new Result().ok(userPointStatisticalDailyService.myPointRank(tokenDto, formDTO)); + } + + /** + * @Description 网格当月积分在组织和客户内排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/9/10 14:13 + */ + @PostMapping("gridpointrank") + public Result gridPointRank(@LoginUser TokenDto tokenDto, @RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.PointRank.class); + return new Result().ok(userPointStatisticalDailyService.gridPointRank(tokenDto, formDTO)); + } + + } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java index 63a3e68c1c..2966e00f75 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java @@ -18,7 +18,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.BizPointUserTotalDetailDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; +import com.epmet.dto.result.AllPartyResultDTO; import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO; import com.epmet.dto.result.ResiPointRankResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; @@ -73,6 +75,7 @@ public interface UserPointStatisticalDailyDao extends BaseDao selectListGridPartyRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO); + List selectListGridPartyNewRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO); /** * 身边党员-积分排行 :按网格统计,对本月党员增加的积分 进行排序 @@ -82,4 +85,10 @@ public interface UserPointStatisticalDailyDao extends BaseDao selectListGridPartyRankByMonth(ResiAroundPartyPointRankFormDTO formDTO); + List selectListGridPartyNewRankByMonth(ResiAroundPartyPointRankFormDTO formDTO); + + List selectUserPointByMonth(@Param("customerId") String customerId, @Param("agencyId") String agencyId, + @Param("gridId") String gridId); + + List selectGridPointByMonth(@Param("customerId") String customerId, @Param("agencyId") String agencyId); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java index 6630a87891..a563768be5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java @@ -19,11 +19,13 @@ 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.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.AllPartyFormDTO; +import com.epmet.dto.form.GroupPointFormDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; -import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO; -import com.epmet.dto.result.ResiPointRankListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.UserPointStatisticalDailyEntity; import java.util.List; @@ -125,4 +127,32 @@ public interface UserPointStatisticalDailyService extends BaseService listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO); + + /** + * @Description 全部党员积分排行 + * @Param formDTO + * @author zxc + * @date 2021/9/6 3:30 下午 + */ + List allParty(AllPartyFormDTO formDTO); + + /** + * @Description 个人当月积分在网格和客户中的排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link MyPointRankResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 14:18 + */ + MyPointRankResultDTO myPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO); + + /** + * @Description 网格当月积分在组织和客户内排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link GridPointRankResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 14:18 + */ + GridPointRankResultDTO gridPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 10ed45500f..5842e34bf6 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -23,11 +23,16 @@ import com.epmet.common.enu.AroundPartyConstant; 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.exception.RenException; 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.commons.tools.utils.Result; import com.epmet.dao.UserPointStatisticalDailyDao; +import com.epmet.dto.BizPointUserTotalDetailDTO; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.AllPartyFormDTO; +import com.epmet.dto.form.GroupPointFormDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.*; @@ -41,12 +46,14 @@ import com.epmet.utils.DimIdGenerator; import com.epmet.utils.ModuleConstant; 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 org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -292,6 +299,95 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl allParty(AllPartyFormDTO formDTO) { + formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); + Result> partyMemberInfosResult = resiPartyMemberOpenFeignClient.getPartyMemberInfoByCustomerId(formDTO.getCustomerId()); + if (!partyMemberInfosResult.success()){ + throw new RenException("查询客户下的党员失败......"); + } + if (CollectionUtils.isEmpty(partyMemberInfosResult.getData())){ + return new ArrayList<>(); + } + List partyMemberInfos = partyMemberInfosResult.getData(); + List userIds = partyMemberInfos.stream().map(m -> m.getUserId()).collect(Collectors.toList()); + ResiAroundPartyPointRankFormDTO selDto = ConvertUtils.sourceToTarget(formDTO, ResiAroundPartyPointRankFormDTO.class); + selDto.setUserIds(userIds); + List resultDTOS = new ArrayList<>(); + if (AroundPartyConstant.ALL.equals(formDTO.getType())){ + resultDTOS = baseDao.selectListGridPartyNewRankByUsablePoint(selDto); + }else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){ + resultDTOS = baseDao.selectListGridPartyNewRankByMonth(selDto); + } + List partyBaseInfo = getPartyBaseInfo(ConvertUtils.sourceToTarget(resultDTOS, ResiAroundPartyPointRankResultDTO.class)); + List result = ConvertUtils.sourceToTarget(partyBaseInfo, AllPartyResultDTO.class); + return result; + } + + /** + * @param tokenDto + * @param formDTO + * @Description 个人当月积分在网格和客户中的排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link MyPointRankResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 14:18 + */ + @Override + public MyPointRankResultDTO myPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO) { + List userIds = new ArrayList<>(); + userIds.add(tokenDto.getUserId()); + //获取我的个人信息 + Result> myInfoResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + if(!myInfoResult.success()){ + throw new RenException(myInfoResult.getCode(), myInfoResult.getMsg()); + } + MyPointRankResultDTO result = new MyPointRankResultDTO(); + result.setHeadPhoto(myInfoResult.getData().get(0).getHeadImgUrl()); + //获取客户下用户积分 + List list = getUserPointList(tokenDto.getCustomerId(), null, null); + result.setCustomerRank(getRank(list, tokenDto.getUserId())); + //获取网格用户积分 + List gridRankList = getUserPointList(tokenDto.getCustomerId(), null, formDTO.getGridId()); + result.setGridRank(getRank(gridRankList, tokenDto.getUserId())); + return result; + } + + /** + * @param tokenDto + * @param formDTO + * @Description 网格当月积分在组织和客户内排名 + * @Param tokenDto + * @Param formDTO + * @Return {@link GridPointRankResultDTO} + * @Author zhaoqifeng + * @Date 2021/9/10 14:18 + */ + @Override + public GridPointRankResultDTO gridPointRank(TokenDto tokenDto, GroupPointFormDTO formDTO) { + GridPointRankResultDTO result = new GridPointRankResultDTO(); + //获取网格信息 + Result gridInfoResult = govOrgOpenFeignClient.queryGridInfo(formDTO.getGridId()); + if (!gridInfoResult.success()) { + throw new RenException(gridInfoResult.getCode()); + } + result.setGridName(gridInfoResult.getData().getGridName()); + String agencyId = gridInfoResult.getData().getParentAgencyId(); + //获取客户下用户积分 + List list = getGridPointList(tokenDto.getCustomerId(), null); + result.setCustomerRank(getGridRank(list, formDTO.getGridId())); + List agencyPointList = getGridPointList(tokenDto.getCustomerId(), agencyId); + result.setAgencyRank(getGridRank(agencyPointList, formDTO.getGridId())); + return result; + } + /** * 获取认证通过的党员的 用户id * @@ -338,4 +434,84 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/9/10 15:04 + */ + private List getUserPointList(String customerId, String agencyId, String gridId) { + return baseDao.selectUserPointByMonth(customerId, agencyId, gridId); + } + + private List getGridPointList(String customerId, String agencyId) { + return baseDao.selectGridPointByMonth(customerId, agencyId); + } + + private Boolean havePoint(List list, String userId) { + Map map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getUserId, BizPointUserTotalDetailDTO::getTotalPoint)); + return null != map.get(userId); + } + + + private String getGridRank(List list, String gridId) { + if (CollectionUtils.isEmpty(list)) { + return NumConstant.ONE_STR; + } + //如果当月网格没有积分变动,则积分为0 + Map map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getGridId, BizPointUserTotalDetailDTO::getTotalPoint)); + if (null == map.get(gridId)) { + BizPointUserTotalDetailDTO dto = new BizPointUserTotalDetailDTO(); + dto.setGridId(gridId); + dto.setTotalPoint(NumConstant.ZERO); + list.add(dto); + } + //排序 + list = list.stream().sorted(Comparator.comparing(BizPointUserTotalDetailDTO :: getTotalPoint).reversed() + .thenComparing(BizPointUserTotalDetailDTO::getGridId)) + .collect(Collectors.toList()); + AtomicInteger i = new AtomicInteger(1); + AtomicInteger point = new AtomicInteger(0); + list.forEach(item -> { + if (item.getTotalPoint().equals(point.get())) { + item.setRank(String.valueOf(i)); + } else { + item.setRank(String.valueOf(i.getAndIncrement())); + } + point.set(item.getTotalPoint()); + }); + Map rankMap = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getGridId, BizPointUserTotalDetailDTO::getRank)); + return rankMap.get(gridId); + } + + private String getRank(List list, String userId) { + if (CollectionUtils.isEmpty(list)) { + return NumConstant.ONE_STR; + } + if (!havePoint(list, userId)) { + BizPointUserTotalDetailDTO dto = new BizPointUserTotalDetailDTO(); + dto.setUserId(userId); + dto.setTotalPoint(NumConstant.ZERO); + list.add(dto); + } + //排序 + list = list.stream().sorted(Comparator.comparing(BizPointUserTotalDetailDTO :: getTotalPoint).reversed() + .thenComparing(BizPointUserTotalDetailDTO::getUserId)) + .collect(Collectors.toList()); + AtomicInteger i = new AtomicInteger(1); + AtomicInteger point = new AtomicInteger(0); + list.forEach(item -> { + if (item.getTotalPoint().equals(point.get())) { + item.setRank(String.valueOf(i)); + } else { + item.setRank(String.valueOf(i.getAndIncrement())); + } + point.set(item.getTotalPoint()); + }); + Map map = list.stream().collect(Collectors.toMap(BizPointUserTotalDetailDTO::getUserId, BizPointUserTotalDetailDTO::getRank)); + return map.get(userId); + } } 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..6bd5f6b76a 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,97 @@ ORDER BY P.point DESC LIMIT #{pageNo}, #{pageSize} + + + + + + + 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..acacd98237 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 @@ -25,6 +25,7 @@ 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.page.PageData; +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; @@ -1075,4 +1076,31 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl 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-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/GuideAttachmentServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideAttachmentServiceImpl.java new file mode 100644 index 0000000000..43a8c41683 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideAttachmentServiceImpl.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.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..72bfeb9d05 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java @@ -0,0 +1,143 @@ +/** + * 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.setCustomerId(customerId); + }); + insertBatch(moduleList); + list = baseDao.selectList(wrapper); + } + 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/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/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/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/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/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/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-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/GroupActInfoDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java index 85f243e608..c4082b67c9 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,13 @@ 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.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 +35,36 @@ 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); + } \ 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/GroupActInfoServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java index 48334bac4e..326380d48f 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 @@ -58,9 +58,11 @@ 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.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 +77,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; @@ -862,4 +865,87 @@ 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; + } + + /** + * @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/resources/mapper/act/GroupActInfoDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml index 70b86b20e5..6ebd2be427 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,65 @@ + + + + + + \ 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..3d416b3a91 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} @@ -157,7 +157,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 ) @@ -452,7 +453,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 +649,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) 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/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/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index 876e1102f0..d6585f8dfb 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -169,4 +169,15 @@ + + + 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-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/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/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 @@ ) +