diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 8626ef3f13..313c3b3bde 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -20,7 +20,6 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.MessageFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; @@ -51,8 +50,6 @@ public class GovLoginServiceImpl implements GovLoginService { @Autowired private CaptchaRedis captchaRedis; @Autowired - private MessageFeignClient messageFeignClient; - @Autowired private JwtTokenUtils jwtTokenUtils; @Autowired private JwtTokenProperties jwtTokenProperties; diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index a796eedf89..92905f4848 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -4,7 +4,6 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; @@ -17,7 +16,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.OperAccessFeignClient; +import com.epmet.feign.OperAccessOpenFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.service.CaptchaService; @@ -63,7 +62,7 @@ public class LoginServiceImpl implements LoginService { private CaptchaService captchaService; @Autowired - private OperAccessFeignClient operAccessFeignClient; + private OperAccessOpenFeignClient operAccessOpenFeignClient; /** * 居民端微信小程序登录 @@ -321,7 +320,7 @@ public class LoginServiceImpl implements LoginService { } cpUserDetailRedis.logout(tokenDto.getApp(), tokenDto.getClient(), tokenDto.getUserId()); //web端清空菜单栏和权限 - Result operAccessResult = operAccessFeignClient.clearOperUserAccess(); + Result operAccessResult = operAccessOpenFeignClient.clearOperUserAccess(); if (operAccessResult.success()) { logger.info(String.format("运营人员%s退出成功,清空菜单和权限redis成功", tokenDto.getUserId())); } else { diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java index 574072a71a..d85182f71e 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/annotation/DataFilter.java @@ -32,12 +32,12 @@ public @interface DataFilter { * public void test(String a, String b, String gridId) {...} * @return */ - String gridIdsArgName() default ""; + String gridIdArgName() default ""; /** * 部门ID参数名 * @return */ - String deptIdsArgName() default ""; + String deptIdArgName() default ""; } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java index 0772305976..3250a4f25f 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/aspect/DataFilterAspect.java @@ -19,8 +19,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.Set; - /** * 数据过滤,切面处理类 * @@ -59,24 +57,24 @@ public class DataFilterAspect { MethodSignature methodSignature = (MethodSignature) point.getSignature(); DataFilter dataFilterAnno = methodSignature.getMethod().getAnnotation(DataFilter.class); String tableAlias = dataFilterAnno.tableAliases()[0]; - String gridIdsArgName = dataFilterAnno.gridIdsArgName(); - String deptIdsArgName = dataFilterAnno.deptIdsArgName(); + String gridIdArgName = dataFilterAnno.gridIdArgName(); + String deptIdArgName = dataFilterAnno.deptIdArgName(); String[] parameterNames = methodSignature.getParameterNames(); // 取出注解参数中指定的gridId和deptId的入参的值 - Set gridIds = null; - Set deptIds = null; - if (StringUtils.isNotBlank(gridIdsArgName)) { - int gridIdArgIndex = ArrayUtils.indexOf(parameterNames, gridIdsArgName); + String gridId = null; + String deptId = null; + if (StringUtils.isNotBlank(gridIdArgName)) { + int gridIdArgIndex = ArrayUtils.indexOf(parameterNames, gridIdArgName); if (gridIdArgIndex >-1){ - gridIds = (Set) point.getArgs()[gridIdArgIndex]; + gridId = (String) point.getArgs()[gridIdArgIndex]; } } - if (StringUtils.isNotBlank(deptIdsArgName)) { - int deptArgIndex = ArrayUtils.indexOf(parameterNames, deptIdsArgName); + if (StringUtils.isNotBlank(deptIdArgName)) { + int deptArgIndex = ArrayUtils.indexOf(parameterNames, deptIdArgName); if (deptArgIndex > -1) { - deptIds = (Set) point.getArgs()[deptArgIndex]; + deptId = (String) point.getArgs()[deptArgIndex]; } } @@ -86,8 +84,8 @@ public class DataFilterAspect { form.setApp(loginUserUtil.getLoginUserApp()); form.setClient(loginUserUtil.getLoginUserClient()); form.setUserId(loginUserUtil.getLoginUserId()); - form.setDepartmentIds(deptIds); - form.setGridIds(gridIds); + form.setDepartmentId(deptId); + form.setGridId(gridId); form.setOperationKey(requirePermission); form.setTableAlias(tableAlias); Result sqlFilterSegmentRst = mybatisGovAccessFeignClient.getSqlFilterSegment(form); diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/GetSQLFilterFormDTO.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/GetSQLFilterFormDTO.java index 25c92a11a8..e0d6b266d6 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/GetSQLFilterFormDTO.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dto/form/GetSQLFilterFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.commons.mybatis.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; -import java.util.Set; @Data public class GetSQLFilterFormDTO { @@ -22,8 +21,8 @@ public class GetSQLFilterFormDTO { private String tableAlias; - private Set gridIds; + private String gridId; - private Set departmentIds; + private String departmentId; } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/MybatisGovAccessFeignClient.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/MybatisGovAccessFeignClient.java index 2b712ff301..1dbe11149b 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/MybatisGovAccessFeignClient.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/MybatisGovAccessFeignClient.java @@ -16,7 +16,7 @@ import java.util.Set; * @Description * @Author sun */ -//@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = MybatisGovAccessFeignClientFallback.class, url = "localhost:8099") +//, url = "localhost:8099" @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = MybatisGovAccessFeignClientFallback.class) public interface MybatisGovAccessFeignClient { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/EpmetRoleKeyConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/EpmetRoleKeyConstant.java index 4d11b57738..d4ec337c86 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/EpmetRoleKeyConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/EpmetRoleKeyConstant.java @@ -1,7 +1,7 @@ package com.epmet.commons.tools.constant; /** - * @Description + * @Description 居民端角色key * @Author yinzuomei * @Date 2020/3/30 16:38 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 2e67bb3098..00c957c680 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -16,6 +16,7 @@ public interface NumConstant { int TWO = 2; int THREE = 3; int FOUR = 4; + int FIVE = 5; int SIX = 6; int SEVEN = 7; int EIGHT = 8; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 5be4136e4b..05b505594b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -100,12 +100,13 @@ public enum RequirePermissionEnum { WORK_PARTY_VOICE_PUBLISHED_LIST("work_party_voice_published_list", "党建声音:已发布列表", "已发布文章列表查询"), WORK_PARTY_VOICE_DETAIL("work_party_voice_detail", "党建声音:文章详情", "已发布详情、已下线详情"), WORK_PARTY_VOICE_DRAFT_LIST("work_party_voice_draft_list", "党建声音:草稿箱列表", "草稿箱列表"), + WORK_PARTY_VOICE_DRAFT_EDIT("work_party_voice_draft_edit", "党建声音:编辑草稿", "编辑草稿"), WORK_PARTY_VOICE_DRAFT_DELETE("work_party_voice_draft_delete", "党建声音:删除草稿", "删除草稿"), WORK_PARTY_VOICE_OFFLINE_LIST("work_party_voice_offline_list", "党建声音:已下线列表", "已下线文章列表"), WORK_PARTY_VOICE_PUBLISH("work_party_voice_publish", "党建声音:创建文章", ""), WORK_PARTY_VOICE_EDIT("work_party_voice_edit", "党建声音:重新编辑", ""), - WORK_PARTY_VOICE_OFFLINE("work_party_voice_offline", "党建声音:下线文章", ""); - + WORK_PARTY_VOICE_OFFLINE("work_party_voice_offline", "党建声音:下线文章", ""), + WORK_PARTY_VOICE_OPERATION_LIST("work_party_voice_operation_list","党建声音:查看文章操作记录",""); private String key; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index 2e45203dc0..ba34e7ff6a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -9,15 +9,18 @@ package com.epmet.commons.tools.redis; import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ZSetOperations; import org.springframework.data.redis.support.atomic.RedisAtomicLong; import org.springframework.stereotype.Component; import java.util.Collection; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -262,4 +265,46 @@ public class RedisUtils { return hGetAll(key); } + + /** + * @Description 获取集合的元素, 从大到小排序 + * @param key + * @param start + * @param end + * @author zxc + */ + public Set zRevRange(String key, long start, long end) { + return redisTemplate.opsForZSet().reverseRange(key, start, end); + } + + /** + * @Description 获取key集合与多个集合的交集 + * @param key + * @param otherKeys + * @author zxc + */ + public Set intersect(String key, Collection otherKeys) { + return redisTemplate.opsForSet().intersect(key, otherKeys); + } + + /** + * @Description 获取集合(set) + * @param key + * @author zxc + */ + public Set sMembers(String key){ + return redisTemplate.opsForSet().members(key); + } + + /** + * @Description 获取 zset 中带score的集合 + * @param key + * @param start + * @param end + * @author zxc + */ + public Set> zReverseRangeWithScores(String key, long start, long end) { + Set> typedTuples = redisTemplate.opsForZSet().reverseRangeWithScores(key, start, end); + return typedTuples; + } } diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 22ac52df2f..75cb2d2151 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -72,7 +72,17 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(e.getCode(),e.getMsg())); + } + }else{ + baseTokenDto = null; + } String customerId = ""; @@ -117,14 +127,17 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory> + * @author yinzuomei@elink-cn.com + * @description 根据起止时间,计算工作日 + * @date 2020/6/4 10:44 + **/ + @PostMapping("commonservice/workday/detentiondays") + Result> detentionDays(@RequestBody List formDTO); +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java new file mode 100644 index 0000000000..2a83a94bfc --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -0,0 +1,25 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.WorkDayFormDTO; +import com.epmet.dto.result.WorkDayResultDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 10:32 + */ +@Component +public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonServiceOpenFeignClient { + @Override + public Result> detentionDays(List formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "detentionDays", formDTO); + } +} diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java index 1a8c985f55..ccb39198c4 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/service/impl/DemoServiceImpl.java @@ -34,8 +34,8 @@ import com.epmet.dto.form.SaveCustomerFormDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.DemoEntity; import com.epmet.feign.AdminFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.MessageFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.DemoRedis; import com.epmet.service.DemoService; @@ -70,7 +70,7 @@ public class DemoServiceImpl extends BaseServiceImpl implem @Autowired private AdminFeignClient adminFeignClient; @Autowired - private MessageFeignClient messageFeignClient; + private EpmetMessageOpenFeignClient messageFeignClient; @Override public PageData page(Map params) { diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/MessageFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java similarity index 76% rename from epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/MessageFeignClient.java rename to epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index 355bdf2a34..ba775e2546 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/MessageFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -1,10 +1,5 @@ package com.epmet.feign; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.SysSmsDTO; -import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.feign.fallback.MessageFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; @@ -12,9 +7,20 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = MessageFeignClientFallback.class) -public interface MessageFeignClient { +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback; +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:47 + */ +@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) +public interface EpmetMessageOpenFeignClient { /** * 发送短信 * @return @@ -37,5 +43,5 @@ public interface MessageFeignClient { * @Date 2020/4/7 15:36 **/ @PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result saveUserMessage(UserMessageFormDTO formDto); + Result saveUserMessage(@RequestBody UserMessageFormDTO formDto); } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java similarity index 75% rename from epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java rename to epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java index cf105730e2..a3f4dbbbc1 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java @@ -1,19 +1,22 @@ package com.epmet.feign.fallback; +import org.springframework.stereotype.Component; + import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.feign.MessageFeignClient; -import org.springframework.stereotype.Component; +import com.epmet.feign.EpmetMessageOpenFeignClient; /** - * 消息服务降级 + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:48 */ @Component -public class MessageFeignClientFallback implements MessageFeignClient { - +public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeignClient { @Override public Result send(SysSmsDTO smsDTO) { @@ -29,5 +32,4 @@ public class MessageFeignClientFallback implements MessageFeignClient { public Result saveUserMessage(UserMessageFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto); } - } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java index 75da5ccf9e..9dc94b7a2d 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java @@ -22,7 +22,7 @@ import com.epmet.dao.SysSmsDao; import com.epmet.dto.SysSmsDTO; import com.epmet.entity.SysSmsEntity; import com.epmet.exception.ModuleErrorCode; -import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.service.SysSmsService; import com.epmet.sms.AbstractSmsService; import com.epmet.sms.SmsFactory; @@ -34,7 +34,9 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.*; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; @Service public class SysSmsServiceImpl extends BaseServiceImpl implements SysSmsService { @@ -42,7 +44,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired - private MessageFeignClient messageFeignClient; + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Override public PageData page(Map params) { @@ -125,7 +127,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl sysSmsDTO.setMobile(mobile); sysSmsDTO.setParams(paramJson); - Result result = messageFeignClient.send(sysSmsDTO); + Result result = epmetMessageOpenFeignClient.send(sysSmsDTO); if (result != null && result.success()) { HashMap data = new HashMap<>(); data.put("code", codeStr); 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 efe52eda9e..2826dc9932 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 @@ -55,6 +55,7 @@ public class OssController { private ParamsRemoteService paramsRemoteService; private final static String KEY = ModuleConstant.CLOUD_STORAGE_CONFIG_KEY; + public static final String IMAGE_JPG_VALUE = "image/jpg"; @GetMapping("page") @ApiOperation(value = "分页") @@ -186,4 +187,24 @@ public class OssController { return ossService.uploadImg(file); } + @PostMapping("article/upload") + public Result uploadArticleImg(@RequestParam("file") MultipartFile file) { + + // 校验文件类型 + if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !IMAGE_JPG_VALUE.equals(file.getContentType())) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); + } + + // 校验文件体积,不超过2m + long maxSize = 2 * 1024 * 1024; + long size = file.getSize(); + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } + + return ossService.uploadImg(file); + } + } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GetSQLFilterFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GetSQLFilterFormDTO.java index 4901eca2bb..4a63754bd7 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GetSQLFilterFormDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/GetSQLFilterFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; -import java.util.Set; @Data public class GetSQLFilterFormDTO { @@ -22,8 +21,8 @@ public class GetSQLFilterFormDTO { private String tableAlias; - private Set gridIds; + private String gridId; - private Set departmentIds; + private String departmentId; } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index cc723cca1f..6fa5770d0e 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -139,7 +139,7 @@ public class AccessServiceImpl implements AccessService { // 生成开关范围的sql过滤器 if (!CollectionUtil.isEmpty(switchScopes)) { - genSwitchScopeSqlFilter(switchScopes, sb, form.getTableAlias(), userDetails.getUserId(), form.getGridIds(), form.getDepartmentIds()); + genSwitchScopeSqlFilter(switchScopes, sb, form.getTableAlias(), userDetails.getUserId(), form.getGridId(), form.getDepartmentId()); } return sb.toString(); @@ -153,29 +153,29 @@ public class AccessServiceImpl implements AccessService { StringBuilder sb, String tableAlias, String userId, - Set gridIds, - Set departmentIds) { + String gridId, + String departmentId) { if (switchScopes.contains(OperationScopeConstant.SCOPE_I_CREATED)) { genICreatedSql(sb, userId, tableAlias); } if (switchScopes.contains(OperationScopeConstant.SCOPE_IN_GRID)) { - if (CollectionUtils.isEmpty(gridIds)) { - String error = String.format("DataFilter:拼接SQL语句出错:需要in grid权限,但是代码中没有获取到gridIds"); + if (StringUtils.isBlank(gridId)) { + String error = String.format("DataFilter:拼接SQL语句出错:需要in grid权限,但是代码中没有获取到,GridId:%s", gridId); logger.error(error); throw new RenException(error); } - genInGrid(sb, gridIds, tableAlias); + genInGrid(sb, gridId, tableAlias); } if (switchScopes.contains(OperationScopeConstant.SCOPE_IN_DEPARTMENT)) { - if (CollectionUtils.isEmpty(departmentIds)) { - String error = String.format("DataFilter:拼接SQL语句出错:需要in department权限,但是代码中没有获取到, departmentIds"); + if (StringUtils.isBlank(departmentId)) { + String error = String.format("DataFilter:拼接SQL语句出错:需要in department权限,但是代码中没有获取到, departmentId:%s", departmentId); logger.error(error); throw new RenException(error); } - genDepartmentFilterSql(sb, departmentIds, tableAlias); + genDepartmentFilterSql(sb, departmentId, tableAlias); } } @@ -199,25 +199,18 @@ public class AccessServiceImpl implements AccessService { * @param sb * @param tableAlias */ - private void genInGrid(StringBuilder sb, Set gridIds, String tableAlias) { + private void genInGrid(StringBuilder sb, String gridId, String tableAlias) { if (hasConditions.get()) { // 之前没有条件 sb.append(" OR "); } - // OR GRID_ID = 'XXX' OR GRID_ID = 'QQQ' OR - - for (String gridId : gridIds) { - if (StringUtils.isBlank(tableAlias)) { - sb.append(" GRID_ID = '").append(gridId).append("' OR "); - } else { - sb.append(" ").append(tableAlias).append(".GRID_ID ='").append(gridId).append("' OR "); - } + // OR GRID_ID = 'XXX' OR GRID_ID = 'QQQ' + if (StringUtils.isBlank(tableAlias)) { + sb.append(" GRID_ID = '").append(gridId).append("' "); + } else { + sb.append(" ").append(tableAlias).append(".GRID_ID ='").append(gridId).append("' "); } - - int lastOrIndex = sb.lastIndexOf("OR"); - sb.replace(lastOrIndex, lastOrIndex + "OR".length(), "" ); - hasConditions.set(true); } @@ -226,24 +219,17 @@ public class AccessServiceImpl implements AccessService { * * @param sb */ - private void genDepartmentFilterSql(StringBuilder sb, Set deptIds, String tableAlias) { + private void genDepartmentFilterSql(StringBuilder sb, String deptId, String tableAlias) { //Result> deptListResult = govOrgFeignClient.getDepartmentListByStaffId(staffId); if (hasConditions.get()) { // 之前没有条件 sb.append(" OR "); } - - for (String deptId : deptIds) { - if (StringUtils.isBlank(tableAlias)) { - sb.append(" DEPARTMENT_ID = '").append(deptId).append("' OR "); - } else { - sb.append(" ").append(tableAlias).append(".DEPARTMENT_ID ='").append(deptId).append("' OR "); - } + if (StringUtils.isBlank(tableAlias)) { + sb.append(" DEPARTMENT_ID = '").append(deptId).append("' "); + } else { + sb.append(" ").append(tableAlias).append(".DEPARTMENT_ID ='").append(deptId).append("' "); } - - int lastOrIndex = sb.lastIndexOf("OR"); - sb.replace(lastOrIndex, lastOrIndex + "OR".length(), "" ); - hasConditions.set(true); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java new file mode 100644 index 0000000000..b9997f1705 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:37 + */ +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) +public interface GovIssueOpenFeignClient { +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java new file mode 100644 index 0000000000..65b8a24fc6 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.GovIssueOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:43 + */ +@Component +public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient { +} diff --git a/epmet-module/gov-org/gov-org-client/pom.xml b/epmet-module/gov-org/gov-org-client/pom.xml index f97bdc99ad..124e7ca4a5 100644 --- a/epmet-module/gov-org/gov-org-client/pom.xml +++ b/epmet-module/gov-org/gov-org-client/pom.xml @@ -32,6 +32,12 @@ 2.0.0 compile + + com.epmet + gov-voice-client + 2.0.0 + compile + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java new file mode 100644 index 0000000000..9cba1d736e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java @@ -0,0 +1,40 @@ +package com.epmet.dto.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.feign.fallback.GovOrgSelfFeignClientFallBack; +import com.epmet.dto.form.PublishGridListFormDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * @Description gov-org服务 + * @Author sun + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgSelfFeignClientFallBack.class) +public interface GovOrgSelfFeignClient { + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围接口调用 + **/ + @PostMapping(value = "gov/org/customeragency/getagencygridlist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getAgencyGridList(@PathVariable("staffId") String staffId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位接口调用 + **/ + @PostMapping(value = "gov/org/customeragency/getpublishagencylist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result getPublishAgencyList(@PathVariable("staffId") String staffId); + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java new file mode 100644 index 0000000000..b7c8924ea9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java @@ -0,0 +1,29 @@ +package com.epmet.dto.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.feign.GovOrgSelfFeignClient; +import com.epmet.dto.form.PublishGridListFormDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; +import org.springframework.stereotype.Component; + +/** + * @Description gov-org服务 + * @Author sun + */ +@Component +public class GovOrgSelfFeignClientFallBack implements GovOrgSelfFeignClient { + + @Override + public Result getAgencyGridList(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyGridList", staffId); + } + + @Override + public Result getPublishAgencyList(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getPublishAgencyList", staffId); + } + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyDeptList.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyDeptList.java new file mode 100644 index 0000000000..c678c1a723 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyDeptList.java @@ -0,0 +1,44 @@ +/** + * 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.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加组织-接口返参 + * + * @author sun + */ +@Data +public class AgencyDeptList implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门Id + */ + private String departmentId = ""; + /** + * 机关-部门名称 + */ + private String agencyDeptName = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java new file mode 100644 index 0000000000..ad2c907fd5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java @@ -0,0 +1,44 @@ +/** + * 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.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加组织-接口返参 + * + * @author sun + */ +@Data +public class AgencyGridList implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格Id + */ + private String gridId = ""; + /** + * 机关-网格名称 + */ + private String agencyGridName = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridListResultDTO.java new file mode 100644 index 0000000000..5474009956 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridListResultDTO.java @@ -0,0 +1,41 @@ +/** + * 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.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 党建声音-可选发布范围-接口返参 + * + * @author sun + */ +@Data +public class AgencyGridListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String gridId = ""; + private String gridName = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.java new file mode 100644 index 0000000000..923872f31e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleGridResultDTO.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.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + * 党建声音-可选发布范围、可下线网格列表-接口返参 + * + * @author sun + */ +@Data +public class ArticleGridResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 当前机关的下属网格列表 + */ + private List gridList = new ArrayList<>(); + /** + * 当前组织的所有下级组织信息(递归) + */ + private List subAgencyGridList = new ArrayList<>(); + /** + * 上级组织机构ID + */ + private String pid = ""; + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids = ""; + /** + * 所有上级名称,以-连接 + */ + private String allParentName = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PublishAgencyListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PublishAgencyListResultDTO.java new file mode 100644 index 0000000000..baa54e8f73 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PublishAgencyListResultDTO.java @@ -0,0 +1,53 @@ +/** + * 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.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 党建声音-可选发布单位-接口返参 + * + * @author sun + */ +@Data +public class PublishAgencyListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 机关下部门列表信息 + */ + private List agencyDeptList; + /** + * 机关下网格列表信息 + */ + private List agencyGridList; + +} \ No newline at end of file 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 88df475dac..a780ef8896 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 @@ -1,23 +1,40 @@ package com.epmet.feign; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.feign.callback.GovOrgOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:37 + */ +// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = +// "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class) public interface GovOrgOpenFeignClient { /** * 根据Id查询agency + * * @param agencyId * @return */ @PostMapping("/gov/org/agency/agencybyid/{agencyId}") Result getAgencyById(@PathVariable("agencyId") String agencyId); + /** + * 根据staffId查询所属的组织机构 + * + * @param staffId + * @return + */ + @PostMapping("/gov/org/agency/agencybystaff/{staffId}") + Result getAgencyByStaff(@PathVariable("staffId") String staffId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/callback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java similarity index 60% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/callback/GovOrgOpenFeignClientFallback.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 03c5cf8712..262b037206 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/callback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -1,4 +1,4 @@ -package com.epmet.feign.callback; +package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; @@ -7,10 +7,21 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.feign.GovOrgOpenFeignClient; import org.springframework.stereotype.Component; +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:37 + */ @Component public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { @Override public Result getAgencyById(String agencyId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getAgencyById", agencyId); } + + @Override + public Result getAgencyByStaff(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaff", staffId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java index c4d48ee458..b1a42c4209 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java @@ -55,4 +55,16 @@ public interface CustomerAgencyConstant { * 调用epmet-user服务查询用户基础信息失败 */ String SELECT_USER_EXCEPTION = "获取用户基本信息失败"; + /** + * 获取组织人员关系表数据失败 + */ + String SELECT_AGENCY_STAFF_EXCEPTION = "获取机关下人员信息失败"; + /** + * 党建负责人角色 + */ + String PARTY_PRINCIPALS = "party_principals"; + /** + * 网格党建指导员角色 + */ + String GRID_PARTY_DIRECTOR = "grid_party_director"; } 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 2bc9b1e136..6177a24ce6 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 @@ -26,10 +26,7 @@ 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.CustomerAgencyDTO; -import com.epmet.dto.form.AgencyDeptGridFormDTO; -import com.epmet.dto.form.CanTickStaffListFormDTO; -import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.form.TransferOptionalStaffListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.excel.CustomerAgencyExcel; import com.epmet.service.CustomerAgencyService; @@ -163,4 +160,25 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.getProcessorList(agencyId)); } + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围 + **/ + @PostMapping("getagencygridlist/{staffId}") + public Result getAgencyGridList(@PathVariable("staffId") String staffId) { + return new Result().ok(customerAgencyService.getAgencyGridList(staffId)); + } + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 + **/ + @PostMapping("getpublishagencylist/{staffId}") + public Result getPublishAgencyList(@PathVariable("staffId") String staffId) { + return new Result().ok(customerAgencyService.getPublishAgencyList(staffId)); + } } \ No newline at end of file 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 ec559ccaa6..8a51d3ad19 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 @@ -116,4 +116,12 @@ public interface CustomerAgencyDao extends BaseDao { * @return java.lang.String */ String selectAgencyName(@Param("agencyId") String agencyId); + + /** + * @param subAgencyPids + * @return + * @Author sun + * @Description 递归查询当前机关的下一级机关列表 + **/ + List selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java index 13cb1da0ea..2debda4fce 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerDepartmentDTO; import com.epmet.dto.CustomerIdDTO; +import com.epmet.dto.result.AgencyDeptList; import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.dto.result.SubListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; @@ -75,4 +76,12 @@ public interface CustomerDepartmentDao extends BaseDao * @Description 批量查询部门信息 **/ List selectDeptListByIds(@Param("deptIdList") List deptIdList); + + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询机关下部门列表信息 + **/ + List selectAgencyDeptMsgList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 2256263cd0..86303b5b28 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -184,4 +184,20 @@ public interface CustomerGridDao extends BaseDao { * @date 2020.05.13 11:01 **/ CommonDataFilterResultDTO getGridDataFilterMsg(@Param("gridId")String gridId); + + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询组织下网格列表 + **/ + List selectAgencyGridList(@Param("agencyId") String agencyId); + + /** + * @param agencyId + * @return + * @Author sun + * @Description 查询机关下网格列表信息 + **/ + List selectAgencyGridMsgList(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 767b073359..7f980cb8c8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -72,4 +72,12 @@ public interface CustomerStaffAgencyDao extends BaseDao selectAgencyStaffList(@Param("agencyId") String agencyId); + + /** + * @param dto + * @return + * @Author sun + * @Description 根据staffId查询数据 + **/ + CustomerStaffAgencyDTO selectByStaffId(CustomerStaffAgencyDTO dto); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java index 2a160f8a90..54cad95662 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java @@ -90,4 +90,11 @@ public interface CustomerStaffGridDao extends BaseDao { * @Description 遍历查询每个部门下人员 */ List selectGridStaffs(@Param("gridIdList") List gridIdList); + + /** + * + * @Author sun + * @Description 查询人员在客户下参与的网格列表 + */ + List selectStaffGridList(CustomerStaffGridDTO staffGridDTO); } \ 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 e29bff8bf1..66586aeec4 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 @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.form.AgencyDeptGridFormDTO; -import com.epmet.dto.form.CanTickStaffListFormDTO; -import com.epmet.dto.form.StaffOrgFormDTO; -import com.epmet.dto.form.TransferOptionalStaffListFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; @@ -156,4 +153,20 @@ public interface CustomerAgencyService extends BaseService * @return java.lang.String */ String getAgencyName(String agencyId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围接口调用-根据人员角色查询对应的不同发布范围 + **/ + ArticleGridResultDTO getAgencyGridList(String staffId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 + **/ + PublishAgencyListResultDTO getPublishAgencyList(String staffId); } \ No newline at end of file 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 bf01b2e618..3a9e12778d 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 @@ -35,6 +35,8 @@ import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.EpmetUserSelfFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; @@ -75,6 +77,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -628,4 +632,180 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl> listResult = epmetUserOpenFeignClient.getCustomerStaffRoleList(formDTO); + if (null == listResult.getData() || listResult.getData().size() < NumConstant.ONE) { + return returnDTO; + } + List RoleList = listResult.getData(); + + //3:判断用户是否具有机关党建负责人或网格指导员角色 + //机关党建负责人角色 + boolean party = false; + //网格指导员角色 + boolean gridParty = false; + for (CustomerStaffRoleListResultDTO role : RoleList) { + if (CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())) { + party = true; + } + if (CustomerAgencyConstant.GRID_PARTY_DIRECTOR.equals(role.getRoleKey())) { + gridParty = true; + } + } + if (!party && !gridParty) { + return returnDTO; + } + + //4:根据不同角色查询不同数据 + CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId()); + if (party) { + //4.1:查询当前机关的网格列表以及所有下级机关的网格列表 + //当前机关信息 + returnDTO.setAgencyId(agencyEntity.getId()); + returnDTO.setAgencyName(agencyEntity.getOrganizationName()); + //当前机关下网格列表 + List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); + returnDTO.setGridList(gridList); + //递归查询当前组织的下级组织以及每个下级组织对应的网格列表 + List subAgencyGridList = getGridList(agencyEntity.getPids() + ":" + agencyEntity.getId()); + returnDTO.setSubAgencyGridList(subAgencyGridList); + } else if (gridParty) { + //4.2:查询人员在当前机关下参与的网格列表 + //查询当前组织下的网格列表 + List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); + //查询该工作人员在该客户下参与的网格列表 + CustomerStaffGridDTO staffGridDTO = new CustomerStaffGridDTO(); + staffGridDTO.setCustomerId(staffAgencyDTO.getCustomerId()); + staffGridDTO.setUserId(staffId); + List gridDTOList = customerStaffGridDao.selectStaffGridList(staffGridDTO); + //遍历取出该人员在该组织下参与的网格列表 + List resultList = gridList.stream().flatMap(agencyGrid -> gridDTOList.stream().filter(staffGrid -> + agencyGrid.getGridId().equals(staffGrid.getGridId())).map(grid -> { + AgencyGridListResultDTO resultDTO = ConvertUtils.sourceToTarget(agencyGrid, AgencyGridListResultDTO.class); + return resultDTO; + })).collect(Collectors.toList()); + + returnDTO.setGridList(resultList); + } + return returnDTO; + } + /** + * @Author sun + * @Description 递归查询当前机关的下一级机关列表 + **/ + private List getGridList(String subAgencyPids) { + List subAgencyList = baseDao.selectAllSubAgency(subAgencyPids); + if (subAgencyList.size() > NumConstant.ZERO) { + for (ArticleGridResultDTO sub : subAgencyList) { + List gridList = customerGridDao.selectAgencyGridList(sub.getAgencyId()); + sub.setGridList(gridList); + List subAgency = getGridList(sub.getPids() + ":" + sub.getAgencyId()); + sub.setSubAgencyGridList(subAgency); + } + } + return subAgencyList; + } + + /** + * @param staffId + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 + **/ + @Override + public PublishAgencyListResultDTO getPublishAgencyList(String staffId) { + PublishAgencyListResultDTO returnDTO = new PublishAgencyListResultDTO(); + //1:根据staffId查询该工作人员对应的机关Id、客户Id + CustomerStaffAgencyDTO staffAgencyDTO = new CustomerStaffAgencyDTO(); + staffAgencyDTO.setUserId(staffId); + staffAgencyDTO = customerStaffAgencyDao.selectByStaffId(staffAgencyDTO); + if (null == staffAgencyDTO.getId()) { + throw new RenException(CustomerAgencyConstant.SELECT_AGENCY_STAFF_EXCEPTION); + } + + //2:调用epmet-user服务,根据客户Id、staffId获取该人员在该客户下的角色列表 + CustomerStaffRoleListFormDTO formDTO = new CustomerStaffRoleListFormDTO(); + formDTO.setCustomerId(staffAgencyDTO.getCustomerId()); + formDTO.setStaffId(staffId); + Result> listResult = epmetUserOpenFeignClient.getCustomerStaffRoleList(formDTO); + if (null == listResult.getData() || listResult.getData().size() < NumConstant.ONE) { + return returnDTO; + } + List RoleList = listResult.getData(); + + //3:判断用户是否具有机关党建负责人或网格指导员角色 + //机关党建负责人角色 + boolean party = false; + //网格指导员角色 + boolean gridParty = false; + for (CustomerStaffRoleListResultDTO role : RoleList) { + if (CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())) { + party = true; + } + if (CustomerAgencyConstant.GRID_PARTY_DIRECTOR.equals(role.getRoleKey())) { + gridParty = true; + } + } + if (!party && !gridParty) { + return returnDTO; + } + + //4:根据不同角色查询不同数据 + CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId()); + if (party) { + //4.1:查询当前机关的网格列表以及所有下级机关的网格列表 + //当前机关信息 + returnDTO.setAgencyId(agencyEntity.getId()); + returnDTO.setAgencyName(agencyEntity.getOrganizationName()); + //当前机关下部门列表信息 + List agencyDeptList = customerDepartmentDao.selectAgencyDeptMsgList(agencyEntity.getId()); + returnDTO.setAgencyDeptList(agencyDeptList); + //当前机关下网格列表 + List agencyGridList = customerGridDao.selectAgencyGridMsgList(agencyEntity.getId()); + returnDTO.setAgencyGridList(agencyGridList); + } else if (gridParty) { + //4.2:查询人员在当前机关下参与的网格列表 + //查询当前组织下的网格列表 + List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); + //查询该工作人员在该客户下参与的网格列表 + CustomerStaffGridDTO staffGridDTO = new CustomerStaffGridDTO(); + staffGridDTO.setCustomerId(staffAgencyDTO.getCustomerId()); + staffGridDTO.setUserId(staffId); + List gridDTOList = customerStaffGridDao.selectStaffGridList(staffGridDTO); + //遍历取出该人员在该组织下参与的网格列表 + List resultList = gridList.stream().flatMap(agencyGrid -> gridDTOList.stream().filter(staffGrid -> + agencyGrid.getGridId().equals(staffGrid.getGridId())).map(grid -> { + AgencyGridList resultDTO = new AgencyGridList(); + resultDTO.setGridId(agencyGrid.getGridId()); + resultDTO.setAgencyGridName(agencyEntity.getOrganizationName() + "-" + agencyGrid.getGridName()); + return resultDTO; + })).collect(Collectors.toList()); + + returnDTO.setAgencyGridList(resultList); + } + + return returnDTO; + } + + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index e8a38d2af6..17f9f75731 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -20,17 +20,17 @@ 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dto.*; import com.epmet.dto.form.CommonDepartmentFormDTO; +import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CommonUserIdListFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; 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 6b7afa1455..61b9011343 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 @@ -156,4 +156,17 @@ WHERE a.ID = #{agencyId} + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index 47273d910c..a31747facc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -54,4 +54,21 @@ id = #{departmentId} + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index c82576b64b..11744f7f5a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -320,4 +320,30 @@ AND agency.DEL_FLAG = '0' AND grid.ID = #{gridId} + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index cd4f40f9fb..21d9cf139c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -105,4 +105,16 @@ AND agency_id =#{agencyId} + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index 1e6501c6bb..7f1a8d3220 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -77,6 +77,17 @@ + + insert into customer_staff_grid diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java new file mode 100644 index 0000000000..b2e6b7f32c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:32 + */ +@FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class) +public interface GovProjectOpenFeignClient { +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java new file mode 100644 index 0000000000..4b8c2cd82b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.GovProjectOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:33 + */ +@Component +public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignClient { +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/CommonFeignClient.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/CommonFeignClient.java deleted file mode 100644 index 10ed3733c3..0000000000 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/CommonFeignClient.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.epmet.feign; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.WorkDayFormDTO; -import com.epmet.dto.result.WorkDayResultDTO; -import com.epmet.feign.fallback.CommonFeignClientFallBack; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; - -/** - * @author zhaoqifeng - * @dscription - * @date 2020/5/12 15:48 - */ -@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = CommonFeignClientFallBack.class) -public interface CommonFeignClient { - @PostMapping("commonservice/workday/detentiondays") - Result> detentionDays(@RequestBody List formDTO); -} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/CommonFeignClientFallBack.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/CommonFeignClientFallBack.java deleted file mode 100644 index 0d7aa93769..0000000000 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/CommonFeignClientFallBack.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.epmet.feign.fallback; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.WorkDayFormDTO; -import com.epmet.dto.result.WorkDayResultDTO; -import com.epmet.feign.CommonFeignClient; -import org.springframework.stereotype.Component; - -import java.util.List; - -/** - * @author zhaoqifeng - * @dscription - * @date 2020/5/12 15:51 - */ -@Component -public class CommonFeignClientFallBack implements CommonFeignClient { - @Override - public Result> detentionDays(List formDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "detentionDays", formDTO); - } -} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index 8a9392db14..436610ef21 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -32,7 +32,6 @@ import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; import com.epmet.dao.ProjectProcessDao; import com.epmet.dao.ProjectStaffDao; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -41,7 +40,6 @@ import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectStaffEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.MessageFeignClient; import com.epmet.redis.ProjectProcessRedis; import com.epmet.service.ProjectProcessService; import com.epmet.service.ProjectService; @@ -52,7 +50,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; -import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 2b55312a72..29a964851f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -40,7 +40,7 @@ import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectRelatedPersonnelEntity; import com.epmet.entity.ProjectStaffEntity; -import com.epmet.feign.CommonFeignClient; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.MessageFeignClient; @@ -69,7 +69,7 @@ public class ProjectServiceImpl extends BaseServiceImpl> detentionDays = commonFeignClient.detentionDays(list); + Result> detentionDays = epmetCommonServiceOpenFeignClient.detentionDays(list); return detentionDays.getData().get(NumConstant.ZERO).getDetentionDays(); } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java new file mode 100644 index 0000000000..88aa05b3a8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java @@ -0,0 +1,106 @@ +/** + * 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 2020-06-02 + */ +@Data +public class ArticleContentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail;审核中:auditing + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 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/ArticleCoverDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleCoverDTO.java new file mode 100644 index 0000000000..ad9e063b58 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleCoverDTO.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 2020-06-02 + */ +@Data +public class ArticleCoverDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 封面图片地址 url地址 + */ + private String imgUrl; + + /** + * 审核状态 通过:pass;失败:fail;审核中:auditing + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 删除标识 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/ArticleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java new file mode 100644 index 0000000000..4c72866e27 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private String publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + + /** + * 删除标识 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/ArticleOperateRecordDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleOperateRecordDTO.java new file mode 100644 index 0000000000..2bc20ce5ae --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleOperateRecordDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleOperateRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 执行人 xx街道-xx中心-姓名 + */ + private String opUser; + + /** + * 操作内容 操作内容,eg:重新编辑文章; + */ + private String content; + + /** + * 操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange + */ + private String opType; + + /** + * 操作时间 + */ + private Date opTime; + + /** + * 删除标识 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/ArticlePublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.java new file mode 100644 index 0000000000..ace8e48edd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticlePublishRangeDTO.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 2020-06-02 + */ +@Data +public class ArticlePublishRangeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织-网格名称 + */ + private String agencyGridName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 + */ + private String publishStatus; + + /** + * 删除标识 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/ArticleTagsDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleTagsDTO.java new file mode 100644 index 0000000000..0db5cd3f30 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleTagsDTO.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 2020-06-02 + */ +@Data +public class ArticleTagsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 删除标识 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/ArticleVisitRecordDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleVisitRecordDTO.java new file mode 100644 index 0000000000..4ac7e6a720 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleVisitRecordDTO.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 2020-06-02 + */ +@Data +public class ArticleVisitRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 用户ID + */ + private String userId; + + /** + * 删除标识 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/DraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java new file mode 100644 index 0000000000..b0699b4c59 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java @@ -0,0 +1,106 @@ +/** + * 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 2020-06-02 + */ +@Data +public class DraftContentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 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/DraftCoverDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftCoverDTO.java new file mode 100644 index 0000000000..e3b5c98a04 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftCoverDTO.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 2020-06-02 + */ +@Data +public class DraftCoverDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 封面图片地址 url地址 + */ + private String imgUrl; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 删除标识 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/DraftDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java new file mode 100644 index 0000000000..c7a383a56d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private String publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 未发布:unpublish ;已发布:published,审核中:auditing + */ + private String statusFlag; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + + /** + * 删除标识 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/DraftPublishRangeDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.java new file mode 100644 index 0000000000..5bd39c480b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftPublishRangeDTO.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 2020-06-02 + */ +@Data +public class DraftPublishRangeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * ID草稿 + */ + private String draftId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织-网格名称 + */ + private String agencyGridName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 未发布:unpublish ;已发布:published + */ + private String publishStatus; + + /** + * 删除标识 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/TagCustomerDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java new file mode 100644 index 0000000000..33415b9d95 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagCustomerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + + /** + * 删除标识 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/TagDefaultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagDefaultDTO.java new file mode 100644 index 0000000000..5a0a6524a7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagDefaultDTO.java @@ -0,0 +1,76 @@ +/** + * 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 2020-06-02 + */ +@Data +public class TagDefaultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 删除标识 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/TagGridDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagGridDTO.java new file mode 100644 index 0000000000..d5a6ae2760 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagGridDTO.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 2020-06-02 + */ +@Data +public class TagGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + + /** + * 删除标识 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/form/ArticleOperationFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java new file mode 100644 index 0000000000..600a3913ad --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleOperationFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询文章操作记录 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 16:42 + */ +@Data +public class ArticleOperationFormDTO implements Serializable { + private static final long serialVersionUID = -6659391832410565077L; + + public interface AddUserInternalGroup {} + + /** + * 文章id + */ + @NotBlank(message = "文章id不能为空", groups = {ArticleOperationFormDTO.AddUserInternalGroup.class}) + private String articleId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java new file mode 100644 index 0000000000..f15a296854 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticlePageFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民端查看文章列表参数DTO + * @ClassName ArticlePageFormDTO + * @Auth wangc + * @Date 2020-06-03 14:21 + */ + +@Data +public class ArticlePageFormDTO implements Serializable { + private static final long serialVersionUID = -6201259689082896334L; + + public interface ArticlePageInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空" , groups = {ArticlePageInternalGroup.class}) + private String gridId; + + /** + * 标签Id集合 + * */ + private List tagIdList; + + /** + * 页码 + * */ + private Integer pageNo = 1; + + /** + * 每页显示量 + * */ + private Integer pageSize = 10; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java new file mode 100644 index 0000000000..5602cabf48 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民端首页轮播查询接口DTO + * @ClassName ArticleBannerFormDTO + * @Auth wangc + * @Date 2020-06-02 11:20 + */ +@Data +public class CommonArticleListFormDTO implements Serializable { + private static final long serialVersionUID = 5996259506950697451L; + + /** + * 内部错误分组 + * */ + public interface ArticleBannerInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空" , groups = {ArticleBannerInternalGroup.class}) + private String gridId; + + /** + * 客户定制化条数(高级配置里的参数) + * */ + private Integer num; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java new file mode 100644 index 0000000000..335c18afdd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CorrelationTagListFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/3 9:39 + */ +@Data +public class CorrelationTagListFormDTO implements Serializable { + + private static final long serialVersionUID = -1588825995685146967L; + + /** + * 标签id集合 + */ + private List tagIdList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java new file mode 100644 index 0000000000..761b844b0e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DeleteDraftFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 政府端工作人员,删除草稿入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 15:25 + */ +@Data +public class DeleteDraftFormDTO implements Serializable { + private static final long serialVersionUID = -2424432724401298206L; + + public interface AddUserInternalGroup {} + + /** + * 草稿id + */ + @NotBlank(message = "草稿id不能为空", groups = {AddUserInternalGroup.class}) + private String draftId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java new file mode 100644 index 0000000000..1a81faee29 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + + +/** + * 文章属性form + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftAttrFromDTO implements Serializable { + + + private static final long serialVersionUID = 6463906402283515172L; + /** + * 草稿ID + */ + @NotBlank(message = "草稿ID不能为空") + private String draftId; + + /** + * 封面图片地址 + */ + private String coverImg; + + /** + * 标签名称数组 + */ + private List tagNameList; + + /** + * 是否置顶 + */ + @NotNull(message = "是否置顶不能为空") + private Integer isTop; + + /** + * 网格Id数组 + */ + private List gridIdList; + + /** + * 发布单位Id 类型不同 id含义不同 + */ + private String publisher; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布日期 + */ + @NotBlank(message = "发布日期不能为空") + private String publishDate; + + /** + * 发布者类型 机关:agency;发布类型 部门:department;网格:grid + */ + private String publisherType; +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java new file mode 100644 index 0000000000..5d933697d7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + + +/** + * 保存文章内容form + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftContentFromDTO implements Serializable { + + + private static final long serialVersionUID = -4206020151361420221L; + + + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + @NotBlank(message = "文章标题不能为空") + private String title; + + /** + * 内容列表 + */ + private List contentList; + + @Data + public static class DraftContentDTO { + public DraftContentDTO() { + } + + /** + * 内容Id + */ + private String draftContentId; + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + } +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java new file mode 100644 index 0000000000..2fed15dcf8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 编辑草稿-获取草稿内容、属性统一入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 12:58 + */ +@Data +public class DraftDetailFormDTO implements Serializable { + private static final long serialVersionUID = 4492335656284426299L; + + public interface AddUserInternalGroup {} + + /** + * 草稿ID + */ + @NotBlank(message = "草稿id不能为空", groups = {DraftDetailFormDTO.AddUserInternalGroup.class}) + private String draftId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java new file mode 100644 index 0000000000..02dd80d4df --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/3 14:43 + */ +@Data +public class DraftListFormDTO implements Serializable { + private static final long serialVersionUID = 7957826609741967502L; + /** + * 页码 + */ + private Integer pageNo; + /** + * 每页显示数量 + */ + private Integer pageSize; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java new file mode 100644 index 0000000000..a2a629059e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GovArticleDetailFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 政府端:(已发布、已下线)文章详情 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 17:21 + */ +@Data +public class GovArticleDetailFormDTO implements Serializable { + private static final long serialVersionUID = 2149876964249893025L; + public interface AddUserInternalGroup {} + + /** + * 文章id + */ + @NotBlank(message = "文章id不能为空", groups = {GovArticleDetailFormDTO.AddUserInternalGroup.class}) + private String articleId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OffLineArticleFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OffLineArticleFormDTO.java new file mode 100644 index 0000000000..bda7f57c9f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OffLineArticleFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 党建声音-政府端-下线文章-接口入参 + * @Author sun + */ +@Data +public class OffLineArticleFormDTO implements Serializable { + private static final long serialVersionUID = 4859779755214502427L; + + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + @NotBlank(message = "文章Id不能为空", groups = { AddUserInternalGroup.class }) + private String articleId; + + @Size(min = 1, message = "项目人员关联Id不能为空", groups = {AddUserInternalGroup.class}) + private List gridIdList; + + private String staffId; +} + diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OfflineListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OfflineListFormDTO.java new file mode 100644 index 0000000000..fe005409d4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OfflineListFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/3 14:47 + */ +@Data +public class OfflineListFormDTO implements Serializable { + private static final long serialVersionUID = -5928134434874117068L; + /** + * 页码 + */ + private Integer pageNo; + /** + * 每页显示数量 + */ + private Integer pageSize; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java new file mode 100644 index 0000000000..3186b08037 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 党建声音-可下线网格列表-接口入参 + * + * @author sun + */ +@Data +public class PublishGridListFormDTO implements Serializable { + private static final long serialVersionUID = -6659391832410565077L; + + public interface AddUserInternalGroup {} + + /** + * 文章Id + */ + @NotBlank(message = "文章id不能为空", groups = {PublishGridListFormDTO.AddUserInternalGroup.class}) + private String articleId; + /** + * token中人员Id + */ + private String staffId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishedListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishedListFormDTO.java new file mode 100644 index 0000000000..a4a514c06f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishedListFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/2 14:09 + */ +@Data +public class PublishedListFormDTO implements Serializable { + + private static final long serialVersionUID = -8377558773628524229L; + /** + * 页码 + */ + private Integer pageNo; + /** + * 每页显示数量 + */ + private Integer pageSize; + /** + * 标签 + */ + private List tagIdList; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java new file mode 100644 index 0000000000..87de7f5045 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiArticleDetailFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 居民端查看文章详情传参DTO + * @ClassName ResiArticleDetailFormDTO + * @Auth wangc + * @Date 2020-06-04 09:20 + */ +@Data +public class ResiArticleDetailFormDTO implements Serializable { + private static final long serialVersionUID = -7197489284630455909L; + + public interface ResiArticleDetailInternalGroup{} + + /** + * 网格Id + * */ + @NotBlank(message = "网格Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String gridId; + + /** + * 文章Id + * */ + @NotBlank(message = "文章Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String articleId; + + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空",groups = ResiArticleDetailInternalGroup.class) + private String userId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDTO.java new file mode 100644 index 0000000000..f91cb8f355 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ResiTagListFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/2 15:50 + */ +@Data +public class ResiTagListFormDTO implements Serializable { + + private static final long serialVersionUID = 4337657473061285656L; + + public interface ResiTagListForm{} + public interface ResiTagListFormWeb extends CustomerClientShowGroup{} + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空",groups = {ResiTagListForm.class}) + private String gridId; + + /** + * 用户id + */ + @NotBlank(message = "客户id不能为空",groups = {ResiTagListForm.class}) + private String customerId; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCascadeListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCascadeListFormDTO.java new file mode 100644 index 0000000000..2c914dd6aa --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCascadeListFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/3 13:16 + */ +@Data +public class TagCascadeListFormDTO implements Serializable { + + private static final long serialVersionUID = -727325750715567406L; + + public interface TagCascadeList{} + public interface TagCascadeListWeb extends CustomerClientShowGroup {} + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空",groups = {TagCascadeList.class}) + private String gridId; + + /** + * 标签id集合 + */ + private List tagIdList; + + /** + * 客户id + */ + private String customerId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/.gitkeep b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java new file mode 100644 index 0000000000..c88dc10f22 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleBannerResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleBannerResultDTO + * @Auth wangc + * @Date 2020-06-02 13:55 + */ +@Data +public class ArticleBannerResultDTO implements Serializable { + private static final long serialVersionUID = 7764443348626371305L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 封面图url + * */ + private String coverImg; + + /** + * 标题 + * */ + private String title; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java new file mode 100644 index 0000000000..9b12f89213 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleContentResultDTO + * @Auth wangc + * @Date 2020-06-03 16:41 + */ +@Data +public class ArticleContentResultDTO implements Serializable { + private static final long serialVersionUID = 2853197212163051558L; + + /** + * 内容类型(图片:img;文字:text) + * */ + private String contentType; + + /** + * 内容 + * */ + private String content; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java new file mode 100644 index 0000000000..be9299e914 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleDetailResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ArticleDetailResultDTO + * @Auth wangc + * @Date 2020-06-03 16:36 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class ArticleDetailResultDTO implements Serializable { + private static final long serialVersionUID = 4659147595194692686L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 文章发布单位名称 + * */ + private String publishUnitDesc; + + /** + * 发布时间 + * */ + private String publishDate; + + /** + * 文章当前网格阅读量(article_visit_record统计数) + * */ + private Integer visitRecordCount; + + /** + * 标签名称集合(竖线分隔) + * */ + private String tags; + + /** + * 文章内容 + * */ + private List articleContentList; + + /** + * 客户Id + * */ + private String customerId; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java new file mode 100644 index 0000000000..ce5420f22e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleLatestResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleLatestResultDTO + * @Auth wangc + * @Date 2020-06-02 17:11 + */ +@Data +public class ArticleLatestResultDTO implements Serializable { + private static final long serialVersionUID = 6953266228209247094L; + + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章封面图片url + * */ + private String articleCoverImg; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 发布单位名称 + * */ + private String publishName; + + /** + * 发布时间(天级别) 时间戳 + * */ + private String publishDate; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java new file mode 100644 index 0000000000..04d4f14a27 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ArticleListResultDTO + * @Auth wangc + * @Date 2020-06-03 10:59 + */ +@Data +public class ArticleListResultDTO implements Serializable { + private static final long serialVersionUID = 293527138997974861L; + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 发布单位名称 + * */ + private String publishName; + + /** + * 发布时间(天级别) + * */ + private String publishDate; + + /** + * 文章发布内容(只截取前50字) + * */ + private String articleContent; + + /** + * 标签名称集合(竖线分隔) + * */ + private String tagName; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java new file mode 100644 index 0000000000..899c7273ec --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleOperationResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/2 16:44 + */ +@Data +public class ArticleOperationResultDTO implements Serializable { + private static final long serialVersionUID = -436748500797911121L; + private String id; + private String content; + private Long createdTime; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java new file mode 100644 index 0000000000..c614999e66 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CorrelationTagListResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/3 9:41 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class CorrelationTagListResultDTO implements Serializable { + + private static final long serialVersionUID = 5536953304816455733L; + + /** + * 标签id + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java new file mode 100644 index 0000000000..d0e8f0f393 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/CoverImgDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:选中草稿编辑,获取草稿属性-封面图片 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 14:26 + */ +@Data +public class CoverImgDTO implements Serializable { + private static final long serialVersionUID = -6735712590479867385L; + /** + * 封面Id + */ + private String coverId; + + /** + * 封面url + */ + private String url; + + /** + * 审核状态 + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java new file mode 100644 index 0000000000..3a4e3ab481 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftAttrResultDTO.java @@ -0,0 +1,79 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 政府端:选中草稿编辑,获取草稿属性 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 14:15 + */ +@Data +public class DraftAttrResultDTO implements Serializable { + private static final long serialVersionUID = 6999941497971286747L; + + /** + * 草稿Id + */ + private String draftId; + + /** + * 封面图片 + */ + private CoverImgDTO coverImg; + + /** + * 标签名称数组, 竖杠分割的标签名称 + */ + private String[] tagNameList; + + /** + * 是否置顶 1是;0 否 + */ + private Integer isTop; + + /** + * 网格Id数组 + */ + private List gridIdList; + + /** + * 发布单位Id + */ + private String publisher; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date publishDate; + + /** + * 标题 + */ + private String title; + + /** + * 发布范围拼接的字符串,顿号隔开 + */ + private String publishRangeDesc; + + /** + * 机关:agency;部门:department;网格:grid + */ + private String publisherType; + + @JsonIgnore + private String tags; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java new file mode 100644 index 0000000000..d468ffb81a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:选中草稿编辑,获取草稿内容返参明细 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 13:14 + */ +@Data +public class DraftContentDetailDTO implements Serializable { + private static final long serialVersionUID = -415892498226389295L; + /** + *内容Id + */ + private String id; + + /** + * 具体内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容序号 + */ + private Integer orderNum; + + /** + * 审核状态 通过:pass;失败:fail + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java new file mode 100644 index 0000000000..0394760301 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 政府端:选中草稿编辑,获取草稿内容返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 13:01 + */ +@Data +public class DraftContentResultDTO implements Serializable { + private static final long serialVersionUID = -1310987373261903935L; + /** + * + */ + private String draftId; + /** + * 标题 + */ + private String title; + /** + * 内容 + */ + private List contentList; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java new file mode 100644 index 0000000000..ccd0e9918e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 政府端:文章预览接口返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/5 10:56 + */ +@Data +public class DraftDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 6156947260878857897L; + /** + * 草稿Id + */ + private String draftId; + + /** + * 标题 + */ + private String title; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + private Date publishDate; + + /** + * 访问量 + */ + private Integer visitRecordCount; + + /** + * 标签字符串 已废弃 + */ + @JsonIgnore + private String tags; + + /** + * 内容列表 + */ + private List articleContentList; + + /** + * 标签名称数组 + */ + private String[] tagNameList; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java new file mode 100644 index 0000000000..4f41ee517c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/3 14:44 + */ +@NoArgsConstructor +@Data +public class DraftListResultDTO implements Serializable { + + private static final long serialVersionUID = -3596277149943610099L; + /** + * 文章ID + */ + private String draftId; + /** + * 文章标题 + */ + private String title; + /** + * 文章内容 + */ + private String content; + /** + * 创建时间 + */ + private Long createdTime; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java new file mode 100644 index 0000000000..dbb98d9d3d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:(已发布、已下线)文章内容详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 9:39 + */ +@Data +public class GovArticleContentDTO implements Serializable { + private static final long serialVersionUID = 1519014754254863006L; + /** + * 内容类型,图片:img;文字:text + */ + private String contentType; + + /** + * 内容 + */ + private String content; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java new file mode 100644 index 0000000000..51ed6bc69b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 政府端:(已发布、已下线)文章详情 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/3 9:29 + */ +@Data +public class GovArticleDetailResultDTO implements Serializable { + private static final long serialVersionUID = -8328304788721564622L; + /** + * 文章id + */ + private String articleId; + + /** + * 标题 + */ + private String title; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布日期 + */ + @JsonFormat(pattern="yyyy-MM-dd") + private Date publishDate; + + /** + * 访问量 + */ + private Integer visitRecordCount; + + /** + * 发布范围字符串 + */ + private String publishRangeDesc; + + /** + * 标签字符串 + */ + private String tags; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 草稿Id,重新编辑时使用 + */ + private String draftId; + + /** + * 内容列表 + */ + private List articleContentList; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java new file mode 100644 index 0000000000..1b0530e3e4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:文章预览接口返参DTO-内容列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/5 12:10 + */ +@Data +public class GovDraftContentDTO implements Serializable { + private static final long serialVersionUID = 5653062658148122552L; + + /** + * 内容类型,图片:img;文字:text + */ + private String contentType; + + /** + * 内容 + */ + private String content; + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java new file mode 100644 index 0000000000..e277f6cd7a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/OfflineListResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/3 14:48 + */ +@NoArgsConstructor +@Data +public class OfflineListResultDTO implements Serializable { + + private static final long serialVersionUID = -5817451219557672084L; + /** + * 文章ID + */ + private String articleId; + /** + * 文章标题 + */ + private String title; + /** + * 发布单位 + */ + private String publisherName; + /** + * 发布时间 + */ + private String publishDate; + /** + * 概要内容 + */ + private String previewContent; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java new file mode 100644 index 0000000000..4241ebac0c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/2 14:12 + */ +@NoArgsConstructor +@Data +public class PublishedListResultDTO implements Serializable { + + private static final long serialVersionUID = -8525181219822398750L; + /** + * 文章ID + */ + private String articleId; + /** + * 文章标题 + */ + private String title; + /** + * 发布单位 + */ + private String publisherName; + /** + * 发布时间 + */ + private String publishDate; + /** + * 文章标签串 + */ + private String tags; + /** + * 概要内容 + */ + private String previewContent; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java new file mode 100644 index 0000000000..a547af8767 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagInfoResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/2 9:47 + */ +@JsonIgnoreProperties(ignoreUnknown = true) +@Data +public class TagInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 4366515668545958124L; + + /** + * 标签id + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagRankResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagRankResultDTO.java new file mode 100644 index 0000000000..5763ecddbd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/TagRankResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/3 19:38 + */ +@Data +public class TagRankResultDTO implements Serializable { + + private static final long serialVersionUID = 4107657623174653243L; + + /** + * zSet排序 + */ + private Double score; + + /** + * 标签Id + */ + private String tagId; + + /** + * 标签名字 + */ + private String tagName; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java new file mode 100644 index 0000000000..3bbc14112f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/GovVoiceOpenFeignClient.java @@ -0,0 +1,84 @@ +package com.epmet.feign; + + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.fallback.GovVoiceOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 16:01 + */ +@FeignClient(name = ServiceConstant.GOV_VOICE_SERVER, fallback = GovVoiceOpenFeignClientFallback.class) +public interface GovVoiceOpenFeignClient { + + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("/gov/voice/tag/resitaglist") + Result> resiTagList(@RequestBody ResiTagListFormDTO formDto); + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("/gov/voice/tag/tagcascadelist") + Result> tagCascadeList(@RequestBody TagCascadeListFormDTO formDto); + + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("/gov/voice/article/resitoparticlelist") + Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO); + + + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("/gov/voice/article/resilatestarticlelist") + Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO); + + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("/gov/voice/article/resiarticlelist") + Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO); + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("/gov/voice/article/resiarticledetail") + Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO); + + +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/fallback/GovVoiceOpenFeignClientFallback.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/fallback/GovVoiceOpenFeignClientFallback.java new file mode 100644 index 0000000000..9ed332730a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/feign/fallback/GovVoiceOpenFeignClientFallback.java @@ -0,0 +1,50 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.GovVoiceOpenFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 16:01 + */ +@Component +public class GovVoiceOpenFeignClientFallback implements GovVoiceOpenFeignClient { + @Override + public Result> resiTagList(ResiTagListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTagList", formDto); + } + + @Override + public Result> tagCascadeList(TagCascadeListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "tagCascadeList", formDto); + } + + @Override + public Result> resiTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiTopArticleList", commonArticleListFormDTO); + } + + @Override + public Result> resiLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiLatestArticleList", commonArticleListFormDTO); + } + + @Override + public Result> resiArticleList(ArticlePageFormDTO articlePageFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiArticleList", articlePageFormDTO); + } + + @Override + public Result resiArticleDetail(ResiArticleDetailFormDTO articleDetailFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_VOICE_SERVER, "resiArticleDetail", articleDetailFormDTO); + } +} diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index aee9221446..3213128ee2 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -19,6 +19,16 @@ gov-voice-client 2.0.0 + + com.epmet + epmet-user-client + 2.0.0 + + + com.epmet + resi-voice-client + 2.0.0 + com.epmet epmet-commons-tools @@ -55,6 +65,18 @@ feign-httpclient 10.3.0 + + com.epmet + gov-org-client + 2.0.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java new file mode 100644 index 0000000000..d2e2edecfb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 常量 + * @author sun + * @since 1.0.0 + */ +public interface ArticleConstant { + + /** + * 发布状态-已发布 + */ + String PUBLISHED = "published"; + /** + * 发布状态-已下线 + */ + String OFFLINE = "offline"; + /** + * 文章发布范围内已全部下线,不能再调用此接口 + */ + String RANGE_DATA_EXCEPTION = "发布范围内无可下线文章"; + /** + * 调用epmet-user服务。查询工作人员基本信息失败 + */ + String SELECT_STAFF_EXCEPTION = "获取用户基本信息失败"; + /** + * 调用gov-org服务。查询工作人员组织信息失败 + */ + String SELECT_AGRNCY_EXCEPTION = "获取用户组织信息失败"; + /** + * 下线文章操作记录表文案 + */ + String OFF_LINE_ARTICLE_MSG = "%s-%s下线文章【%s】"; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java new file mode 100644 index 0000000000..26bbba7918 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 常量 + * + * @author sun + * @since 1.0.0 + */ +public interface DraftConstant { + // 发布状态 + /** + * 未发布:unpublish + */ + String UNPUBLISH = "unpublish"; + + /** + * 已发布:published + */ + String PUBLISHED = "published"; + + /** + * 审核中:auditing + */ + String AUDITING = "auditing"; + + //是否置顶 + /** + * 置顶:1 + */ + Integer TOP = 1; + + /** + * 不置顶:0 + */ + Integer UN_TOP = 0; +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java new file mode 100644 index 0000000000..15c6267b3a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 常量 + * @author sun + * @since 1.0.0 + */ +public interface TagConstant { + + /** + * 客户维度(政府端) 热度标签 key的前缀 【zset】 + */ + String GOV_TAG_KEY = "epmet:customer:articletag:"; + + /** + * 客户维度(政府端) 关联标签 key的前缀 【set】 + */ + String GOV_RETAG_KEY = "epmet:customer:article:retag:"; + + /** + * 网格热度标签 key的前缀 【zset】 + */ + String GRID_TAG_KEY = "epmet:grid:articletag:"; + + /** + * 政府——关联标签 key的前缀 【set】 + */ + String GRID_RETAG_KEY ="epmet:grid:article:retag:"; + + /** + * 冒号 + */ + String COLON = ":"; + + + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleContentController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleContentController.java new file mode 100644 index 0000000000..4edca1a60d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleContentController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleContentDTO; +import com.epmet.excel.ArticleContentExcel; +import com.epmet.service.ArticleContentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articlecontent") +public class ArticleContentController { + + @Autowired + private ArticleContentService articleContentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleContentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleContentDTO data = articleContentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleContentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleContentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleContentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleContentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleContentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleContentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleContentExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java new file mode 100644 index 0000000000..5cfa184a1e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -0,0 +1,365 @@ +/** + * 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.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.ArticleDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.excel.ArticleExcel; +import com.epmet.service.ArticleOperateRecordService; +import com.epmet.service.ArticleService; +import com.epmet.service.DraftService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("article") +public class ArticleController { + + @Autowired + private ArticleService articleService; + @Autowired + private ArticleOperateRecordService articleOperateRecordService; + @Autowired + private DraftService draftService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleDTO data = articleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleExcel.class); + } + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @PostMapping("agencygridlist") + public Result agencyGridList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(articleService.agencyGridList(tokenDTO)); + } + + /** + * desc:保存或修改草稿内容 + * @param fromDTO + * @throws Exception + */ + @GetMapping("savecontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { + String draftId = articleService.saveOrUpdateContent(tokenDto, fromDTO); + return new Result().ok(draftId); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei@elink-cn.com + * @description 政府端:查询文章操作记录 + * @date 2020/6/2 16:50 + **/ + @PostMapping("oprationlist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OPERATION_LIST) + public Result> operationList(@RequestBody ArticleOperationFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); + List list = + articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId()); + return new Result>().ok(list); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:(已发布、已下线)文章详情 + * @date 2020/6/3 9:44 + **/ + @PostMapping("articledetail") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DETAIL) + public Result articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); + return new Result().ok(articleDetail); + } + + /** + * @param formDTO 草稿id + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:选中草稿编辑,获取草稿内容 + * @date 2020/6/3 13:18 + **/ + @PostMapping("getcontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) + public Result getContent(@RequestBody DraftDetailFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftContentResultDTO draftContent=draftService.queryDraftContent(formDTO); + return new Result().ok(draftContent); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:选中草稿编辑,获取草稿属性 + * @date 2020/6/3 13:51 + **/ + @PostMapping("getattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) + public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftAttrResultDTO draftAttrResultDTO=draftService.getDraftAttr(formDTO); + return new Result().ok(draftAttrResultDTO); + } + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位 + **/ + @PostMapping("publishagencylist") + public Result publishAgencyList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(articleService.publishAgencyList(tokenDTO)); + } + + /** + * @param tokenDTO formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-下线文章 + **/ + @PostMapping("offlinearticle") + public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class); + articleService.offLineArticle(formDTO); + return new Result(); + } + + /** + * desc:保存草稿属性 + * @param fromDTO + * @throws Exception + */ + @GetMapping("saveattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result saveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { + ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); + Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO); + if (isSuccess){ + //TODO 异步校验内容 + } + return new Result().ok(isSuccess); + } + + /** + * desc:预览保存草稿属性 + * @param fromDTO + * @throws Exception + */ + @GetMapping("previewsaveattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result previewSaveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { + ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); + Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO); + return new Result().ok(isSuccess); + } + + /** + * desc:发布文章 + * @param draftId + * @throws Exception + */ + @GetMapping("publish") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result publishArticle(@LoginUser TokenDto tokenDto, String draftId) throws Exception { + Boolean isSuccess = articleService.publish(tokenDto, draftId); + return new Result().ok(isSuccess); + } + + + /** + * 已发布文章列表 + * @author zhaoqifeng + * @date 2020/6/3 16:19 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("publishedarticlelist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result publishedArticleList(@LoginUser TokenDto tokenDto, @RequestBody PublishedListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(articleService.publishedArticleList(tokenDto, formDTO)); + } + + + /** + * 已下线文章列表 + * @author zhaoqifeng + * @date 2020/6/3 16:19 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("offlinearticlelist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE_LIST) + public Result offLineList(@LoginUser TokenDto tokenDto, @RequestBody OfflineListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(articleService.offlineList(tokenDto, formDTO)); + } + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("resitoparticlelist") + public Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return new Result>().ok(articleService.getTopArticleList(commonArticleListFormDTO)); + } + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("resilatestarticlelist") + public Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return new Result>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); + } + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("resiarticlelist") + public Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ + ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); + return new Result>().ok(articleService.getArticleList(articlePageFormDTO)); + } + + /** + * @param tokenDTO formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可下线网格列表 + **/ + @PostMapping("publishgridlist") + public Result publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class); + return new Result().ok(articleService.publishGridList(formDTO)); + } + + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("resiarticledetail") + public Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO){ + ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); + return new Result().ok(articleService.getArticleDetail(articleDetailFormDTO)); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:文章预览 + * @date 2020/6/5 10:56 + **/ + @PostMapping("draftdetail") + public Result queryDraftDetail(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); + return new Result().ok(draftDetailResultDTO); + } +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleCoverController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleCoverController.java new file mode 100644 index 0000000000..5f84494bab --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleCoverController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleCoverDTO; +import com.epmet.excel.ArticleCoverExcel; +import com.epmet.service.ArticleCoverService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articlecover") +public class ArticleCoverController { + + @Autowired + private ArticleCoverService articleCoverService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleCoverService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleCoverDTO data = articleCoverService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleCoverDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleCoverService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleCoverDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleCoverService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleCoverService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleCoverService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleCoverExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleOperateRecordController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleOperateRecordController.java new file mode 100644 index 0000000000..3fd7dbfeeb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleOperateRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.excel.ArticleOperateRecordExcel; +import com.epmet.service.ArticleOperateRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articleoperaterecord") +public class ArticleOperateRecordController { + + @Autowired + private ArticleOperateRecordService articleOperateRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleOperateRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleOperateRecordDTO data = articleOperateRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleOperateRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleOperateRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleOperateRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleOperateRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleOperateRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleOperateRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleOperateRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticlePublishRangeController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticlePublishRangeController.java new file mode 100644 index 0000000000..e075ec871a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticlePublishRangeController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticlePublishRangeDTO; +import com.epmet.excel.ArticlePublishRangeExcel; +import com.epmet.service.ArticlePublishRangeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articlepublishrange") +public class ArticlePublishRangeController { + + @Autowired + private ArticlePublishRangeService articlePublishRangeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articlePublishRangeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticlePublishRangeDTO data = articlePublishRangeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticlePublishRangeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articlePublishRangeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticlePublishRangeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articlePublishRangeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articlePublishRangeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articlePublishRangeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticlePublishRangeExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleTagsController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleTagsController.java new file mode 100644 index 0000000000..deccf70345 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleTagsController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleTagsDTO; +import com.epmet.excel.ArticleTagsExcel; +import com.epmet.service.ArticleTagsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articletags") +public class ArticleTagsController { + + @Autowired + private ArticleTagsService articleTagsService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleTagsService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleTagsDTO data = articleTagsService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleTagsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleTagsService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleTagsDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleTagsService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleTagsService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleTagsService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleTagsExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleVisitRecordController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleVisitRecordController.java new file mode 100644 index 0000000000..8d3bfa3859 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleVisitRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ArticleVisitRecordDTO; +import com.epmet.excel.ArticleVisitRecordExcel; +import com.epmet.service.ArticleVisitRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("articlevisitrecord") +public class ArticleVisitRecordController { + + @Autowired + private ArticleVisitRecordService articleVisitRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = articleVisitRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ArticleVisitRecordDTO data = articleVisitRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ArticleVisitRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + articleVisitRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ArticleVisitRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + articleVisitRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + articleVisitRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = articleVisitRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ArticleVisitRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java new file mode 100644 index 0000000000..82243e0e48 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftContentController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.DraftContentDTO; +import com.epmet.excel.DraftContentExcel; +import com.epmet.service.DraftContentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("draftcontent") +public class DraftContentController { + + @Autowired + private DraftContentService draftContentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = draftContentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DraftContentDTO data = draftContentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DraftContentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + draftContentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DraftContentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + draftContentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + draftContentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = draftContentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DraftContentExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java new file mode 100644 index 0000000000..bdbf8fd8d5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -0,0 +1,121 @@ +/** + * 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.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftListFormDTO; +import com.epmet.excel.DraftExcel; +import com.epmet.service.DraftService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("draft") +public class DraftController { + + @Autowired + private DraftService draftService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = draftService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DraftDTO data = draftService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DraftDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + draftService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DraftDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + draftService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + draftService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = draftService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DraftExcel.class); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:工作人员,删除草稿 + * @date 2020/6/2 16:00 + **/ + @PostMapping("deletedraft") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_DELETE) + public Result deleteDraft(@RequestBody DeleteDraftFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, DeleteDraftFormDTO.AddUserInternalGroup.class); + draftService.deleteDraft(formDTO); + return new Result(); + } + + @PostMapping("draftlist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_LIST) + public Result draftList(@LoginUser TokenDto tokenDto, DraftListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(draftService.draftList(tokenDto, formDTO)); + } +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftCoverController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftCoverController.java new file mode 100644 index 0000000000..e4606661bb --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftCoverController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.DraftCoverDTO; +import com.epmet.excel.DraftCoverExcel; +import com.epmet.service.DraftCoverService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("draftcover") +public class DraftCoverController { + + @Autowired + private DraftCoverService draftCoverService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = draftCoverService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DraftCoverDTO data = draftCoverService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DraftCoverDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + draftCoverService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DraftCoverDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + draftCoverService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + draftCoverService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = draftCoverService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DraftCoverExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftPublishRangeController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftPublishRangeController.java new file mode 100644 index 0000000000..a17d349e66 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftPublishRangeController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.DraftPublishRangeDTO; +import com.epmet.excel.DraftPublishRangeExcel; +import com.epmet.service.DraftPublishRangeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("draftpublishrange") +public class DraftPublishRangeController { + + @Autowired + private DraftPublishRangeService draftPublishRangeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = draftPublishRangeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DraftPublishRangeDTO data = draftPublishRangeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DraftPublishRangeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + draftPublishRangeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DraftPublishRangeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + draftPublishRangeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + draftPublishRangeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = draftPublishRangeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DraftPublishRangeExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java new file mode 100644 index 0000000000..5dbec6fa20 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -0,0 +1,75 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; +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.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.service.TagService; +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; + +@RestController +@RequestMapping("tag") +public class TagController { + + @Autowired + private TagService tagService; + + /** + * @Description 已发布列表页的标签——政府端 + * @param tokenDto + * @author zxc + */ + @PostMapping("taglist") +// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result> tagList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(tagService.tagList(tokenDto)); + } + + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("resitaglist") + public Result> resiTagList(@RequestBody ResiTagListFormDTO formDto){ + ValidatorUtils.validateEntity(formDto, ResiTagListFormDTO.ResiTagListForm.class); + return new Result>().ok(tagService.resiTagList(formDto)); + } + + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param tokenDto + * @param formDto + * @author zxc + */ + @PostMapping("correlationtaglist") +// @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result> correlationTagList(@LoginUser TokenDto tokenDto, @RequestBody CorrelationTagListFormDTO formDto){ + ValidatorUtils.validateEntity(formDto); + return new Result>().ok(tagService.correlationTagList(tokenDto,formDto)); + } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("tagcascadelist") + public Result> tagCascadeList(@RequestBody TagCascadeListFormDTO formDto){ + return new Result>().ok(tagService.tagCascadeList(formDto)); + } + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagCustomerController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagCustomerController.java new file mode 100644 index 0000000000..9e358543c1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagCustomerController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.excel.TagCustomerExcel; +import com.epmet.service.TagCustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("tagcustomer") +public class TagCustomerController { + + @Autowired + private TagCustomerService tagCustomerService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = tagCustomerService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TagCustomerDTO data = tagCustomerService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TagCustomerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + tagCustomerService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TagCustomerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + tagCustomerService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + tagCustomerService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = tagCustomerService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TagCustomerExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagDefaultController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagDefaultController.java new file mode 100644 index 0000000000..4983388eea --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagDefaultController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.TagDefaultDTO; +import com.epmet.excel.TagDefaultExcel; +import com.epmet.service.TagDefaultService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("tagdefault") +public class TagDefaultController { + + @Autowired + private TagDefaultService tagDefaultService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = tagDefaultService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TagDefaultDTO data = tagDefaultService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TagDefaultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + tagDefaultService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TagDefaultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + tagDefaultService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + tagDefaultService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = tagDefaultService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TagDefaultExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagGridController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagGridController.java new file mode 100644 index 0000000000..eb51f03d87 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagGridController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.TagGridDTO; +import com.epmet.excel.TagGridExcel; +import com.epmet.service.TagGridService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("taggrid") +public class TagGridController { + + @Autowired + private TagGridService tagGridService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = tagGridService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TagGridDTO data = tagGridService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TagGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + tagGridService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TagGridDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + tagGridService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + tagGridService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = tagGridService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TagGridExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.java new file mode 100644 index 0000000000..44d12946d9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleContentDao.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.ArticleContentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleContentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleCoverDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleCoverDao.java new file mode 100644 index 0000000000..cd087445ae --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleCoverDao.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.ArticleCoverEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleCoverDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java new file mode 100644 index 0000000000..9946d010b2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java @@ -0,0 +1,137 @@ +/** + * 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.annotation.DataFilter; +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.*; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.result.GovArticleContentDTO; +import com.epmet.dto.result.GovArticleDetailResultDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleDetailResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; +import com.epmet.entity.ArticleEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Set; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleDao extends BaseDao { + + /** + * 政府端查询文章详情 + * + * @param articleId + * 文章id + */ + GovArticleDetailResultDTO queryGovArticleDetail(String articleId); + + /** + * 政府端查询文章详情-内容 + * + * @param articleId + * 文章id + */ + List queryGovArticleContent(String articleId); + + /** + * @Description + * @param formDto + * @author zxc + */ + Integer checkPublishArticle(ResiTagListFormDTO formDto); + + /** + * 已发布列表---组织工作人员 + * @author zhaoqifeng + * @date 2020/6/2 16:59 + * @param customerId + * @return java.util.List + */ + @DataFilter(tableAliases = "a") + List selectArticleListForAgency(@Param("customerId") String customerId); + + /** + * 已发布列表---网格工作人员 + * @author zhaoqifeng + * @date 2020/6/2 16:59 + * @param customerId + * @param gridList + * @return java.util.List + */ + @DataFilter(tableAliases = {"a", "apr"}, gridIdArgName = "gridList") + List selectArticleListForGrid(@Param("customerId") String customerId, Set gridList); + + /** + * 已下线文章列表 + * @author zhaoqifeng + * @date 2020/6/3 15:16 + * @param gridList + * @return java.util.List + */ + @DataFilter(tableAliases = "a", gridIdArgName = "gridList") + List selectOfflineList(Set gridList); + + + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param gridId + * @param num + * @return List + * @author wangc + * @date 2020.06.02 16:04 + **/ + List selectTopArticleMsg (@Param("gridId")String gridId,@Param("num")Integer num); + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端最新文章列表 + * @param gridId + * @param num + * @return List + * @author wangc + * @date 2020.06.02 16:04 + **/ + List selectLatestArticleMsg(@Param("gridId")String gridId,@Param("num")Integer num); + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param gridId + * @param tagIdList + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + List selectArticleList(@Param("gridId") String gridId, @Param("tagIdList")List tagIdList); + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param gridId + * @param articleId + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + ArticleDetailResultDTO selectArticleDetail(@Param("gridId")String gridId,@Param("articleId")String articleId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java new file mode 100644 index 0000000000..f186193252 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleOperateRecordDao.java @@ -0,0 +1,42 @@ +/** + * 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.result.ArticleOperationResultDTO; +import com.epmet.entity.ArticleOperateRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleOperateRecordDao extends BaseDao { + + /** + * 根据文章id查询操作记录 + * + * @param articleId + */ + List selectListByArticleId(String articleId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java new file mode 100644 index 0000000000..9b3ef332aa --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ArticlePublishRangeDTO; +import com.epmet.entity.ArticlePublishRangeEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticlePublishRangeDao extends BaseDao { + + /** + * @param rangeEntity + * @return + * @Author sun + * @Description 根据文章Id查询发布范围数据 + **/ + List selectByArticleId(ArticlePublishRangeEntity rangeEntity); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleTagsDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleTagsDao.java new file mode 100644 index 0000000000..44852adba8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleTagsDao.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.ArticleTagsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleTagsDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleVisitRecordDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleVisitRecordDao.java new file mode 100644 index 0000000000..7c89f6ef0b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleVisitRecordDao.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.ArticleVisitRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface ArticleVisitRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java new file mode 100644 index 0000000000..3c7af386a0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.java @@ -0,0 +1,46 @@ +/** + * 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.DraftContentDTO; +import com.epmet.entity.DraftContentEntity; +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 2020-06-02 + */ +@Mapper +public interface DraftContentDao extends BaseDao { + + /** + * @Description 通过草稿Id获取草稿内容并按照orderNum排序,默认拿取所有状态 + * @param draftId + * @param auditStatus + * @return List + * @author wangc + * @date 2020.06.05 10:28 + **/ + List selectByDraftId(@Param("draftId")String draftId,@Param("auditStatus")String auditStatus); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java new file mode 100644 index 0000000000..bcf58361e1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java @@ -0,0 +1,46 @@ +/** + * 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.DraftCoverDTO; +import com.epmet.entity.DraftCoverEntity; +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 2020-06-02 + */ +@Mapper +public interface DraftCoverDao extends BaseDao { + + /** + * @Description 通过草稿Id获取草稿封面且创建时间是为最新的 + * @param draftId + * @param auditStatus + * @return DraftCoverDTO + * @author wangc + * @date 2020.06.05 10:28 + **/ + DraftCoverDTO selectByDraftId(@Param("draftId")String draftId,@Param("auditStatus")String auditStatus); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java new file mode 100644 index 0000000000..39b47a54f9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.*; +import com.epmet.entity.DraftEntity; +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 2020-06-02 + */ +@Mapper +public interface DraftDao extends BaseDao { + /** + * 政府端查询草稿内容详情 + * + * @param draftId 草稿id + * @author yinzuomei + */ + DraftContentResultDTO selectDraftContent(String draftId); + + /** + * 政府端查询草稿内容详情 + * + * @param draftId 草稿id + * @author yinzuomei + */ + List selectDraftContentDetail(String draftId); + + /** + * 政府端:选中草稿编辑,获取草稿属性 + * + * @param draftId 草稿id + * @author yinzuomei + */ + DraftAttrResultDTO selectDraftAttr(String draftId); + + /** + * 政府端:选中草稿编辑,获取草稿属性-封面信息 + * + * @param draftId 草稿id + * @author yinzuomei + */ + CoverImgDTO selectDraftCoverImg(String draftId); + + /** + * 政府端:选中草稿编辑,获取草稿属性-已选择发布网格 + * + * @param draftId 草稿id + * @author yinzuomei + */ + List selectDraftGrids(String draftId); + + /** + * 草稿列表 + * @author zhaoqifeng + * @date 2020/6/3 14:54 + * @param userId + * @return java.util.List + */ + List selectDraftList(@Param("userId") String userId); + + /** + * @param draftId + * @return com.epmet.dto.result.DraftDetailResultDTO + * @author yinzuomei@elink-cn.com + * @description 文章预览-获取文章基本属性 + * @date 2020/6/5 12:23 + **/ + DraftDetailResultDTO selectDraftDetail(String draftId); + + /** + * @param draftId + * @return java.util.List + * @author yinzuomei@elink-cn.com + * @description 文章预览-获取文章内容列表 + * @date 2020/6/5 12:23 + **/ + List selectDraftContentList(String draftId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java new file mode 100644 index 0000000000..b3da6a7c4e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.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.DraftPublishRangeDTO; +import com.epmet.entity.DraftPublishRangeEntity; +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 2020-06-02 + */ +@Mapper +public interface DraftPublishRangeDao extends BaseDao { + + /** + * @Description 通过草稿Id获取草稿发布范围 + * @param draftId + * @return List + * @author wangc + * @date 2020.06.05 10:28 + **/ + List selectByDraftId(@Param("draftId")String draftId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java new file mode 100644 index 0000000000..af76d0fdad --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.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.TagCustomerEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface TagCustomerDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagDefaultDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagDefaultDao.java new file mode 100644 index 0000000000..4de3aae4bf --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagDefaultDao.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.TagDefaultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface TagDefaultDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagGridDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagGridDao.java new file mode 100644 index 0000000000..ac6dbaf6fe --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagGridDao.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.TagGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Mapper +public interface TagGridDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java new file mode 100644 index 0000000000..f4a961b974 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java @@ -0,0 +1,76 @@ +/** + * 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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_content") +public class ArticleContentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail;审核中:auditing + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleCoverEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleCoverEntity.java new file mode 100644 index 0000000000..9e7d6c8751 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleCoverEntity.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_cover") +public class ArticleCoverEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 封面图片地址 url地址 + */ + private String imgUrl; + + /** + * 审核状态 通过:pass;失败:fail;审核中:auditing + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java new file mode 100644 index 0000000000..eb2b026fb7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article") +public class ArticleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private String publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleOperateRecordEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleOperateRecordEntity.java new file mode 100644 index 0000000000..bae61d92f1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleOperateRecordEntity.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.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_operate_record") +public class ArticleOperateRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 执行人 xx街道-xx中心-姓名 + */ + private String opUser; + + /** + * 操作内容 操作内容,eg:重新编辑文章; + */ + private String content; + + /** + * 操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange + */ + private String opType; + + /** + * 操作时间 + */ + private Date opTime; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java new file mode 100644 index 0000000000..1328aa6f1e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticlePublishRangeEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_publish_range") +public class ArticlePublishRangeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织-网格名称 + */ + private String agencyGridName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 + */ + private String publishStatus; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleTagsEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleTagsEntity.java new file mode 100644 index 0000000000..af09af33fd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleTagsEntity.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_tags") +public class ArticleTagsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleVisitRecordEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleVisitRecordEntity.java new file mode 100644 index 0000000000..6805243128 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleVisitRecordEntity.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_visit_record") +public class ArticleVisitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 用户ID + */ + private String userId; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java new file mode 100644 index 0000000000..a5ab64db0e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java @@ -0,0 +1,76 @@ +/** + * 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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("draft_content") +public class DraftContentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftCoverEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftCoverEntity.java new file mode 100644 index 0000000000..b7cd32ccd3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftCoverEntity.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("draft_cover") +public class DraftCoverEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 封面图片地址 url地址 + */ + private String imgUrl; + + /** + * 审核状态 通过:pass;失败:fail; + */ + private String auditStatus; + + /** + * 审核理由 + */ + private String auditReason; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java new file mode 100644 index 0000000000..b3c7fd96b6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java @@ -0,0 +1,116 @@ +/** + * 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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("draft") +public class DraftEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private String publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 未发布:unpublish ;已发布:published,审核中:auditing + */ + private String statusFlag; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java new file mode 100644 index 0000000000..861b80c239 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftPublishRangeEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("draft_publish_range") +public class DraftPublishRangeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * ID草稿 + */ + private String draftId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织-网格名称 + */ + private String agencyGridName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 未发布:unpublish ;已发布:published + */ + private String publishStatus; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.java new file mode 100644 index 0000000000..878b9e05e5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagCustomerEntity.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.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("tag_customer") +public class TagCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagDefaultEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagDefaultEntity.java new file mode 100644 index 0000000000..479d068761 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagDefaultEntity.java @@ -0,0 +1,46 @@ +/** + * 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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("tag_default") +public class TagDefaultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagGridEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagGridEntity.java new file mode 100644 index 0000000000..507aed9cd0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/TagGridEntity.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 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("tag_grid") +public class TagGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleContentExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleContentExcel.java new file mode 100644 index 0000000000..090b11ce59 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleContentExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleContentExcel { + + @Excel(name = "主键ID 主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "审核状态 通过:pass;失败:fail;审核中:auditing") + private String auditStatus; + + @Excel(name = "审核理由") + private String auditReason; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleCoverExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleCoverExcel.java new file mode 100644 index 0000000000..3b0523effc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleCoverExcel.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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleCoverExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "封面图片地址 url地址") + private String imgUrl; + + @Excel(name = "审核状态 通过:pass;失败:fail;审核中:auditing") + private String auditStatus; + + @Excel(name = "审核理由") + private String auditReason; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java new file mode 100644 index 0000000000..a5f28f84a3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleExcel.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "草稿ID") + private String draftId; + + @Excel(name = "文章标题") + private String title; + + @Excel(name = "文章内容 精简内容") + private String previewContent; + + @Excel(name = "是否置顶") + private Integer isTop; + + @Excel(name = "发布范围描述 所有发布范围集合") + private String publishRangeDesc; + + @Excel(name = "发布单位ID") + private String publisherId; + + @Excel(name = "发布单位名称") + private String publisherName; + + @Excel(name = "发布单位类型 机关:agency;部门:department;网格:grid") + private String publisherType; + + @Excel(name = "发布时间") + private Date publishDate; + + @Excel(name = "发布状态 已发布:published;已下线:offline") + private String statusFlag; + + @Excel(name = "下线时间") + private Date offLineTime; + + @Excel(name = "文章标签串 竖杠分割的标签名称") + private String tags; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织ID路径 eg:字段为def:abc") + private String orgIdPath; + + @Excel(name = "网格ID 数据权限使用") + private String gridId; + + @Excel(name = "部门ID 数据权限使用") + private String departmentId; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleOperateRecordExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleOperateRecordExcel.java new file mode 100644 index 0000000000..23a6ee7c7d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleOperateRecordExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleOperateRecordExcel { + + @Excel(name = "主键ID 主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "执行人 xx街道-xx中心-姓名") + private String opUser; + + @Excel(name = "操作内容 操作内容,eg:重新编辑文章;") + private String content; + + @Excel(name = "操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange") + private String opType; + + @Excel(name = "操作时间") + private Date opTime; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticlePublishRangeExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticlePublishRangeExcel.java new file mode 100644 index 0000000000..6ac248177e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticlePublishRangeExcel.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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticlePublishRangeExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "下线时间") + private Date offLineTime; + + @Excel(name = "发布状态") + private String publishStatus; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleTagsExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleTagsExcel.java new file mode 100644 index 0000000000..524f8d972f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleTagsExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleTagsExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "标签ID") + private String tagId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleVisitRecordExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleVisitRecordExcel.java new file mode 100644 index 0000000000..17baa06b2d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/ArticleVisitRecordExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class ArticleVisitRecordExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "文章ID") + private String articleId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftContentExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftContentExcel.java new file mode 100644 index 0000000000..196a2668c0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftContentExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftContentExcel { + + @Excel(name = "主键ID 主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "草稿ID") + private String draftId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "审核状态 通过:pass;失败:fail;") + private String auditStatus; + + @Excel(name = "审核理由") + private String auditReason; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftCoverExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftCoverExcel.java new file mode 100644 index 0000000000..79be31f82e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftCoverExcel.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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftCoverExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "草稿ID") + private String draftId; + + @Excel(name = "封面图片地址 url地址") + private String imgUrl; + + @Excel(name = "审核状态 通过:pass;失败:fail;") + private String auditStatus; + + @Excel(name = "审核理由") + private String auditReason; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java new file mode 100644 index 0000000000..6f913525d7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftExcel.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "文章标题") + private String title; + + @Excel(name = "文章内容 精简内容") + private String previewContent; + + @Excel(name = "是否置顶") + private Integer isTop; + + @Excel(name = "发布范围描述 所有发布范围集合") + private String publishRangeDesc; + + @Excel(name = "发布单位ID") + private String publisherId; + + @Excel(name = "发布单位名称") + private String publisherName; + + @Excel(name = "发布单位类型 机关:agency;部门:department;网格:grid") + private String publisherType; + + @Excel(name = "发布时间") + private Date publishDate; + + @Excel(name = "发布状态 未发布:unpublish ;已发布:published,审核中:auditing") + private String statusFlag; + + @Excel(name = "文章标签串 竖杠分割的标签名称") + private String tags; + + @Excel(name = "组织ID") + private String orgId; + + @Excel(name = "组织ID路径 eg:字段为def:abc") + private String orgIdPath; + + @Excel(name = "网格ID 数据权限使用") + private String gridId; + + @Excel(name = "部门ID 数据权限使用") + private String departmentId; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftPublishRangeExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftPublishRangeExcel.java new file mode 100644 index 0000000000..96cabd9723 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/DraftPublishRangeExcel.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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class DraftPublishRangeExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "ID草稿") + private String draftId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "下线时间") + private Date offLineTime; + + @Excel(name = "发布状态 未发布:unpublish ;已发布:published") + private String publishStatus; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagCustomerExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagCustomerExcel.java new file mode 100644 index 0000000000..498d15587f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagCustomerExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagCustomerExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "使用计数") + private Integer useCount; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagDefaultExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagDefaultExcel.java new file mode 100644 index 0000000000..c09474c21b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagDefaultExcel.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagDefaultExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagGridExcel.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagGridExcel.java new file mode 100644 index 0000000000..9a08ad832a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/excel/TagGridExcel.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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +public class TagGridExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "标签ID") + private String tagId; + + @Excel(name = "标签名称") + private String tagName; + + @Excel(name = "使用计数") + private Integer useCount; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleContentRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleContentRedis.java new file mode 100644 index 0000000000..46e5931a9f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleContentRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleContentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleCoverRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleCoverRedis.java new file mode 100644 index 0000000000..a07e70e34f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleCoverRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleCoverRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleOperateRecordRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleOperateRecordRedis.java new file mode 100644 index 0000000000..a9f0b87082 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleOperateRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleOperateRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticlePublishRangeRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticlePublishRangeRedis.java new file mode 100644 index 0000000000..2d6973a237 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticlePublishRangeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticlePublishRangeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleRedis.java new file mode 100644 index 0000000000..f3b51ce245 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleTagsRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleTagsRedis.java new file mode 100644 index 0000000000..c4df800cac --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleTagsRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleTagsRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleVisitRecordRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleVisitRecordRedis.java new file mode 100644 index 0000000000..5143fb466c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/ArticleVisitRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class ArticleVisitRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftContentRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftContentRedis.java new file mode 100644 index 0000000000..8defdcfa5d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftContentRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class DraftContentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftCoverRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftCoverRedis.java new file mode 100644 index 0000000000..43ad67a79c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftCoverRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class DraftCoverRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftPublishRangeRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftPublishRangeRedis.java new file mode 100644 index 0000000000..7de60b82e2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftPublishRangeRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class DraftPublishRangeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftRedis.java new file mode 100644 index 0000000000..efbd69581c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/DraftRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class DraftRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagCustomerRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagCustomerRedis.java new file mode 100644 index 0000000000..08faa58c43 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagCustomerRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class TagCustomerRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagDefaultRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagDefaultRedis.java new file mode 100644 index 0000000000..2889f6208c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagDefaultRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class TagDefaultRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagGridRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagGridRedis.java new file mode 100644 index 0000000000..86527b7153 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagGridRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Component +public class TagGridRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java new file mode 100644 index 0000000000..48dcb2a23c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java @@ -0,0 +1,227 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.constant.TagConstant; +import com.epmet.dto.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.dto.result.TagRankResultDTO; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.ZSetOperations; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +@Component +public class TagRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param customerId + * @param formDto + * @author zxc + */ + public List get(String customerId, CorrelationTagListFormDTO formDto){ + List tagIdList = formDto.getTagIdList(); + Set objects ; + Collection keys = new ArrayList<>(); + //当查询关联标签数量大于1条时 + if (tagIdList.size() > 1){ + for (int i = NumConstant.ONE; i < tagIdList.size(); i++) { + String tagId = tagIdList.get(i); + tagId = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagId; + keys.add(tagId); + } + String key = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagIdList.get(0); + objects = redisUtils.intersect(key, keys); + }else { + // 查询关联标签数量 等于1条时 + String key = TagConstant.GOV_RETAG_KEY+customerId+TagConstant.COLON+tagIdList.get(0); + objects = redisUtils.sMembers(key); + } + List resultList = new ArrayList<>(); + if (objects.size()==NumConstant.ZERO){ + return resultList; + } + //转换DTO + for (Object object : objects) { + resultList.add(objectToDTO(object,CorrelationTagListResultDTO.class)); + } + //级联标签排序 + //1.取出 zset 中的有序标签,根据级联标签,筛选有序标签 + List resultEquals = new ArrayList<>(); + if (resultList.size() > NumConstant.ZERO) { + long start = 0; + long end = -1; + String customerKey = TagConstant.GOV_TAG_KEY + customerId; + Set> typedTuples = redisUtils.zReverseRangeWithScores(customerKey, start, end); + for (CorrelationTagListResultDTO correlationTagList : resultList) { + for (ZSetOperations.TypedTuple typedTuple : typedTuples) { + TagRankResultDTO tagRank = objectToDTO(typedTuple.getValue(), TagRankResultDTO.class); + tagRank.setScore(typedTuple.getScore()); + if (correlationTagList.getTagId().equals(tagRank.getTagId())){ + resultEquals.add(tagRank); + } + } + } + } + // 根据标签使用顺序倒叙 + List collect = resultEquals.stream().sorted(Comparator.comparing(TagRankResultDTO::getScore).reversed()).collect(Collectors.toList()); + List realResult = new ArrayList<>(); + for (TagRankResultDTO tagRankResultDTO : collect) { + CorrelationTagListResultDTO correlation = new CorrelationTagListResultDTO(); + BeanUtils.copyProperties(tagRankResultDTO,correlation); + realResult.add(correlation); + } + return realResult; + } + + + /** + * @Description 获取标签(政府端),按使用次数倒叙 + * @param key == customerId + * @author zxc + */ + public List zRevRange(String key){ + long start = 0; + long end = -1; + String tagKey = TagConstant.GOV_TAG_KEY+key; + Set objects = redisUtils.zRevRange(tagKey, start, end); + if (objects.size()== NumConstant.ZERO){ + return new ArrayList<>(); + } + List result = new ArrayList(); + for (Object object : objects) { + result.add(objectToDTO(object,TagInfoResultDTO.class)); + } + return result; + } + + /** + * @Description 获取标签(居民端) + * @param key == gridId + * @author zxc + */ + public List zGridRevRange(String key){ + long start = 0; + long end = -1; + String tagKey = TagConstant.GRID_TAG_KEY+key; + Set objects = redisUtils.zRevRange(tagKey, start, end); + if (objects.size()== NumConstant.ZERO){ + return new ArrayList<>(); + } + List result = new ArrayList(); + for (Object object : objects) { + result.add(objectToDTO(object,TagInfoResultDTO.class)); + } + return result; + } + + /** + * @Description 获取居民端级联标签——按照使用次数倒序 + * @param formDto + * @author zxc + */ + public List getResiTag(TagCascadeListFormDTO formDto){ + List tagIdList = formDto.getTagIdList(); + String gridId = formDto.getGridId(); + Set objects ; + Collection keys = new ArrayList<>(); + //当 级联标签大于1条的时候 + if (tagIdList.size() > 1){ + for (int i = NumConstant.ONE; i < tagIdList.size(); i++) { + String tagId = tagIdList.get(i); + tagId = TagConstant.GRID_RETAG_KEY+gridId+TagConstant.COLON+tagId; + keys.add(tagId); + } + String key = TagConstant.GRID_RETAG_KEY+gridId+TagConstant.COLON+tagIdList.get(0); + objects = redisUtils.intersect(key, keys); + }else { + //当级联标签为一条时 + String key = TagConstant.GRID_RETAG_KEY+gridId+TagConstant.COLON+tagIdList.get(0); + objects = redisUtils.sMembers(key); + } + List resultList = new ArrayList<>(); + if (objects.size()==NumConstant.ZERO){ + return resultList; + } + //转换DTO + for (Object object : objects) { + resultList.add(objectToDTO(object, TagInfoResultDTO.class)); + } + //级联标签排序 + //1.取出 zset 中的有序标签,根据级联标签,筛选有序标签 + List resultEquals = new ArrayList<>(); + if (resultList.size() > NumConstant.ZERO) { + long start = 0; + long end = -1; + String customerKey = TagConstant.GRID_TAG_KEY+formDto.getGridId(); + Set> typedTuples = redisUtils.zReverseRangeWithScores(customerKey, start, end); + for (TagInfoResultDTO tagInfo : resultList) { + for (ZSetOperations.TypedTuple typedTuple : typedTuples) { + TagRankResultDTO tagRank = objectToDTO(typedTuple.getValue(), TagRankResultDTO.class); + tagRank.setScore(typedTuple.getScore()); + if (tagInfo.getTagId().equals(tagRank.getTagId())){ + resultEquals.add(tagRank); + } + } + } + } + // 根据标签使用顺序倒叙 + List collect = resultEquals.stream().sorted(Comparator.comparing(TagRankResultDTO::getScore).reversed()).collect(Collectors.toList()); + List tagInfoResultList = new ArrayList<>(); + for (TagRankResultDTO tagRankResultDTO : collect) { + TagInfoResultDTO tagInfoResult = new TagInfoResultDTO(); + BeanUtils.copyProperties(tagRankResultDTO,tagInfoResult); + tagInfoResultList.add(tagInfoResult); + } + return tagInfoResultList; + } + + /** + * @Description Object 转换 DTO + * @param o + * @param tClass + * @author zxc + */ + public T objectToDTO(Object o,Class tClass){ + ObjectMapper objectMapper = new ObjectMapper(); + T t = objectMapper.convertValue(o, tClass); + return t; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleContentService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleContentService.java new file mode 100644 index 0000000000..d99c8a3e97 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleContentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleContentDTO; +import com.epmet.entity.ArticleContentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleContentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleContentDTO + * @author generator + * @date 2020-06-02 + */ + ArticleContentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleContentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleContentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleCoverService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleCoverService.java new file mode 100644 index 0000000000..0320c2f173 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleCoverService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleCoverDTO; +import com.epmet.entity.ArticleCoverEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleCoverService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleCoverDTO + * @author generator + * @date 2020-06-02 + */ + ArticleCoverDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleCoverDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleCoverDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java new file mode 100644 index 0000000000..368ecfcef7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleOperateRecordService.java @@ -0,0 +1,106 @@ +/** + * 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.ArticleOperateRecordDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; +import com.epmet.entity.ArticleOperateRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleOperateRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleOperateRecordDTO + * @author generator + * @date 2020-06-02 + */ + ArticleOperateRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleOperateRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleOperateRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); + + /** + * 查询文章操作记录 + * + * @param articleId + * @return com.epmet.dto.form.ArticleOperationResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-02 + */ + List listOfArticleOperation(String articleId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticlePublishRangeService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticlePublishRangeService.java new file mode 100644 index 0000000000..e6c23554e7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticlePublishRangeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticlePublishRangeDTO; +import com.epmet.entity.ArticlePublishRangeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticlePublishRangeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticlePublishRangeDTO + * @author generator + * @date 2020-06-02 + */ + ArticlePublishRangeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticlePublishRangeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticlePublishRangeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java new file mode 100644 index 0000000000..4e8613f908 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -0,0 +1,242 @@ +/** + * 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.ArticleDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.CommonArticleListFormDTO; +import com.epmet.entity.ArticleEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleDTO + * @author generator + * @date 2020-06-02 + */ + ArticleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + ArticleGridResultDTO agencyGridList(TokenDto tokenDTO); + + /** + * desc:保存或修改文章内容 + * + * @param tokenDto + * @param fromDTO + * @return + */ + String saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO); + + /** + * 政府端:(已发布、已下线)文章详情 + * + * @param articleId + * @return com.epmet.dto.result.GovArticleDetailResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + GovArticleDetailResultDTO queryGovArticleDetail(String articleId); + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位 + **/ + PublishAgencyListResultDTO publishAgencyList(TokenDto tokenDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-下线文章 + **/ + void offLineArticle(OffLineArticleFormDTO formDTO); + + /** + * desc:点击保存草稿时,保存文章属性 + * @param tokenDto + * @param fromDTO + * @return + */ + Boolean saveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO); + + /** + * desc:预览时修改文章属性 + * @param tokenDto + * @param fromDTO + * @return + */ + Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO); + + /** + * 已发布文章列表 + * @author zhaoqifeng + * @date 2020/6/2 14:38 + * @param tokenDto token + * @param formDTO 参数 + * @return java.util.List + */ + PageData publishedArticleList(TokenDto tokenDto, PublishedListFormDTO formDTO); + + /** + * 已下线列表 + * @author zhaoqifeng + * @date 2020/6/3 14:51 + * @param tokenDto token + * @param formDTO 参数 + * @return java.util.List + */ + PageData offlineList(TokenDto tokenDto, OfflineListFormDTO formDTO); + + /** + * desc: 发布文章 + * @param:draftId + * @return: Boolean + * date: 2020/6/3 16:34 + * @author: jianjun liu + */ + Boolean publish(TokenDto tokenDto, String draftId); + + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + List getTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO); + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + List getLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO); + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + List getArticleList(ArticlePageFormDTO articlePageFormDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可下线网格列表 + **/ + ArticleGridResultDTO publishGridList(PublishGridListFormDTO formDTO); + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + ArticleDetailResultDTO getArticleDetail(ResiArticleDetailFormDTO articleDetailFormDTO); + + /** + * @Description 草稿发布文章 + * @param draftId + * @return String 返回新发布文章的Id + * @author wangc + * @date 2020.06.05 09:10 + **/ + String publishDraftToArticle(String draftId); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleTagsService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleTagsService.java new file mode 100644 index 0000000000..6a0fae3346 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleTagsService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleTagsDTO; +import com.epmet.entity.ArticleTagsEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleTagsService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleTagsDTO + * @author generator + * @date 2020-06-02 + */ + ArticleTagsDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleTagsDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleTagsDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleVisitRecordService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleVisitRecordService.java new file mode 100644 index 0000000000..cdaa50388c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleVisitRecordService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ArticleVisitRecordDTO; +import com.epmet.entity.ArticleVisitRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleVisitRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ArticleVisitRecordDTO + * @author generator + * @date 2020-06-02 + */ + ArticleVisitRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(ArticleVisitRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(ArticleVisitRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftContentService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftContentService.java new file mode 100644 index 0000000000..bc28794b91 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftContentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DraftContentDTO; +import com.epmet.entity.DraftContentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface DraftContentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DraftContentDTO + * @author generator + * @date 2020-06-02 + */ + DraftContentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(DraftContentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(DraftContentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftCoverService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftCoverService.java new file mode 100644 index 0000000000..ff35690eb2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftCoverService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DraftCoverDTO; +import com.epmet.entity.DraftCoverEntity; + +import java.util.List; +import java.util.Map; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface DraftCoverService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DraftCoverDTO + * @author generator + * @date 2020-06-02 + */ + DraftCoverDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(DraftCoverDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(DraftCoverDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftPublishRangeService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftPublishRangeService.java new file mode 100644 index 0000000000..adcf30f72b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftPublishRangeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.DraftPublishRangeDTO; +import com.epmet.entity.DraftPublishRangeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface DraftPublishRangeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DraftPublishRangeDTO + * @author generator + * @date 2020-06-02 + */ + DraftPublishRangeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(DraftPublishRangeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(DraftPublishRangeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java new file mode 100644 index 0000000000..a11c1361a3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java @@ -0,0 +1,151 @@ +/** + * 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.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftDetailFormDTO; +import com.epmet.dto.form.DraftListFormDTO; +import com.epmet.dto.result.DraftAttrResultDTO; +import com.epmet.dto.result.DraftContentResultDTO; +import com.epmet.dto.result.DraftDetailResultDTO; +import com.epmet.entity.DraftEntity; + +import java.util.List; +import java.util.Map; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface DraftService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DraftDTO + * @author generator + * @date 2020-06-02 + */ + DraftDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(DraftDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(DraftDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return void + * @author yinzuomei@elink-cn.com + * @description 政府端工作人员,删除草稿 + * @date 2020/6/2 16:09 + **/ + void deleteDraft(DeleteDraftFormDTO formDTO); + + /** + * 政府端:选中草稿编辑,获取草稿内容 + * + * @param formDTO + * @return com.epmet.dto.result.DraftContentResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + DraftContentResultDTO queryDraftContent(DraftDetailFormDTO formDTO); + + /** + * 政府端:选中草稿编辑,获取草稿属性 + * + * @param formDTO + * @return com.epmet.dto.result.DraftContentResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + DraftAttrResultDTO getDraftAttr(DraftDetailFormDTO formDTO); + + /** + * 草稿列表 + * @author zhaoqifeng + * @date 2020/6/3 14:51 + * @param tokenDto token + * @param formDTO 参数 + * @return java.util.List + */ + PageData draftList(TokenDto tokenDto, DraftListFormDTO formDTO); + + /** + * 政府端:文章预览 + * + * @param formDTO + * @return com.epmet.dto.result.DraftContentResultDTO + * @author yinzuomei@elink-cn.com + * @date 2020-06-03 + */ + DraftDetailResultDTO queryDraftDetail(DraftDetailFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java new file mode 100644 index 0000000000..5747f098e8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.entity.TagCustomerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface TagCustomerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TagCustomerDTO + * @author generator + * @date 2020-06-02 + */ + TagCustomerDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(TagCustomerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(TagCustomerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagDefaultService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagDefaultService.java new file mode 100644 index 0000000000..18fdbd0988 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagDefaultService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.TagDefaultDTO; +import com.epmet.entity.TagDefaultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface TagDefaultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TagDefaultDTO + * @author generator + * @date 2020-06-02 + */ + TagDefaultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(TagDefaultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(TagDefaultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagGridService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagGridService.java new file mode 100644 index 0000000000..d32414d636 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagGridService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.TagGridDTO; +import com.epmet.entity.TagGridEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface TagGridService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TagGridDTO + * @author generator + * @date 2020-06-02 + */ + TagGridDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void save(TagGridDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-02 + */ + void update(TagGridDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java new file mode 100644 index 0000000000..b78a9f837a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java @@ -0,0 +1,43 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; + +import java.util.List; + +public interface TagService { + + /** + * @Description 已发布列表页的标签——政府端 + * @param tokenDto + * @author zxc + */ + List tagList(TokenDto tokenDto); + + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ + List resiTagList( ResiTagListFormDTO formDto); + + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param tokenDto + * @param formDto + * @author zxc + */ + List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDTO formDto); + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + List tagCascadeList(TagCascadeListFormDTO formDto); + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleContentServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleContentServiceImpl.java new file mode 100644 index 0000000000..a7b59c26c4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleContentServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleContentDao; +import com.epmet.dto.ArticleContentDTO; +import com.epmet.entity.ArticleContentEntity; +import com.epmet.redis.ArticleContentRedis; +import com.epmet.service.ArticleContentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleContentServiceImpl extends BaseServiceImpl implements ArticleContentService { + + @Autowired + private ArticleContentRedis articleContentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleContentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleContentDTO.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 ArticleContentDTO get(String id) { + ArticleContentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleContentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleContentDTO dto) { + ArticleContentEntity entity = ConvertUtils.sourceToTarget(dto, ArticleContentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleContentDTO dto) { + ArticleContentEntity entity = ConvertUtils.sourceToTarget(dto, ArticleContentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleCoverServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleCoverServiceImpl.java new file mode 100644 index 0000000000..79da94dd42 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleCoverServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleCoverDao; +import com.epmet.dto.ArticleCoverDTO; +import com.epmet.entity.ArticleCoverEntity; +import com.epmet.redis.ArticleCoverRedis; +import com.epmet.service.ArticleCoverService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleCoverServiceImpl extends BaseServiceImpl implements ArticleCoverService { + + @Autowired + private ArticleCoverRedis articleCoverRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleCoverDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleCoverDTO.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 ArticleCoverDTO get(String id) { + ArticleCoverEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleCoverDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleCoverDTO dto) { + ArticleCoverEntity entity = ConvertUtils.sourceToTarget(dto, ArticleCoverEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleCoverDTO dto) { + ArticleCoverEntity entity = ConvertUtils.sourceToTarget(dto, ArticleCoverEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java new file mode 100644 index 0000000000..a237638d2b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java @@ -0,0 +1,115 @@ +/** + * 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.ArticleOperateRecordDao; +import com.epmet.dto.ArticleOperateRecordDTO; +import com.epmet.dto.result.ArticleOperationResultDTO; +import com.epmet.entity.ArticleOperateRecordEntity; +import com.epmet.redis.ArticleOperateRecordRedis; +import com.epmet.service.ArticleOperateRecordService; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleOperateRecordServiceImpl extends BaseServiceImpl implements ArticleOperateRecordService { + + @Autowired + private ArticleOperateRecordRedis articleOperateRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleOperateRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleOperateRecordDTO.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 ArticleOperateRecordDTO get(String id) { + ArticleOperateRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleOperateRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleOperateRecordDTO dto) { + ArticleOperateRecordEntity entity = ConvertUtils.sourceToTarget(dto, ArticleOperateRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleOperateRecordDTO dto) { + ArticleOperateRecordEntity entity = ConvertUtils.sourceToTarget(dto, ArticleOperateRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listOfArticleOperation(String articleId) { + List list = baseDao.selectListByArticleId(articleId); + if (null == list) { + return new ArrayList<>(); + } + return list; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticlePublishRangeServiceImpl.java new file mode 100644 index 0000000000..db2e800930 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticlePublishRangeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticlePublishRangeDao; +import com.epmet.dto.ArticlePublishRangeDTO; +import com.epmet.entity.ArticlePublishRangeEntity; +import com.epmet.redis.ArticlePublishRangeRedis; +import com.epmet.service.ArticlePublishRangeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { + + @Autowired + private ArticlePublishRangeRedis articlePublishRangeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticlePublishRangeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticlePublishRangeDTO.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 ArticlePublishRangeDTO get(String id) { + ArticlePublishRangeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticlePublishRangeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticlePublishRangeDTO dto) { + ArticlePublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, ArticlePublishRangeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticlePublishRangeDTO dto) { + ArticlePublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, ArticlePublishRangeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java new file mode 100644 index 0000000000..c6cc12bef5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -0,0 +1,876 @@ +/** + * 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.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +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.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.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +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.constant.ArticleConstant; +import com.epmet.constant.DraftConstant; +import com.epmet.constant.RoleKeyConstants; +import com.epmet.dao.*; +import com.epmet.dto.*; +import com.epmet.dto.feign.GovOrgSelfFeignClient; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.*; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.redis.ArticleRedis; +import com.epmet.service.ArticleOperateRecordService; +import com.epmet.service.ArticlePublishRangeService; +import com.epmet.service.ArticleService; +import com.epmet.service.ArticleVisitRecordService; +import com.epmet.utils.ModuleConstant; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.jsoup.helper.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Slf4j +@Service +public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { + @Autowired + private ArticleRedis articleRedis; + @Autowired + private GovOrgSelfFeignClient govOrgSelfFeignClient; + @Autowired + private DraftDao draftDao; + @Autowired + private DraftContentDao draftContentDao; + @Autowired + private ArticlePublishRangeService articlePublishRangeService; + @Autowired + private ArticlePublishRangeDao articlePublishRangeDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private ArticleOperateRecordService articleOperateRecordService; + @Autowired + private DraftCoverDao draftCoverDao; + @Autowired + private DraftPublishRangeDao draftPublishRangeDao; + @Autowired + private LoginUserUtil loginUserUtil; + @Autowired + private ArticleContentDao articleContentDao; + @Autowired + private ArticleCoverDao articleCoverDao; + + private static final String AGENCY = "agency"; + private static final String GRID = "grid"; + + + @Autowired + private ArticleVisitRecordService articleVisitRecordService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleDTO.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 ArticleDTO get(String id) { + ArticleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleDTO dto) { + ArticleEntity entity = ConvertUtils.sourceToTarget(dto, ArticleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleDTO dto) { + ArticleEntity entity = ConvertUtils.sourceToTarget(dto, ArticleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @Override + public ArticleGridResultDTO agencyGridList(TokenDto tokenDTO) { + Result result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId()); + return result.getData(); + } + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位 + **/ + @Override + public PublishAgencyListResultDTO publishAgencyList(TokenDto tokenDTO) { + Result result = govOrgSelfFeignClient.getPublishAgencyList(tokenDTO.getUserId()); + return result.getData(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { + log.debug("saveOrUpdateContent param:{}", JSON.toJSONString(fromDTO)); + ValidatorUtils.validateEntity(fromDTO, AddGroup.class, DefaultGroup.class); + + DraftEntity draftEntity = null; + List draftContentList = null; + if (StringUtils.isNotBlank(fromDTO.getDraftId())) { + draftEntity = draftDao.selectById(fromDTO.getDraftId()); + if (draftEntity == null) { + log.warn("saveOrUpdateContent draftId is not exist in db"); + throw new RenException("参数错误"); + } + draftEntity.setTitle(draftEntity.getTitle()); + draftEntity.setUpdatedTime(new Date()); + draftDao.updateById(draftEntity); + + } else { + LoginUserDetailsFormDTO detailsFormDTO = new LoginUserDetailsFormDTO(); + detailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); + detailsFormDTO.setApp(loginUserUtil.getLoginUserApp()); + detailsFormDTO.setClient(loginUserUtil.getLoginUserClient()); + Result loginUserDetails = epmetUserOpenFeignClient.getLoginUserDetails(detailsFormDTO); + if (loginUserDetails == null || loginUserDetails.getData() == null){ + log.warn("saveOrUpdateContent getloginUserDetails return null"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),EpmetErrorCode.SERVER_ERROR.getMsg()); + } + draftEntity = new DraftEntity(); + draftEntity.setTitle(fromDTO.getTitle()); + draftEntity.setCustomerId(tokenDto.getCustomerId()); + draftEntity.setIsTop(DraftConstant.UN_TOP); + draftEntity.setStatusFlag(DraftConstant.UNPUBLISH); + draftEntity.setOrgId(loginUserDetails.getData().getAgencyId()); + draftEntity.setOrgIdPath(loginUserDetails.getData().getOrgIdPath()); + draftEntity.setGridId(""); + draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId()); + draftEntity.setDelFlag(NumConstant.ZERO_STR); + draftDao.insert(draftEntity); + } + + String draftId = draftEntity.getId(); + fromDTO.setDraftId(draftId); + draftContentList = buildDraftContent(tokenDto, fromDTO); + if (CollectionUtils.isEmpty(draftContentList)) { + log.warn("saveOrUpdateContent contentList is empty"); + throw new RenException("参数错误"); + } + + Map draftIdMap = new HashMap<>(); + draftIdMap.put("DRAFT_ID", fromDTO.getDraftId()); + draftContentDao.deleteByMap(draftIdMap); + //TODO 改为批量插入 + draftContentList.forEach(content -> draftContentDao.insert(content)); + + return draftId; + } + + @Override + public GovArticleDetailResultDTO queryGovArticleDetail(String articleId) { + GovArticleDetailResultDTO articleDetail = baseDao.queryGovArticleDetail(articleId); + if (null != articleDetail) { + List articleContentList = baseDao.queryGovArticleContent(articleId); + articleDetail.setArticleContentList(articleContentList); + } + return articleDetail; + } + + @Override + public Boolean saveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + log.debug("saveDraftAttr param:{}",JSON.toJSONString(fromDTO)); + + DraftEntity draftEntity = checkDraftStatus(fromDTO.getDraftId()); + + //构建标签 + if (!CollectionUtils.isEmpty(fromDTO.getTagNameList())) { + List tagNameList = fromDTO.getTagNameList(); + tagNameList = tagNameList.stream().distinct().collect(Collectors.toList()); + String tagNamesStr = StringUtils.join(tagNameList, "、"); + draftEntity.setTags(tagNamesStr); + } + draftEntity.setIsTop(fromDTO.getIsTop()); + + //发布单位 + if (StringUtils.isNotBlank(fromDTO.getPublisher())){ + String publisherType = fromDTO.getPublisherType(); + String publisherName = fromDTO.getPublisherName(); + if (StringUtils.isBlank(publisherType) || StringUtils.isBlank(publisherName)) { + log.warn("saveDraftAttr publisher info is illegal,publisher:{},publisherType:{},publisherName:{}",fromDTO.getPublisher(),publisherType,publisherName); + throw new RenException("发布单位不能为空"); + } + } + draftEntity.setPublisherName(fromDTO.getPublisherName()); + draftEntity.setPublisherId(fromDTO.getPublisher()); + draftEntity.setPublisherType(fromDTO.getPublisher()); + + + draftEntity.setPublishDate(DateUtils.stringToDate(fromDTO.getPublishDate(),DateUtils.DATE_PATTERN)); + + //封面 + DraftCoverEntity coverEntity = buildCoverEntity(tokenDto, fromDTO); + //发布范围 + List publishRangeEntityList = buildDraftPublishRange(draftEntity,tokenDto, fromDTO); + + + executeSaveDraftAttr(draftEntity, coverEntity, publishRangeEntityList); + return true; + } + + private DraftEntity checkDraftStatus(String draftId) { + DraftEntity draftEntity = draftDao.selectById(draftId); + if (draftEntity == null) { + log.warn("saveDraftAttr draftId:{} is not exist in db",draftId); + throw new RenException("参数错误"); + } + if (NumConstant.ONE_STR.equals(draftEntity.getDelFlag())) { + log.warn("saveDraftAttr draftId:{} have deleted",draftId); + throw new RenException("参数错误"); + } + if (DraftConstant.PUBLISHED.equals(draftEntity.getStatusFlag())) { + log.warn("saveDraftAttr draftId:{} publishStatus have published"); + throw new RenException("参数错误"); + } + return draftEntity; + } + + @Override + public Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + //校验参数 + if (fromDTO.getIsTop() == 1 && StringUtils.isBlank(fromDTO.getCoverImg())) { + log.warn("saveOrUpdateAttr isTop=1 but coverImg is blank"); + throw new RenException("文章封面不能为空"); + } + if (CollectionUtils.isEmpty(fromDTO.getGridIdList())) { + log.warn("saveOrUpdateAttr gridIdList is empty"); + throw new RenException("发布范围不能为空"); + } + + if (StringUtils.isBlank(fromDTO.getPublisher())) { + log.warn("saveOrUpdateAttr publisher is blank"); + throw new RenException("发布单位不能为空"); + } + return saveDraftAttr(tokenDto, fromDTO); + } + + @Override + public Boolean publish(TokenDto tokenDto, String draftId) { + if (StringUtils.isBlank(draftId)){ + log.warn("publish param error draftId is blank"); + throw new RenException("草稿Id不能为空"); + } + DraftEntity draftEntity = checkDraftStatus(draftId); + draftEntity.setStatusFlag(DraftConstant.AUDITING); + draftDao.updateById(draftEntity); + return true; + } + + @Transactional(rollbackFor = Exception.class) + public void executeSaveDraftAttr(DraftEntity draftEntity, DraftCoverEntity coverEntity, List publishRangeEntityList) { + Map draftIdMap = new HashMap<>(); + draftIdMap.put("DRAFT_ID", draftEntity.getId()); + draftCoverDao.deleteByMap(draftIdMap); + if (coverEntity != null){ + draftCoverDao.insert(coverEntity); + } + + draftPublishRangeDao.deleteByMap(draftIdMap); + if (!CollectionUtils.isEmpty(publishRangeEntityList)){ + publishRangeEntityList.forEach(publishRange->draftPublishRangeDao.insert(publishRange)); + } + draftDao.updateById(draftEntity); + } + + private List buildDraftPublishRange(DraftEntity draftEntity, TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + if (CollectionUtils.isEmpty(fromDTO.getGridIdList())){ + return null; + } + List publishRangeEntityList = new ArrayList<>(); + List agencyGridNameList = new ArrayList<>(); + + ArticleGridResultDTO articleGridResultDTO = this.agencyGridList(tokenDto); + if (articleGridResultDTO == null) { + log.warn("saveDraftAttr userId:{} have not right access publishRange", tokenDto.getUserId()); + throw new RenException("参数错误"); + } + buildName(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO); + buildAgencyGridNames(tokenDto,agencyGridNameList,publishRangeEntityList, fromDTO, articleGridResultDTO); + draftEntity.setPublishRangeDesc(StringUtils.join(agencyGridNameList,"|")); + return publishRangeEntityList; + } + + private DraftCoverEntity buildCoverEntity(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + String coverImg = fromDTO.getCoverImg(); + if (StringUtils.isBlank(coverImg)){ + return null; + } + DraftCoverEntity coverEntity = new DraftCoverEntity(); + coverEntity.setCustomerId(tokenDto.getCustomerId()); + coverEntity.setDraftId(fromDTO.getDraftId()); + coverEntity.setImgUrl(coverImg); + coverEntity.setAuditStatus(""); + coverEntity.setAuditReason(""); + coverEntity.setRevision(0); + coverEntity.setDelFlag(NumConstant.ZERO_STR); + return coverEntity; + } + + private void buildAgencyGridNames(TokenDto tokenDto, List agencyGridNameList, List publishRangeEntityList, DraftAttrFromDTO fromDTO, ArticleGridResultDTO articleGridResultDTO) { + articleGridResultDTO.getSubAgencyGridList().forEach(subAgencyGrid -> { + buildName(tokenDto,agencyGridNameList, publishRangeEntityList,fromDTO, subAgencyGrid); + }); + if (!CollectionUtils.isEmpty(articleGridResultDTO.getSubAgencyGridList())) { + articleGridResultDTO.getSubAgencyGridList().forEach(subAgencyGrid -> { + buildAgencyGridNames(tokenDto, agencyGridNameList, publishRangeEntityList, fromDTO, subAgencyGrid); + }); + } + } + + public static void main(String[] args) { + String str = "{\"agencyId\":\"1041fe5e8499dbd8add314291d2f6da4\",\"agencyName\":\"省委宣传部\",\"gridList\":[{\"gridId\":\"1\",\"gridName\":\"第一\"},{\"gridId\":\"2\",\"gridName\":\"第二\"}],\"subAgencyGridList\":[{\"agencyId\":\"8f9d9990f9502be0f5158b59fbcba7f9\",\"agencyName\":\"枣庄市\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4\"},{\"agencyId\":\"a03b85699795bf9bd192a1b08ee579b7\",\"agencyName\":\"淄博市\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4\"},{\"agencyId\":\"ae2b16245d52e79bffc81da18882bd52\",\"agencyName\":\"青岛市市委宣传办\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"355c9b2ca286dfc4a12e8ceb0e701cd2\",\"agencyName\":\"莱西市委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"f3bc7390a1ce4770ab315e35bf486d26\",\"agencyName\":\"李沧区委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"3a7a375ebce1ec29a1f4c09598ae4a93\",\"agencyName\":\"大大大街道\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"af65cfe91297f7128553d65be08604b8\",\"agencyName\":\"小小小社区\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52:f3bc7390a1ce4770ab315e35bf486d26:3a7a375ebce1ec29a1f4c09598ae4a93\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52:f3bc7390a1ce4770ab315e35bf486d26\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"9a072413f6de9ab2468132716e3c4023\",\"agencyName\":\"平度区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"81ea088d5415b39d87488a45c294881e\",\"agencyName\":\"jiaozhoushiwe胶州市委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"f89f1ed4b6b178fe6b1af5acbca751c4\",\"agencyName\":\"崂山区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"c27644b0d4e0b03821df55efae7e8f0e\",\"agencyName\":\"市北市委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"1432bbed56c9ba1c8a7ceea04ecd0695\",\"agencyName\":\"市南市委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"},{\"agencyId\":\"e07464abe1d2b86c6bd55ac0f8ed8b96\",\"agencyName\":\"黄岛区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:ae2b16245d52e79bffc81da18882bd52\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4\"},{\"agencyId\":\"8644222c22ee9e989eff748104785083\",\"agencyName\":\"济南市市委宣传办\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"6980c7edd43f3ebed4770d28c9acd7f5\",\"agencyName\":\"飞飞飞\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"03c965e0e5c89e5bf275b53d2a149bf9\",\"agencyName\":\"哈哈哈\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"e6bb0092805119fca932f126b58fcb4a\",\"agencyName\":\"1111\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:03c965e0e5c89e5bf275b53d2a149bf9\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"e2b0cc9f9f30cfeaab6645dcdb75992f\",\"agencyName\":\"快快快\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"4ba9eb65a791932cdaae3ff1fb45a7e3\",\"agencyName\":\"三四十\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:e2b0cc9f9f30cfeaab6645dcdb75992f\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"afb5790c997478df4086bccbb6a1583f\",\"agencyName\":\"市中市委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"b9e295f8c1906a0d1c5e0b313afcda3f\",\"agencyName\":\"啦啦啦啦\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"3a376fd514af0219c3023905faaac5ac\",\"agencyName\":\"lo咯啦啦啦\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:afb5790c997478df4086bccbb6a1583f:b9e295f8c1906a0d1c5e0b313afcda3f\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:afb5790c997478df4086bccbb6a1583f\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"f6336c5a9f34b793c1a9aec083261a43\",\"agencyName\":\"济阳市市委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"3930282aa029a4446f8a3ca25274ed2a\",\"agencyName\":\"啦啦啦啦\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:f6336c5a9f34b793c1a9aec083261a43\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"043d2ecc5ae1766014fdf59743836ce8\",\"agencyName\":\"商河县县委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"8b7d82b8be943adaf82816f4336b87c8\",\"agencyName\":\"平阴区区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"580701ffcc58e7f867b89727a422adce\",\"agencyName\":\"长青区委\",\"gridList\":[],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"9a1fefeff0d891209a583c2c62be237c\",\"agencyName\":\"天桥区区委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"4d562a1dc673e1ea2aa0d76d2799b133\",\"agencyName\":\"泺口街道党委\",\"gridList\":[{\"gridId\":\"9cf7b9ad21c488a4884effb2b342c23d\",\"gridName\":\"第二网格\"},{\"gridId\":\"d5e746de405cb38479fccea3228b0fa4\",\"gridName\":\"黄河公园第一网格\"}],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:9a1fefeff0d891209a583c2c62be237c\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"},{\"agencyId\":\"5a40658e540b0701eb04666930db9f73\",\"agencyName\":\"槐荫区区委\",\"gridList\":[],\"subAgencyGridList\":[{\"agencyId\":\"c2e4d28be976e6f66828e213daa0f965\",\"agencyName\":\"省立医院西院党委\",\"gridList\":[{\"gridId\":\"b3f5c5464ad3634982116c174b22ee35\",\"gridName\":\"省立西院第一网格\"}],\"subAgencyGridList\":[],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083:5a40658e540b0701eb04666930db9f73\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4:8644222c22ee9e989eff748104785083\"}],\"pids\":\"0:1041fe5e8499dbd8add314291d2f6da4\"}],\"pids\":\"\"}"; + ArticleGridResultDTO articleGridResultDTOS = JSON.parseObject(str, ArticleGridResultDTO.class); + System.out.println(JSON.toJSONString(articleGridResultDTOS)); + List gridIdList = Arrays.asList("1","2","d5e746de405cb38479fccea3228b0fa4"); + List agencyGridNameList = new ArrayList<>(); + List publishRangeEntityList = new ArrayList<>(); + TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId("1"); + + DraftAttrFromDTO fromDTO = new DraftAttrFromDTO(); + fromDTO.setGridIdList(gridIdList); + //buildName(tokenDto,agencyGridNameList, publishRangeEntityList,fromDTO, articleGridResultDTOS); + //buildAgencyGridNames(tokenDto,agencyGridNameList,publishRangeEntityList,fromDTO,articleGridResultDTOS); + System.out.println("组织-网格名称:"+JSON.toJSONString(agencyGridNameList)); + System.out.println("publishRangeEntityList:"+JSON.toJSONString(publishRangeEntityList)); + + } + + private void buildName(TokenDto tokenDto, List agencyGridNameList, List publishRangeEntityList, DraftAttrFromDTO fromDTO, ArticleGridResultDTO articleGridResultDTO) { + List gridIdList = fromDTO.getGridIdList(); + List gridList = articleGridResultDTO.getGridList(); + if (!CollectionUtils.isEmpty(gridList)&&!CollectionUtils.isEmpty(gridIdList)) { + gridList.forEach(grid -> { + if (gridIdList.contains(grid.getGridId())) { + String agencyGridName = articleGridResultDTO.getAgencyName().concat("_").concat(grid.getGridName()); + agencyGridNameList.add(agencyGridName); + DraftPublishRangeEntity draftPublishRangeEntity = new DraftPublishRangeEntity(); + draftPublishRangeEntity.setCustomerId(tokenDto.getCustomerId()); + draftPublishRangeEntity.setDraftId(fromDTO.getDraftId()); + draftPublishRangeEntity.setGridId(grid.getGridId()); + draftPublishRangeEntity.setAgencyGridName(agencyGridName); + draftPublishRangeEntity.setOffLineTime(null); + draftPublishRangeEntity.setPublishStatus(DraftConstant.UNPUBLISH); + draftPublishRangeEntity.setRevision(0); + draftPublishRangeEntity.setDelFlag(NumConstant.ZERO_STR); + draftPublishRangeEntity.setPids(articleGridResultDTO.getPids()); + draftPublishRangeEntity.setAllParentName(articleGridResultDTO.getAllParentName()); + + publishRangeEntityList.add(draftPublishRangeEntity); + } + }); + } + } + + /** + * desc:构建 内容对象 + * + * @param tokenDto + * @param fromDTO + * @return + */ + private List buildDraftContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { + List newContentList = new ArrayList<>(); + + List contentList = fromDTO.getContentList(); + + for (int i = 0; i < contentList.size(); i++) { + DraftContentFromDTO.DraftContentDTO content = contentList.get(i); + DraftContentEntity entity = ConvertUtils.sourceToTarget(content, DraftContentEntity.class); + entity.setId(content.getDraftContentId()); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setDraftId(fromDTO.getDraftId()); + entity.setOrderNum(i + 1); + newContentList.add(entity); + } + + return newContentList; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-下线文章 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void offLineArticle(OffLineArticleFormDTO formDTO) { + //1:根据文章Id查询全部(已发布、已下线)发布范围数据 + ArticlePublishRangeEntity rangeEntity = new ArticlePublishRangeEntity(); + rangeEntity.setArticleId(formDTO.getArticleId()); + List rangeEntityList = articlePublishRangeDao.selectByArticleId(rangeEntity); + if (null == rangeEntityList || rangeEntityList.size() < NumConstant.ONE) { + throw new RenException(ArticleConstant.RANGE_DATA_EXCEPTION); + } + + //2:批量更新发布范围数据,将前台勾选的文章网格列表数据置为下线状态 + Date date = new Date(); + //还未下线的发布范围列表 + List publishedList = new ArrayList<>(); + //将要下线的发布范围列表 + List offLineList = new ArrayList<>(); + rangeEntityList.forEach(entity -> { + if (entity.getPublishStatus().equals(ArticleConstant.PUBLISHED)) { + //是否下线(true:是) + AtomicBoolean isOffLine = new AtomicBoolean(false); + formDTO.getGridIdList().forEach(gridId -> { + if (entity.getGridId().equals(gridId)) { + isOffLine.set(true); + entity.setOffLineTime(date); + entity.setPublishStatus(ArticleConstant.OFFLINE); + offLineList.add(entity); + } + }); + if (!isOffLine.get()) { + publishedList.add(entity); + } + } + }); + //2.1:批量更新发布范围表数据 + articlePublishRangeService.updateBatchById(offLineList); + + //3:根据是否全部下线更新文章主表数据 + ArticleEntity entity = new ArticleEntity(); + entity.setId(formDTO.getArticleId()); + StringBuffer publishRangeDesc = new StringBuffer(); + if (null == publishedList || publishedList.size() < NumConstant.ONE) { + entity.setStatusFlag(ArticleConstant.OFFLINE); + entity.setOffLineTime(date); + rangeEntityList.forEach(range -> { + publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? "、" : ""); + publishRangeDesc.append(range.getAgencyGridName()); + }); + } else { + publishedList.forEach(pub -> { + publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? "、" : ""); + publishRangeDesc.append(pub.getAgencyGridName()); + }); + } + entity.setPublishRangeDesc(publishRangeDesc.toString()); + baseDao.updateById(entity); + + //4:文章操作记录表新增数据 + //4.1:调用epmet-user服务,查询工作人员信息 + Result resultStaff = epmetUserOpenFeignClient.getCustomerStaff(formDTO.getStaffId()); + if (null == resultStaff.getData()) { + throw new RenException(ArticleConstant.SELECT_STAFF_EXCEPTION); + } + CustomerStaffDTO staffDTO = resultStaff.getData(); + //4.2:查询文章表数据 + ArticleEntity articleEntity = baseDao.selectById(formDTO.getArticleId()); + //4.3:新增操作表数据 + ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity(); + recordEntity.setCustomerId(articleEntity.getCustomerId()); + recordEntity.setArticleId(formDTO.getArticleId()); + recordEntity.setOpUser(articleEntity.getPublisherName() + "-" + staffDTO.getRealName()); + recordEntity.setContent(String.format(ArticleConstant.OFF_LINE_ARTICLE_MSG, articleEntity.getPublisherName(), staffDTO.getRealName(), articleEntity.getTitle())); + recordEntity.setOpType(ArticleConstant.OFFLINE); + recordEntity.setOpTime(date); + articleOperateRecordService.insert(recordEntity); + } + + @Override + public PageData publishedArticleList(TokenDto tokenDto, PublishedListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); + List resultList; + List roles = epmetUserOpenFeignClient.getStaffRoles(tokenDto.getUserId()).getData(); + LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp(tokenDto.getApp()); + loginUserDetailsFormDTO.setClient(tokenDto.getClient()); + loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); + LoginUserDetailsResultDTO userInfo = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); + String staffLevel = ""; + for (CustomerStaffRoleResultDTO role : roles) { + //党建负责人 + if (RoleKeyConstants.ROLE_KEY_PARTY_PRINCIPALS.equals(role.getRoleKey()) || + RoleKeyConstants.ROLE_KEY_AGENCY_LEADER.equals(role.getRoleKey()) || + RoleKeyConstants.ROLE_KEY_MANAGER.equals(role.getRoleKey()) || + RoleKeyConstants.ROLE_KEY_STAFF.equals(role.getRoleKey()) || + RoleKeyConstants.ROLE_KEY_DEPT_LEADER.equals(role.getRoleKey())) { + staffLevel = AGENCY; + break; + } else { + staffLevel = GRID; + } + } + if (AGENCY.equals(staffLevel)) { + resultList = baseDao.selectArticleListForAgency(tokenDto.getCustomerId()); + } else { + resultList = baseDao.selectArticleListForGrid(tokenDto.getCustomerId(), userInfo.getGridIdList()); + } + PageInfo pageInfo = new PageInfo<>(resultList); + return new PageData<>(resultList, pageInfo.getTotal()); + } + + @Override + public PageData offlineList(TokenDto tokenDto, OfflineListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); + + LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp(tokenDto.getApp()); + loginUserDetailsFormDTO.setClient(tokenDto.getClient()); + loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); + LoginUserDetailsResultDTO userInfo = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); + List resultList = baseDao.selectOfflineList(userInfo.getGridIdList()); + PageInfo pageInfo = new PageInfo<>(resultList); + return new PageData<>(resultList, pageInfo.getTotal()); + } + + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @Override + public List getTopArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return baseDao.selectTopArticleMsg(commonArticleListFormDTO.getGridId(), + null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ? + NumConstant.THREE : commonArticleListFormDTO.getNum()); + } + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @Override + public List getLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) { + return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(), + null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ? + NumConstant.FIVE : commonArticleListFormDTO.getNum()); + } + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @Override + public List getArticleList(ArticlePageFormDTO articlePageFormDTO) { + PageHelper.startPage(articlePageFormDTO.getPageNo(),articlePageFormDTO.getPageSize()); + return baseDao.selectArticleList(articlePageFormDTO.getGridId(),articlePageFormDTO.getTagIdList()); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可下线网格列表 + **/ + @Override + public ArticleGridResultDTO publishGridList(PublishGridListFormDTO formDTO) { + //1:查询当前文章发布范围内还未下线网格列表 + ArticlePublishRangeEntity rangeEntity = new ArticlePublishRangeEntity(); + rangeEntity.setArticleId(formDTO.getArticleId()); + rangeEntity.setPublishStatus(ArticleConstant.PUBLISHED); + List rangeEntityList = articlePublishRangeDao.selectByArticleId(rangeEntity); + if (null == rangeEntityList || rangeEntityList.size() < NumConstant.ONE) { + return new ArticleGridResultDTO(); + } + //2:查询当前工作人员的所属组织,以此作为根节点的起始位置 + LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp("gov"); + loginUserDetailsFormDTO.setClient("wxmp"); + loginUserDetailsFormDTO.setUserId(formDTO.getStaffId()); + Result resultDTOResult = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); + String agencyId = resultDTOResult.getData().getOrgIdPath(); + //存放树的每一个节点对象,用于将同一节点下的网格列表合并(主键:agencyId 值:节点对象) + Map map = new HashMap<>(); + //3:循环可下线网格列表,根据pids组织每一个树节点对象信息 + for (ArticlePublishRangeEntity range : rangeEntityList) { + //当前网格的所有机关id + String gridPids = range.getPids() + ":" + range.getAgencyId(); + //当前网格的所有机关名称 + String gridAgencyNames = range.getAllParentName() + "-" + range.getAgencyGridName().substring(NumConstant.ZERO, range.getAgencyGridName().lastIndexOf("-")); + String[] pids = gridPids.split(":"); + String[] names = gridAgencyNames.split("-"); + //倒序遍历 + for (int i = (pids.length - NumConstant.ONE); i >= NumConstant.ZERO; i--) { + //遍历到当前人员所属组织的上一级组织时停止遍历 + if (i + NumConstant.ONE < pids.length && agencyId.equals(pids[i + NumConstant.ONE])) { + break; + } + if (null == map.get(pids[i])) { + ArticleGridResultDTO dto = new ArticleGridResultDTO(); + dto.setAgencyId(pids[i]); + dto.setAgencyName(names[i]); + //根节点没有上级id的值 + if (i > NumConstant.ZERO) { + dto.setPid(pids[i - NumConstant.ONE]); + } + if (pids.length - NumConstant.ONE == i) { + List gridList = new ArrayList<>(); + AgencyGridListResultDTO gridDto = new AgencyGridListResultDTO(); + gridDto.setGridId(range.getGridId()); + gridDto.setGridName(range.getAgencyGridName().substring(range.getAgencyGridName().lastIndexOf("-") + NumConstant.ONE)); + gridList.add(gridDto); + dto.setGridList(gridList); + } + map.put(pids[i], dto); + } else { + if (pids.length - NumConstant.ONE == i) { + ArticleGridResultDTO dto1 = map.get(pids[i]); + List gridList = dto1.getGridList(); + AgencyGridListResultDTO gridDto = new AgencyGridListResultDTO(); + gridDto.setGridId(range.getGridId()); + gridDto.setGridName(range.getAgencyGridName().substring(range.getAgencyGridName().lastIndexOf("-") + NumConstant.ONE)); + gridList.add(gridDto); + dto1.setGridList(gridList); + map.put(pids[i], dto1); + } + } + } + } + //去除map中所有的节点对象,将list转成tree结构 + List resultDTOList = map.values().stream().collect(Collectors.toList()); + List list = agencyGridListToTree(resultDTOList); + return list.get(NumConstant.ZERO); + } + /** + * @Author sun + * @Description 可下线网格列表-将list转为Tree结构 + */ + private List agencyGridListToTree(List resultDTOList) { + //根节点集合(pid为空) + List listParentRecord = new ArrayList<>(); + //非根节点集合(pid不为空) + List listNotParentRecord = new ArrayList<>(); + //1:遍历resultDTOList 保存所有数据的agencyId 用于判断是不是根节点 + //agencyId + Map agencyIdMap = new HashMap<>(); + //每一个agencyId对应的节点对象信息 + Map allRecordMap = new HashMap(); + for (ArticleGridResultDTO dto : resultDTOList) { + agencyIdMap.put(dto.getAgencyId(), dto.getAgencyId()); + allRecordMap.put(dto.getAgencyId(), dto); + } + //2:遍历resultDTOList 找出所有的根节点和非根节点(pid是否为空) + if (resultDTOList != null && resultDTOList.size() > NumConstant.ZERO) { + for (ArticleGridResultDTO record : resultDTOList) { + //为空且存在 + if (StringUtil.isBlank(record.getPid()) || !agencyIdMap.containsKey(record.getPid())) { + listParentRecord.add(record); + } else { + listNotParentRecord.add(record); + } + } + } + //3:遍历根节点,递归获取所有子节点并添加到对应下级 + for (ArticleGridResultDTO dto : listParentRecord) { + //添加所有子级 + List subList = getSubTreeNodeList(listNotParentRecord, dto.getAgencyId()); + dto.setSubAgencyGridList(subList); + } + return listParentRecord; + } + /** + * @Author sun + * @Description 可下线网格列表-将list转为Tree结构-递归查询每一个根节点的下级节点集合 + */ + private List getSubTreeNodeList(List listNotParentRecord, String agencyId) { + List subParentRecordList = new ArrayList<>(); + List subNotParentRecordList = new ArrayList<>(); + //1:遍历tmpList,找出所有的根节点和非根节点 + if (listNotParentRecord != null && listNotParentRecord.size() > NumConstant.ZERO) { + for (ArticleGridResultDTO record : listNotParentRecord) { + // 对比找出父节点 + if (record.getPid().equals(agencyId)) { + subParentRecordList.add(record); + } else { + subNotParentRecordList.add(record); + } + } + } + //2:层层递归添加下级查询子节点 + for (ArticleGridResultDTO record : subParentRecordList) { + //添加子节点 + List subList = getSubTreeNodeList(subNotParentRecordList, record.getAgencyId()); + record.setSubAgencyGridList(subList); + } + return subParentRecordList; + } + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public ArticleDetailResultDTO getArticleDetail(ResiArticleDetailFormDTO articleDetailFormDTO) { + //1.查询文章详情信息 + ArticleDetailResultDTO articleInfo = baseDao.selectArticleDetail(articleDetailFormDTO.getGridId(),articleDetailFormDTO.getArticleId()); + if(null == articleInfo) + throw new RenException(String.format(ModuleConstant.SPECIFIED_ARTICLE_NOT_FOUND_EXCEPTION_TEMPLATE,articleDetailFormDTO.getArticleId(),articleDetailFormDTO.getGridId())); + //2.判断当前用户当前文章当前网格是否存在访问记录 + Map params = new HashMap<>(); + params.put(ModuleConstant.FIELD_GRID_ID_CAMEL,articleDetailFormDTO.getGridId()); + params.put(ModuleConstant.FIELD_USER_ID_CAMEL,articleDetailFormDTO.getUserId()); + params.put(ModuleConstant.FIELD_ARTICLE_ID_CAMEL,articleDetailFormDTO.getArticleId()); + params.put(ModuleConstant.FIELD_CUSTOMER_ID_CAMEL,articleInfo.getCustomerId()); + params.put(FieldConstant.DEL_FLAG_HUMP,NumConstant.ZERO_STR); + List existedVisitRecord = articleVisitRecordService.list(params); + //3.没有则插入 + if(null == existedVisitRecord || existedVisitRecord.size() < NumConstant.ONE){ + ArticleVisitRecordEntity recordToInsert = new ArticleVisitRecordEntity(); + recordToInsert.setArticleId(articleDetailFormDTO.getArticleId()); + recordToInsert.setGridId(articleDetailFormDTO.getGridId()); + recordToInsert.setUserId(articleDetailFormDTO.getUserId()); + recordToInsert.setCustomerId(articleInfo.getCustomerId()); + articleVisitRecordService.insert(recordToInsert); + + articleInfo.setVisitRecordCount(null == articleInfo.getVisitRecordCount() || articleInfo.getVisitRecordCount() <= NumConstant.ZERO ? NumConstant.ONE : articleInfo.getVisitRecordCount() + 1); + } + + return articleInfo; + } + + /** + * @Description 草稿发布文章 + * @param draftId + * @return String 返回新发布文章的Id + * @author wangc + * @date 2020.06.05 09:10 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public String publishDraftToArticle(String draftId) { + //1.查找草稿内容 + DraftEntity draft = draftDao.selectById(draftId); + if(null != draft){ + //2.查找草稿内容、封面、发布范围 + List draftContents = draftContentDao.selectByDraftId(draftId,ModuleConstant.AUDIT_STATUS_PASS); + DraftCoverDTO draftCover = draftCoverDao.selectByDraftId(draftId,ModuleConstant.AUDIT_STATUS_PASS); + List draftPublishRange = draftPublishRangeDao.selectByDraftId(draftId); + + //3.生成文章以及相关记录 + ArticleEntity article = ConvertUtils.sourceToTarget(draft,ArticleEntity.class); + article.setId(null); + article.setDraftId(draftId); + baseDao.insert(article); + int order = NumConstant.ONE; + if(null != draftContents && draftContents.size() > NumConstant.ZERO){ + draftContents.forEach(content -> { + content.setOrderNum(order+NumConstant.ONE); + ArticleContentEntity contentToInsert = ConvertUtils.sourceToTarget(content,ArticleContentEntity.class); + contentToInsert.setArticleId(article.getId()); + contentToInsert.setId(null); + articleContentDao.insert(contentToInsert); + }); + } + if(null != draftPublishRange && draftPublishRange.size() > NumConstant.ZERO){ + draftPublishRange.forEach(range -> { + ArticlePublishRangeEntity rangeToInsert = ConvertUtils.sourceToTarget(range,ArticlePublishRangeEntity.class); + rangeToInsert.setArticleId(article.getId()); + rangeToInsert.setId(null); + articlePublishRangeDao.insert(rangeToInsert); + }); + if(null != draftCover){ + ArticleCoverEntity coverToInsert = ConvertUtils.sourceToTarget(draftCover,ArticleCoverEntity.class); + coverToInsert.setArticleId(article.getId()); + coverToInsert.setId(null); + articleCoverDao.insert(coverToInsert); + } + } + + return article.getId(); + } + + throw new RenException(String.format(ModuleConstant.SPECIFIED_DRAFT_NOT_FOUNT_EXCEPTION_TEMPLATE,draftId)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleTagsServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleTagsServiceImpl.java new file mode 100644 index 0000000000..7d0eac9bf6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleTagsServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleTagsDao; +import com.epmet.dto.ArticleTagsDTO; +import com.epmet.entity.ArticleTagsEntity; +import com.epmet.redis.ArticleTagsRedis; +import com.epmet.service.ArticleTagsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleTagsServiceImpl extends BaseServiceImpl implements ArticleTagsService { + + @Autowired + private ArticleTagsRedis articleTagsRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleTagsDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleTagsDTO.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 ArticleTagsDTO get(String id) { + ArticleTagsEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleTagsDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleTagsDTO dto) { + ArticleTagsEntity entity = ConvertUtils.sourceToTarget(dto, ArticleTagsEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleTagsDTO dto) { + ArticleTagsEntity entity = ConvertUtils.sourceToTarget(dto, ArticleTagsEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java new file mode 100644 index 0000000000..9e42ddaccf --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ArticleVisitRecordDao; +import com.epmet.dto.ArticleVisitRecordDTO; +import com.epmet.entity.ArticleVisitRecordEntity; +import com.epmet.redis.ArticleVisitRecordRedis; +import com.epmet.service.ArticleVisitRecordService; +import com.epmet.utils.ModuleConstant; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleVisitRecordServiceImpl extends BaseServiceImpl implements ArticleVisitRecordService { + + @Autowired + private ArticleVisitRecordRedis articleVisitRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ArticleVisitRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ArticleVisitRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + String gridId = (String)params.get(ModuleConstant.FIELD_GRID_ID_CAMEL); + String userId = (String)params.get(ModuleConstant.FIELD_USER_ID_CAMEL); + String articleId = (String)params.get(ModuleConstant.FIELD_ARTICLE_ID_CAMEL); + String customerId = (String)params.get(ModuleConstant.FIELD_CUSTOMER_ID_CAMEL); + String delFlag = (String)params.get(FieldConstant.DEL_FLAG_HUMP); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(gridId),ModuleConstant.FIELD_GRID_ID,gridId); + wrapper.eq(StringUtils.isNotBlank(userId),ModuleConstant.FIELD_USER_ID,userId); + wrapper.eq(StringUtils.isNotBlank(articleId), ModuleConstant.FIELD_ARTICLE_ID,articleId); + wrapper.eq(StringUtils.isNotBlank(delFlag),FieldConstant.DEL_FLAG,delFlag); + wrapper.eq(StringUtils.isNotBlank(customerId),ModuleConstant.FIELD_CUSTOMER_ID,customerId); + return wrapper; + } + + @Override + public ArticleVisitRecordDTO get(String id) { + ArticleVisitRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ArticleVisitRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ArticleVisitRecordDTO dto) { + ArticleVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, ArticleVisitRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ArticleVisitRecordDTO dto) { + ArticleVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, ArticleVisitRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftContentServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftContentServiceImpl.java new file mode 100644 index 0000000000..2bf0807e44 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftContentServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.DraftContentDao; +import com.epmet.dto.DraftContentDTO; +import com.epmet.entity.DraftContentEntity; +import com.epmet.redis.DraftContentRedis; +import com.epmet.service.DraftContentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftContentServiceImpl extends BaseServiceImpl implements DraftContentService { + + @Autowired + private DraftContentRedis draftContentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DraftContentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DraftContentDTO.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 DraftContentDTO get(String id) { + DraftContentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DraftContentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DraftContentDTO dto) { + DraftContentEntity entity = ConvertUtils.sourceToTarget(dto, DraftContentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DraftContentDTO dto) { + DraftContentEntity entity = ConvertUtils.sourceToTarget(dto, DraftContentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftCoverServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftCoverServiceImpl.java new file mode 100644 index 0000000000..722ef35742 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftCoverServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.DraftCoverDao; +import com.epmet.dto.DraftCoverDTO; +import com.epmet.entity.DraftCoverEntity; +import com.epmet.redis.DraftCoverRedis; +import com.epmet.service.DraftCoverService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftCoverServiceImpl extends BaseServiceImpl implements DraftCoverService { + + @Autowired + private DraftCoverRedis draftCoverRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DraftCoverDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DraftCoverDTO.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 DraftCoverDTO get(String id) { + DraftCoverEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DraftCoverDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DraftCoverDTO dto) { + DraftCoverEntity entity = ConvertUtils.sourceToTarget(dto, DraftCoverEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DraftCoverDTO dto) { + DraftCoverEntity entity = ConvertUtils.sourceToTarget(dto, DraftCoverEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftPublishRangeServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftPublishRangeServiceImpl.java new file mode 100644 index 0000000000..9e5554e0c0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftPublishRangeServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.DraftPublishRangeDao; +import com.epmet.dto.DraftPublishRangeDTO; +import com.epmet.entity.DraftPublishRangeEntity; +import com.epmet.redis.DraftPublishRangeRedis; +import com.epmet.service.DraftPublishRangeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftPublishRangeServiceImpl extends BaseServiceImpl implements DraftPublishRangeService { + + @Autowired + private DraftPublishRangeRedis draftPublishRangeRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DraftPublishRangeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DraftPublishRangeDTO.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 DraftPublishRangeDTO get(String id) { + DraftPublishRangeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DraftPublishRangeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DraftPublishRangeDTO dto) { + DraftPublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, DraftPublishRangeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DraftPublishRangeDTO dto) { + DraftPublishRangeEntity entity = ConvertUtils.sourceToTarget(dto, DraftPublishRangeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java new file mode 100644 index 0000000000..1cd8271353 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -0,0 +1,173 @@ +/** + * 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.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DraftConstant; +import com.epmet.dao.DraftDao; +import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftDetailFormDTO; +import com.epmet.dto.form.DraftListFormDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.DraftEntity; +import com.epmet.redis.DraftRedis; +import com.epmet.service.DraftService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftServiceImpl extends BaseServiceImpl implements DraftService { + private Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private DraftRedis draftRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DraftDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DraftDTO.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 DraftDTO get(String id) { + DraftEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DraftDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DraftDTO dto) { + DraftEntity entity = ConvertUtils.sourceToTarget(dto, DraftEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DraftDTO dto) { + DraftEntity entity = ConvertUtils.sourceToTarget(dto, DraftEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void deleteDraft(DeleteDraftFormDTO formDTO) { + DraftDTO draftDTO = this.get(formDTO.getDraftId()); + // 已发布的草稿不能删除 + if (null == draftDTO || DraftConstant.PUBLISHED.equals(draftDTO.getStatusFlag())) { + logger.error(String.format("删除草稿错误,已发布的草稿不能删除。草稿id%s", formDTO.getDraftId())); + return; + } + draftDTO.setDelFlag(NumConstant.ONE); + this.update(draftDTO); + } + + @Override + public DraftContentResultDTO queryDraftContent(DraftDetailFormDTO formDTO) { + DraftContentResultDTO draftContentResultDTO = baseDao.selectDraftContent(formDTO.getDraftId()); + return draftContentResultDTO; + } + + @Override + public DraftAttrResultDTO getDraftAttr(DraftDetailFormDTO formDTO) { + DraftAttrResultDTO draftAttrResultDTO = baseDao.selectDraftAttr(formDTO.getDraftId()); + if (null != draftAttrResultDTO) { + CoverImgDTO coverImgDTO = baseDao.selectDraftCoverImg(formDTO.getDraftId()); + List gridIdList = baseDao.selectDraftGrids(formDTO.getDraftId()); + draftAttrResultDTO.setCoverImg(coverImgDTO); + draftAttrResultDTO.setGridIdList(gridIdList); + if (StringUtils.isNoneBlank(draftAttrResultDTO.getTags())) { + String[] tagNames = draftAttrResultDTO.getTags().split("\\|"); + draftAttrResultDTO.setTagNameList(tagNames); + } + } else { + logger.error(String.format("查询草稿属性失败,草稿id=%s", formDTO.getDraftId())); + } + return draftAttrResultDTO; + } + + @Override + public PageData draftList(TokenDto tokenDto, DraftListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(),formDTO.getPageSize()); + List resultList = baseDao.selectDraftList(tokenDto.getUserId()); + PageInfo pageInfo = new PageInfo<>(resultList); + return new PageData<>(resultList, pageInfo.getTotal()); + } + + @Override + public DraftDetailResultDTO queryDraftDetail(DraftDetailFormDTO formDTO) { + DraftDetailResultDTO draftDetailResultDTO=baseDao.selectDraftDetail(formDTO.getDraftId()); + if(null!=draftDetailResultDTO){ + List articleContentList=baseDao.selectDraftContentList(formDTO.getDraftId()); + draftDetailResultDTO.setArticleContentList(articleContentList); + if (StringUtils.isNoneBlank(draftDetailResultDTO.getTags())) { + String[] tagNames = draftDetailResultDTO.getTags().split("\\|"); + draftDetailResultDTO.setTagNameList(tagNames); + } + } + return draftDetailResultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java new file mode 100644 index 0000000000..8094215a25 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.TagCustomerDao; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.entity.TagCustomerEntity; +import com.epmet.redis.TagCustomerRedis; +import com.epmet.service.TagCustomerService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagCustomerServiceImpl extends BaseServiceImpl implements TagCustomerService { + + @Autowired + private TagCustomerRedis tagCustomerRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TagCustomerDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TagCustomerDTO.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 TagCustomerDTO get(String id) { + TagCustomerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TagCustomerDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TagCustomerDTO dto) { + TagCustomerEntity entity = ConvertUtils.sourceToTarget(dto, TagCustomerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TagCustomerDTO dto) { + TagCustomerEntity entity = ConvertUtils.sourceToTarget(dto, TagCustomerEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagDefaultServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagDefaultServiceImpl.java new file mode 100644 index 0000000000..b89506b691 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagDefaultServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.TagDefaultDao; +import com.epmet.dto.TagDefaultDTO; +import com.epmet.entity.TagDefaultEntity; +import com.epmet.redis.TagDefaultRedis; +import com.epmet.service.TagDefaultService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagDefaultServiceImpl extends BaseServiceImpl implements TagDefaultService { + + @Autowired + private TagDefaultRedis tagDefaultRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TagDefaultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TagDefaultDTO.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 TagDefaultDTO get(String id) { + TagDefaultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TagDefaultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TagDefaultDTO dto) { + TagDefaultEntity entity = ConvertUtils.sourceToTarget(dto, TagDefaultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TagDefaultDTO dto) { + TagDefaultEntity entity = ConvertUtils.sourceToTarget(dto, TagDefaultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagGridServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagGridServiceImpl.java new file mode 100644 index 0000000000..6593a5c0e4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagGridServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.TagGridDao; +import com.epmet.dto.TagGridDTO; +import com.epmet.entity.TagGridEntity; +import com.epmet.redis.TagGridRedis; +import com.epmet.service.TagGridService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagGridServiceImpl extends BaseServiceImpl implements TagGridService { + + @Autowired + private TagGridRedis tagGridRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TagGridDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TagGridDTO.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 TagGridDTO get(String id) { + TagGridEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TagGridDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TagGridDTO dto) { + TagGridEntity entity = ConvertUtils.sourceToTarget(dto, TagGridEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TagGridDTO dto) { + TagGridEntity entity = ConvertUtils.sourceToTarget(dto, TagGridEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java new file mode 100644 index 0000000000..340516bfb6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java @@ -0,0 +1,75 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dao.ArticleDao; +import com.epmet.dto.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.redis.TagRedis; +import com.epmet.service.TagService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class TagServiceImpl implements TagService { + + @Autowired + private TagRedis tagRedis; + @Autowired + private ArticleDao articleDao; + + /** + * @Description 已发布列表页的标签——政府端 + * @param tokenDto + * @author zxc + */ + @Override + public List tagList(TokenDto tokenDto) { + String customerId = tokenDto.getCustomerId(); + List resultDtos = tagRedis.zRevRange(customerId); + return resultDtos; + } + + /** + * @Description 已发布列表页的标签——居民端 + * @param formDto + * @author zxc + */ + @Override + public List resiTagList(ResiTagListFormDTO formDto) { + //校验 在本网格是否发布过文章 + Integer articleCounts = articleDao.checkPublishArticle(formDto); + if (articleCounts== NumConstant.ZERO){ + return new ArrayList<>(); + } + return tagRedis.zGridRevRange(formDto.getGridId()); + } + + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param tokenDto + * @param formDto + * @author zxc + */ + @Override + public List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDTO formDto) { + String customerId = tokenDto.getCustomerId(); + return tagRedis.get(customerId,formDto); + } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @Override + public List tagCascadeList(TagCascadeListFormDTO formDto) { + return tagRedis.getResiTag(formDto); + } +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java new file mode 100644 index 0000000000..e3df228591 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,67 @@ +package com.epmet.utils; + +/** + * 常量类 + * */ +public interface ModuleConstant { + /** + * 数据库列名 - 网格ID + * */ + String FIELD_GRID_ID = "GRID_ID"; + + /** + * 实体属性名 - 网格ID + * */ + String FIELD_GRID_ID_CAMEL = "gridId"; + + /** + * 数据库列名 - 客户ID + * */ + String FIELD_CUSTOMER_ID = "CUSTOMER_ID"; + + /** + * 实体属性名 - 客户ID + * */ + String FIELD_CUSTOMER_ID_CAMEL = "customerId"; + + /** + * 数据库列名 - 用户ID + * */ + String FIELD_USER_ID = "USER_ID"; + + /** + * 实体属性名 - 用户ID + * */ + String FIELD_USER_ID_CAMEL = "userId"; + + /** + * 数据库列名 - 文章ID + * */ + String FIELD_ARTICLE_ID = "ARTICLE_ID"; + + /** + * 实体属性名 - 文章ID + * */ + String FIELD_ARTICLE_ID_CAMEL = "articleId"; + + /** + * 文章未找到异常模板 + * */ + String SPECIFIED_ARTICLE_NOT_FOUND_EXCEPTION_TEMPLATE = "未找到指定文章,文章Id:【%s】,发布网格Id:【%s】,可能原因:没有该文章或者请求网格不在该文章发布范围内。"; + + /** + * 审核类型 通过 + * */ + String AUDIT_STATUS_PASS = "pass"; + + /** + * 审核类型 失败 + * */ + String AUDIT_STATUS_FAIL = "fail"; + + /** + * 草稿未找到异常模板 + * */ + String SPECIFIED_DRAFT_NOT_FOUNT_EXCEPTION_TEMPLATE = "未找到指定草稿,草稿Id:【%s】"; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml new file mode 100644 index 0000000000..fb55860502 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleContentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml new file mode 100644 index 0000000000..684910ea8d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleCoverDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml new file mode 100644 index 0000000000..14f8875696 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml new file mode 100644 index 0000000000..2b80096293 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleOperateRecordDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml new file mode 100644 index 0000000000..0052c7414a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.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/ArticleTagsDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleTagsDao.xml new file mode 100644 index 0000000000..d4dcad3ce6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleTagsDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleVisitRecordDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleVisitRecordDao.xml new file mode 100644 index 0000000000..7647247b63 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleVisitRecordDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml new file mode 100644 index 0000000000..271ba5b972 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml new file mode 100644 index 0000000000..03f8a04596 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml new file mode 100644 index 0000000000..0c1f84593f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml new file mode 100644 index 0000000000..afcb6f71a9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml new file mode 100644 index 0000000000..21234d2e14 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagDefaultDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagDefaultDao.xml new file mode 100644 index 0000000000..4916e09728 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagDefaultDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagGridDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagGridDao.xml new file mode 100644 index 0000000000..7346056561 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagGridDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql new file mode 100644 index 0000000000..3e6b5f587d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/migration/epmet_gov_voice.sql @@ -0,0 +1,278 @@ +/* + Date: 2/06/2020 16:13:38 +*/ + +-- SET NAMES utf8mb4; +-- #SET FOREIGN_KEY_CHECKS = 0; + +CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; +CREATE TABLE tag_default( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '默认标签表 默认标签表'; + +ALTER TABLE tag_default COMMENT '默认标签表'; +CREATE TABLE tag_customer( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , + USE_COUNT INT NOT NULL DEFAULT 0 COMMENT '使用计数' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '客户标签表 客户标签表'; + +ALTER TABLE tag_customer ADD INDEX INX_TAG_NAME(TAG_NAME); +ALTER TABLE tag_customer COMMENT '客户标签表'; +CREATE TABLE tag_grid( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + TAG_ID VARCHAR(64) NOT NULL COMMENT '标签ID' , + TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , + USE_COUNT INT NOT NULL DEFAULT 0 COMMENT '使用计数' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '网格标签表 网格标签表'; + +ALTER TABLE tag_grid COMMENT '网格标签表'; +CREATE TABLE article_tags( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + TAG_ID VARCHAR(64) NOT NULL COMMENT '标签ID' , + TAG_NAME VARCHAR(32) NOT NULL COMMENT '标签名称' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '文章标签表 文章标签表'; + +ALTER TABLE article_tags ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); +ALTER TABLE article_tags COMMENT '文章标签表'; +CREATE TABLE draft( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , + PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , + IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , + PUBLISH_RANGE_DESC VARCHAR(512) COMMENT '发布范围描述 所有发布范围集合,顿号隔开' , + PUBLISHER_ID VARCHAR(64) COMMENT '发布单位ID' , + PUBLISHER_NAME VARCHAR(128) COMMENT '发布单位名称' , + PUBLISHER_TYPE VARCHAR(32) COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , + PUBLISH_DATE DATE COMMENT '发布时间' , + STATUS_FLAG VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published,审核中:auditing;审核失败:auditfail' , + TAGS VARCHAR(512) COMMENT '文章标签串 竖杠分割的标签名称' , + ORG_ID VARCHAR(64) COMMENT '组织ID' , + ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , + GRID_ID VARCHAR(64) COMMENT '网格ID 数据权限使用' , + DEPARTMENT_ID VARCHAR(32) COMMENT '部门ID 数据权限使用' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '草稿表 草稿表'; + +ALTER TABLE draft COMMENT '草稿表'; +CREATE TABLE draft_content( + ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , + CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , + CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , + ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '草稿内容表 草稿内容表'; + +ALTER TABLE draft_content COMMENT '草稿内容表'; +CREATE TABLE draft_publish_range( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + DRAFT_ID VARCHAR(64) NOT NULL COMMENT 'ID草稿' , + GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , + AGENCY_ID VARCHAR(64) NOT NULL COMMENT '组织ID' , + PIDS VARCHAR(1024) NOT NULL COMMENT '所有上级组织机构ID 以英文:隔开' , + ALL_PARENT_NAME VARCHAR(1024) NOT NULL COMMENT '所有上级名称 以横杠隔开' , + OFF_LINE_TIME DATETIME COMMENT '下线时间' , + PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 未发布:unpublish ;已发布:published' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '草稿发布范围表 草稿发布范围表'; + +ALTER TABLE draft_publish_range COMMENT '草稿发布范围表'; +CREATE TABLE draft_cover( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , + IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '草稿封面表 草稿封面表'; + +ALTER TABLE draft_cover COMMENT '草稿封面表'; +CREATE TABLE article( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + DRAFT_ID VARCHAR(64) NOT NULL COMMENT '草稿ID' , + TITLE VARCHAR(128) NOT NULL COMMENT '文章标题' , + PREVIEW_CONTENT VARCHAR(512) NOT NULL COMMENT '文章内容 精简内容' , + IS_TOP INT NOT NULL COMMENT '是否置顶 1是;0否;' , + PUBLISH_RANGE_DESC VARCHAR(512) NOT NULL COMMENT '发布范围描述 所有发布范围集合,顿号隔开' , + PUBLISHER_ID VARCHAR(64) NOT NULL COMMENT '发布单位ID' , + PUBLISHER_NAME VARCHAR(128) NOT NULL COMMENT '发布单位名称' , + PUBLISHER_TYPE VARCHAR(32) NOT NULL COMMENT '发布单位类型 机关:agency;部门:department;网格:grid' , + PUBLISH_DATE DATE NOT NULL COMMENT '发布时间' , + STATUS_FLAG VARCHAR(32) NOT NULL DEFAULT 0 COMMENT '发布状态 已发布:published;已下线:offline' , + OFF_LINE_TIME DATETIME COMMENT '下线时间' , + TAGS VARCHAR(512) COMMENT '文章标签串 竖杠分割的标签名称' , + ORG_ID VARCHAR(64) COMMENT '组织ID' , + ORG_ID_PATH VARCHAR(512) COMMENT '组织ID路径 eg:字段为def:abc' , + GRID_ID VARCHAR(64) COMMENT '网格ID 数据权限使用' , + DEPARTMENT_ID VARCHAR(32) COMMENT '部门ID 数据权限使用' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '文章表 正式文章表'; + +ALTER TABLE article COMMENT '文章表'; +CREATE TABLE article_content( + ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + CONTENT VARCHAR(1024) NOT NULL COMMENT '内容' , + CONTENT_TYPE VARCHAR(32) NOT NULL COMMENT '内容类型 图片:img;文字:text' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing;' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , + ORDER_NUM INT NOT NULL COMMENT '内容顺序 从1开始' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '文章内容表 文章内容表'; + +ALTER TABLE article_content COMMENT '文章内容表'; +CREATE TABLE article_cover( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + IMG_URL VARCHAR(512) NOT NULL COMMENT '封面图片地址 url地址' , + AUDIT_STATUS VARCHAR(32) COMMENT '审核状态 通过:pass;失败:fail;审核中:auditing' , + AUDIT_REASON VARCHAR(128) COMMENT '审核理由' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '文章封面表 文章封面表'; + +ALTER TABLE article_cover COMMENT '文章封面表'; +CREATE TABLE article_publish_range( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + AGENCY_GRID_NAME VARCHAR(64) NOT NULL COMMENT '组织-网格名称' , + AGENCY_ID VARCHAR(64) NOT NULL COMMENT '组织ID' , + PIDS VARCHAR(1024) NOT NULL COMMENT '所有上级组织机构ID 以英文:隔开' , + ALL_PARENT_NAME VARCHAR(1024) NOT NULL COMMENT '所有上级名称 以横杠隔开' , + OFF_LINE_TIME DATETIME COMMENT '下线时间' , + PUBLISH_STATUS VARCHAR(32) NOT NULL COMMENT '发布状态 已发布:published;已下线:offline' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '文章发布范围表 文章发布范围表'; + +ALTER TABLE article_publish_range ADD INDEX IDX_ARTICLE_ID(ARTICLE_ID); +ALTER TABLE article_publish_range COMMENT '文章发布范围表'; +CREATE TABLE article_operate_record( + ID VARCHAR(64) NOT NULL COMMENT '主键ID 主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + OP_USER VARCHAR(128) NOT NULL COMMENT '执行人 xx街道-xx中心-姓名' , + CONTENT VARCHAR(512) NOT NULL COMMENT '操作内容 操作内容,eg:重新编辑文章;' , + OP_TYPE VARCHAR(32) NOT NULL COMMENT '操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settom;下线文章:offline;修改文章发布范围:updatepublishrange' , + OP_TIME DATETIME NOT NULL COMMENT '操作时间' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '文章操作记录表 文章操作记录表'; + +ALTER TABLE article_operate_record COMMENT '文章操作记录表'; +CREATE TABLE article_visit_record( + ID VARCHAR(64) NOT NULL COMMENT '主键ID' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + GRID_ID VARCHAR(64) NOT NULL COMMENT '网格ID' , + ARTICLE_ID VARCHAR(64) NOT NULL COMMENT '文章ID' , + USER_ID VARCHAR(64) NOT NULL COMMENT '用户ID' , + DEL_FLAG INT NOT NULL DEFAULT 0 COMMENT '删除标识 0.未删除 1.已删除' , + REVISION INT 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) +) COMMENT = '文章访问记录表 文章访问记录表'; + +ALTER TABLE article_visit_record ADD UNIQUE UNX_INDEX(ARTICLE_ID,GRID_ID,USER_ID); +ALTER TABLE article_visit_record COMMENT '文章访问记录表'; + diff --git a/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java new file mode 100644 index 0000000000..bf88b68040 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/test/java/com/epmet/ArticleServiceTest.java @@ -0,0 +1,66 @@ +package com.epmet; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.constant.DraftConstant; +import com.epmet.dto.form.DraftAttrFromDTO; +import com.epmet.dto.form.DraftContentFromDTO; +import com.epmet.service.ArticleService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ArticleServiceTest { + + + + @Autowired + private ArticleService articleService; + + @Test + public void saveOrUpdateContent() { + TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId("1"); + tokenDto.setUserId("1"); + DraftContentFromDTO draftContentFromDTO = new DraftContentFromDTO(); + //draftContentFromDTO.setDraftId("1"); + draftContentFromDTO.setTitle("testTitle"); + List list = new ArrayList<>(); + for (int i = 0; i <2 ; i++) { + DraftContentFromDTO.DraftContentDTO contentDTO = new DraftContentFromDTO.DraftContentDTO(); + contentDTO.setDraftContentId(""); + contentDTO.setContent("内容"+i); + contentDTO.setContentType("text"); + contentDTO.setOrderNum(1+i); + list.add(contentDTO); + } + draftContentFromDTO.setContentList(list); + String s = articleService.saveOrUpdateContent(tokenDto, draftContentFromDTO); + System.out.println(s); + } + + @Test + public void saveOrUpdateAttr() { + TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId("1"); + tokenDto.setUserId("1"); + DraftAttrFromDTO draftAttrFromDTO = new DraftAttrFromDTO(); + draftAttrFromDTO.setDraftId("f93b9fa4e78eadc97164fb5203aa580a"); + draftAttrFromDTO.setCoverImg("http://www.baidu.com"); + draftAttrFromDTO.setTagNameList(Arrays.asList("标签1","标签2")); + draftAttrFromDTO.setIsTop(DraftConstant.UN_TOP); + draftAttrFromDTO.setGridIdList(Arrays.asList("b3f5c5464ad3634982116c174b22ee35")); + draftAttrFromDTO.setPublisher("1"); + draftAttrFromDTO.setPublishDate("2020-06-03"); + draftAttrFromDTO.setPublisherType("agency"); + + Boolean aBoolean = articleService.saveDraftAttr(tokenDto, draftAttrFromDTO); + System.out.println(aBoolean); + } +} diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessFeignClient.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessOpenFeignClient.java similarity index 69% rename from epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessFeignClient.java rename to epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessOpenFeignClient.java index 202b2c152d..cba3dfa021 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessFeignClient.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/OperAccessOpenFeignClient.java @@ -1,19 +1,20 @@ package com.epmet.feign; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.feign.fallback.OperAccessFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.fallback.OperAccessOpenFeignClientFallback; + /** * @Description 运营端权限模块 * @Author yinzuomei - * @Date 2020/5/21 15:17 + * @Date 2020/5/21 15:17 本服务对外开放的API,其他服务通过引用此client调用该服务 */ -//, url = "http://localhost:8093" -@FeignClient(name = ServiceConstant.OPER_ACCESS_SERVER, fallback = OperAccessFeignClientFallback.class) -public interface OperAccessFeignClient { +// , url = "http://localhost:8093" +@FeignClient(name = ServiceConstant.OPER_ACCESS_SERVER, fallback = OperAccessOpenFeignClientFallback.class) +public interface OperAccessOpenFeignClient { /** * @param * @return com.epmet.commons.tools.utils.Result diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessFeignClientFallback.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessOpenFeignClientFallback.java similarity index 78% rename from epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessFeignClientFallback.java rename to epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessOpenFeignClientFallback.java index 1cd7d7915d..32693f4ed8 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessFeignClientFallback.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/feign/fallback/OperAccessOpenFeignClientFallback.java @@ -3,7 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.feign.OperAccessFeignClient; +import com.epmet.feign.OperAccessOpenFeignClient; import org.springframework.stereotype.Component; /** @@ -12,7 +12,7 @@ import org.springframework.stereotype.Component; * @Date 2020/5/21 15:47 */ @Component -public class OperAccessFeignClientFallback implements OperAccessFeignClient { +public class OperAccessOpenFeignClientFallback implements OperAccessOpenFeignClient { @Override public Result clearOperUserAccess() { return ModuleUtils.feignConError(ServiceConstant.OPER_ACCESS_SERVER, "clearOperUserAccess"); diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java new file mode 100644 index 0000000000..5b85dd5438 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:25 + */ +@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class) +public interface OperCrmOpenFeignClient { +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java new file mode 100644 index 0000000000..896781e016 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.OperCrmOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:26 + */ +@Component +public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java new file mode 100644 index 0000000000..9e81857ef7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -0,0 +1,17 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:16 + */ +@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeOpenFeignClientFallback.class) +public interface OperCustomizeOpenFeignClient { + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java new file mode 100644 index 0000000000..7b912afc73 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.OperCustomizeOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:23 + */ +@Component +public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFeignClient { +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java new file mode 100644 index 0000000000..58ff87be1e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.resi.group.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:16 + */ +@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class) +public interface ResiGroupOpenFeignClient { +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java new file mode 100644 index 0000000000..df1c7bebf2 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.resi.group.feign.fallback; + +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:17 + */ +@Component +public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClient { +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java index 610dfe3edb..36b41f84c4 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java @@ -33,8 +33,7 @@ import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; -import com.epmet.dto.result.UserRoleResultDTO; -import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.modules.constant.UserMessageConstant; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.ResiGuideFeignClient; @@ -96,7 +95,7 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl votableCountMap = new HashMap<>(); gridList.getGridIds().forEach(gridId -> { diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index cb97219777..d95ed1fd32 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -62,6 +62,12 @@ 2.0.0 compile + + com.epmet + gov-voice-client + 2.0.0 + compile + diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java new file mode 100644 index 0000000000..16a9774f59 --- /dev/null +++ b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/VoiceController.java @@ -0,0 +1,50 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CommonArticleListFormDTO; +import com.epmet.dto.result.ArticleBannerResultDTO; +import com.epmet.dto.result.ArticleLatestResultDTO; +import com.epmet.feign.GovVoiceOpenFeignClient; +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; + +@RestController +@RequestMapping("voice") +public class VoiceController { + + @Autowired + private GovVoiceOpenFeignClient govVoiceFeignClient; + + /** + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("toparticlelist") + public Result> topArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return govVoiceFeignClient.resiTopArticleList(commonArticleListFormDTO); + } + + /** + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("latestarticlelist") + public Result> latestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return govVoiceFeignClient.resiLatestArticleList(commonArticleListFormDTO); + } + +} 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 new file mode 100644 index 0000000000..ef7105186d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.resi.partymember.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.resi.partymember.feign.fallback.ResiPartyMemberOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:12 + */ +@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartyMemberOpenFeignClientFallback.class) +public interface ResiPartyMemberOpenFeignClient { +} 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 new file mode 100644 index 0000000000..cdcbbcbc92 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.resi.partymember.feign.fallback; + +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:14 + */ +@Component +public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOpenFeignClient { +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleWithTagsResultDTO.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleWithTagsResultDTO.java new file mode 100644 index 0000000000..9b55cf2d13 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/dto/result/ArticleWithTagsResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Set; + +/** + * @Description + * @ClassName ArticleWithTagsResultDTO + * @Auth wangc + * @Date 2020-06-04 16:53 + */ +@Data +public class ArticleWithTagsResultDTO implements Serializable { + private static final long serialVersionUID = 2877103226476707681L; + /** + * 文章Id + * */ + private String articleId; + + /** + * 文章标题 + * */ + private String articleTitle; + + /** + * 发布单位名称 + * */ + private String publishName; + + /** + * 发布时间(天级别) + * */ + private String publishDate; + + /** + * 文章发布内容(只截取前50字) + * */ + private String articleContent; + + /** + * 标签名称集合(竖线分隔) + * */ + private Set tagName; +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/ResiVoiceOpenFeignClient.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/ResiVoiceOpenFeignClient.java new file mode 100644 index 0000000000..a31843a85f --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/ResiVoiceOpenFeignClient.java @@ -0,0 +1,16 @@ +package com.epmet.feign; + +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.ResiVoiceOpenFeignClientFallback; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:01 + */ +@FeignClient(name = ServiceConstant.RESI_VOICE_SERVER, fallback = ResiVoiceOpenFeignClientFallback.class) +public interface ResiVoiceOpenFeignClient { +} diff --git a/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/fallback/ResiVoiceOpenFeignClientFallback.java b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/fallback/ResiVoiceOpenFeignClientFallback.java new file mode 100644 index 0000000000..f538efd990 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/src/main/java/com/epmet/feign/fallback/ResiVoiceOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.ResiVoiceOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:05 + */ +@Component +public class ResiVoiceOpenFeignClientFallback implements ResiVoiceOpenFeignClient { +} diff --git a/epmet-module/resi-voice/resi-voice-server/pom.xml b/epmet-module/resi-voice/resi-voice-server/pom.xml index 702124f779..836d94fe43 100644 --- a/epmet-module/resi-voice/resi-voice-server/pom.xml +++ b/epmet-module/resi-voice/resi-voice-server/pom.xml @@ -19,6 +19,11 @@ resi-voice-client 2.0.0 + + com.epmet + gov-voice-client + 2.0.0 + com.epmet epmet-commons-tools diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java new file mode 100644 index 0000000000..2a8bbfd988 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -0,0 +1,82 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +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.form.ArticlePageFormDTO; +import com.epmet.dto.form.ResiArticleDetailFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.ArticleDetailResultDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.feign.GovVoiceOpenFeignClient; +import com.epmet.service.ArticleService; +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; + +@RestController +@RequestMapping("article") +public class ArticleController { + + @Autowired + private ArticleService articleService; + @Autowired + private GovVoiceOpenFeignClient govVoiceOpenFeignClient; + + /** + * @Description 首页标签及更多——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("taglist") + public Result> resiTagList(@LoginUser TokenDto tokenDto, @RequestBody ResiTagListFormDTO formDto){ + ValidatorUtils.validateEntity(formDto, ResiTagListFormDTO.ResiTagListForm.class); + return new Result>().ok(articleService.resiTagList(tokenDto,formDto)); + } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @PostMapping("tagcascadelist") + public Result> tagCascadeList(@LoginUser TokenDto tokenDto, @RequestBody TagCascadeListFormDTO formDto){ + ValidatorUtils.validateEntity(formDto, TagCascadeListFormDTO.TagCascadeList.class); + return new Result>().ok(articleService.tagCascadeList(tokenDto,formDto)); + } + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("articlelist") + public Result> articleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ + ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); + return new Result>().ok(articleService.articleList(articlePageFormDTO)); + } + + /** + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("articledetail") + public Result articleDetail(@LoginUser TokenDto tokenDto,@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO){ + articleDetailFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); + return govVoiceOpenFeignClient.resiArticleDetail(articleDetailFormDTO); + } + +} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java new file mode 100644 index 0000000000..d84c9fb966 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -0,0 +1,40 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/2 15:59 + */ +public interface ArticleService { + + /** + * @Description 首页标签及更多——居民端 + * @param formDto + * @author zxc + */ + List resiTagList(TokenDto tokenDto, ResiTagListFormDTO formDto); + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + List tagCascadeList(TokenDto tokenDto, TagCascadeListFormDTO formDto); + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 返回的标签以数组形式 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + List articleList(ArticlePageFormDTO articlePageFormDTO); +} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java new file mode 100644 index 0000000000..565e6bfda3 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -0,0 +1,88 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +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.dto.form.ArticlePageFormDTO; +import com.epmet.dto.form.ResiTagListFormDTO; +import com.epmet.dto.form.TagCascadeListFormDTO; +import com.epmet.dto.result.ArticleListResultDTO; +import com.epmet.dto.result.ArticleWithTagsResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.feign.GovVoiceOpenFeignClient; +import com.epmet.service.ArticleService; +import com.epmet.utils.ModuleConstant; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.stream.Collectors; + + +/** + * @Author zxc + * @CreateTime 2020/6/2 16:00 + */ +@Service +public class ArticleServiceImpl implements ArticleService { + + @Autowired + private GovVoiceOpenFeignClient govVoiceOpenFeignClient; + + /** + * @Description 首页标签及更多——居民端 + * @param formDto + * @author zxc + */ + @Override + public List resiTagList(TokenDto tokenDto, ResiTagListFormDTO formDto) { +// formDto.setCustomerId(tokenDto.getCustomerId()); + formDto.setUserId(tokenDto.getUserId()); + return govVoiceOpenFeignClient.resiTagList(formDto).getData(); + } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @Override + public List tagCascadeList(TokenDto tokenDto, TagCascadeListFormDTO formDto) { +// formDto.setCustomerId(tokenDto.getCustomerId()); + return govVoiceOpenFeignClient.tagCascadeList(formDto).getData(); + } + + /** + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 返回的标签以数组形式 + * @param articlePageFormDTO + * @return List + * @author wangc + * @date 2020.06.03 14:19 + **/ + @Override + public List articleList(ArticlePageFormDTO articlePageFormDTO) { + Result> articles = govVoiceOpenFeignClient.resiArticleList(articlePageFormDTO); + if(articles.success() && null != articles.getData() && articles.getData().size() > NumConstant.ZERO){ + return articles.getData().stream().map(article -> { + ArticleWithTagsResultDTO artObj = ConvertUtils.sourceToTarget(article,ArticleWithTagsResultDTO.class); + artObj.setTagName(new HashSet<>()); + if(StringUtils.isNotBlank(article.getTagName())){ + String[] tagArray = article.getTagName().split(ModuleConstant.VERTICAL_BAR_WITH_ESCAPE_CHARACTER); + if(tagArray.length > NumConstant.ZERO){ + artObj.setTagName(new HashSet<>(Arrays.asList(tagArray))); + } + } + return artObj; + }).collect(Collectors.toList()); + + } + + throw new RenException(articles.getInternalMsg()); + } + +} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java new file mode 100644 index 0000000000..693bdc156d --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,12 @@ +package com.epmet.utils; + +/** + * 常量类 + * */ +public interface ModuleConstant { + + /** + * 竖线的转义字符表示 + * */ + String VERTICAL_BAR_WITH_ESCAPE_CHARACTER = "\\|"; +} diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..8aed7ac022 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-user-server: + container_name: epmet-openapi-scan-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-scan:0.3.56 + ports: + - "8107:8107" + network_mode: host # 不会创建新的网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..ef6895dc7b --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-user-server: + container_name: epmet-openapi-scan-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-scan:0.3.53 + ports: + - "8107:8107" + network_mode: host # 不会创建新的网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml new file mode 100644 index 0000000000..47462e4a16 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -0,0 +1,136 @@ + + + + epmet-cloud + com.epmet + 2.0.0 + + 4.0.0 + + epmet-openapi-scan + jar + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + com.epmet + epmet-commons-tools + 2.0.0 + + + + com.aliyun + aliyun-java-sdk-core + 3.5.0 + + + com.aliyun + aliyun-java-sdk-green + 3.5.0 + + + + org.apache.httpcomponents + httpclient + 4.5.2 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev + + true + + + 8107 + dev + + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + test + + + 8107 + test + + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + + + + \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java new file mode 100644 index 0000000000..b87a8dc231 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.openapi.scan; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * 管理后台 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ + +@SpringBootApplication +public class ScanApplication { + + public static void main(String[] args) { + SpringApplication.run(ScanApplication.class, args); + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..ae6960a52d --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.openapi.scan.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.openapi.scan.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java new file mode 100644 index 0000000000..1fcbbba9f0 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java @@ -0,0 +1,46 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author jianjun liu + * @date 2020-06-04 21:39 + **/ +public enum ImgSceneEnum { + PORN("porn", "图片智能鉴黄"), + TERRORISM("terrorism", "图片暴恐涉政识别"); + + private String code; + private String desc; + + ImgSceneEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static List getImgSceneList() { + List result = new ArrayList<>(); + ImgSceneEnum[] values = ImgSceneEnum.values(); + for (ImgSceneEnum v : values) { + result.add(v.getCode()); + } + return result; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java new file mode 100644 index 0000000000..e1dbd5897b --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/RegionIdEnum.java @@ -0,0 +1,49 @@ +package com.epmet.openapi.scan.common.enu; + +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 21:39 + **/ +public enum RegionIdEnum { + SHANG_HAI("cn-shanghai","green.cn-shanghai.aliyuncs.com"), + BEI_JING("cn-beijing","green.cn-beijing.aliyuncs.com"), + AP_SOUTHEAST_1("ap-southeast-1","green.ap-southeast-1.aliyuncs.com"), + US_WEST_1("us-west-1","green.us-west-1.aliyuncs.com"); + + private String regionId; + private String domain; + RegionIdEnum(String regionId, String domain){ + this.regionId = regionId; + this.domain = domain; + } + + public static String getDoMain(String regionId){ + if (regionId == null) { + return SHANG_HAI.getDomain(); + } + RegionIdEnum[] values = RegionIdEnum.values(); + for (RegionIdEnum v : values) { + if (regionId.equals(v.getDomain())) { + return v.getDomain(); + } + } + return SHANG_HAI.getDomain(); + } + + public String getRegionId() { + return regionId; + } + + public void setRegionId(String regionId) { + this.regionId = regionId; + } + + public String getDomain() { + return domain; + } + + public void setDomain(String domain) { + this.domain = domain; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/TestController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/TestController.java new file mode 100644 index 0000000000..e903a8d0e7 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/TestController.java @@ -0,0 +1,36 @@ +package com.epmet.openapi.scan.controller; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author jianjun liu + * @date 2020-06-04 20:39 + **/ +@RestController +@RequestMapping("test") +public class TestController { + @Value("${aliyun.green.accessKeyId}") + private String accessKeyId; + + @Value("${aliyun.green.accessKeySecret}") + private String accessKeySecret; + + @Value("${aliyun.green.regionId}") + private String regionId; + @GetMapping("api") + public Result page() { + Map map = new HashMap<>(); + map.put(accessKeyId,accessKeyId); + map.put(accessKeySecret,accessKeySecret); + map.put(regionId, regionId); + return new Result().ok(JSON.toJSONString(map)); + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ScanParam.java new file mode 100644 index 0000000000..d589aa33b7 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ScanParam.java @@ -0,0 +1,37 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +import java.util.List; + +/** + * 审查参数 + * + * @author jianjun liu + * @date 2020-06-04 21:57 + **/ +@Data +public class ScanParam { + /** + * 场景 必填 + * + * @see com.epmet.openapi.scan.common.enu.ImgSceneEnum; + */ + private List scenes; + + /** + * 要检测的内容列表,必填 + * remark:一组任务列表中的taskId不能相同 + */ + private List tasks; + + /** + * 异步检测结果回调地址,执行异步审查内容时 必填 + */ + private String callback; + + /** + * 随机字符串,该值用于回调通知请求中的签名,使用callback时 必填 + */ + private String seed; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/Task.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/Task.java new file mode 100644 index 0000000000..51f38b1b3b --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/Task.java @@ -0,0 +1,25 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +/** + * 任务参数 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 22:13 + **/ +@Data +public class Task { + + /** + * 要检测的数据id 非必填 + * + * */ + private String dataId; + + /** + * 图片url 必填 + */ + private String url; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..c2cf89a17e --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -0,0 +1,77 @@ +server: + port: @server.port@ + servlet: + context-path: /epmetscan + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-openapi-scan + #环境 dev|test|prod + profiles: + active: dev + messages: + encoding: UTF-8 + basename: i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +aliyun: + green: + accessKeyId: 123 + accessKeySecret: 456 + regionId: cn-shanghai \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml b/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..d244b6fa2a --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java new file mode 100644 index 0000000000..8c0774030d --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/BaseSample.java @@ -0,0 +1,50 @@ +import java.io.IOException; +import java.util.Properties; + +/** + * Created by liuhai.lh on 17/01/12. + */ +public class BaseSample { + + protected static String accessKeyId = "123"; + protected static String accessKeySecret = "456"; + + protected static String regionId = "cn-shanghai"; + + static { + Properties properties = new Properties(); + + try { + properties.load(BaseSample.class.getResourceAsStream("bootstrap.yml")); + accessKeyId = properties.getProperty("aliyun.green.accessKeyId"); + accessKeySecret = properties.getProperty("aliyun.green.accessKeySecret"); + regionId = properties.getProperty("aliyun.green.url"); + } catch(IOException e) { + e.printStackTrace(); + } + + } + protected static String getDomain(){ + if("cn-shanghai".equals(regionId)){ + return "green.cn-shanghai.aliyuncs.com"; + } + + if ("cn-beijing".equals(regionId)) { + return "green.cn-beijing.aliyuncs.com"; + } + + if ("ap-southeast-1".equals(regionId)) { + return "green.ap-southeast-1.aliyuncs.com"; + } + + if ("us-west-1".equals(regionId)) { + return "green.us-west-1.aliyuncs.com"; + } + + return "green.cn-shanghai.aliyuncs.com"; + } + protected static String getEndPointName(){ + return regionId; + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java new file mode 100644 index 0000000000..acba42e763 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanRequestSample.java @@ -0,0 +1,95 @@ +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.exceptions.ServerException; +import com.aliyuncs.green.model.v20180509.ImageAsyncScanRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.epmet.openapi.scan.common.enu.RegionIdEnum; + +import java.util.*; + +/** + * Created by liuhai.lh on 2017/2/17. + * 图片异步检测接口 + * @author liuhai.lh + * @date 2017/02/17 + */ +public class ImageAsyncScanRequestSample extends BaseSample{ + + public static void main(String[] args) throws Exception { + //请替换成你自己的accessKeyId、accessKeySecret + IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); + DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", RegionIdEnum.getDoMain(regionId)); + IAcsClient client = new DefaultAcsClient(profile); + + ImageAsyncScanRequest imageAsyncScanRequest = new ImageAsyncScanRequest(); + imageAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + imageAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + imageAsyncScanRequest.setEncoding("utf-8"); + imageAsyncScanRequest.setRegionId(regionId); + + + List> tasks = new ArrayList>(); + Map task1 = new LinkedHashMap(); + task1.put("dataId", UUID.randomUUID().toString()); + task1.put("url", "https://img.alicdn.com/tfs/TB1Xk_qvwmTBuNjy1XbXXaMrVXa-550-407.jpg"); + task1.put("time", new Date()); + + tasks.add(task1); + JSONObject data = new JSONObject(); + /** + * porn: 色情 + * terrorism: 暴恐 + * qrcode: 二维码 + * ad: 图片广告 + * ocr: 文字识别 + */ + data.put("scenes", Arrays.asList("porn", "ocr", "qrcode", "sface")); + data.put("tasks", tasks); + + imageAsyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON); + + /** + * 请务必设置超时时间 + */ + imageAsyncScanRequest.setConnectTimeout(3000); + imageAsyncScanRequest.setReadTimeout(6000); + + try { + HttpResponse httpResponse = client.doAction(imageAsyncScanRequest); + + if(httpResponse.isSuccess()){ + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + System.out.println(JSON.toJSONString(scrResponse, true)); + if (200 == scrResponse.getInteger("code")) { + JSONArray taskResults = scrResponse.getJSONArray("data"); + for (Object taskResult : taskResults) { + if(200 == ((JSONObject)taskResult).getInteger("code")){ + String taskId = ((JSONObject)taskResult).getString("taskId"); + // 将taskId 保存下来,间隔一段时间来轮询结果, 参照ImageAsyncScanResultsRequest + System.out.println("args = [" + taskId + "]"); + }else{ + System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code")); + } + } + } else { + System.out.println("detect not success. code:" + scrResponse.getInteger("code")); + } + }else{ + System.out.println("response not success. status:" + httpResponse.getStatus()); + } + } catch (ServerException e) { + e.printStackTrace(); + } catch (ClientException e) { + e.printStackTrace(); + } catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java new file mode 100644 index 0000000000..27e0b6e233 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageAsyncScanResultsSample.java @@ -0,0 +1,83 @@ +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.exceptions.ServerException; +import com.aliyuncs.green.model.v20180509.ImageAsyncScanResultsRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by liuhai.lh on 2017/2/17. + * 获取图片异步检测结果接口 + * @author liuhai.lh + * @date 2017/02/17 + */ +public class ImageAsyncScanResultsSample extends BaseSample{ + + public static void main(String[] args) throws Exception { + //请替换成你自己的accessKeyId、accessKeySecret + IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); + DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", getDomain()); + IAcsClient client = new DefaultAcsClient(profile); + + ImageAsyncScanResultsRequest imageAsyncScanResultsRequest = new ImageAsyncScanResultsRequest(); + imageAsyncScanResultsRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + imageAsyncScanResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + imageAsyncScanResultsRequest.setEncoding("utf-8"); + imageAsyncScanResultsRequest.setRegionId(regionId); + + + List taskIds = new ArrayList(); + taskIds.add("img1hdP5Wn0QC@7wW0n$VX0R@-1p3mnZ"); + imageAsyncScanResultsRequest.setHttpContent(JSON.toJSONString(taskIds).getBytes("UTF-8"), "UTF-8", FormatType.JSON); + + /** + * 请务必设置超时时间 + */ + imageAsyncScanResultsRequest.setConnectTimeout(3000); + imageAsyncScanResultsRequest.setReadTimeout(6000); + + try { + HttpResponse httpResponse = client.doAction(imageAsyncScanResultsRequest); + + if(httpResponse.isSuccess()){ + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + System.out.println(JSON.toJSONString(scrResponse, true)); + if (200 == scrResponse.getInteger("code")) { + JSONArray taskResults = scrResponse.getJSONArray("data"); + for (Object taskResult : taskResults) { + if(200 == ((JSONObject)taskResult).getInteger("code")){ + JSONArray sceneResults = ((JSONObject)taskResult).getJSONArray("results"); + for (Object sceneResult : sceneResults) { + String scene = ((JSONObject)sceneResult).getString("scene"); + String suggestion = ((JSONObject)sceneResult).getString("suggestion"); + //根据scene和suggetion做相关的处理 + //do something + } + }else{ + System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code")); + } + } + } else { + System.out.println("detect not success. code:" + scrResponse.getInteger("code")); + } + }else{ + System.out.println("response not success. status:" + httpResponse.getStatus()); + } + } catch (ServerException e) { + e.printStackTrace(); + } catch (ClientException e) { + e.printStackTrace(); + } catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java new file mode 100644 index 0000000000..ec418154d9 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/ImageSyncScanRequestSample.java @@ -0,0 +1,101 @@ +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.exceptions.ServerException; +import com.aliyuncs.green.model.v20180509.ImageSyncScanRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; + +import java.util.*; + +/** + * Created by liuhai.lh on 2017/2/17. + * 图片同步检测接口 + * @author liuhai.lh + * @date 2017/02/17 + */ +public class ImageSyncScanRequestSample extends BaseSample { + + + public static void main(String[] args) throws Exception { + //请替换成你自己的accessKeyId、accessKeySecret + IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret); + DefaultProfile.addEndpoint(getEndPointName(), regionId, "Green", getDomain()); + IAcsClient client = new DefaultAcsClient(profile); + + ImageSyncScanRequest imageSyncScanRequest = new ImageSyncScanRequest(); + imageSyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + imageSyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + imageSyncScanRequest.setEncoding("utf-8"); + imageSyncScanRequest.setRegionId(regionId); + + + List> tasks = new ArrayList>(); + Map task = new LinkedHashMap(); + task.put("dataId", UUID.randomUUID().toString()); + task.put("url", "http://f.hiphotos.baidu.com/image/pic/item/aa18972bd40735fa13899ac392510fb30f24084b.jpg"); + task.put("time", new Date()); + + tasks.add(task); + JSONObject data = new JSONObject(); + /** + * porn: 色情 + * terrorism: 暴恐 + * qrcode: 二维码 + * ad: 图片广告 + * ocr: 文字识别 + */ + data.put("scenes", Arrays.asList("porn","terrorism")); + data.put("tasks", tasks); + + imageSyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON); + + /** + * 请务必设置超时时间 + */ + imageSyncScanRequest.setConnectTimeout(3000); + imageSyncScanRequest.setReadTimeout(10000); + + try { + HttpResponse httpResponse = client.doAction(imageSyncScanRequest); + + if (httpResponse.isSuccess()) { + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + System.out.println(JSON.toJSONString(scrResponse, true)); + if (200 == scrResponse.getInteger("code")) { + JSONArray taskResults = scrResponse.getJSONArray("data"); + for (Object taskResult : taskResults) { + if(200 == ((JSONObject)taskResult).getInteger("code")){ + JSONArray sceneResults = ((JSONObject)taskResult).getJSONArray("results"); + for (Object sceneResult : sceneResults) { + String scene = ((JSONObject)sceneResult).getString("scene"); + String suggestion = ((JSONObject)sceneResult).getString("suggestion"); + //根据scene和suggetion做相关的处理 + //do something + System.out.println("args = [" + scene + "]"); + System.out.println("args = [" + suggestion + "]"); + } + }else{ + System.out.println("task process fail:" + ((JSONObject)taskResult).getInteger("code")); + } + } + } else { + System.out.println("detect not success. code:" + scrResponse.getInteger("code")); + } + } else { + System.out.println("response not success. status:" + httpResponse.getStatus()); + } + } catch (ServerException e) { + e.printStackTrace(); + } catch (ClientException e) { + e.printStackTrace(); + } catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/epmet-openapi/pom.xml b/epmet-openapi/pom.xml new file mode 100644 index 0000000000..47fcd27942 --- /dev/null +++ b/epmet-openapi/pom.xml @@ -0,0 +1,18 @@ + + + + epmet-cloud + com.epmet + 2.0.0 + + 4.0.0 + jar + + epmet-openapi + + epmet-openapi-scan + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/pom.xml b/epmet-user/epmet-user-client/pom.xml index da75b38ba7..7b15551338 100644 --- a/epmet-user/epmet-user-client/pom.xml +++ b/epmet-user/epmet-user-client/pom.xml @@ -26,6 +26,12 @@ io.springfox springfox-swagger-ui + + com.epmet + gov-org-client + 2.0.0 + compile + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java index 1bc1e03a24..4d82df0d1f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java @@ -1,17 +1,47 @@ package com.epmet.constant; /** - * 角色key常量 + * 政府端工作人员角色key常量 */ public class RoleKeyConstants { - + /** + * 管理员 + */ public static final String ROLE_KEY_MANAGER = "manager"; + + /** + * 党建负责人 + */ public static final String ROLE_KEY_PARTY_PRINCIPALS = "party_principals"; + + /** + * 网格长 + */ public static final String ROLE_KEY_GRID_MANAGER = "grid_manager"; + + /** + * 单位领导 + */ public static final String ROLE_KEY_AGENCY_LEADER = "agency_leader"; + + /** + * 网格党建指导员 + */ public static final String ROLE_KEY_GRID_PARTY_DIRECTOR = "grid_party_director"; + + /** + * 部门领导 + */ public static final String ROLE_KEY_DEPT_LEADER = "dept_leader"; + + /** + * 工作人员 + */ public static final String ROLE_KEY_STAFF = "staff"; + + /** + * 网格员 + */ public static final String ROLE_KEY_GRID_MEMBER = "grid_member"; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffRoleListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffRoleListFormDTO.java new file mode 100644 index 0000000000..050dc62091 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffRoleListFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 查询客户下人员拥有的角色列表-接口入参 + * @Author sun + */ +@Data +public class CustomerStaffRoleListFormDTO implements Serializable{ + private static final long serialVersionUID = -7994579456530273809L; + + /** + * 客户Id + * */ + private String customerId; + /** + * 用户Id + * */ + @NotBlank(message = "用户Id不能为空") + private String staffId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java new file mode 100644 index 0000000000..62dd66c8a0 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class TagCustomerFormDTO implements Serializable{ + + private static final long serialVersionUID = -6722269597588807655L; + /** + * 用户Id + * */ + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleListResultDTO.java new file mode 100644 index 0000000000..66b843e924 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleListResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 根据客户Id staffId查询人员在客户下的角色列表-接口返参 + * @Author sun + */ +@Data +public class CustomerStaffRoleListResultDTO implements Serializable { + private static final long serialVersionUID = -2049883620062097446L; + + /** + * 客户Id + * */ + private String customerId; + /** + * 员工Id + * */ + private String staffId; + /** + * 员工姓名 + * */ + private String staffName; + /** + * 角色Id + * */ + private String roleId; + /** + * 角色Key + * */ + private String roleKey; + /** + * 角色名称 + * */ + private String roleName; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleResultDTO.java new file mode 100644 index 0000000000..f54628f303 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerStaffRoleResultDTO.java @@ -0,0 +1,48 @@ +/** + * 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.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 工作人员角色 + * + * @author sun + */ +@Data +public class CustomerStaffRoleResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 工作人员Id + */ + private String staffId = ""; + /** + * 人员角色Key + */ + private String roleKey = ""; + /** + * 人员角色名称 + */ + private String roleName = ""; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TagCustomerResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TagCustomerResultDTO.java new file mode 100644 index 0000000000..73f3498b2e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/TagCustomerResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zxc + */ +@Data +public class TagCustomerResultDTO implements Serializable { + + private static final long serialVersionUID = 4890020932450803062L; + /** + * 客户id + * */ + private String customerId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java new file mode 100644 index 0000000000..93c756c76a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -0,0 +1,66 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import org.springframework.cloud.openfeign.FeignClient; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:09 + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) +public interface EpmetUserOpenFeignClient { + + /** + * 从缓存中查询已登录用户的基本信息以及角色等相关信息 + * + * @return + */ + @PostMapping("/epmetuser/user/loginuserdetails") + Result getLoginUserDetails(@RequestBody LoginUserDetailsFormDTO dto); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + **/ + @PostMapping("/epmetuser/staffrole/getcustomerstaffrolelist") + Result> getCustomerStaffRoleList(@RequestBody CustomerStaffRoleListFormDTO formDTO); + + /** + * 根据staffId查询人员拥有的所有角色信息 + * + * @param staffId + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/2 16:11 + */ + @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") + Result> getStaffRoles(@PathVariable String staffId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + @PostMapping("/epmetuser/customerstaff/getcustomerstaff/{staffId}") + Result getCustomerStaff(@PathVariable("staffId") String staffId); + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java new file mode 100644 index 0000000000..8d1d933de2 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java @@ -0,0 +1,55 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.dto.result.TagCustomerResultDTO; +import com.epmet.feign.fallback.EpmetUserSelfFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +/** + * @author sun + * @dscription epmet-user服务 + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserSelfFeignClientFallBack.class) +public interface EpmetUserSelfFeignClient { + + /** + * 从缓存中查询已登录用户的基本信息以及角色等相关信息 + * + * @return + */ + @PostMapping("/epmetuser/user/loginuserdetails") + Result getLoginUserDetails(@RequestBody LoginUserDetailsFormDTO dto); + + /** + * @param formDTO + * @Description 根据userId获取customerId + * @author zxc + */ + @PostMapping("/epmetuser/user/getcustomeridbyuserid") + Result getCustomerIdByUserId(@RequestBody TagCustomerFormDTO formDTO); + + /** + * 根据staffId查询人员拥有的所有角色信息 + * + * @param staffId + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/2 16:11 + */ + @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") + Result> getStaffRoles(@PathVariable String staffId); + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java new file mode 100644 index 0000000000..58b4543d2d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -0,0 +1,45 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:10 + */ +@Component +public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClient { + + @Override + public Result getLoginUserDetails(LoginUserDetailsFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLoginUserDetails", dto); + } + + @Override + public Result> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoleList", formDTO); + } + + @Override + public Result> getStaffRoles(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffRoles", staffId); + } + + @Override + public Result getCustomerStaff(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaff", staffId); + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java new file mode 100644 index 0000000000..5b6c8abb57 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java @@ -0,0 +1,40 @@ +package com.epmet.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.form.TagCustomerFormDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.dto.result.TagCustomerResultDTO; +import com.epmet.feign.EpmetUserSelfFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @dscription epmet-user服务 + * @author sun + */ +@Component +public class EpmetUserSelfFeignClientFallBack implements EpmetUserSelfFeignClient { + + @Override + public Result getLoginUserDetails(LoginUserDetailsFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getLoginUserDetails", dto); + } + + @Override + public Result getCustomerIdByUserId(TagCustomerFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerIdByUserId", formDTO); + } + + @Override + public Result> getStaffRoles(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffRoles", staffId); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index f77e5deb4d..ca315b6c68 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -273,4 +273,15 @@ public class CustomerStaffController { return new Result().ok(customerStaffService.getCustomerStaffList(staffIdList)); } + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + @PostMapping(value = "getcustomerstaff/{staffId}") + public Result getCustomerStaff(@PathVariable("staffId") String staffId){ + return new Result().ok(customerStaffService.getCustomerStaff(staffId)); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 7b9424076f..2eada17f01 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -9,6 +9,9 @@ import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerRoleFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.GovStaffRoleEntity; @@ -142,4 +145,26 @@ public class StaffRoleController { GovStaffRoleDTO role = govStaffRoleService.getRoleByCustomerIdAndRoleKey(form.getCustomerId(), form.getRoleKey()); return new Result().ok(role); } + + /** + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + * @Author sun + **/ + @PostMapping("getcustomerstaffrolelist") + public Result> getCustomerStaffRoleList(@RequestBody CustomerStaffRoleListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(staffRoleService.getCustomerStaffRoleList(formDTO)); + } + + /** + * 根据staffId查询人员拥有的所有角色信息 + * @author zhaoqifeng + * @date 2020/6/2 16:11 + * @param staffId + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("staffroles/{staffId}") + public Result> getStaffRoles(@PathVariable String staffId) { + return new Result>().ok(staffRoleService.getStaffRoles(staffId)); + } } 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 c5dbec183f..4922683935 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 @@ -132,4 +132,12 @@ public interface CustomerStaffDao extends BaseDao { * @Description 根据staffId集合查询工作人员基础信息 **/ List selectStaffByIds(@Param("staffIdList") List staffIdList); + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + CustomerStaffDTO selectByStaffId(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index c7e1be6e9c..5cf2cd03b7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -22,10 +22,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.StaffListResultDTO; -import com.epmet.dto.result.StaffRolesResultDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -85,4 +83,19 @@ public interface StaffRoleDao extends BaseDao { * @Description 根据staffId集合查询人员拥有的所有角色信息 **/ List selectStaffRoleList(@Param("staffIdList") List staffIdList); + + /** + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + * @Author sun + **/ + List selectCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); + + /** + * 根据staffId查询人员拥有的所有角色信息 + * @author zhaoqifeng + * @date 2020/6/2 15:54 + * @param staffId + * @return java.util.List + */ + List selectStaffRoles(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 4f4908cf32..c166c3093f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -225,4 +225,11 @@ public interface CustomerStaffService extends BaseService { **/ CustomerStaffListResultDTO getCustomerStaffList(List staffIdList); + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + CustomerStaffDTO getCustomerStaff(String staffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java index 04dfb2d94f..f3913d588b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java @@ -23,7 +23,10 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; +import com.epmet.dto.form.CustomerStaffRoleListFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.StaffRoleEntity; @@ -130,4 +133,19 @@ public interface StaffRoleService extends BaseService { * @date 2020.04.29 23:44 **/ Result> getSpecificRolesStaffs(RolesUsersListFormDTO rolesUsersListFormDTO); + + /** + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + * @Author sun + **/ + List getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO); + + /** + * 根据staffId查询人员拥有的所有角色信息 + * @author zhaoqifeng + * @date 2020/6/2 15:54 + * @param staffId + * @return java.util.List + */ + List getStaffRoles(String staffId); } \ No newline at end of file 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 ba47befa3f..be1796082c 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 @@ -424,4 +424,15 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>().ok(new ArrayList<>()); } + /** + * @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表 + * @Author sun + **/ + @Override + public List getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) { + return baseDao.selectCustomerStaffRoleList(formDTO); + } + + @Override + public List getStaffRoles(String staffId) { + return baseDao.selectStaffRoles(staffId); + } + } \ No newline at end of file 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 ea61d2b9a0..b9bea4e305 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 @@ -193,4 +193,14 @@ user_id = #{userId} + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index 1f570a073d..94ae4b700d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -119,4 +119,41 @@ sr.staff_id = #{staffId} + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 741f491b12..ee379a6b7a 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,7 @@ epmet-admin epmet-module epmet-user + epmet-openapi