diff --git a/epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml b/epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml index a01d47f829..3d9b60add2 100644 --- a/epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml +++ b/epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-admin-server: container_name: epmet-admin-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-admin-server:0.3.12 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-admin-server:0.3.13 ports: - "8082:8082" network_mode: host # 使用现有网络 diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 98fa262234..81e6b31a39 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -110,6 +110,8 @@ false + + false @@ -140,6 +142,8 @@ false + + true diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml index 5c0eba5a63..0275695054 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml +++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml @@ -66,6 +66,15 @@ spring: namespace: @nacos.config.namespace@ group: @nacos.config.group@ file-extension: yaml + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 management: endpoints: web: diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index e7908c2727..e76069a10f 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.16 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.23 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/deploy/docker-compose-test.yml b/epmet-auth/deploy/docker-compose-test.yml index 84ff2951b8..e177ec9944 100644 --- a/epmet-auth/deploy/docker-compose-test.yml +++ b/epmet-auth/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.15 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.21 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index cdfd640802..25c493667a 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.16 + 0.3.23 com.epmet epmet-cloud @@ -159,8 +159,8 @@ 111 111 - wx9b6102a8ee5add65 - 16fdb68bc2b3e732324ba5d8b8a9b5e2 + wx07674c23af51b521 + a2fd0d29b007cbbcf8c8dda8c693d99b wx3d1372029eb816a3 651f02d71ed3f123dfb584b8bf0f4d8b @@ -196,8 +196,8 @@ 111 111 - wx9b6102a8ee5add65 - 16fdb68bc2b3e732324ba5d8b8a9b5e2 + wx07674c23af51b521 + a2fd0d29b007cbbcf8c8dda8c693d99b wx3d1372029eb816a3 651f02d71ed3f123dfb584b8bf0f4d8b diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java index 477195041b..1eb86003bd 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java @@ -4,10 +4,7 @@ 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.GovWxmpEnteOrgFormDTO; -import com.epmet.dto.form.GovWxmpFormDTO; -import com.epmet.dto.form.SendSmsCodeFormDTO; -import com.epmet.dto.form.StaffOrgsFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.GovLoginService; @@ -53,7 +50,7 @@ public class GovLoginController { **/ @PostMapping(value = "/loginwxmp/sendsmscode") public Result sendSmsCode(@RequestBody SendSmsCodeFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO,SendSmsCodeFormDTO.AddUserShowGroup.class); govLoginService.sendSmsCode(formDTO); return new Result(); } @@ -67,7 +64,7 @@ public class GovLoginController { **/ @PostMapping(value = "/loginwxmp/getmyorg") public Result> getmyorg(@RequestBody StaffOrgsFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO,StaffOrgsFormDTO.AddUserShowGroup.class); List staffOrgs=govLoginService.getMyOrg(formDTO); return new Result>().ok(staffOrgs); } @@ -98,5 +95,17 @@ public class GovLoginController { govLoginService.loginOut(tokenDto); return new Result(); } + + /** + * 更新缓存的角色列表 + * @param form + * @return + */ + @PostMapping("/updatecachedroles") + public Result updateCachedRoles(@RequestBody UpdateCachedRolesFormDTO form) { + ValidatorUtils.validateEntity(form); + govLoginService.updateCachedRoles(form.getStaffId(), form.getOrgId(), form.getRoleIds()); + return new Result(); + } } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java index 8d82624aee..fe21b303d4 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SendSmsCodeFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,7 +14,13 @@ import java.io.Serializable; @Data public class SendSmsCodeFormDTO implements Serializable { private static final long serialVersionUID = -1852541457359282018L; - - @NotBlank(message = "手机号不能为空") + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) private String mobile; } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgsFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgsFormDTO.java index e36c100809..e2f32fd286 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgsFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/StaffOrgsFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,11 +14,17 @@ import java.io.Serializable; @Data public class StaffOrgsFormDTO implements Serializable { private static final long serialVersionUID = 4193133227120225342L; - + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } /** * 手机号 */ - @NotBlank(message = "手机号不能为空") + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) private String mobile; /** diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/UpdateCachedRolesFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/UpdateCachedRolesFormDTO.java new file mode 100644 index 0000000000..80559c4ec5 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/UpdateCachedRolesFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +@Data +public class UpdateCachedRolesFormDTO { + + @NotBlank(message = "客户ID不能为空") + private String staffId; + + @NotBlank(message = "机关ID不能为空") + private String orgId; + + private List roleIds; + +} diff --git a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java index 37b78533b5..a07565cf50 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java @@ -61,4 +61,11 @@ public interface GovLoginService { * @Date 2020/4/21 22:08 **/ void loginOut(TokenDto tokenDto); + + /** + * 更新缓存中的角色列表 + * @param staffId + * @param roleIds + */ + void updateCachedRoles(String staffId, String orgId, List roleIds); } 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 42c52ff600..bbb71f448b 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 @@ -2,24 +2,27 @@ package com.epmet.service.impl; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.PhoneValidatorUtils; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; 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; @@ -50,8 +53,6 @@ public class GovLoginServiceImpl implements GovLoginService { @Autowired private CaptchaRedis captchaRedis; @Autowired - private MessageFeignClient messageFeignClient; - @Autowired private JwtTokenUtils jwtTokenUtils; @Autowired private JwtTokenProperties jwtTokenProperties; @@ -59,6 +60,8 @@ public class GovLoginServiceImpl implements GovLoginService { private CpUserDetailRedis cpUserDetailRedis; @Autowired private GovOrgFeignClient govOrgFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * @param formDTO @@ -72,8 +75,7 @@ public class GovLoginServiceImpl implements GovLoginService { //1、校验手机号是否符合规范 if (!PhoneValidatorUtils.isMobile(formDTO.getMobile())) { logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg())); - //TODO 2020-05-21 手机号验证先去掉方便测试 - //throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); + throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); } //2、根据手机号校验用户是否存在 Result> customerStaffResult = epmetUserFeignClient.checkCustomerStaff(formDTO.getMobile()); @@ -81,14 +83,17 @@ public class GovLoginServiceImpl implements GovLoginService { logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } - //3、发送短信验证码 TODO 2020-05-21 发送验证先去掉方便测试 - /*Result> smsCodeResult = messageFeignClient.sendSmsCaptcha(formDTO.getMobile()); + //3、发送短信验证码 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(formDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.LGOIN_CONFIRM); + Result smsCodeResult=epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); if (!smsCodeResult.success()) { logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg())); throw new RenException(smsCodeResult.getCode()); } //4、保存短信验证码(删除现有短信验证码、将新的短信验证码存入Redis) - captchaRedis.saveSmsCode(formDTO, smsCodeResult.getData().get("code"));*/ + captchaRedis.saveSmsCode(formDTO, smsCodeResult.getData().getCode()); logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getMobile())); } @@ -111,8 +116,7 @@ public class GovLoginServiceImpl implements GovLoginService { String rightSmsCode = captchaRedis.getSmsCode(formDTO.getMobile()); if (!formDTO.getSmsCode().equals(rightSmsCode)) { logger.error(String.format("验证码错误code[%s],msg[%s]",EpmetErrorCode.MOBILE_CODE_ERROR.getCode(),EpmetErrorCode.MOBILE_CODE_ERROR.getMsg())); - //TODO 2020-05-21 校验验证码先去掉方便测试 - //throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); } //3、查询用户所有的组织信息 List customerIdList = new ArrayList<>(); @@ -170,7 +174,7 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setToken(token); govTokenDto.setUpdateTime(System.currentTimeMillis()); govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); - govTokenDto.setAgencyId(staffLatestAgency.getAgencyId()); + govTokenDto.setRootAgencyId(staffLatestAgency.getAgencyId()); govTokenDto.setCustomerId(staffLatestAgency.getCustomerId()); //设置部门,网格,角色列表 @@ -178,7 +182,8 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setGridIdList(getGridIdList(staffLatestAgency.getStaffId())); CustomerAgencyDTO agency = getAgencyByStaffId(staffLatestAgency.getStaffId()); if (agency != null) { - govTokenDto.setRoleIdList(queryGovStaffRoleIds(staffLatestAgency.getStaffId(), agency.getId())); + govTokenDto.setAgencyId(agency.getId()); + govTokenDto.setRoleList(queryGovStaffRoles(staffLatestAgency.getStaffId(), agency.getId())); } govTokenDto.setOrgIdPath(getOrgIdPath(staffLatestAgency.getStaffId())); @@ -192,13 +197,14 @@ public class GovLoginServiceImpl implements GovLoginService { * @param orgId * @return */ - public Set queryGovStaffRoleIds(String staffId, String orgId) { + public List queryGovStaffRoles(String staffId, String orgId) { StaffRoleFormDTO formDTO = new StaffRoleFormDTO(); formDTO.setStaffId(staffId); formDTO.setOrgId(orgId); Result> gridResult = epmetUserFeignClient.getRolesOfStaff(formDTO); if (!CollectionUtils.isEmpty(gridResult.getData())) { - return gridResult.getData().stream().map(role -> role.getId()).collect(Collectors.toSet()); + //return gridResult.getData().stream().map(role -> role.getId()).collect(Collectors.toSet()); + return ConvertUtils.sourceToTarget(gridResult.getData(), GovTokenDto.Role.class); } return null; } @@ -285,6 +291,17 @@ public class GovLoginServiceImpl implements GovLoginService { cpUserDetailRedis.logout(tokenDto.getApp() , tokenDto.getClient() , tokenDto.getUserId()); } + @Override + public void updateCachedRoles(String staffId, String orgId, List roleIds) { + GovTokenDto userDetails = cpUserDetailRedis.get(AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, staffId, GovTokenDto.class); + if (userDetails == null) { + return; + } + List roles = queryGovStaffRoles(staffId, orgId); + userDetails.setRoleList(roles); + cpUserDetailRedis.set(userDetails, jwtTokenProperties.getExpire()); + } + //保存登录日志 private Result saveStaffLoginRecord(GovWxmpEnteOrgFormDTO formDTO, String staffId, String openId) { StaffLoginAgencyRecordFormDTO staffLoginAgencyRecordFormDTO = new StaffLoginAgencyRecordFormDTO(); @@ -347,7 +364,7 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setToken(token); govTokenDto.setUpdateTime(System.currentTimeMillis()); govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); - govTokenDto.setAgencyId(orgId); + govTokenDto.setRootAgencyId(orgId); govTokenDto.setCustomerId(customerId); //设置部门,网格,角色列表 @@ -355,10 +372,10 @@ public class GovLoginServiceImpl implements GovLoginService { govTokenDto.setGridIdList(getGridIdList(staffId)); CustomerAgencyDTO agency = getAgencyByStaffId(staffId); if (agency != null) { - govTokenDto.setRoleIdList(queryGovStaffRoleIds(staffId, agency.getId())); + govTokenDto.setAgencyId(agency.getId()); + govTokenDto.setRoleList(queryGovStaffRoles(staffId, agency.getId())); } govTokenDto.setOrgIdPath(getOrgIdPath(staffId)); - cpUserDetailRedis.set(govTokenDto, expire); logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); } 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-auth/src/test/java/com/epmet/TokenGenTest.java b/epmet-auth/src/test/java/com/epmet/TokenGenTest.java index e337632663..578e7a6652 100644 --- a/epmet-auth/src/test/java/com/epmet/TokenGenTest.java +++ b/epmet-auth/src/test/java/com/epmet/TokenGenTest.java @@ -78,7 +78,7 @@ public class TokenGenTest { govTokenDto.setGridIdList(govLoginService.getGridIdList(staffId)); CustomerAgencyDTO agency = govLoginService.getAgencyByStaffId(staffId); if (agency != null) { - govTokenDto.setRoleIdList(govLoginService.queryGovStaffRoleIds(staffId, agency.getId())); + govTokenDto.setRoleList(govLoginService.queryGovStaffRoles(staffId, agency.getId())); } govTokenDto.setOrgIdPath(govLoginService.getOrgIdPath(staffId)); diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index f759f036b9..8e526e2a73 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 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 d85182f71e..574072a71a 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 gridIdArgName() default ""; + String gridIdsArgName() default ""; /** * 部门ID参数名 * @return */ - String deptIdArgName() default ""; + String deptIdsArgName() 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 3250a4f25f..0772305976 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,6 +19,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.Set; + /** * 数据过滤,切面处理类 * @@ -57,24 +59,24 @@ public class DataFilterAspect { MethodSignature methodSignature = (MethodSignature) point.getSignature(); DataFilter dataFilterAnno = methodSignature.getMethod().getAnnotation(DataFilter.class); String tableAlias = dataFilterAnno.tableAliases()[0]; - String gridIdArgName = dataFilterAnno.gridIdArgName(); - String deptIdArgName = dataFilterAnno.deptIdArgName(); + String gridIdsArgName = dataFilterAnno.gridIdsArgName(); + String deptIdsArgName = dataFilterAnno.deptIdsArgName(); String[] parameterNames = methodSignature.getParameterNames(); // 取出注解参数中指定的gridId和deptId的入参的值 - String gridId = null; - String deptId = null; - if (StringUtils.isNotBlank(gridIdArgName)) { - int gridIdArgIndex = ArrayUtils.indexOf(parameterNames, gridIdArgName); + Set gridIds = null; + Set deptIds = null; + if (StringUtils.isNotBlank(gridIdsArgName)) { + int gridIdArgIndex = ArrayUtils.indexOf(parameterNames, gridIdsArgName); if (gridIdArgIndex >-1){ - gridId = (String) point.getArgs()[gridIdArgIndex]; + gridIds = (Set) point.getArgs()[gridIdArgIndex]; } } - if (StringUtils.isNotBlank(deptIdArgName)) { - int deptArgIndex = ArrayUtils.indexOf(parameterNames, deptIdArgName); + if (StringUtils.isNotBlank(deptIdsArgName)) { + int deptArgIndex = ArrayUtils.indexOf(parameterNames, deptIdsArgName); if (deptArgIndex > -1) { - deptId = (String) point.getArgs()[deptArgIndex]; + deptIds = (Set) point.getArgs()[deptArgIndex]; } } @@ -84,8 +86,8 @@ public class DataFilterAspect { form.setApp(loginUserUtil.getLoginUserApp()); form.setClient(loginUserUtil.getLoginUserClient()); form.setUserId(loginUserUtil.getLoginUserId()); - form.setDepartmentId(deptId); - form.setGridId(gridId); + form.setDepartmentIds(deptIds); + form.setGridIds(gridIds); 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 e0d6b266d6..25c92a11a8 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,6 +3,7 @@ package com.epmet.commons.mybatis.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import java.util.Set; @Data public class GetSQLFilterFormDTO { @@ -21,8 +22,8 @@ public class GetSQLFilterFormDTO { private String tableAlias; - private String gridId; + private Set gridIds; - private String departmentId; + private Set departmentIds; } 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 2c6e0d5ed8..2b712ff301 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,25 +16,10 @@ import java.util.Set; * @Description * @Author sun */ -//, url = "localhost:8099" +//@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = MybatisGovAccessFeignClientFallback.class, url = "localhost:8099") @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = MybatisGovAccessFeignClientFallback.class) public interface MybatisGovAccessFeignClient { - /** - * 查询角色的操作key对应操作范围列表 - * @param operationScopeFormDTO - * @return - */ - @PostMapping("/gov/access/access/operationscopes") - Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO); - - /** - * 查询角色所有operation及其范围(缓存) - * @return - */ - @PostMapping("/gov/access/access/roleallopesandscopes/{roleId}") - Result> listRoleAllOperationScopesByRoleId(@PathVariable("roleId") String roleId); - /** * 查询sql过滤片段 * @param form diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/MybatisGovAccessFeignClientFallback.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/MybatisGovAccessFeignClientFallback.java index a14452346a..97f64e9d95 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/MybatisGovAccessFeignClientFallback.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/feign/fallback/MybatisGovAccessFeignClientFallback.java @@ -21,16 +21,6 @@ import java.util.Set; @Component public class MybatisGovAccessFeignClientFallback implements MybatisGovAccessFeignClient { - @Override - public Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getOperationScopesByRoleId", operationScopeFormDTO); - } - - @Override - public Result> listRoleAllOperationScopesByRoleId(@PathVariable("roleId") String roleId){ - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listRoleAllOperationScopesByRoleId", roleId); - } - @Override public Result getSqlFilterSegment(GetSQLFilterFormDTO form) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getSqlFilterSegment", form); diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java index 1b9215e22a..1015ade75d 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java @@ -48,14 +48,11 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { public void insertFill(MetaObject metaObject) { Date date = new Date(); if (metaObject.getOriginalObject() instanceof BaseEpmetEntity) { - String loginUserId = loginUserUtil.getLoginUserId(); // epmet项目新增的 - loginUserId = StringUtils.isBlank(loginUserId) ? Constant.APP_USER_FLAG : loginUserId; - //Long deptId = user == null ? null : user.getDeptId(); setFieldValByName(FieldConstant.CREATED_TIME_HUMP, date, metaObject); - setFieldValByName(FieldConstant.CREATED_BY_HUMP, loginUserId, metaObject); + setFieldValByName(FieldConstant.CREATED_BY_HUMP, getCreatedByFieldValue(metaObject), metaObject); setFieldValByName(FieldConstant.UPDATED_TIME_HUMP, date, metaObject); - setFieldValByName(FieldConstant.UPDATED_BY_HUMP, loginUserId, metaObject); + setFieldValByName(FieldConstant.UPDATED_BY_HUMP, getUpdatedByFieldValue(metaObject), metaObject); setFieldValByName(FieldConstant.REVISION_HUMP, NumConstant.ZERO, metaObject); //删除标识 setFieldValByName(FieldConstant.DEL_FLAG_HUMP, EpmetDelFlagEnum.NORMAL.value(), metaObject); @@ -82,6 +79,32 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { } } + public Object getCreatedByFieldValue(MetaObject metaObject) { + Object value = loginUserUtil.getLoginUserId(); + if (value == null) { + if (metaObject.hasGetter(FieldConstant.CREATED_BY_HUMP)) { + value = metaObject.getValue(FieldConstant.CREATED_BY_HUMP); + } + if (value == null) { + value = Constant.APP_USER_FLAG; + } + } + return value; + } + + public Object getUpdatedByFieldValue(MetaObject metaObject) { + Object value = loginUserUtil.getLoginUserId(); + if (value == null) { + if (metaObject.hasGetter(FieldConstant.UPDATED_BY_HUMP)) { + value = metaObject.getValue(FieldConstant.UPDATED_BY_HUMP); + } + if (value == null) { + value = Constant.APP_USER_FLAG; + } + } + return value; + } + @Override public void updateFill(MetaObject metaObject) { @@ -111,9 +134,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { //更新时间 setFieldValByName(UPDATE_DATE, new Date(), metaObject); } else if (fillEsuaEntity) { - String loginUserId = loginUserUtil.getLoginUserId(); - String userId = StringUtils.isBlank(loginUserId) ? Constant.APP_USER_FLAG : loginUserId; - setFieldValByName(FieldConstant.UPDATED_BY_HUMP, userId, metaObject); + setFieldValByName(FieldConstant.UPDATED_BY_HUMP, getUpdatedByFieldValue(metaObject), metaObject); setFieldValByName(FieldConstant.UPDATED_TIME_HUMP, new Date(), metaObject); } } diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 53697b265e..216ec1c8b1 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -123,6 +123,12 @@ lombok ${lombok.version} + + + org.apache.httpcomponents + httpclient + 4.5.2 + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java index 732ac08e32..3e7af3ced6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java @@ -1,10 +1,7 @@ package com.epmet.commons.tools.aspect; import com.epmet.commons.tools.constant.AppClientConstant; -import com.epmet.commons.tools.exception.ErrorCode; -import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.exception.*; import com.epmet.commons.tools.utils.Result; import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.ProceedingJoinPoint; @@ -156,9 +153,18 @@ public abstract class BaseRequestLogAspect { * @return */ private Result handleValidateException(ValidateException ex) { - Result result=new Result(); - result.setCode(ex.getCode()); - result.setMsg(ex.getMsg()); + Result result = null; + if (Integer.valueOf(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode()).equals(ex.getCode())) { + // 显示给客户的 + result = new Result(); + result.setCode(ex.getCode()); + result.setMsg(ex.getMsg()); + result.setInternalMsg(ex.getMsg()); + } else { + // 不显示给客户的 + result = new Result().error(); + result.setInternalMsg(ex.getMsg()); + } return result; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java index 1eca4a088b..65673d8e19 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java @@ -41,6 +41,11 @@ public interface AppClientConstant { * */ String CLIENT = "client"; + /** + * 客户ID + */ + String CUSTOMER_ID = "customerId"; + /** * 事务流水号,每次请求串起来的多个服务拥有相同的流水号,便于日志追踪 */ 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 5f13d2bb81..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; @@ -39,6 +40,7 @@ public interface NumConstant { long TWO_L = 2L; long THREE_L = 3L; long FOUR_L = 4L; + long MINUS_ONE_L = -1L; String ZERO_STR = "0"; String ONE_STR = "1"; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index 3ac97e8e0e..0b1295ab88 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -103,4 +103,19 @@ public interface ServiceConstant { * 共通 */ String EPMET_COMMON_SERVICE = "common-service-server"; + + /** + * 政府端-党建声音 + */ + String GOV_VOICE_SERVER = "gov-voice-server"; + + /** + * 居民端-党建声音 + */ + String RESI_VOICE_SERVER = "resi-voice-server"; + + /** + * 数据统计 + */ + String DATA_STATISTICAL_SERVER = "data-statistical-server"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index 769ace3cab..b4a81ce53a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -29,6 +29,11 @@ public interface StrConstant { */ String HYPHEN = "-"; + /** + * 短下划线符号 + */ + String UNDER_LINE = "_"; + /** * 英文逗号 */ @@ -38,4 +43,9 @@ public interface StrConstant { * 冒号 */ String COLON = ":"; + + /** + * 中文顿号 + */ + String COMMA_ZH = "、"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java new file mode 100644 index 0000000000..b548bad87f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java @@ -0,0 +1,88 @@ +package com.epmet.commons.tools.dto.form; + +import com.alibaba.fastjson.JSON; +import lombok.Data; +import org.springframework.util.CollectionUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * desc: 钉钉文本消息参数 实体类 + * date: 2019/2/20 11:00 + * @author: jianjun liu + * email:liujianjun@yunzongnet.com + */ +public class DingTalkTextMsg { + + /** + * 消息接收者 + */ + private String receiver; + /** + * 发送内容 + */ + private String content; + + /** + * at的群成员手机号 + */ + private List atMobiles; + + /** + * 是否at所有人 + */ + private boolean isAtAll; + + public String getReceiver() { + return receiver; + } + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public List getAtMobiles() { + return atMobiles; + } + + public void setAtMobiles(List atMobiles) { + this.atMobiles = atMobiles; + } + + public boolean isAtAll() { + return isAtAll; + } + + public void setAtAll(boolean atAll) { + isAtAll = atAll; + } + + public String getMsgContent() { + Map items = new HashMap<>(); + items.put("msgtype", "text"); + + Map textContent = new HashMap<>(); + textContent.put("content", getContent()); + items.put("text", textContent); + + Map atItems = new HashMap<>(); + if (!CollectionUtils.isEmpty(atMobiles)) { + atItems.put("atMobiles", atMobiles); + } + if (isAtAll) { + atItems.put("isAtAll", isAtAll); + } + items.put("at", atItems); + return JSON.toJSONString(items); + } +} 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 1e7e8d4016..9de4b0d167 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 @@ -76,23 +76,47 @@ public enum RequirePermissionEnum { /** * 基层治理-议题管理 */ - WORK_GRASSROOTS_ISSUE_VOTINGLIST("work_grassroots_issue_voting_list","表决中列","表决中议题列表查询"), - WORK_GRASSROOTS_ISSUE_SHIFTED_PROJECT_LIST("work_grassroots_issue_shifted_project_list", "已转项目列表查询","已转项目议题列表查询"), - WORK_GRASSROOTS_ISSUE_CLOSED_LIST("work_grassroots_issue_closed_list","已关闭","已关闭议题列表查询"), - WORK_GRASSROOTS_ISSUE_DETAIL("work_grassroots_issue_detail", "议题详情","议题详情界面所有的api添加此校验"), - WORK_GRASSROOTS_ISSUE_SHIFT_PROJECT("work_grassroots_issue_shift_project", "转项目","转项目(选择处理部门api也需要添加此校验)"), - WORK_GRASSROOTS_ISSUE_CLOSE("work_grassroots_issue_close","关闭议题","关闭议题"), + WORK_GRASSROOTS_ISSUE_VOTINGLIST("work_grassroots_issue_voting_list","基层治理:议题管理:表决中","表决中议题列表查询"), + WORK_GRASSROOTS_ISSUE_SHIFTED_PROJECT_LIST("work_grassroots_issue_shifted_project_list", "基层治理:议题管理:已转项目列表查询","已转项目议题列表查询"), + WORK_GRASSROOTS_ISSUE_CLOSED_LIST("work_grassroots_issue_closed_list","基层治理:议题管理:已关闭","已关闭议题列表查询"), + WORK_GRASSROOTS_ISSUE_DETAIL("work_grassroots_issue_detail", "基层治理:议题管理:议题详情","议题详情界面所有的api添加此校验"), + WORK_GRASSROOTS_ISSUE_SHIFT_PROJECT("work_grassroots_issue_shift_project", "基层治理:议题管理:转项目","转项目(选择处理部门api也需要添加此校验)"), + WORK_GRASSROOTS_ISSUE_CLOSE("work_grassroots_issue_close","基层治理:议题管理:关闭议题","关闭议题"), /** * 工作-项目跟踪 */ - WORK_PROJECT_TRACE_PENDING_LIST("work_project_trace_pending_list","待处理","待处理的项目,列表查询"), - WORK_PROJECT_TRACE_CREATED_LIST("work_project_trace_created_list","我发起","我发起的项目,列表查询"), - WORK_PROJECT_TRACE_INVOLVED_LIST("work_project_trace_involved_list","我参与","我参与的项目,列表查询"), - WORK_PROJECT_TRACE_DETAIL("work_project_trace_detail","项目详情","项目详情界面所有的api添加此校验"), - WORK_PROJECT_TRACE_CLOSE("work_project_trace_close","结案","结案"), - WORK_PROJECT_TRACE_TRANSFER("work_project_trace_transfer","转其他部门","转其他部门(选择处理部门api也需要添加此校验)"), - WORK_PROJECT_TRACE_RETURN("work_project_trace_return","退回","退回"); + WORK_PROJECT_TRACE_PENDING_LIST("work_project_trace_pending_list","项目跟踪:待处理","待处理的项目,列表查询"), + WORK_PROJECT_TRACE_CREATED_LIST("work_project_trace_created_list","项目跟踪:我发起","我发起的项目,列表查询"), + WORK_PROJECT_TRACE_INVOLVED_LIST("work_project_trace_involved_list","项目跟踪:我参与","我参与的项目,列表查询"), + WORK_PROJECT_TRACE_DETAIL("work_project_trace_detail","项目跟踪:项目详情","项目详情界面所有的api添加此校验"), + WORK_PROJECT_TRACE_CLOSE("work_project_trace_close","项目跟踪:结案","结案"), + WORK_PROJECT_TRACE_TRANSFER("work_project_trace_transfer","项目跟踪:转其他部门","转其他部门(选择处理部门api也需要添加此校验)"), + WORK_PROJECT_TRACE_RETURN("work_project_trace_return","项目跟踪:退回","退回"), + + /** + * 党务工作-党建声音 + */ + 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_OPERATION_LIST("work_party_voice_operation_list","党建声音:查看文章操作记录",""), + + /** + * 基层治理-支部管理 + */ + WORK_GRASSROOTS_PARTY_BRANCH_ADD("work_grassroots_party_branch_add","基层治理:支部管理:添加党支部","支部管理-添加党支部"), + WORK_GRASSROOTS_PARTY_BRANCH_EDIT("work_grassroots_party_branch_edit","基层治理:支部管理:编辑党支部","支部管理-编辑党支部信息"), + WORK_GRASSROOTS_PARTY_BRANCH_DELETE("work_grassroots_party_branch_delete","基层治理:支部管理:删除党支部","支部管理-删除党支部"), + WORK_GRASSROOTS_PARTY_MEMBER_ADD("work_grassroots_party_member_add","基层治理:支部管理:添加党员","支部管理-添加党员"), + WORK_GRASSROOTS_PARTY_MEMBER_EDIT("work_grassroots_party_member_edit","基层治理:支部管理:编辑党员","支部管理-编辑党员"), + WORK_GRASSROOTS_PARTY_MEMBER_DELETE("work_grassroots_party_member_delete","基层治理:支部管理:删除党员","支部管理-删除党员"); private String key; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 32c074f291..e12787cc3b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -6,6 +6,8 @@ package com.epmet.commons.tools.exception; * @Description: */ public enum EpmetErrorCode { + + ERR10002( 10002,"数据库中已存在该记录"), /** * 账号或密码错误ACCOUNT_NOT_EXIST */ @@ -35,7 +37,13 @@ public enum EpmetErrorCode { MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), NOT_DEL_GRID(8106,"该网格存在工作人员,不允许删除"), + ORG_IS_NOT_NULL(8107,"党组织关系不能为空"), + CANNOT_DELETE_PARTY_BRANCH(8108,"当前支部存在党员,不允许删除"), + IDCARDNO_ALREADY_EXITS(8109,"系统已存在相同身份证号码,请重新输入"), + IDCARDNO_ERROR(8110,"身份证号格式错误,请重新输入"), + CANNOT_DELETE_PARTY_MEMBER(8111,"该用户已注册党员,不允许删除"), + CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), @@ -65,8 +73,13 @@ public enum EpmetErrorCode { OPER_UPLOAD_FILE_OVER_SIZE(8707, "文件体积过大"), OPER_UPLOAD_FILE_TYPE_ERROR(8708, "文件类型错误"), + // 党建声音 前端提示 88段 + DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), + ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"), + CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"); + private int code; private String msg; @@ -82,7 +95,7 @@ public enum EpmetErrorCode { return epmetErrorCodeEnum.getMsg(); } } - return null; + return EpmetErrorCode.SERVER_ERROR.getMsg(); } public int getCode(){ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovAccessFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovAccessFeignClient.java index 180cef4025..4d04ce783d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovAccessFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovAccessFeignClient.java @@ -2,40 +2,21 @@ package com.epmet.commons.tools.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; -import com.epmet.commons.tools.dto.form.RoleOpeScopeResultDTO; import com.epmet.commons.tools.feign.fallback.CommonGovAccessFeignClientFallback; import com.epmet.commons.tools.utils.Result; 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; /** * @Description * @Author sun */ -//, url = "localhost:8099" +//@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = CommonGovAccessFeignClientFallback.class, url = "localhost:8099") @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = CommonGovAccessFeignClientFallback.class) public interface CommonGovAccessFeignClient { - /** - * 查询登陆用户信息 - * @return - */ - @PostMapping("/gov/access/access/loginuserinfo") - Result getLoginUserInfo(@RequestBody LoginUserInfoFormDTO dto); - - /** - * 查询角色所有operation及其范围(缓存) - * @return - */ - @PostMapping("/gov/access/access/roleallopesandscopes/{roleId}") - Result> listRoleAllOperationScopesByRoleId(@PathVariable("roleId") String roleId); - /** * 用户是否具有指定权限 * @param form diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovAccessFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovAccessFeignClientFallback.java index feb8af499f..bc564fe148 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovAccessFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovAccessFeignClientFallback.java @@ -2,16 +2,10 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; -import com.epmet.commons.tools.dto.form.RoleOpeScopeResultDTO; import com.epmet.commons.tools.feign.CommonGovAccessFeignClient; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PathVariable; - -import java.util.List; /** * 调用政府端权限 @@ -22,16 +16,6 @@ import java.util.List; @Component public class CommonGovAccessFeignClientFallback implements CommonGovAccessFeignClient { - @Override - public Result getLoginUserInfo(LoginUserInfoFormDTO dto) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getLoginUserInfo", dto); - } - - @Override - public Result> listRoleAllOperationScopesByRoleId(@PathVariable("roleId") String roleId){ - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listRoleAllOperationScopesByRoleId", roleId); - } - @Override public Result hasSpecifiedPermission(HasSpecifiedPermissionFormDTO form) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "hasSpecifiedPermission", form); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java new file mode 100644 index 0000000000..826bb05905 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java @@ -0,0 +1,97 @@ +package com.epmet.commons.tools.filter; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.filter.LevelFilter; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.classic.spi.IThrowableProxy; +import ch.qos.logback.classic.spi.StackTraceElementProxy; +import ch.qos.logback.core.spi.FilterReply; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.SimpleDateFormat; + +/** + * desc: 发送日志消息 + * + * @date: 2020/6/24 17:47 + * @author: jianjun liu + */ +public class LogMsgSendFilter extends LevelFilter { + private static final Logger logger = LoggerFactory.getLogger(LogMsgSendFilter.class); + @Override + public FilterReply decide(ILoggingEvent event) { + //如果日志级别等于设置的日志级别 则发送消息 + if (event.getLevel().isGreaterOrEqual(Level.ERROR)) { + try { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("【日志告警】\n"); + + stringBuilder.append("\n"); + + stringBuilder.append("告警级别:" + event.getLevel()); + stringBuilder.append("\n"); + stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp())); + stringBuilder.append("\n"); + stringBuilder.append("TraceId:" + Thread.currentThread().getName()); + stringBuilder.append("\n"); + stringBuilder.append("告警信息:" + event.getFormattedMessage()); + stringBuilder.append("\n"); + + IThrowableProxy throwableProxy = event.getThrowableProxy(); + //异常信息处理 暂时处理一级的5行数据 + apendStackInfo(stringBuilder, throwableProxy); + + Result flag = HttpClientManager.getInstance().sendAlarmMsg(stringBuilder.toString()); + if (!flag.success()) { + logger.warn("msgSender.sendMsg fail,param:{}", stringBuilder.toString()); + } + } catch (Exception e) { + logger.warn("decide exception", e); + } + } + //交给其他filter继续向下处理 + return super.decide(event); + } + + private void apendStackInfo(StringBuilder stringBuilder, IThrowableProxy throwableProxy) { + int defaultRowLine = 5; + if (throwableProxy != null) { + stringBuilder.append("异常信息:") + .append(throwableProxy.getClassName()) + .append(" : ") + .append(throwableProxy.getMessage()) + .append("\n"); + + StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray(); + StackTraceElementProxy stackTraceElementProxy = null; + + if (stackTraceElementProxyArray.length < defaultRowLine) { + defaultRowLine = stackTraceElementProxyArray.length; + } + for (int i = 0; i < defaultRowLine; i++) { + stackTraceElementProxy = stackTraceElementProxyArray[i]; + StackTraceElement stackTraceElement = stackTraceElementProxy.getStackTraceElement(); + stringBuilder.append("\t\tat "); + stringBuilder.append(stackTraceElement.getClassName()); + stringBuilder.append("."); + stringBuilder.append(stackTraceElement.getMethodName()); + stringBuilder.append("("); + stringBuilder.append(stackTraceElement.getFileName()); + stringBuilder.append(":"); + stringBuilder.append(stackTraceElement.getLineNumber()); + stringBuilder.append(")"); + stringBuilder.append("\n"); + } + } + } + + + private String formatLongTime2Str(long timestamp) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + return dateFormat.format(timestamp); + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 321211465d..dcf93d3a24 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -8,6 +8,8 @@ package com.epmet.commons.tools.redis; +import com.epmet.commons.tools.constant.StrConstant; + /** * @author Mark sunlightcs@gmail.com * @since 1.0.0 @@ -213,4 +215,43 @@ public class RedisKeys { public static String getAgencyByIdKey(String agencyId) { return rootPrefix.concat("gov:agency:").concat(agencyId); } + + /** + * 客户标签排行 缓存Key + * @param customerId + * @return + */ + public static String getCustomerTagKey(String customerId) { + return rootPrefix.concat("tags:customer:rankingTag:").concat(customerId); + } + + /** + * 客户关联标签 缓存Key + * @param customerId + * @param tagId + * @return + */ + public static String getCustomerReTagKey(String customerId,String tagId) { + return rootPrefix.concat("tags:customer:relationTag:").concat(customerId).concat(StrConstant.COLON).concat(tagId); + } + + /** + * 网格标签排行 缓存Key + * @param gridId + * @return + */ + public static String getGridTagKey(String gridId) { + return rootPrefix.concat("tags:grid:rankingTag:").concat(gridId); + } + + /** + * 网格关联标签 缓存Key + * @param gridId + * @param tagId + * @return + */ + public static String getGridReTagKey(String gridId,String tagId) { + return rootPrefix.concat("tags:grid:relationTag:").concat(gridId).concat(StrConstant.COLON).concat(tagId); + } + } 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..f7f985ed63 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 @@ -10,10 +10,10 @@ package com.epmet.commons.tools.redis; import com.epmet.commons.tools.constant.NumConstant; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.data.redis.connection.RedisConnection; 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.*; import org.springframework.data.redis.support.atomic.RedisAtomicLong; import org.springframework.stereotype.Component; @@ -262,4 +262,58 @@ 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; + } + + /** + * @Description 标签使用数量缓存更新 + * @param key + * @param value + * @param delta + * @author zxc + */ + public Double zIncrementScore(String key, Object value, double delta) { + return redisTemplate.opsForZSet().incrementScore(key, value, delta); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/ImgScanParamDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/ImgScanParamDTO.java new file mode 100644 index 0000000000..15a50be668 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/ImgScanParamDTO.java @@ -0,0 +1,25 @@ +package com.epmet.commons.tools.scan.param; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 审查参数 + * + * @author jianjun liu + * @date 2020-06-04 21:57 + **/ +@Data +public class ImgScanParamDTO implements Serializable { + + private static final long serialVersionUID = -5982388188212400644L; + + /** + * 要检测的内容列表,必填 + * remark:一组任务列表中的taskId不能相同 + */ + private List tasks = new ArrayList<>(); +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/ImgTaskDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/ImgTaskDTO.java new file mode 100644 index 0000000000..a724f437ee --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/ImgTaskDTO.java @@ -0,0 +1,28 @@ +package com.epmet.commons.tools.scan.param; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 任务参数 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 22:13 + **/ +@Data +public class ImgTaskDTO implements Serializable { + + private static final long serialVersionUID = -747206284930578105L; + /** + * 要检测的数据id 非必填 + * + * */ + private String dataId; + + /** + * 图片url 必填 + */ + private String url; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/TextScanParamDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/TextScanParamDTO.java new file mode 100644 index 0000000000..9fa8b8104f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/TextScanParamDTO.java @@ -0,0 +1,25 @@ +package com.epmet.commons.tools.scan.param; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 文本审查参数 + * + * @author jianjun liu + * @date 2020-06-05 11:17 + **/ +@Data +public class TextScanParamDTO implements Serializable { + + private static final long serialVersionUID = -6244354240835340471L; + + /** + * 要检测的内容列表,必填 + * remark:一组任务列表中的taskId不能相同 + */ + private List tasks = new ArrayList<>(); +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/TextTaskDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/TextTaskDTO.java new file mode 100644 index 0000000000..5e7791f628 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/TextTaskDTO.java @@ -0,0 +1,28 @@ +package com.epmet.commons.tools.scan.param; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 任务参数 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 22:13 + **/ +@Data +public class TextTaskDTO implements Serializable { + + private static final long serialVersionUID = 6957195274696018630L; + /** + * 要检测的数据id 非必填 + * + * */ + private String dataId; + + /** + * 文本内容 必填 最多不能超过10000 + */ + private String content; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/SyncScanResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/SyncScanResult.java new file mode 100644 index 0000000000..edab5da461 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/SyncScanResult.java @@ -0,0 +1,42 @@ +package com.epmet.commons.tools.scan.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 检测结果 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-05 10:52 + **/ +@Data +public class SyncScanResult implements Serializable { + /** + * 执行成功的任务Id集合 + */ + private List successDataIds = new ArrayList<>(); + /** + * 执行失败的任务Id集合 + */ + private List failDataIds = new ArrayList<>(); + + /** + * 本地是否全部通过 + */ + private boolean isAllPass; + + public boolean isAllPass() { + if (failDataIds.isEmpty() && !successDataIds.isEmpty()) { + return true; + } + return isAllPass; + } + + public void setAllPass(boolean allPass) { + isAllPass = allPass; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java index 1025d173a4..c0fe871d08 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/GovTokenDto.java @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON; import lombok.Data; import java.io.Serializable; +import java.util.Comparator; +import java.util.List; import java.util.Set; /** @@ -47,6 +49,11 @@ public class GovTokenDto extends BaseTokenDto implements Serializable { /** * 当前登录的组织id(顶级) */ + private String rootAgencyId; + + /** + * 当前用户所属的机关单位id + */ private String agencyId; /** @@ -77,7 +84,18 @@ public class GovTokenDto extends BaseTokenDto implements Serializable { /** * 角色ID列表 */ - private Set roleIdList; + private List roleList; + + @Data + public static class Role { + + private String id; + private String roleKey; + private String roleName; + + public Role() { + } + } @Override public String toString() { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/TokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/TokenDto.java index 642bad2941..6db5a629cd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/TokenDto.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/TokenDto.java @@ -40,6 +40,11 @@ public class TokenDto extends BaseTokenDto implements Serializable { */ private long updateTime; + /** + * 当前工作人员进入的客户id + */ + private String customerId; + @Override public String toString() { return JSON.toJSONString(this); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java index ec70df9403..57a537d027 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/resolver/LoginUserHandlerMethodArgumentResolver.java @@ -10,6 +10,7 @@ package com.epmet.commons.tools.security.resolver; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -77,10 +78,12 @@ public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgu // String client=keyArray[1]; // String userId=keyArray[2]; // TokenDto tokenDto = cpUserDetailRedis.get(app,client,userId); + TokenDto tokenDto = new TokenDto(); - tokenDto.setUserId(request.getHeader("userId")); - tokenDto.setApp(request.getHeader("app")); - tokenDto.setClient(request.getHeader("client")); + tokenDto.setUserId(request.getHeader(AppClientConstant.USER_ID)); + tokenDto.setApp(request.getHeader(AppClientConstant.APP)); + tokenDto.setClient(request.getHeader(AppClientConstant.CLIENT)); + tokenDto.setCustomerId(request.getHeader(AppClientConstant.CUSTOMER_ID)); logger.info("resolveArgument TokenDto:"+ JSON.toJSONString(tokenDto)); logger.info("CURRENT-REDIS-DATABASE---------!!!!!!:"+redisDb); return tokenDto; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index e4fcc31010..532420581a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

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

* 版权所有,侵权必究! */ @@ -16,7 +16,7 @@ import org.joda.time.format.DateTimeFormatter; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Date; +import java.util.*; /** * 日期处理工具类 @@ -25,21 +25,37 @@ import java.util.Date; * @since 1.0.0 */ public class DateUtils { - /** 时间格式(yyyy-MM-dd) */ - public final static String DATE_PATTERN = "yyyy-MM-dd"; - /** 时间格式(yyyy-MM-dd HH:mm:ss) */ - public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; + + /** 季度月份列表 */ + public static final List Q1Months = Arrays.asList(1, 2, 3); + public static final List Q2Months = Arrays.asList(4, 5, 6); + public static final List Q3Months = Arrays.asList(7, 8, 9); + public static final List Q4Months = Arrays.asList(10, 11, 12); + + /** 时间格式(yyyy-MM-dd) */ + public final static String DATE_PATTERN = "yyyy-MM-dd"; + /** 时间格式(yyyy-MM-dd HH:mm:ss) */ + public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; /** 时间格式(yyyyMMddHHmmss) */ - public final static String DATE_TIME_NO_SPLIT = "yyyyMMddHHmmss"; + public final static String DATE_TIME_NO_SPLIT = "yyyyMMddHHmmss"; /** 时间格式(yyyy-MM-dd HH:mm) */ public final static String DATE_TIME_PATTERN_END_WITH_MINUTE = "yyyy-MM-dd HH:mm"; + public static final String DATE_PATTERN_YYYYMMDD = "yyyyMMdd"; + public static final String DATE_NAME_PATTERN = "yyyy年MM月dd日"; + public static final String MONTH_NAME_PATTERN = "yyyy年MM月"; + public static final String DATE_PATTERN_YYYY = "yyyy"; + public static final String DATE_PATTERN_YYYYMM = "yyyyMM"; + public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM"; + public static final String WEEK_TYPE_ENGLISH = "english"; + public static final String WEEK_TYPE_CHINESE = "chinese"; + /** * 日期格式化 日期格式为:yyyy-MM-dd * @param date 日期 - * @return 返回yyyy-MM-dd格式日期 + * @return 返回yyyy-MM-dd格式日期 */ - public static String format(Date date) { + public static String format(Date date) { return format(date, DATE_PATTERN); } @@ -47,10 +63,10 @@ public class DateUtils { * 日期格式化 日期格式为:yyyy-MM-dd * @param date 日期 * @param pattern 格式,如:DateUtils.DATE_TIME_PATTERN - * @return 返回yyyy-MM-dd格式日期 + * @return 返回yyyy-MM-dd格式日期 */ public static String format(Date date, String pattern) { - if(date != null){ + if (date != null) { SimpleDateFormat df = new SimpleDateFormat(pattern); return df.format(date); } @@ -61,7 +77,7 @@ public class DateUtils { * 日期解析 * @param date 日期 * @param pattern 格式,如:DateUtils.DATE_TIME_PATTERN - * @return 返回Date + * @return 返回Date */ public static Date parse(String date, String pattern) { try { @@ -78,7 +94,7 @@ public class DateUtils { * @param pattern 日期的格式,如:DateUtils.DATE_TIME_PATTERN */ public static Date stringToDate(String strDate, String pattern) { - if (StringUtils.isBlank(strDate)){ + if (StringUtils.isBlank(strDate)) { return null; } @@ -89,7 +105,7 @@ public class DateUtils { /** * 根据周数,获取开始日期、结束日期 * @param week 周期 0本周,-1上周,-2上上周,1下周,2下下周 - * @return 返回date[0]开始日期、date[1]结束日期 + * @return 返回date[0]开始日期、date[1]结束日期 */ public static Date[] getWeekStartAndEnd(int week) { DateTime dateTime = new DateTime(); @@ -101,6 +117,21 @@ public class DateUtils { return new Date[]{beginDate, endDate}; } + /** + * 根据日期,获取周开始日期、结束日期 + * @param date + * @return + */ + public static Date[] getWeekStartAndEnd(Date date) { + DateTime dateTime = new DateTime(date); + LocalDate localDate = new LocalDate(dateTime); + + localDate = localDate.dayOfWeek().withMinimumValue(); + Date beginDate = localDate.toDate(); + Date endDate = localDate.plusDays(6).toDate(); + return new Date[]{beginDate, endDate}; + } + /** * 对日期的【秒】进行加/减 * @@ -184,4 +215,260 @@ public class DateUtils { DateTime dateTime = new DateTime(date); return dateTime.plusYears(years).toDate(); } + + /** + * 获取星期几,例如:星期一 + * @param date + * @return + */ + public static String getWeekNameOfWeek(Date date, String type) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); + String[] chineseWeekDayName = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"}; + String[] englishWeekDayName = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; + + String weekDayName; + switch (type) { + case WEEK_TYPE_ENGLISH: + weekDayName = englishWeekDayName[dayOfWeek - 1]; + break; + case WEEK_TYPE_CHINESE: + weekDayName = chineseWeekDayName[dayOfWeek - 1]; + break; + default: + weekDayName = ""; + } + + return weekDayName; + } + + //public static String getEnglishWeekName(Date date) { + // new SimpleDateFormat("E"); + //} + + /** + * 获取属于一年的第几周 + * @param date + * @return + */ + public static int getWeekOfYear(Date date) { + DateTime dateTime = new DateTime(date); + return dateTime.getWeekOfWeekyear(); + } + + /** + * 按照格式进行时间取整 + * @param targetDate + * @param pattern + * @return + */ + public static Date integrate(Date targetDate, String pattern) { + return DateUtils.parse(DateUtils.format(targetDate, pattern), pattern); + } + + /** + * 查询指定日期是几月 + * @param date + * @return + */ + public static int getMonthOfYear(Date date) { + LocalDate localDate = new LocalDate(date); + return localDate.getMonthOfYear(); + } + + /** + * 获取季度 + * @param date + * @return + */ + public static int getQuarterIndex(Date date) { + LocalDate localDate = new LocalDate(date); + int monthOfYear = localDate.getMonthOfYear(); + if (Q1Months.contains(monthOfYear)) { + return 1; + } + if (Q2Months.contains(monthOfYear)) { + return 2; + } + if (Q3Months.contains(monthOfYear)) { + return 3; + } + return 4; + } + + /** + * 根据季度查询季度的月份列表 + * @param quarterIndex + * @return + */ + public static List getMonthsByQuarterIndex(Integer quarterIndex) { + switch (quarterIndex) { + case 1: + return Q1Months; + case 2: + return Q2Months; + case 3: + return Q3Months; + default: + return Q4Months; + } + } + + /** + * 获取季度的开始date + * @param year + * @param quarterIndex + * @return + */ + public static Date getQuarterStartDate(String year, Integer quarterIndex) { + List months = getMonthsByQuarterIndex(quarterIndex); + String yyyyMM = year.concat(String.format("%02d", months.get(0))); + return DateUtils.parse(yyyyMM, DateUtils.DATE_PATTERN_YYYYMM); + } + + /** + * 获取季度的结束date + * @param year + * @param quarterIndex + * @return + */ + public static Date getQuarterEndDate(String year, Integer quarterIndex) { + List months = getMonthsByQuarterIndex(quarterIndex); + String yyyyMM = year.concat(String.format("%02d", months.get(2))); + Date nextMonth = DateUtils.addDateMonths(DateUtils.parse(yyyyMM, DateUtils.DATE_PATTERN_YYYYMM), 1); + // 用下一个季度开头-1天就是上一个月季度最后一天 + return DateUtils.addDateDays(nextMonth, -1); + } + + public static void main(String[] args) { + //int weekOfYear = getWeekOfYear(new Date()); + String format = String.format("%02d", 9); + + System.out.println(666); + } + + /** + * 获取日期前一天 + * @author zhaoqifeng + * @date 2020/6/22 11:08 + * @param date + * @return java.util.Date + */ + public static Date getBeforeDay(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DATE, -1); + return calendar.getTime(); + } + + /** + * @return java.lang.String + * @param dateStr yyyyMMdd返回yyyy.MM.dd yyyyMM返回yyyy/MM + * @author yinzuomei + * @description 返回yyyy.MM.dd + * @Date 2020/6/22 18:38 + **/ + public static String getxAxisDatePattern(String dateStr,String character){ + if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==8){ + return String.valueOf(new StringBuffer(dateStr).insert(4,character).insert(7,character)); + }else if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==6){ + return String.valueOf(new StringBuffer(dateStr).insert(4,character)); + } + return dateStr; + } + + /** + * @return java.lang.String + * @param beforDay + * @author yinzuomei + * @description 获取当前日期的前n天 返回yyyyMMdd + * @Date 2020/6/23 1:50 + **/ + public static String getBeforeNDay(int beforDay){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.DATE, - beforDay); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD); + } + + /** + * @return java.lang.String + * @param beforMonth + * @author yinzuomei + * @description 获取当前 月份的前n月 返回yyyyMM + * @Date 2020/6/23 1:50 + **/ + public static String getBeforeNMonth(int beforMonth){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.MONTH, - beforMonth); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMM); + } + + /** + * @return java.util.List 返回yyyyMMdd + * @param startTime yyyyMMdd + * @param endTime yyyyMMdd + * @author yinzuomei + * @description 获取两个日期之间所有的日期集合,包含开始结束 + * @Date 2020/6/23 1:26 + **/ + public static List getDaysBetween(String startTime, String endTime){ + // 返回的日期集合 + List days = new ArrayList(); + try{ + Date start = DateUtils.parse(startTime,DateUtils.DATE_PATTERN_YYYYMMDD); + Date end = DateUtils.parse(endTime,DateUtils.DATE_PATTERN_YYYYMMDD); + + Calendar tempStart = Calendar.getInstance(); + tempStart.setTime(start); + + Calendar tempEnd = Calendar.getInstance(); + tempEnd.setTime(end); + // 日期加1(包含结束) + tempEnd.add(Calendar.DATE, +1); + while (tempStart.before(tempEnd)) { + days.add(DateUtils.format(tempStart.getTime(),DateUtils.DATE_PATTERN_YYYYMMDD)); + tempStart.add(Calendar.DAY_OF_YEAR, 1); + } + }catch (Exception e){ + e.printStackTrace(); + } + return days; + } + + /** + * @return java.util.List + * @param minDate yyyMM + * @param maxDate yyyyMM + * @author yinzuomei + * @description 计算两个月份中间所有的月份包含起始 + * @Date 2020/6/23 2:10 + **/ + public static List getMonthBetween(String minDate, String maxDate){ + ArrayList result = new ArrayList(); + try{ + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");//格式化为年月 + + Calendar min = Calendar.getInstance(); + Calendar max = Calendar.getInstance(); + + min.setTime(sdf.parse(minDate)); + min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1); + + max.setTime(sdf.parse(maxDate)); + max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2); + + Calendar curr = min; + while (curr.before(max)) { + result.add(sdf.format(curr.getTime())); + curr.add(Calendar.MONTH, 1); + } + min = null;max = null;curr = null; + }catch(Exception e){ + e.printStackTrace(); + } + return result; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java new file mode 100644 index 0000000000..2cfaed7588 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -0,0 +1,221 @@ +package com.epmet.commons.tools.utils; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.dto.form.DingTalkTextMsg; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpStatus; +import org.apache.http.NameValuePair; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.springframework.util.CollectionUtils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.IOException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * desc: http 工具类 + * date: 2020/6/4 22:27 + * + * @author: jianjun liu + */ +@Slf4j +public class HttpClientManager { + private static int connectionTimeout = 3000;// 连接超时时间,毫秒 + private static int soTimeout = 10000;// 读取数据超时时间,毫秒 + /** + * HttpClient对象 + */ + private static CloseableHttpClient httpclient = HttpClients.custom().disableAutomaticRetries().build(); + + /*** 超时设置 ****/ + private static RequestConfig requestConfig = RequestConfig.custom() + .setSocketTimeout(soTimeout) + .setConnectTimeout(connectionTimeout) + .build();//设置请求和传输超时时间 + + public static HttpClientManager getInstance() { + return SingleClass.instance; + } + + private static class SingleClass { + private final static HttpClientManager instance = new HttpClientManager(); + } + + /** + * desc: 发送json post 请求 + * param: url,jsonStrParam + * return: CallResult + * date: 2019/2/21 9:12 + * + * @author: jianjun liu + */ + public Result sendPost(String url, Map paramsMap) { + + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + httppost.addHeader("Content-Type", "application/x-www-form-urlencoded charset=utf-8"); + + List list = new ArrayList(); + for (String key : paramsMap.keySet()) { + list.add(new BasicNameValuePair(key, String.valueOf(paramsMap.get(key)))); + } + UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, "utf-8"); + httppost.setEntity(urlEncodedFormEntity); + + return execute(httppost); + } catch (Exception e) { + e.printStackTrace(); + log.error("send exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + } + + /** + * desc: 发送json post 请求 + * param: url,jsonStrParam + * return: Result + * date: 2019/2/21 9:12 + * + * @author: jianjun liu + */ + public Result sendPostByJSON(String url, String jsonStrParam) { + + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + httppost.addHeader("Content-Type", "application/json; charset=utf-8"); + if (StringUtils.isNotEmpty(jsonStrParam)) { + StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + httppost.setEntity(se); + } + return execute(httppost); + } catch (Exception e) { + log.error("send exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + } + + /** + * desc: 发送钉钉群消息 简版 + * param: url,jsonStrParam + * return: Result + * + * @author: jianjun liu + */ + public Result sendAlarmMsg(String content) { + Long timestamp = System.currentTimeMillis(); + String url = "https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c"; + String secret = "SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19"; + + try { + String stringToSign = timestamp + "\n" + secret; + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); + String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)),"UTF-8"); + DingTalkTextMsg msg = new DingTalkTextMsg(); + msg.setContent(content); + url = url.concat("×tamp="+timestamp+"&sign="+sign); + String jsonStrParam = msg.getMsgContent(); + return sendPostByJSON(url, jsonStrParam); + } catch (Exception e) { + e.printStackTrace(); + } + return new Result().error(); + } + + /** + * desc: 发送get请求 + * param:url, params + * return: CallResult + * date: 2019/2/21 9:16 + * + * @author: jianjun liu + */ + public Result sendGet(String url, Map params) { + + try { + URIBuilder builder = new URIBuilder(url); + if (!CollectionUtils.isEmpty(params)) { + Set set = params.keySet(); + for (String key : set) { + builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key))); + } + } + HttpGet httpGet = new HttpGet(builder.build()); + httpGet.setConfig(requestConfig); + return execute(httpGet); + } catch (Exception e) { + log.error("sendGet exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + private Result execute(HttpRequestBase httpMethod) { + CloseableHttpResponse response = null; + try { + response = httpclient.execute(httpMethod); + log.debug("http send response:{}", JSON.toJSONString(response)); + if (response != null && response.getStatusLine() != null) { + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + String result = EntityUtils.toString(response.getEntity()); + return new Result().ok(result); + } else { + log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode()); + } + } + } catch (Exception e) { + log.error("execute exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } finally { + httpMethod.releaseConnection(); + try { + if (response != null) { + response.close(); + } + } catch (IOException e) { + } + } + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + public static void main(String[] args) { + String url = "http://localhost:8107/epmetscan/api/textSyncScan"; + TextTaskDTO p = new TextTaskDTO(); + p.setDataId("1"); + p.setContent("neirong1"); + List list = new ArrayList<>(); + list.add(p); + TextScanParamDTO param = new TextScanParamDTO(); + param.setTasks(list); + Result result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); + System.out.println(JSON.toJSONString(result)); + } +} + + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java new file mode 100644 index 0000000000..a39a45309e --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -0,0 +1,101 @@ +package com.epmet.commons.tools.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 扫描内容工具类 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-08 8:28 + **/ +@Slf4j +public class ScanContentUtils { + /** + * desc:图片同步扫描 + * + * @return + */ + public static Result imgSyncScan(String url, ImgScanParamDTO param) { + log.debug("imgSyncScan param:{}", JSON.toJSONString(param)); + if (StringUtils.isBlank(url) || param == null) { + throw new RenException("参数错误"); + } + try { + Result result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); + log.debug("imgSyncScan result:{}", JSON.toJSONString(param)); + if (result.success()) { + return JSON.parseObject(result.getData(),new TypeReference>(){}); + } + Result resultResult = new Result<>(); + resultResult.error(result.getCode(),result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.debug("imgSyncScan param:{}", JSON.toJSONString(param)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + } + + /** + * desc:文字同步扫描 + * + * @return + */ + public static Result textSyncScan(String url, TextScanParamDTO param) { + log.debug("textSyncScan param:{}", JSON.toJSONString(param)); + if (StringUtils.isBlank(url) || param == null) { + throw new RenException("参数错误"); + } + try { + Result result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); + log.debug("textSyncScan result:{}", JSON.toJSONString(result)); + if (result.success()) { + //return JSON.parseObject(result.getData(),Result.class); + return JSON.parseObject(result.getData(),new TypeReference>(){}); + } + Result resultResult = new Result<>(); + resultResult.error(result.getCode(),result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.error("textSyncScan exception:", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + } + + public static void main(String[] args) { + String url = "http://localhost:8107/epmetscan/api/textSyncScan"; + TextTaskDTO p = new TextTaskDTO(); + p.setDataId("1"); + p.setContent("neirong1"); + List list = new ArrayList<>(); + list.add(p); + TextScanParamDTO param = new TextScanParamDTO(); + param.setTasks(list); + Result imgSyncScanResult = ScanContentUtils.textSyncScan(url, param); + System.out.println(JSON.toJSONString(imgSyncScanResult)); + SyncScanResult result = new SyncScanResult(); + if (imgSyncScanResult != null){ + SyncScanResult imgSyncScanResultData = imgSyncScanResult.getData(); + if (imgSyncScanResult.success()&&imgSyncScanResultData.isAllPass()) { + result.setAllPass(imgSyncScanResultData.isAllPass()); + result.getSuccessDataIds().addAll(imgSyncScanResultData.getSuccessDataIds()); + result.getFailDataIds().addAll(imgSyncScanResultData.getFailDataIds()); + System.out.println("================"+JSON.toJSONString(result)); + } + } + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java new file mode 100644 index 0000000000..08a96295ac --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java @@ -0,0 +1,212 @@ +package com.epmet.commons.tools.validator; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.Hashtable; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static java.util.regex.Pattern.*; + +/** + * 身份证号校验 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 9:59 + */ +public class IdCardNoValidatorUtils { + + private static Logger logger = LoggerFactory.getLogger(IdCardNoValidatorUtils.class); + + /** + * 身份证验证 + * + * @param idCardNo + * @return 校验信息,correct为成功,失败会返回对应的失败原因 + */ + public static boolean checkIsIdCardNo(String idCardNo) { + String[] wf = {"1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"}; + String[] checkCode = {"7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2"}; + String iDCardNo = ""; + try { + //判断号码的长度 15位或18位 + if (idCardNo.length() != 15 && idCardNo.length() != 18) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位")); + return false; + } + if (idCardNo.length() == 18) { + String lastStr = idCardNo.substring(idCardNo.length() - 1); + if (!Character.isDigit(lastStr.charAt(0))) { + if (Character.isLowerCase(lastStr.charAt(0))) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写")); + return false; + } + } else { + logger.info(String.format("身份证号%s最后一位为数字",idCardNo)); + } + } + if (idCardNo.length() == 18) { + iDCardNo = idCardNo.substring(0, 17); + } else if (idCardNo.length() == 15) { + iDCardNo = idCardNo.substring(0, 6) + "19" + idCardNo.substring(6, 15); + } + if (isStrNum(iDCardNo) == false) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字")); + return false; + } + //判断出生年月 + String strYear = iDCardNo.substring(6, 10);// 年份 + String strMonth = iDCardNo.substring(10, 12);// 月份 + String strDay = iDCardNo.substring(12, 14);// 月份 + if (isStrDate(strYear + "-" + strMonth + "-" + strDay) == false) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效")); + return false; + } + GregorianCalendar gc = new GregorianCalendar(); + SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); + if ((gc.get(Calendar.YEAR) - Integer.parseInt(strYear)) > 150 || (gc.getTime().getTime() - s.parse(strYear + "-" + strMonth + "-" + strDay).getTime()) < 0) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围")); + return false; + } + if (Integer.parseInt(strMonth) > 12 || Integer.parseInt(strMonth) == 0) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效")); + return false; + } + if (Integer.parseInt(strDay) > 31 || Integer.parseInt(strDay) == 0) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效")); + return false; + } + //判断地区码 + Hashtable h = GetAreaCode(); + if (h.get(iDCardNo.substring(0, 2)) == null) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误")); + return false; + } + //判断最后一位 + int theLastOne = 0; + for (int i = 0; i < 17; i++) { + theLastOne = theLastOne + Integer.parseInt(String.valueOf(iDCardNo.charAt(i))) * Integer.parseInt(checkCode[i]); + } + int modValue = theLastOne % 11; + String strVerifyCode = wf[modValue]; + iDCardNo = iDCardNo + strVerifyCode; + + if (idCardNo.length() == 18 && !iDCardNo.equals(idCardNo)) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码")); + return false; + } + + } catch (Exception e) { + logger.error(String.format("校验身份证号方法异常")); + e.printStackTrace(); + } + return true; + } + + /** + * 地区代码 + * + * @return Hashtable + */ + private static Hashtable GetAreaCode() { + Hashtable hashtable = new Hashtable(); + hashtable.put("11", "北京"); + hashtable.put("12", "天津"); + hashtable.put("13", "河北"); + hashtable.put("14", "山西"); + hashtable.put("15", "内蒙古"); + hashtable.put("21", "辽宁"); + hashtable.put("22", "吉林"); + hashtable.put("23", "黑龙江"); + hashtable.put("31", "上海"); + hashtable.put("32", "江苏"); + hashtable.put("33", "浙江"); + hashtable.put("34", "安徽"); + hashtable.put("35", "福建"); + hashtable.put("36", "江西"); + hashtable.put("37", "山东"); + hashtable.put("41", "河南"); + hashtable.put("42", "湖北"); + hashtable.put("43", "湖南"); + hashtable.put("44", "广东"); + hashtable.put("45", "广西"); + hashtable.put("46", "海南"); + hashtable.put("50", "重庆"); + hashtable.put("51", "四川"); + hashtable.put("52", "贵州"); + hashtable.put("53", "云南"); + hashtable.put("54", "西藏"); + hashtable.put("61", "陕西"); + hashtable.put("62", "甘肃"); + hashtable.put("63", "青海"); + hashtable.put("64", "宁夏"); + hashtable.put("65", "新疆"); + hashtable.put("71", "台湾"); + hashtable.put("81", "香港"); + hashtable.put("82", "澳门"); + hashtable.put("91", "国外"); + return hashtable; + } + + /** + * 判断字符串是否为数字 + * + * @param str + * @return + */ + private static boolean isStrNum(String str) { + Pattern pattern = compile("[0-9]*"); + Matcher isNum = pattern.matcher(str); + if (isNum.matches()) { + return true; + } else { + return false; + } + } + + /** + * 判断字符串是否为日期格式 + * + * @param strDate + * @return + */ + public static boolean isStrDate(String strDate) { + Pattern pattern = compile("^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1-2][0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$"); + Matcher m = pattern.matcher(strDate); + if (m.matches()) { + return true; + } else { + return false; + } + } + + + //根据身份证号判断性别 1男2女0未知 + public static String getGender(String idCard) { + String gender = "0"; + if (!IdCardNoValidatorUtils.checkIsIdCardNo(idCard)) { + return gender; + } + if (idCard.length() == 18) { + if (Integer.parseInt(idCard.substring(16).substring(0, 1)) % 2 == 0) { + gender = "2"; + } else { + gender = "1"; + } + } else if (idCard.length() == 15) { + String usex = idCard.substring(14, 15); + if (Integer.parseInt(usex) % 2 == 0) { + gender = "2"; + } else { + gender = "1"; + } + } + return gender; + } + +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java index c5ae8767a2..e98cc09fe7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/ValidatorUtils.java @@ -50,7 +50,10 @@ public class ValidatorUtils { List> customerShowGroups = new ArrayList<>(); List> internalGroups = new ArrayList<>(); - + if (groups == null || groups.length ==0){ + validate(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR ,object,groups); + return; + } Arrays.asList(groups).forEach(g -> { if (CustomerClientShowGroup.class.isAssignableFrom(g)) { //如果派生自客户端显示分组,那么会优先校验,并且将错误提示给客户端,返回客户端可见的错误码 diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index d6e496766a..393d9ab000 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.13 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.18 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/deploy/docker-compose-test.yml b/epmet-gateway/deploy/docker-compose-test.yml index 6a3c273155..9ceffc1c63 100644 --- a/epmet-gateway/deploy/docker-compose-test.yml +++ b/epmet-gateway/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.12 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.18 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 52fe2026f8..354c47f3ea 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.13 + 0.3.18 com.epmet epmet-cloud @@ -169,6 +169,18 @@ lb://resi-home-server + + lb://gov-voice-server + + + lb://resi-voice-server + + + lb://data-report-server + + + lb://data-statistical-server + @@ -241,6 +253,14 @@ lb://common-service-server lb://resi-home-server + + lb://gov-voice-server + + lb://resi-voice-server + + lb://data-report-server + + lb://data-statistical-server 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 acb3d166b5..75cb2d2151 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -70,58 +70,98 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory().error(EpmetErrorCode.ERR10005.getCode(),EpmetErrorCode.ERR10005.getMsg())); + String token = getTokenFromRequest(request); + //BaseTokenDto baseTokenDto = StringUtils.isNotBlank(token) ? getBaseTokenDto(token, jwtTokenUtils) : null; + BaseTokenDto baseTokenDto; + if(StringUtils.isNotBlank(token)){ + try{ + baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); + }catch(RenException e){ + return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); + } + }else{ + baseTokenDto = null; } - try { - BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); + + String customerId = ""; + + if (baseTokenDto != null) { if (AppClientConstant.APP_RESI.equals(baseTokenDto.getApp())) { // 居民端 TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, TokenDto.class); - validateTokenDto(resiTokenDto, token); + if (resiTokenDto != null) { + customerId = resiTokenDto.getCustomerId(); + baseTokenDto = resiTokenDto; + } } else if (AppClientConstant.APP_GOV.equals(baseTokenDto.getApp())) { // 政府端 GovTokenDto govTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, GovTokenDto.class); - validateTokenDto(govTokenDto, token); + if (govTokenDto != null) { + customerId = govTokenDto.getCustomerId(); + baseTokenDto = govTokenDto; + } } else if(AppClientConstant.APP_OPER.equals(baseTokenDto.getApp())){ //运营端 TokenDto resiTokenDto = getLoginUserInfoByToken(token, jwtTokenUtils, cpUserDetailRedis, TokenDto.class); - validateTokenDto(resiTokenDto, token); + if (resiTokenDto != null) { + customerId = resiTokenDto.getCustomerId(); + baseTokenDto = resiTokenDto; + } } + } - //当前登录用户userId,添加到header中 + //需要认证 + if (needAuth(requestUri)) { + if (StringUtils.isBlank(token)) { + return response(exchange,new Result<>().error(EpmetErrorCode.ERR10005.getCode(),EpmetErrorCode.ERR10005.getMsg())); + } + // 校验token + try { + validateTokenDto(baseTokenDto, token); + } catch (RenException e) { + return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); + } + } + + if (baseTokenDto != null) { String redisKey = baseTokenDto.getApp() + "-" + baseTokenDto.getClient() + "-" + baseTokenDto.getUserId(); logger.info("redisKey=" + redisKey); - ServerHttpRequest build = exchange.getRequest().mutate() + exchange.getRequest().mutate() .header(Constant.APP_USER_KEY, redisKey) .header(AppClientConstant.APP,baseTokenDto.getApp()) .header(AppClientConstant.CLIENT,baseTokenDto.getClient()) .header(AppClientConstant.USER_ID,baseTokenDto.getUserId()) - .build(); + .header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()}) + ; + if(StringUtils.equals(baseTokenDto.getApp(),"gov")){ + exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID,customerId); + } + ServerHttpRequest build = exchange.getRequest().mutate().build(); return chain.filter(exchange.mutate().request(build).build()); - }catch(RenException e){ - return response(exchange,new Result<>().error(e.getCode(),e.getMsg())); } + + return chain.filter(exchange); }; } + /** + * 获取事务流水号 + * @return + */ + public static String getTransactionSerial() { + String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n" + , "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 2; i++) { + sb.append(letterPool[(int) (Math.random() * 25)]); + } + + sb.append(System.currentTimeMillis()); + return sb.toString(); + } + //public TokenDto getLoginUserInfo(String token) { // //是否过期 // Claims claims = jwtTokenUtils.getClaimByToken(token); @@ -160,7 +200,12 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory filter(ServerWebExchange exchange, GatewayFilterChain chain) { - ServerHttpRequest request = exchange.getRequest(); - HttpHeaders headers = request.getHeaders(); - String token = headers.getFirst(Constant.AUTHORIZATION_HEADER); - if (StringUtils.isBlank(token)) { - token = headers.getFirst(Constant.TOKEN_HEADER); - logger.info("token=" + token); - } else { - logger.info("authorization=" + token); - } - if (StringUtils.isBlank(token)) { - token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER); - logger.info("params token:" + token); - } - - if (StringUtils.isBlank(token)) { - return chain.filter(exchange); - } - - BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); - - if (baseTokenDto != null) { - ServerHttpRequest build = exchange.getRequest().mutate() - .header(AppClientConstant.USER_ID, new String[]{baseTokenDto.getUserId()}) - .header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()}) - .build(); - return chain.filter(exchange.mutate().request(build).build()); - } - - return chain.filter(exchange); - } - - /** - * 获取事务流水号 - * @return - */ - public static String getTransactionSerial() { - String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n" - , "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; - - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < 2; i++) { - sb.append(letterPool[(int) (Math.random() * 25)]); - } - - sb.append(System.currentTimeMillis()); - return sb.toString(); - } -} +//package com.epmet.filter; +// +//import com.epmet.commons.tools.constant.AppClientConstant; +//import com.epmet.commons.tools.constant.Constant; +//import com.epmet.commons.tools.security.dto.BaseTokenDto; +//import com.epmet.commons.tools.utils.CpUserDetailRedis; +//import com.epmet.jwt.JwtTokenUtils; +//import org.apache.commons.lang3.StringUtils; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.cloud.gateway.filter.GatewayFilterChain; +//import org.springframework.cloud.gateway.filter.GlobalFilter; +//import org.springframework.http.HttpHeaders; +//import org.springframework.http.server.reactive.ServerHttpRequest; +//import org.springframework.stereotype.Component; +//import org.springframework.web.server.ServerWebExchange; +//import reactor.core.publisher.Mono; +// +///** +// * Feign调用发送请求的Filter +// * 目前用于封装用户相关信息到request,供上游微服务使用 +// * 已过时,功能移入CpAuthGatewayFilterFacotry +// */ +//@Component +//@Deprecated +//public class FeignRequestFilter implements GlobalFilter, UserTokenFilter { +// +// private Logger logger = LoggerFactory.getLogger(getClass()); +// +// @Autowired +// private JwtTokenUtils jwtTokenUtils; +// @Autowired +// private CpUserDetailRedis cpUserDetailRedis; +// +// @Override +// public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { +// ServerHttpRequest request = exchange.getRequest(); +// HttpHeaders headers = request.getHeaders(); +// String token = headers.getFirst(Constant.AUTHORIZATION_HEADER); +// if (StringUtils.isBlank(token)) { +// token = headers.getFirst(Constant.TOKEN_HEADER); +// logger.info("token=" + token); +// } else { +// logger.info("authorization=" + token); +// } +// if (StringUtils.isBlank(token)) { +// token = request.getQueryParams().getFirst(Constant.AUTHORIZATION_HEADER); +// logger.info("params token:" + token); +// } +// +// if (StringUtils.isBlank(token)) { +// return chain.filter(exchange); +// } +// +// BaseTokenDto baseTokenDto = getBaseTokenDto(token, jwtTokenUtils); +// +// if (baseTokenDto != null) { +// ServerHttpRequest build = exchange.getRequest().mutate() +// .header(AppClientConstant.USER_ID, new String[]{baseTokenDto.getUserId()}) +// .header(AppClientConstant.TRANSACTION_SERIAL_KEY, new String[]{getTransactionSerial()}) +// .build(); +// return chain.filter(exchange.mutate().request(build).build()); +// } +// +// return chain.filter(exchange); +// } +// +// /** +// * 获取事务流水号 +// * @return +// */ +// public static String getTransactionSerial() { +// String[] letterPool = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n" +// , "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}; +// +// StringBuilder sb = new StringBuilder(); +// for (int i = 0; i < 2; i++) { +// sb.append(letterPool[(int) (Math.random() * 25)]); +// } +// +// sb.append(System.currentTimeMillis()); +// return sb.toString(); +// } +//} diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index ba74ff4bfd..f67bd8fdec 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -241,6 +241,42 @@ spring: filters: - StripPrefix=1 - CpAuth=true + #政府端-党建声音 + - id: gov-voice-server + uri: @gateway.routes.gov-voice-server.uri@ + order: 26 + predicates: + - Path=${server.servlet.context-path}/gov/voice/** + filters: + - StripPrefix=1 + - CpAuth=true + #居民端-党建声音 + - id: resi-voice-server + uri: @gateway.routes.resi-voice-server.uri@ + order: 27 + predicates: + - Path=${server.servlet.context-path}/resi/voice/** + filters: + - StripPrefix=1 + - CpAuth=true + #政府端-数据首页 + - id: data-report-server + uri: @gateway.routes.data-report-server.uri@ + order: 28 + predicates: + - Path=${server.servlet.context-path}/data/report/** + filters: + - StripPrefix=1 + - CpAuth=true + #统计服务 + - id: data-statistical-server + uri: @gateway.routes.data-statistical-server.uri@ + order: 29 + predicates: + - Path=${server.servlet.context-path}/data/stats/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/epmet-module/data-report/data-report-client/pom.xml b/epmet-module/data-report/data-report-client/pom.xml new file mode 100644 index 0000000000..5bba5f2cb4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/pom.xml @@ -0,0 +1,23 @@ + + + + data-report + com.epmet + 2.0.0 + + 4.0.0 + + data-report-client + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java new file mode 100644 index 0000000000..f42d52fb72 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java @@ -0,0 +1,40 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 16:35 + */ +public interface UserAnalysisConstant { + + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + String REG_FLAG="reg"; + + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + String PARTI_FLAG="parti"; + + String QUERY_USER_AGENCY_FAILED="查询用户所属机关信息失败"; + + /** + * 普通居民(已注册) + */ + String REGISTERED_RESI= "居民"; + + /** + * 热心居民 + */ + String WARMHEARTED="热心居民"; + + /** + * 党员 + */ + String PARTYMEMBER="党员"; + + String DAY_TYPE="day"; + String MONTH_TYPE="month"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java new file mode 100644 index 0000000000..243404052e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织IDAGENCY_ID + */ + private String id; + + /** + * 组织名称 + */ + private String agencyName; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimGridDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimGridDTO.java new file mode 100644 index 0000000000..8487d6d220 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimGridDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * GRID_ID + */ + private String id; + + /** + * 网格名称 + */ + private String gridName; +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java new file mode 100644 index 0000000000..7f888a0b0d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form.user; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 按日、按月查询注册用户数(参与用户数)增量折线图 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:57 + */ +@Data +public class UserIncrTrendFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + @NotBlank(message = "regOrPatiFlag不能为空", groups = {AddUserInternalGroup.class}) + private String regOrPatiFlag; + + /** + * day:日维度 | month:月维度 | (周、季、年)… + */ + @NotBlank(message = "type不能为空", groups = {AddUserInternalGroup.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java new file mode 100644 index 0000000000..0532ac521a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form.user; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 各机关注册用户数入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:47 + */ +@Data +public class UserSubAgencyFormDTO implements Serializable { + private static final long serialVersionUID = -4558978951554887536L; + public interface AddUserInternalGroup { + } + + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + @NotBlank(message = "regOrPartiFlag不能为空",groups = {AddUserInternalGroup.class}) + private String regOrPartiFlag; + + @NotBlank(message = "查询日期不能为空",groups = {AddUserInternalGroup.class}) + private String dateId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java new file mode 100644 index 0000000000..f0f8303642 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form.user; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 直属网格注册用户数 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:52 + */ +@Data +public class UserSubGridFormDTO implements Serializable { + private static final long serialVersionUID = -1815903503939673149L; + + public interface AddUserInternalGroup { + } + + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + @NotBlank(message = "regOrPartiFlag不能为空", groups = {AddUserInternalGroup.class}) + private String regOrPartiFlag; + + @NotBlank(message = "查询日期不能为空", groups = {AddUserInternalGroup.class}) + private String dateId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java new file mode 100644 index 0000000000..047d909ee2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form.user; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 用户汇总信息 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:31 + */ +@Data +public class UserSummaryInfoFormDTO implements Serializable { + private static final long serialVersionUID = -1802471335671321322L; + public interface AddUserInternalGroup { + } + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + @NotBlank(message = "regOrPartiFlag不能为空",groups = {AddUserInternalGroup.class}) + private String regOrPartiFlag; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java new file mode 100644 index 0000000000..a7f4e87dc5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/23 9:13 + */ +@Data +public class UserIncrTrendResDTO implements Serializable { + private static final long serialVersionUID = 290620373673325352L; + private Integer regIncr; + private Integer warmIncr; + private Integer partymemberIncr; + private String dateIdOrMonthId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java new file mode 100644 index 0000000000..bfd9b17535 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result.user; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 按日、按月查询注册用户数(参与用户数)增量折线图 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:17 + */ +@Data +public class UserIncrTrendResultDTO implements Serializable { + /** + * 日期如果按日查询返回yyyy/MM/dd,如果按月返回yyyy/MM + */ + private String date; + + /** + * 居民、党员、热心居民返回中文描述 + */ + private String type; + + /** + * 增量值 + */ + private Integer value; + + // yyyyMMdd yyyyMM + @JsonIgnore + private String dateOrMonthId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResDTO.java new file mode 100644 index 0000000000..f01c273e2b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 21:45 + */ +@Data +public class UserSubAgencyResDTO implements Serializable { + private static final long serialVersionUID = 5807572279154511198L; + /** + * 机关id + */ + private String agencyId; + + /** + * 机关名称 + */ + private String agencyName; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日(参与用户中)党员总数 + */ + private Integer partymemberTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java new file mode 100644 index 0000000000..107b189660 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result.user; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 各机关注册用户数入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:49 + */ +@Data +public class UserSubAgencyResultDTO implements Serializable { + private static final long serialVersionUID = 3038896791082755087L; + /** + * 辽阳路街道 + */ + private String name; + + /** + * 数值 + */ + private Integer value; + + /** + * 类型:居民、党员、热心居民 + */ + private String type; + + /** + * 机关id + */ + private String agencyId; + + @JsonIgnore + private Integer total; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResDTO.java new file mode 100644 index 0000000000..e20c123147 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 直属网格注册用户数(参与用户、注册用户通用类) + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 23:57 + */ +@Data +public class UserSubGridResDTO implements Serializable { + private static final long serialVersionUID = 2203260762393704885L; + private String gridId; + private Integer regTotal; + private Integer resiTotal; + private Integer warmHeartedTotal; + private Integer partymemberTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java new file mode 100644 index 0000000000..5aa50aad9b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result.user; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + + +/** + * 直属网格注册用户数 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:54 + */ +@Data +public class UserSubGridResultDTO implements Serializable { + private static final long serialVersionUID = -7432747804212305863L; + + /** + * 网格名称:eg:第一网格 + */ + private String name; + + /** + * 数值 + */ + private Integer value; + + /** + * 类型:居民、党员、热心居民 + */ + private String type; + + /** + * 网格id + */ + private String gridId; + + @JsonIgnore + private Integer total; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java new file mode 100644 index 0000000000..a72096446c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.result.user; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 用户汇总信息 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:34 + */ +@Data +public class UserSummaryInfoResultDTO implements Serializable { + private static final long serialVersionUID = -4270726421611289755L; + /** + * 数据更新至yyyy.MM.dd + */ + private String currentDate; + private String dateId; + /** + * 注册居民数 + */ + private Integer regTotal; + + /** + * 参与用户数 + */ + private Integer partiTotal; + + /** + * 党员数 + */ + private Integer partymemberTotal; + + /** + * 党员占比 + */ + private String partymemberProportion; + /** + * 热心居民数 + */ + private Integer warmHeartedTotal; + + /** + * 热心居民占比 + */ + private String warmHeartedProportion; + + @JsonIgnore + private BigDecimal partymemberProportionValue; + + @JsonIgnore + private BigDecimal warmHeartedProportionValue; + + @JsonIgnore + private String id; + + public UserSummaryInfoResultDTO(){ + this.currentDate=""; + this.regTotal=0; + this.partiTotal=0; + this.partymemberTotal=0; + this.partymemberProportion="0%"; + this.warmHeartedTotal=0; + this.warmHeartedProportion="0%"; + this.id=""; + } + + public static void main(String[] args) { + StringBuffer s=new StringBuffer("20190305").insert(4,".").insert(7,"."); + System.out.println(s); + + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java new file mode 100644 index 0000000000..cfc64da174 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java @@ -0,0 +1,12 @@ +package com.epmet.group.constant; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:24 + */ +public interface GroupConstant { + + String MONTH = "month"; + String DATE = "day"; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/form/GroupIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/form/GroupIncrTrendFormDTO.java new file mode 100644 index 0000000000..627b5504c4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/form/GroupIncrTrendFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.group.dto.form; + +import lombok.Data; +import lombok.NonNull; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 12:07 + */ +@Data +public class GroupIncrTrendFormDTO implements Serializable { + + private static final long serialVersionUID = 1788937450915240575L; + + public interface GroupJava {} + + /** + * 类型 month:月 date:日 + */ + @NotBlank(message = "type不能为空", groups = {GroupJava.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GridInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..d9840d841d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GridInfoResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 14:30 + */ +@Data +public class GridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 5301902590768338888L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupIncrTrendResultDTO.java new file mode 100644 index 0000000000..50637d609d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupIncrTrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 12:03 + */ +@Data +public class GroupIncrTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 5132636251609157706L; + + /** + * 日期 + */ + private String date; + + /** + * 值 【小组数量】 + */ + private Integer value; + + /** + * 类型 【小组数量】 + */ + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubAgencyResultDTO.java new file mode 100644 index 0000000000..379f55cdf5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubAgencyResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 11:56 + * 网格小组——下级机关小组数柱状图 + */ +@Data +public class GroupSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 8562403482616167221L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; + + /** + * 机关ID + */ + private String agencyId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubGridResultDTO.java new file mode 100644 index 0000000000..af7e4e84fa --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubGridResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 11:56 + * 网格小组——下级机关小组数柱状图 + */ +@Data +public class GroupSubGridResultDTO implements Serializable { + + private static final long serialVersionUID = -3260124064513560994L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; + + /** + * 机关ID + */ + private String gridId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSummaryInfoResultDTO.java new file mode 100644 index 0000000000..a3e72d6f3a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSummaryInfoResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 11:05 + */ +@Data +public class GroupSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 网格总数量 + */ + private Integer gridTotalCount; + + /** + * 小组总数量 + */ + private Integer groupTotalCount; + + /** + * 小组平均人数 + */ + private Integer groupPeopleAvg; + + /** + * 小组人数中位数 + */ + private Integer groupPeopleMedian; + + /** + * 数据更新至 时间 + */ + private String deadline; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/SubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/SubAgencyResultDTO.java new file mode 100644 index 0000000000..e4b182f09f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/SubAgencyResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 14:02 + */ +@Data +public class SubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 2276056225590553307L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 机关名称 + */ + private String agencyName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java new file mode 100644 index 0000000000..42489e9b4a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java @@ -0,0 +1,14 @@ +package com.epmet.issue.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:07 + */ +public interface IssueConstant { + String MONTH = "month"; + String DATE = "day"; + String VOTING_NAME = "表决中"; + String SHIFT_NAME = "已转项目"; + String CLOSED_NAME = "已关闭"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java new file mode 100644 index 0000000000..b4577b2811 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.issue.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:32 + */ +@Data +public class IssueIncrtrendFormDTO implements Serializable { + private static final long serialVersionUID = 4408419854627376175L; + /** + * 类型,按日date 按月month + */ + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java new file mode 100644 index 0000000000..961727e31c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java @@ -0,0 +1,206 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:11 + */ +@Data +public class IssueDataDTO implements Serializable { + + private static final long serialVersionUID = 9136989870868730175L; + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + + /** + * 年度ID + */ + private String yearId; + + /** + * 年度名 + */ + private String yearName; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 季度名 + */ + private String quarterName; + + /** + * 月度ID + */ + private String monthId; + + /** + * 月度名 + */ + private String monthName; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 日期名 + */ + private String dateName; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java new file mode 100644 index 0000000000..d63d332a9b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:30 + */ +@NoArgsConstructor +@Data +public class IssueIncrtrendResultDTO implements Serializable { + + private static final long serialVersionUID = 7762529188251385355L; + /** + * 日期 + */ + private String date; + /** + * 状态(表决中,已转项目,已关闭) + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java new file mode 100644 index 0000000000..c401d5ecc4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:24 + */ +@NoArgsConstructor +@Data +public class IssueSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 2640337888693960513L; + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名 + */ + private String name; + /** + * 类型 表决中,已转项目,已关闭 + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java new file mode 100644 index 0000000000..3313f0a8e7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:27 + */ +@Data +public class IssueSubGridResultDTO implements Serializable { + private static final long serialVersionUID = -3318384216762207856L; + /** + * 网格名 + */ + private String name; + /** + * 类型 表决中,已转项目,已关闭 + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java new file mode 100644 index 0000000000..c53707c0a1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:17 + */ +@NoArgsConstructor +@Data +public class IssueSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -7959140755148294338L; + /** + * 机关ID + */ + private String agencyId; + /** + * 议题总数 + */ + private Integer issueTotal; + /** + * 表决中数量 + */ + private Integer votingTotal; + /** + * 已转项目数量 + */ + private Integer shiftProjectTotal; + /** + * 已关闭数量 + */ + private Integer closedTotal; + /** + * 表决中占比 + */ + private String votingRatio; + /** + * 已转项目占比 + */ + private String shiftProjectRatio; + /** + * 已关闭占比 + */ + private String closedRatio; + /** + * 更新至日期 + */ + private String dateName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java new file mode 100644 index 0000000000..f6940edeeb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:21 + */ +@NoArgsConstructor +@Data +public class IssueSummaryPieResultDTO implements Serializable { + + private static final long serialVersionUID = -971115426789868580L; + /** + * 名称 表决中,已转项目,已关闭 + */ + private String name; + /** + * 值 + */ + private Integer value; + /** + * 百分比 + */ + private String ratio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java new file mode 100644 index 0000000000..a23dfa1a62 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -0,0 +1,21 @@ +package com.epmet.project.constant; + +/** + * @Author sun + * @Description 数据-项目 + **/ +public interface ProjectConstant { + + String DAY = "day"; + String MONTH = "month"; + + /** + * 根据Token获取组织信息失败 + */ + String GET_AGENCYID = "根据Token获取组织信息失败"; + /** + * 参数异常 + */ + String TYPE_EXCEPTION = "必要参数为空或参数格式错误"; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java new file mode 100644 index 0000000000..ab608a0184 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java @@ -0,0 +1,182 @@ +/** + * 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.project.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactAgencyProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【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/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java new file mode 100644 index 0000000000..a7364cfac9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.project.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-日/月数据查询-接口入参 + */ +@Data +public class ProjectIncrTrendFormDTO implements Serializable { + + private static final long serialVersionUID = -4929038359220814068L; + + public interface ProjectIncr { + } + + /** + * 类型 month:代表月 date:代表日 + */ + @NotBlank(message = "month / date 类型不能为空", groups = {ProjectIncr.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java new file mode 100644 index 0000000000..b53b2a9f14 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectIncrTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 日期(2020/1/1;2020/1/2...) + */ + private String date; + + /** + * 类型对应数量 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java new file mode 100644 index 0000000000..31d25fe6bb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 机关名称 + */ + private String name; + + /** + * 不同类型对应数据 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java new file mode 100644 index 0000000000..19f1632be0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSubGridResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 机关名称 + */ + private String name; + + /** + * 不同类型对应数据 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java new file mode 100644 index 0000000000..b2b5c7d39b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.project.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 类型名称(处理中;已结案) + */ + private String name; + + /** + * 类型对应数量 + */ + private Integer value; + + /** + * 类型对应百分比(10% 10.1% 10.01%小数点后两位) + */ + @JsonIgnore + private BigDecimal ratioInt; + private String ratio; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java new file mode 100644 index 0000000000..220780be29 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.project.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author sun + * @Description 数据-项目-汇总数据-接口返参 + **/ +@Data +public class ProjectSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 更新日期 + */ + private String dateName; + + /** + * 处理中总数 + */ + private Integer pendingTotal; + + /** + * 处理中占比 + */ + @JsonIgnore + private BigDecimal pendingRatioInt; + private String pendingRatio; + + /** + * 已结案总数 + */ + private Integer closedTotal; + + /** + * 已结案占比 + */ + @JsonIgnore + private BigDecimal closedRatioInt; + private String closedRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java new file mode 100644 index 0000000000..8b52307d91 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.publicity.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author jyy + * @CreateTime 2020/6/22 12:07 + */ +@Data +public class TagFormDTO implements Serializable { + + private static final long serialVersionUID = 1788937450915240575L; + + public interface GroupJava {} + + /** + * 获取数据条数;默认为10 + */ + private Integer pageSize; + + /** + * 时间查询维度;日:date;月:month;季:quarter;年:year + */ + @NotBlank(message = "type不能为空", groups = {GroupJava.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java new file mode 100644 index 0000000000..9357d45f2d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.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.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 文章发表数量—下级机关统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactPublishedAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关名称 + */ + private String name; + /** + * 发文数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 上级机关Id + */ + private String pid; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java new file mode 100644 index 0000000000..02eb3446a7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.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.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 文章发表数量—下级机关统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactPublishedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 累计发文总数 + */ + private Integer publishedTotal; + + /** + * 发布中的文章总数 + */ + private Integer publishingTotal; + + /** + * 数据截止日期 + */ + private String dateName; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java new file mode 100644 index 0000000000..11aa1e2cea --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 文章发表数量—直属部门统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactPublishedDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门名称 + */ + private String name; + + /** + * 发文数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 部门Id + */ + private String departmentId; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java new file mode 100644 index 0000000000..909deb2ba4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 文章发表数量—直属部门统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactPublishedGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格名称 + */ + private String name; + + /** + * 发文数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java new file mode 100644 index 0000000000..1d91a3287a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 标签名称 标签名称 + */ + private String name; + + /** + * 使用改标签的数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 标签Id + */ + private String tagId; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java new file mode 100644 index 0000000000..46259526ce --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java @@ -0,0 +1,30 @@ +package com.epmet.topic.constant; + +/** + * @Author zxc + * @CreateTime 2020/6/20 17:19 + */ +public interface TopicConstant { + + /** + * 讨论中 + */ + String DISCUSSING = "discussing"; + + /** + * 已屏蔽 + */ + String HIDDEN = "hidden"; + + /** + * 已关闭 + */ + String CLOSED = "closed"; + + String RATIO = "%"; + + String SHIFTED = "已转议题"; + + String MONTH = "month"; + String DATE = "day"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java new file mode 100644 index 0000000000..2eecf2de34 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.topic.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:24 + */ +@Data +public class TopicIncrTrendFormDTO implements Serializable { + + private static final long serialVersionUID = -4929038359220814068L; + + public interface TopicIncr{} + + /** + * 类型 month:代表月 date:代表日 + */ + @NotBlank(message = "month / date 类型不能为空",groups = {TopicIncr.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java new file mode 100644 index 0000000000..24e3eae7bc --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:09 + */ +@Data +public class TopicIncrTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 6905657684644153197L; + + /** + * 日期 + */ + private String date; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java new file mode 100644 index 0000000000..99b84d913f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 17:32 + */ +@Data +public class TopicShiftedCountResultDTO implements Serializable { + + private static final long serialVersionUID = -7470748727678087785L; + + /** + * 已转议题数量 + */ + private Integer shiftedIssueCount; + + /** + * 数据更新至 时间 + */ + private String deadline; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java new file mode 100644 index 0000000000..c22ebd7176 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 17:10 + */ +@Data +public class TopicStatusResultDTO implements Serializable { + + private static final long serialVersionUID = -6461755954651271901L; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + */ + private String topicStatus; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java new file mode 100644 index 0000000000..87dd107010 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:13 + */ +@Data +public class TopicSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 70586943923355457L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; + + /** + * 机关Id + */ + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java new file mode 100644 index 0000000000..64cad1615c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:13 + */ +@Data +public class TopicSubGridResultDTO implements Serializable { + + private static final long serialVersionUID = -7251687622455341118L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; + + /** + * 网格Id + */ + private String gridId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java new file mode 100644 index 0000000000..3112df3356 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:14 + */ +@Data +public class TopicSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1103298182001744033L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 百分比 + */ + private String ratio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java new file mode 100644 index 0000000000..6f14a45fd5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:04 + */ +@Data +public class TopicSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = -6051892596892952025L; + + /** + * 话题总数 + */ + private Integer topicTotalCount; + + /** + * 讨论中话题数量 + */ + private Integer talkingTotalCount; + + /** + * 已关闭话题数量 + */ + private Integer closedTotalCount; + + /** + * 已屏蔽话题数量 + */ + private Integer shieldedTotalCount; + + /** + * 话题已转议题数量 + */ + private Integer shiftedTotalCount; + + /** + * 数据更新至 时间 + */ + private String deadline; +} diff --git a/epmet-module/data-report/data-report-server/Dockerfile b/epmet-module/data-report/data-report-server/Dockerfile new file mode 100644 index 0000000000..1f773a109f --- /dev/null +++ b/epmet-module/data-report/data-report-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8109 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..2258dd43cf --- /dev/null +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + data-report-server: + container_name: data-report-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.8 + ports: + - "8109:8109" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..3c34b09319 --- /dev/null +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + data-report-server: + container_name: data-report-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.1 + ports: + - "8108:8108" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml new file mode 100644 index 0000000000..a03e16e222 --- /dev/null +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -0,0 +1,164 @@ + + + + 0.3.8 + data-report-server + + + data-report + com.epmet + 2.0.0 + + 4.0.0 + + + + com.epmet + data-report-client + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + com.epmet + epmet-user-client + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.epmet + epmet-commons-service-call + 0.3.1 + + + + + + ${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 + + + 8109 + dev + + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + false + + + + test + + + 8109 + test + + + + + + epmet + elink@833066 + + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + + true + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java new file mode 100644 index 0000000000..cee0ed9096 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java @@ -0,0 +1,17 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableAsync; + +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +@EnableAsync +public class DataReportApplication { + public static void main(String[] args) { + SpringApplication.run(DataReportApplication.class, args); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..7d4ff2d7d4 --- /dev/null +++ b/epmet-module/data-report/data-report-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/data-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..c52ec15b50 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "data-report"; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java new file mode 100644 index 0000000000..88dd3bb376 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java @@ -0,0 +1,74 @@ +package com.epmet.module.group.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.group.dto.form.GroupIncrTrendFormDTO; +import com.epmet.group.dto.result.GroupIncrTrendResultDTO; +import com.epmet.group.dto.result.GroupSubAgencyResultDTO; +import com.epmet.group.dto.result.GroupSubGridResultDTO; +import com.epmet.group.dto.result.GroupSummaryInfoResultDTO; +import com.epmet.service.group.GroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 10:54 + */ +@RestController +@RequestMapping("group") +public class GroupController { + + @Autowired + private GroupService groupService; + + /** + * @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 + * @param tokenDto + * @author zxc + */ + @PostMapping("summaryinfo") + public Result summaryInfo(@LoginUser TokenDto tokenDto){ + return new Result().ok(groupService.summaryInfo(tokenDto)); + } + + /** + * @Description 网格小组——下级机关小组数柱状图 + * @param tokenDto + * @author zxc + */ + @PostMapping("subagency") + public Result> subAgency(@LoginUser TokenDto tokenDto){ + return new Result>().ok(groupService.subAgency(tokenDto)); + } + + /** + * @Description 网格小组——直属网格小组数 + * @param tokenDto + * @author zxc + */ + @PostMapping("subgrid") + public Result> subGrid(@LoginUser TokenDto tokenDto){ + return new Result>().ok(groupService.subGrid(tokenDto)); + } + + /** + * @Description 网格小组——小组分析 + * @param tokenDto + * @author zxc + */ + @PostMapping("incrtrend") + public Result> IncrTrend(@LoginUser TokenDto tokenDto, @RequestBody GroupIncrTrendFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GroupIncrTrendFormDTO.GroupJava.class); + return new Result>().ok(groupService.IncrTrend(tokenDto,formDTO)); + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java new file mode 100644 index 0000000000..c9fad20ce2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java @@ -0,0 +1,95 @@ +package com.epmet.controller.issue; + +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.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; +import com.epmet.service.issue.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:47 + */ +@RestController +@RequestMapping("issue") +public class IssueController { + @Autowired + private IssueService issueService; + + /** + * 数据汇总 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("summaryinfo") + public Result getSummaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(issueService.getSummaryInfo(tokenDto)); + } + + /** + * 数据汇总饼状图 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("summarypie") + public Result> getSummaryPie(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSummaryPie(tokenDto)); + } + + /** + * 下级机关议题统计 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("subagency") + public Result> getSubAgency(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSubAgency(tokenDto)); + } + + /** + * 网格议题统计 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("subgrid") + public Result> getSubGrid(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSubGrid(tokenDto)); + } + + /** + * 议题分析 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("incrtrend") + public Result> getIncrtrend(@LoginUser TokenDto tokenDto, @RequestBody IssueIncrtrendFormDTO formDTO) { + return new Result>().ok(issueService.getIncrtrend(tokenDto, formDTO)); + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/project/ProjectController.java new file mode 100644 index 0000000000..47a4765288 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/project/ProjectController.java @@ -0,0 +1,81 @@ +package com.epmet.module.project.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.RenException; +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.module.project.service.ProjectService; +import com.epmet.project.constant.ProjectConstant; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@RestController +@RequestMapping("project") +public class ProjectController { + + @Autowired + private ProjectService projectService; + + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + @PostMapping("projectsummary") + public Result projectSummary(@LoginUser TokenDto tokenDto) { + return new Result().ok(projectService.getProjectSummary(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + @PostMapping("summaryinfo") + public Result> summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSummaryInfo(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + @PostMapping("subagency") + public Result> subAgency(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSubAgency(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + @PostMapping("subgrid") + public Result> subGrid(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSubGrid(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询 + **/ + @PostMapping("incrtrend") + public Result> incrTrend(@LoginUser TokenDto tokenDto, @RequestBody ProjectIncrTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectIncrTrendFormDTO.ProjectIncr.class); + if (!ProjectConstant.DAY.equals(formDTO.getType()) && !ProjectConstant.MONTH.equals(formDTO.getType())) { + throw new RenException(ProjectConstant.TYPE_EXCEPTION); + } + return new Result>().ok(projectService.getProjectIncrTrend(tokenDto, formDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java new file mode 100644 index 0000000000..56d31b9d17 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java @@ -0,0 +1,132 @@ +/** + * 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.publicity; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; +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.publicity.dto.form.TagFormDTO; +import com.epmet.publicity.dto.result.*; +import com.epmet.service.publicity.PublicityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@RestController +@RequestMapping("publicity") +public class PublicityController { + + + @Autowired + private PublicityService publicityService;// + + + /** + * @return + * @Author jyy + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + **/ + @PostMapping("summaryinfo") + public Result summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(publicityService.summaryInfo(tokenDto)); + } + + /** + * @param tokenDto + * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @author jyy + */ + @PostMapping("tagviewed") + public Result> tagviewed(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + + Integer pageSize = formDTO.getPageSize(); + if (pageSize == null) { + pageSize = NumConstant.TEN; + } + String type = formDTO.getType(); + return new Result>().ok(publicityService.tagviewed(tokenDto, pageSize, type)); + } + + /** + * @param tokenDto + * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @author jyy + */ + @PostMapping("tagused") + public Result> tagused(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + + Integer pageSize = formDTO.getPageSize(); + if (pageSize == null) { + pageSize = NumConstant.TEN; + } + String type = formDTO.getType(); + return new Result>().ok(publicityService.tagused(tokenDto, pageSize, type)); + } + + /** + * @param tokenDto 登录者token + * @Description 获取下级机关发文数 + * @author jyy + */ + @PostMapping("subagency/publishedarticle") + public Result> subagencyPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.subagencyPublishedarticle(tokenDto, type)); + } + + /** + * @param tokenDto 登录者token + * @Description 获取直属部门发文数 + * @author jyy + */ + @PostMapping("department/publishedarticle") + public Result> departmentPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.departmentPublishedarticle(tokenDto, type)); + } + + /** + * @param tokenDto 登录者token + * @Description 获取指数网格发文数 + * @author jyy + */ + @PostMapping("subgrid/publishedarticle") + public Result> subgridPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.subgridPublishedarticle(tokenDto, type)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java new file mode 100644 index 0000000000..233f31dc27 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java @@ -0,0 +1,81 @@ +package com.epmet.controller.topic; + +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.service.topic.TopicService; +import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; +import com.epmet.topic.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:55 + */ +@RestController +@RequestMapping("topic") +public class TopicController { + + @Autowired + private TopicService topicService; + + /** + * @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 + * @param tokenDto + * @author zxc + */ + @PostMapping("topicsummary") + public Result topicSummary(@LoginUser TokenDto tokenDto){ + return new Result().ok(topicService.topicSummary(tokenDto)); + } + + /** + * @Description 话题——话题分析 + * @param tokenDto + * @param formDTO + * @author zxc + */ + @PostMapping("incrtrend") + public Result> topicIncrTrend(@LoginUser TokenDto tokenDto, @RequestBody TopicIncrTrendFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, TopicIncrTrendFormDTO.TopicIncr.class); + return new Result>().ok(topicService.topicIncrTrend(tokenDto,formDTO)); + } + + /** + * @Description 话题——直属网格话题数 + * @param tokenDto + * @author zxc + */ + @PostMapping("subgrid") + public Result> topicSubGrid(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSubGrid(tokenDto)); + } + + /** + * @Description 话题——下级机关话题数 + * @param tokenDto + * @author zxc + */ + @PostMapping("subagency") + public Result> topicSubAgency(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSubAgency(tokenDto)); + } + + /** + * @Description 话题——话题分析表 + * @param tokenDto + * @author zxc + */ + @PostMapping("summaryinfo") + public Result> topicSummaryInfo(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSummaryInfo(tokenDto)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java new file mode 100644 index 0000000000..5f3cfaa290 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java @@ -0,0 +1,90 @@ +package com.epmet.controller.user; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.user.UserIncrTrendFormDTO; +import com.epmet.dto.form.user.UserSubAgencyFormDTO; +import com.epmet.dto.form.user.UserSubGridFormDTO; +import com.epmet.dto.form.user.UserSummaryInfoFormDTO; +import com.epmet.dto.result.user.UserIncrTrendResultDTO; +import com.epmet.dto.result.user.UserSubAgencyResultDTO; +import com.epmet.dto.result.user.UserSubGridResultDTO; +import com.epmet.dto.result.user.UserSummaryInfoResultDTO; +import com.epmet.service.user.UserAnalysisService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 组织能力用户相关接口入口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:22 + */ +@RestController +@RequestMapping("user") +public class UserAnalysisController { + @Autowired + private UserAnalysisService userService; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 用户汇总信息查询 + * @Date 2020/6/22 13:27 + **/ + @PostMapping("summaryinfo") + public Result summaryInfo(@RequestBody UserSummaryInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,UserSummaryInfoFormDTO.AddUserInternalGroup.class); + UserSummaryInfoResultDTO userSummaryInfoResultDTO = userService.summaryInfo(formDTO); + return new Result().ok(userSummaryInfoResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 直属机关柱状图查询 + * @Date 2020/6/22 13:30 + **/ + @PostMapping("subagency") + public Result> subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,UserSubAgencyFormDTO.AddUserInternalGroup.class); + List userSubAgencyResultDTO = userService.subAgency(formDTO); + return new Result>().ok(userSubAgencyResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:33 + **/ + @PostMapping("subgrid") + public Result> subGrid(@RequestBody UserSubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UserSubGridFormDTO.AddUserInternalGroup.class); + List userSubGridResultDTO = userService.subGrid(formDTO); + return new Result>().ok(userSubGridResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:36 + **/ + @PostMapping("incrtrend") + public Result> incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UserIncrTrendFormDTO.AddUserInternalGroup.class); + List userIncrTrendResultDTO = userService.incrTrendV2(formDTO); + return new Result>().ok(userIncrTrendResultDTO); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java new file mode 100644 index 0000000000..0f22c81d2b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java @@ -0,0 +1,58 @@ +package com.epmet.dao.group; + +import com.epmet.group.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 10:55 + */ +@Mapper +public interface GroupDao { + + /** + * @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 + * @param + * @author zxc + */ + GroupSummaryInfoResultDTO summaryInfo(@Param("agencyId") String agencyId); + + /** + * @Description 获取下级机关信息 + * @param agencyId + * @author zxc + */ + List getSubAgencyList(@Param("agencyId") String agencyId); + + /** + * @Description 获取下级机关的小组数 + * @param + * @author zxc + */ + List getSubGroupCount(); + + /** + * @Description 获取直属网格下的小组数 + * @param agencyId + * @author zxc + */ + List getSubGridGroupCount(@Param("agencyId") String agencyId); + + /** + * @Description 小组数量 日增长 + * @param agencyId + * @author zxc + */ + List getIncrDaily(@Param("agencyId") String agencyId); + + /** + * @Description 小组数量 月增长 + * @param agencyId + * @author zxc + */ + List getIncrMonthly(@Param("agencyId") String agencyId); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java new file mode 100644 index 0000000000..f8f3058673 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java @@ -0,0 +1,60 @@ +package com.epmet.dao.issue; + +import com.epmet.issue.dto.result.IssueDataDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:48 + */ +@Mapper +public interface IssueDao { + /** + * 获取当前机关统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:19 + * @param agencyId + * @return com.epmet.issue.dto.result.IssueDataDTO + */ + IssueDataDTO selectAgencyInfo(@Param("agencyId") String agencyId); + + /** + * 获取下级机关统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:20 + * @param agencyId + * @return java.util.List + */ + List selectSubAgencyList(@Param("agencyId") String agencyId); + + /** + * 获取机关下网格统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:21 + * @param agencyId + * @return java.util.List + */ + List selectGridList(@Param("agencyId") String agencyId); + + /** + * 获取当前机关日增量 + * @author zhaoqifeng + * @date 2020/6/22 15:22 + * @param agencyId + * @return java.util.List + */ + List selectAgencyIncDailyList(@Param("agencyId") String agencyId); + + /** + * 获取当前机关月增量 + * @author zhaoqifeng + * @date 2020/6/22 15:23 + * @param agencyId + * @return java.util.List + */ + List selectAgencyIncMonthlyList(@Param("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java new file mode 100644 index 0000000000..3ae53720f7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -0,0 +1,58 @@ +package com.epmet.dao.project; + +import com.epmet.project.dto.FactAgencyProjectDailyDTO; +import com.epmet.project.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@Mapper +public interface ProjectDao { + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + ProjectSummaryResultDTO selectProjectSummary(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + List selectSummaryInfo(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 查询组织最近日期的日统计数据 + **/ + FactAgencyProjectDailyDTO selectAgencyProjectDaily(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 数据-项目-获取最近日期下级组织柱状图数据(按项目总量降序) + **/ + List selectSubAgency(FactAgencyProjectDailyDTO agencyProjectDailyDTO); + + /** + * @Author sun + * @Description 查询机关下直属网格最近一天的日统计数据,按项目总数降序 + **/ + List selectSubGrid(FactAgencyProjectDailyDTO agencyProjectDailyDTO); + + /** + * @Author sun + * @Description 查询机关日统计近九十天数据 + **/ + List selectIncrTrendDaily(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 查询机关月统计近十二个月数据 + **/ + List selectIncrTrendMonthly(@Param("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java new file mode 100644 index 0000000000..33801156b9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java @@ -0,0 +1,145 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.publicity; + +import com.epmet.publicity.dto.result.*; +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-19 + */ +@Mapper +public interface PublicityDao { + + /** + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @param agencyId 机关id + * @author jyy + */ + FactPublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId); + + /** + * @Description 当月———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,monthId,pageSize 机关id,月,展示数量 + * @author zxc + */ + List getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当季———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,quarterId,pageSize 机关id,季,展示数量 + * @author zxc + */ + List getViewedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当年———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,yearId,pageSize 机关id,年,展示数量 + * @author zxc + */ + List getViewedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当月———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,monthId,pageSize 机关id,月,展示数量 + * @author zxc + */ + List getUsedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当季———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,quarterId,pageSize 机关id,季,展示数量 + * @author zxc + */ + List getUsedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当年———获取机关下,每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,yearId,pageSize 机关id,年,展示数量 + * @author zxc + */ + List getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当月———下级机发文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubAgencyPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级机发文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubAgencyPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级机发文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubAgencyPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * @Description 当月———下级部门文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubDepartPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级部门文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubDepartPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级部门文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubDepartPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * @Description 当月———下级网格文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubGridPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级网格文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubGridPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级网格文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubGridPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java new file mode 100644 index 0000000000..e45798d750 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -0,0 +1,108 @@ +package com.epmet.dao.topic; + +import com.epmet.group.dto.result.GroupIncrTrendResultDTO; +import com.epmet.topic.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:55 + */ +@Mapper +public interface TopicDao { + + /** + * @Description 获取话题数量及状态 + * @param agencyId + * @author zxc + */ + List getTopicStatus(@Param("agencyId")String agencyId); + + /** + * @Description 获取机关下已转议题数量 + * @param agencyId + * @author zxc + */ + TopicShiftedCountResultDTO getShiftedCount(@Param("agencyId")String agencyId); + + /** + * @Description 获取话题信息(状态,数量,百分比) + * @param agencyId + * @author zxc + */ + List topicSummaryInfo(@Param("agencyId")String agencyId); + + /** + * @Description 根据当前机关判断是否有下级机关 + * @param agencyId + * @author zxc + */ + List getSubAgencyIdList(@Param("agencyId")String agencyId); + + /** + * @Description 获取最后一天的所有话题数据 【fact_topic_status_agency_daily】 + * @param + * @author zxc + */ + List getAllTopicInfoLastDay(); + + /** + * @Description 获取最后一天的所有话题已转议题数据 + * @param + * @author zxc + */ + List getAllTopicShiftedInfoLastDay(); + + /** + * @Description 校验机关下是否存在直属网格 + * @param agencyId + * @author zxc + */ + List getSubGridIdList(@Param("agencyId")String agencyId); + + /** + * @Description 获取最后一天的所有话题数据 【fact_topic_status_grid_daily】【grid】 + * @param + * @author zxc + */ + List getGridAllTopicInfoLastDay(); + + /** + * @Description 获取最后一天的所有话题已转议题数据【grid】 + * @param + * @author zxc + */ + List getGridAllTopicShiftedInfoLastDay(); + + /** + * @Description 话题日增长 + * @param agencyId + * @author zxc + */ + List getTopicIncrDaily(@Param("agencyId") String agencyId); + + /** + * @Description 话题转议题日增长 + * @param agencyId + * @author zxc + */ + List getTopicShiftedIncrDaily(@Param("agencyId") String agencyId); + + /** + * @Description 话题月增长 + * @param agencyId + * @author zxc + */ + List getTopicIncrMonthly(@Param("agencyId") String agencyId); + + /** + * @Description 话题转议题月增长 + * @param agencyId + * @author zxc + */ + List getTopicShiftedIncrMonthly(@Param("agencyId") String agencyId); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java new file mode 100644 index 0000000000..7b72652ea8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java @@ -0,0 +1,135 @@ +package com.epmet.dao.user; + + +import com.epmet.dto.DimAgencyDTO; +import com.epmet.dto.DimGridDTO; +import com.epmet.dto.result.user.UserIncrTrendResDTO; +import com.epmet.dto.result.user.UserSubAgencyResDTO; +import com.epmet.dto.result.user.UserSubGridResDTO; +import com.epmet.dto.result.user.UserSummaryInfoResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 16:33 + */ +@Mapper +public interface UserAnalysisDao { + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description 根据机关id,查询它下一级机关列表 + * @Date 2020/6/22 22:42 + **/ + List selectSubAgencyList(String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description 根据机关id,查询它下面的直属网格列表 + * @Date 2020/6/22 23:51 + **/ + List selectSubGridList(String myAgencyId); + + /** + * @param myAgencyId + * @return com.epmet.user.result.UserSummaryInfoResultDTO + * @author yinzuomei + * @description 查询注册用户汇总信息 + * @Date 2020/6/22 16:52 + **/ + UserSummaryInfoResultDTO selectRegUserSummaryInfo(String myAgencyId); + + /** + * @param myAgencyId + * @return com.epmet.user.result.UserSummaryInfoResultDTO + * @author yinzuomei + * @description 查询注册用户的汇总信息 + * @Date 2020/6/22 16:52 + **/ + UserSummaryInfoResultDTO selectParticipationUserSummaryInfo(String myAgencyId); + + /** + * @return java.util.List + * @param dateId 20200618日期 + * @param agencyId 用户所属机关 + * @author yinzuomei + * @description 参与用户:子级机关用户分析,按日(date_id)查询 + * @Date 2020/6/22 21:51 + **/ + List selectParticipationSubAgencyRes(@Param("dateId") String dateId ,@Param("agencyId")String agencyId); + + /** + * @param dateId + * @param dateId 20200618日期 + * @param agencyId 用户所属机关id + * @return java.util.List + * @author yinzuomei + * @description 注册用户:子级机关用户分析,按日(date_id)查询 + * @Date 2020/6/22 22:38 + **/ + List selectRegSubAgencyRes(@Param("dateId") String dateId ,@Param("agencyId")String agencyId); + + /** + * @param dateId 20200618日期 + * @param agencyId 用户所属机关id + * @return java.util.List + * @author yinzuomei + * @description 参与用户:机关下,直属网格用户分析 + * @Date 2020/6/23 0:18 + **/ + List selectParticipationSubGridRes(@Param("dateId") String dateId, @Param("agencyId") String agencyId); + + /** + * @param dateId 20200618日期 + * @param agencyId 用户所属机关id + * @return java.util.List + * @author yinzuomei + * @description 注册用户:机关下,直属网格用户分析 + * @Date 2020/6/23 0:18 + **/ + List selectRegSubGridRes(@Param("dateId")String dateId, @Param("agencyId") String agencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description 注册用户:机关、日增量折现图 近90天 + * @Date 2020/6/23 11:24 + **/ + List selectRegDayIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description 注册用户:机关、月增量折线图 近12个月包含当前月 + * @Date 2020/6/23 11:24 + **/ + List selectRegMonthIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description 参与用户:机关、日增量折线图 近90天 + * @Date 2020/6/23 11:24 + **/ + List selectParticipationUserDayIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description 参与用户:机关、月增量插线图 近12个月 包含当前月 + * @Date 2020/6/23 11:24 + **/ + List selectParticipationUserMonthIncr(@Param("agencyId") String myAgencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java new file mode 100644 index 0000000000..d644029bcf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java @@ -0,0 +1,45 @@ +package com.epmet.service.group; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.group.dto.form.GroupIncrTrendFormDTO; +import com.epmet.group.dto.result.GroupIncrTrendResultDTO; +import com.epmet.group.dto.result.GroupSubAgencyResultDTO; +import com.epmet.group.dto.result.GroupSubGridResultDTO; +import com.epmet.group.dto.result.GroupSummaryInfoResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 10:55 + */ +public interface GroupService { + + /** + * @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 + * @param tokenDto + * @author zxc + */ + GroupSummaryInfoResultDTO summaryInfo(TokenDto tokenDto); + + /** + * @Description 网格小组——下级机关小组数柱状图 + * @param tokenDto + * @author zxc + */ + List subAgency(TokenDto tokenDto); + + /** + * @Description 网格小组——直属网格小组数 + * @param tokenDto + * @author zxc + */ + List subGrid(TokenDto tokenDto); + + /** + * @Description 网格小组——小组分析 + * @param tokenDto + * @author zxc + */ + List IncrTrend(TokenDto tokenDto, GroupIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java new file mode 100644 index 0000000000..80a5624e3b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java @@ -0,0 +1,107 @@ +package com.epmet.service.group.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dao.group.GroupDao; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.group.constant.GroupConstant; +import com.epmet.group.dto.form.GroupIncrTrendFormDTO; +import com.epmet.group.dto.result.*; +import com.epmet.service.group.GroupService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 10:56 + */ +@Service +public class GroupServiceImpl implements GroupService { + + @Autowired + private GroupDao groupDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 + * @param tokenDto + * @author zxc + */ + @Override + public GroupSummaryInfoResultDTO summaryInfo(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + return groupDao.summaryInfo(agencyId); + } + + /** + * @Description 网格小组——下级机关小组数柱状图 + * @param tokenDto + * @author zxc + */ + @Override + public List subAgency(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + List subAgencyList = groupDao.getSubAgencyList(agencyId); + List subGroupCount = groupDao.getSubGroupCount(); + if (subAgencyList.size()!= NumConstant.ZERO){ + subGroupCount.forEach(group -> { + subAgencyList.forEach(subAgency -> { + if (subAgency.getAgencyId().equals(group.getAgencyId())){ + group.setName(subAgency.getAgencyName()); + result.add(group); + } + }); + }); + return result; + } + return new ArrayList<>(); + } + + /** + * @Description 网格小组——直属网格小组数 + * @param tokenDto + * @author zxc + */ + @Override + public List subGrid(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + return groupDao.getSubGridGroupCount(agencyId); + } + + /** + * @Description 网格小组——小组分析 + * @param tokenDto + * @author zxc + */ + @Override + public List IncrTrend(TokenDto tokenDto, GroupIncrTrendFormDTO formDTO) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + if (formDTO.getType().equals(GroupConstant.DATE)){ + result = groupDao.getIncrDaily(agencyId); + }else { + result = groupDao.getIncrMonthly(agencyId); + } + return result; + } + + /** + * @Description 获取机关ID + * @param tokenDto + * @author zxc + */ + public String getLoginUserDetails(TokenDto tokenDto){ + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto,dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + return data.getAgencyId(); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java new file mode 100644 index 0000000000..c0d33b2a3b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java @@ -0,0 +1,65 @@ +package com.epmet.service.issue; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:48 + */ +public interface IssueService { + /** + * 议题汇总 + * + * @param tokenDto + * @return com.epmet.issue.dto.result.IssueSummaryInfoResultDTO + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto); + + /** + * 议题汇总饼状图 + * + * @param tokenDto + * @return com.epmet.issue.dto.result.IssueSummaryPieResultDTO + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + List getSummaryPie(TokenDto tokenDto); + + /** + * 下级机关 + * + * @param tokenDto + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + List getSubAgency(TokenDto tokenDto); + + /** + * 网格 + * + * @param tokenDto + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:41 + */ + List getSubGrid(TokenDto tokenDto); + + /** + * 议题分析 + * + * @param tokenDto + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:41 + */ + List getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java new file mode 100644 index 0000000000..207a7f9c30 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java @@ -0,0 +1,210 @@ +package com.epmet.service.issue.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.issue.IssueDao; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.issue.constant.IssueConstant; +import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; +import com.epmet.service.issue.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:49 + */ +@Service +public class IssueServiceImpl implements IssueService { + @Autowired + private IssueDao issueDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Override + public IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto) { + IssueSummaryInfoResultDTO result = new IssueSummaryInfoResultDTO(); + String agencyId = getAgencyId(tokenDto); + IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); + if (null == data) { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); + result.setAgencyId(agencyId); + result.setDateName(DateUtils.format(date, "yyyy.MM.dd")); + result.setIssueTotal(NumConstant.ZERO); + result.setVotingTotal(NumConstant.ZERO); + result.setShiftProjectTotal(NumConstant.ZERO); + result.setClosedTotal(NumConstant.ZERO); + result.setVotingRatio("0%"); + result.setShiftProjectRatio("0%"); + result.setClosedRatio("0%"); + } else { + result.setAgencyId(agencyId); + result.setDateName(data.getDateName()); + result.setIssueTotal(data.getIssueTotal()); + result.setVotingTotal(data.getVotingTotal()); + result.setShiftProjectTotal(data.getShiftProjectTotal()); + result.setClosedTotal(data.getClosedTotal()); + result.setVotingRatio(toRatio(data.getVotingPercent())); + result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent())); + result.setClosedRatio(toRatio(data.getClosedPercent())); + } + return result; + } + + @Override + public List getSummaryPie(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); + if (null == data) { + IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); + voting.setName(IssueConstant.VOTING_NAME); + voting.setValue(NumConstant.ZERO); + voting.setRatio("0%"); + list.add(voting); + IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); + shift.setName(IssueConstant.SHIFT_NAME); + shift.setValue(NumConstant.ZERO); + shift.setRatio("0%"); + list.add(shift); + IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); + closed.setName(IssueConstant.CLOSED_NAME); + closed.setValue(NumConstant.ZERO); + closed.setRatio("0%"); + list.add(closed); + } else { + IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); + voting.setName(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + voting.setRatio(toRatio(data.getVotingPercent())); + list.add(voting); + IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); + shift.setName(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + shift.setRatio(toRatio(data.getShiftProjectPercent())); + list.add(shift); + IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); + closed.setName(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + closed.setRatio(toRatio(data.getClosedPercent())); + list.add(closed); + } + return list; + } + + @Override + public List getSubAgency(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList = issueDao.selectSubAgencyList(agencyId); + if(null != dataList) { + dataList.forEach(data -> { + IssueSubAgencyResultDTO voting = new IssueSubAgencyResultDTO(); + voting.setAgencyId(data.getAgencyId()); + voting.setName(data.getAgencyName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + list.add(voting); + IssueSubAgencyResultDTO shift = new IssueSubAgencyResultDTO(); + shift.setAgencyId(data.getAgencyId()); + shift.setName(data.getAgencyName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + list.add(shift); + IssueSubAgencyResultDTO closed = new IssueSubAgencyResultDTO(); + closed.setAgencyId(data.getAgencyId()); + closed.setName(data.getAgencyName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + list.add(closed); + }); + } + return list; + } + + @Override + public List getSubGrid(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList = issueDao.selectGridList(agencyId); + if(null != dataList) { + dataList.forEach(data -> { + IssueSubGridResultDTO voting = new IssueSubGridResultDTO(); + voting.setName(data.getGridName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + list.add(voting); + IssueSubGridResultDTO shift = new IssueSubGridResultDTO(); + shift.setName(data.getGridName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + list.add(shift); + IssueSubGridResultDTO closed = new IssueSubGridResultDTO(); + closed.setName(data.getGridName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + list.add(closed); + }); + } + return list; + } + + @Override + public List getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList; + if (IssueConstant.DATE.equals(formDTO.getType())) { + dataList = issueDao.selectAgencyIncDailyList(agencyId); + } else { + dataList = issueDao.selectAgencyIncMonthlyList(agencyId); + } + if (null != dataList) { + dataList.forEach(data -> { + IssueIncrtrendResultDTO voting = new IssueIncrtrendResultDTO(); + voting.setDate(data.getDateName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingIncr()); + list.add(voting); + IssueIncrtrendResultDTO shift = new IssueIncrtrendResultDTO(); + shift.setDate(data.getDateName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectIncr()); + list.add(shift); + IssueIncrtrendResultDTO closed = new IssueIncrtrendResultDTO(); + closed.setDate(data.getDateName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedIncr()); + list.add(closed); + }); + } + return list; + } + + private String getAgencyId(TokenDto tokenDto) { + LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp(tokenDto.getApp()); + loginUserDetailsFormDTO.setClient(tokenDto.getClient()); + loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); + LoginUserDetailsResultDTO userInfo = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); + String[] orgIdPath = userInfo.getOrgIdPath().split(":"); + return orgIdPath[orgIdPath.length - 1]; + } + + private String toRatio(BigDecimal data) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + return data.multiply(hundred).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString().concat("%"); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/ProjectService.java new file mode 100644 index 0000000000..baa6e664e0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -0,0 +1,44 @@ +package com.epmet.module.project.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +public interface ProjectService { + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + ProjectSummaryResultDTO getProjectSummary(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + List getSummaryInfo(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + List getSubAgency(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + List getSubGrid(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询 + **/ + List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java new file mode 100644 index 0000000000..26302753eb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -0,0 +1,163 @@ +package com.epmet.service.project.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.dao.project.ProjectDao; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.project.service.ProjectService; +import com.epmet.project.constant.ProjectConstant; +import com.epmet.project.dto.FactAgencyProjectDailyDTO; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@Service +public class ProjectServiceImpl implements ProjectService { + + @Autowired + private ProjectDao projectDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + @Override + public ProjectSummaryResultDTO getProjectSummary(TokenDto tokenDto) { + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据agencyId查询项目统计数据 + ProjectSummaryResultDTO resultDTO = projectDao.selectProjectSummary(agencyId); + if (null != resultDTO) { + //将结果转成百分比 + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMaximumFractionDigits(2); + //四舍五入保留小数点后四位 + BigDecimal pendingRatio = resultDTO.getPendingRatioInt().setScale(4, RoundingMode.HALF_UP); + //将小数转成百分比 + resultDTO.setPendingRatio(percent.format(pendingRatio.doubleValue())); + resultDTO.setClosedRatio(percent.format(resultDTO.getClosedRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); + } + return resultDTO; + } + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + @Override + public List getSummaryInfo(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据agencyId查询各状态统计数据 + resultList = projectDao.selectSummaryInfo(agencyId); + if (null != resultList && resultList.size() > NumConstant.ZERO) { + //将结果转成百分比 + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMaximumFractionDigits(2); + resultList.forEach(sum -> { + //先四舍五入保留四位小数再把小数转成百分比 + sum.setRatio(percent.format(sum.getRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); + }); + } + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + @Override + public List getSubAgency(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据机关Id查询最近日期的日统计数据 + FactAgencyProjectDailyDTO agencyProjectDailyDTO = projectDao.selectAgencyProjectDaily(agencyId); + if (null == agencyProjectDailyDTO) { + return resultList; + } + //2:获取当前组织最近日期的直属下级组织项目统计数据,按项目总量降序 + resultList = projectDao.selectSubAgency(agencyProjectDailyDTO); + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + @Override + public List getSubGrid(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据机关Id查询最近日期的日统计数据 + FactAgencyProjectDailyDTO agencyProjectDailyDTO = projectDao.selectAgencyProjectDaily(agencyId); + if (null == agencyProjectDailyDTO) { + return resultList; + } + //2:获取机关下直属网格最近一天的日统计数据,按项目总数降序 + resultList = projectDao.selectSubGrid(agencyProjectDailyDTO); + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询(日查询进九十天数据,月查询进十二个月数据) + **/ + @Override + public List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:查询机关过去九十天日统计数据(sql降序取前九十条) + if (ProjectConstant.DAY.equals(formDTO.getType())) { + resultList = projectDao.selectIncrTrendDaily(agencyId); + } + + //3:查询机关过去十二个月月统计数据 + if (ProjectConstant.MONTH.equals(formDTO.getType())) { + resultList = projectDao.selectIncrTrendMonthly(agencyId); + } + + return resultList; + } + + /** + * @author sun + * @Description 获取机关ID + */ + private String getLoginUserDetails(TokenDto tokenDto) { + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto, dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + String agencyId = data.getAgencyId(); + if (null == agencyId || "".equals(agencyId)) { + throw new RenException(ProjectConstant.GET_AGENCYID); + } + return agencyId; + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java new file mode 100644 index 0000000000..9eccb5b29f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.publicity; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.publicity.dto.result.*; +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +public interface PublicityService { + + /** + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @param tokenDto + * @author jyy + */ + FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto); + + /** + * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @param tokenDto,formDTO + * @author jyy + */ + public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) ; + + /** + * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @param tokenDto,pageSize,type + * @author jyy + */ + public List tagused(TokenDto tokenDto, Integer pageSize, String type) ; + + /** + * @param tokenDto type + * @Description 获取下级机关发文数 + * @author jyy + */ + public List subagencyPublishedarticle(TokenDto tokenDto, String type) ; + /** + * @param tokenDto type + * @Description 获取直属部门发文数 + * @author jyy + */ + public List departmentPublishedarticle(TokenDto tokenDto, String type); + + /** + * @param tokenDto type + * @Description 获取指数网格发文数 + * @author jyy + */ + public List subgridPublishedarticle(TokenDto tokenDto, String type); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java new file mode 100644 index 0000000000..c5e94f7633 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java @@ -0,0 +1,213 @@ +/** + * 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.publicity.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.publicity.PublicityDao; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.publicity.dto.result.*; +import com.epmet.service.publicity.PublicityService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Service +public class PublicityServiceImpl implements PublicityService { + @Autowired + private PublicityDao publicityDao;//机关每日发文 + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @param tokenDto + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @author jyy + */ + @Override + public FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + return publicityDao.summaryInfo(agencyId); + } + + + /** + * @param tokenDto,formDTO + * @Description 宣传能力—工作端-获取阅读最多的分类数据 + * @author jyy + */ + @Override + public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) { + String agencyId = this.getLoginUserDetails(tokenDto); + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); + String yearId = strDate.substring(0, 4); + + if (StringUtils.equals("month", type)) {//当月 + String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); + return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getViewedYearlyCountByTag(agencyId, yearId, pageSize); + + } else { + return null; + } + } + + /** + * @param tokenDto pageSize type + * @Description 宣传能力—工作端-获取发表最多的分类数据 + * @author jyy + */ + @Override + public List tagused(TokenDto tokenDto, Integer pageSize, String type) { + String agencyId = this.getLoginUserDetails(tokenDto); + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); + String yearId = strDate.substring(0, 4); + + if (StringUtils.equals("month", type)) {//当月 + String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); + return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getUsedYearlyCountByTag(agencyId, yearId, pageSize); + + } else { + return null; + } + } + + /** + * @param tokenDto type + * @Description 获取下级机关发文数 + * @author jyy + */ + @Override + public List subagencyPublishedarticle(TokenDto tokenDto, String type) { + String agencyId = this.getLoginUserDetails(tokenDto); + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubAgencyPublishedYear(agencyId, yearId); + + } else { + return null; + } + } + + /** + * @param tokenDto type + * @Description 获取直属部门发文数 + * @author jyy + */ + @Override + public List departmentPublishedarticle(TokenDto tokenDto, String type) { + String agencyId = this.getLoginUserDetails(tokenDto); + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubDepartPublishedYear(agencyId, yearId); + + } else { + return null; + } + } + + /** + * @param tokenDto type + * @Description 获取指数网格发文数 + * @author jyy + */ + @Override + public List subgridPublishedarticle(TokenDto tokenDto, String type) { + String agencyId = this.getLoginUserDetails(tokenDto); + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubGridPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubGridPublishedYear(agencyId, yearId); + + } else { + return null; + } + } + + /** + * @param tokenDto + * @Description 获取机关ID + * @author zxc + */ + public String getLoginUserDetails(TokenDto tokenDto) { + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto, dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + return data.getAgencyId(); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java new file mode 100644 index 0000000000..584ac1b1dc --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -0,0 +1,51 @@ +package com.epmet.service.topic; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; +import com.epmet.topic.dto.result.*; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:58 + */ +public interface TopicService { + + /** + * @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 + * @param tokenDto + * @author zxc + */ + TopicSummaryResultDTO topicSummary(TokenDto tokenDto); + + /** + * @Description 话题——话题分析 + * @param tokenDto + * @param formDTO + * @author zxc + */ + List topicIncrTrend(TokenDto tokenDto, TopicIncrTrendFormDTO formDTO); + + /** + * @Description 话题——直属网格话题数 + * @param tokenDto + * @author zxc + */ + List topicSubGrid( TokenDto tokenDto); + + /** + * @Description 话题——下级机关话题数 + * @param tokenDto + * @author zxc + */ + List topicSubAgency(TokenDto tokenDto); + + /** + * @Description 话题——话题分析表 + * @param tokenDto + * @author zxc + */ + List topicSummaryInfo(TokenDto tokenDto); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java new file mode 100644 index 0000000000..0859bd2632 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -0,0 +1,183 @@ +package com.epmet.service.topic.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dao.topic.TopicDao; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.topic.TopicService; +import com.epmet.topic.constant.TopicConstant; +import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; +import com.epmet.topic.dto.result.*; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:58 + */ +@Service +public class TopicServiceImpl implements TopicService { + + @Autowired + private TopicDao topicDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 + * @param tokenDto + * @author zxc + */ + @Override + public TopicSummaryResultDTO topicSummary(TokenDto tokenDto) { + TopicSummaryResultDTO result = new TopicSummaryResultDTO(); + String agencyId = this.getLoginUserDetails(tokenDto); + List topicStatus = topicDao.getTopicStatus(agencyId); + if (topicStatus.size() != NumConstant.ZERO){ + topicStatus.forEach(topic -> { + if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){ + result.setTalkingTotalCount(topic.getTopicCount()); + }else if (topic.getTopicStatus().equals(TopicConstant.CLOSED)){ + result.setClosedTotalCount(topic.getTopicCount()); + }else { + result.setShieldedTotalCount(topic.getTopicCount()); + } + }); + result.setTopicTotalCount(topicStatus.stream().collect(Collectors.summingInt(TopicStatusResultDTO::getTopicCount))); + } + TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); + if (shiftedCount != null){ + result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount()); + result.setDeadline(shiftedCount.getDeadline()); + } + return result; + } + + /** + * @Description 话题——话题分析 + * @param tokenDto + * @param formDTO + * @author zxc + */ + @Override + public List topicIncrTrend(TokenDto tokenDto, TopicIncrTrendFormDTO formDTO) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + if (formDTO.getType().equals(TopicConstant.DATE)){ + List topicIncrDaily = topicDao.getTopicIncrDaily(agencyId); + List topicShiftedIncrDaily = topicDao.getTopicShiftedIncrDaily(agencyId); + topicIncrDaily.addAll(topicShiftedIncrDaily); + result = topicIncrDaily.stream().sorted(Comparator.comparing(TopicIncrTrendResultDTO::getDate).reversed()).collect(Collectors.toList()); + }else { + List topicIncrMonthly = topicDao.getTopicIncrMonthly(agencyId); + List topicShiftedIncrMonthly = topicDao.getTopicShiftedIncrMonthly(agencyId); + topicIncrMonthly.addAll(topicShiftedIncrMonthly); + result = topicIncrMonthly.stream().sorted(Comparator.comparing(TopicIncrTrendResultDTO::getDate).reversed()).collect(Collectors.toList()); + } + return result; + } + + /** + * @Description 话题——直属网格话题数 + * @param tokenDto + * @author zxc + */ + @Override + public List topicSubGrid(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + List subGridIdList = topicDao.getSubGridIdList(agencyId); + if (subGridIdList.size() != NumConstant.ZERO){ + List gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay(); + List gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay(); + subGridIdList.forEach(gridId -> { + gridAllTopicInfoLastDay.forEach(gridTopic -> { + if (gridId.equals(gridTopic.getGridId())){ + result.add(gridTopic); + } + }); + gridAllTopicShiftedInfoLastDay.forEach(gridShift -> { + if (gridId.equals(gridShift.getGridId())){ + result.add(gridShift); + } + }); + }); + return result; + } + return new ArrayList<>(); + } + + /** + * @Description 话题——下级机关话题数 + * @param tokenDto + * @author zxc + */ + @Override + public List topicSubAgency(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + List subAgencyIdList = topicDao.getSubAgencyIdList(agencyId); + //存在下级机关 + if (subAgencyIdList.size() != NumConstant.ZERO){ + List allTopicInfoLastDay = topicDao.getAllTopicInfoLastDay(); + List allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay(); + //话题状态为 已关闭、讨论中、已屏蔽 + subAgencyIdList.forEach(agencyIdOne -> { + allTopicInfoLastDay.forEach(agency -> { + if (agencyIdOne.equals(agency.getAgencyId())){ + result.add(agency); + } + }); + allTopicShiftedInfoLastDay.forEach(shiftTopic -> { + if (agencyIdOne.equals(shiftTopic.getAgencyId())){ + result.add(shiftTopic); + } + }); + }); + return result; + } + //不存在 + return new ArrayList<>(); + } + + /** + * @Description 话题——话题分析表 + * @param tokenDto + * @author zxc + */ + @Override + public List topicSummaryInfo(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List topicSummaryInfo = topicDao.topicSummaryInfo(agencyId); + TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); + Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue)); + String ratio; + ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : ((float)shiftedCount.getShiftedIssueCount() / (float)collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO; + TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); + result.setName(TopicConstant.SHIFTED); + result.setRatio(ratio); + result.setValue(shiftedCount.getShiftedIssueCount()); + topicSummaryInfo.add(result); + return topicSummaryInfo; + } + + /** + * @Description 获取机关ID + * @param tokenDto + * @author zxc + */ + public String getLoginUserDetails(TokenDto tokenDto){ + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto,dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + return data.getAgencyId(); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java new file mode 100644 index 0000000000..6e0c796794 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java @@ -0,0 +1,67 @@ +package com.epmet.service.user; + + +import com.epmet.dto.form.user.UserIncrTrendFormDTO; +import com.epmet.dto.form.user.UserSubAgencyFormDTO; +import com.epmet.dto.form.user.UserSubGridFormDTO; +import com.epmet.dto.form.user.UserSummaryInfoFormDTO; +import com.epmet.dto.result.user.UserIncrTrendResultDTO; +import com.epmet.dto.result.user.UserSubAgencyResultDTO; +import com.epmet.dto.result.user.UserSubGridResultDTO; +import com.epmet.dto.result.user.UserSummaryInfoResultDTO; + +import java.util.List; + +/** + * 组织能力用户相关接口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:23 + */ +public interface UserAnalysisService { + /** + * @param formDTO + * @return com.epmet.user.result.UserSummaryInfoResultDTO + * @author yinzuomei + * @description 用户汇总信息查询 + * @Date 2020/6/22 13:41 + **/ + UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubAgencyResultDTO + * @author yinzuomei + * @description 直属机关柱状图查询 + * @Date 2020/6/22 13:42 + **/ + List subAgency(UserSubAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubGridResultDTO + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:42 + **/ + List subGrid(UserSubGridFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserIncrTrendResultDTO + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:42 + **/ + @Deprecated + List incrTrend(UserIncrTrendFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserIncrTrendResultDTO + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:42 + **/ + List incrTrendV2(UserIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java new file mode 100644 index 0000000000..5265749de5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -0,0 +1,531 @@ +package com.epmet.service.user.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.UserAnalysisConstant; +import com.epmet.dao.user.UserAnalysisDao; +import com.epmet.dto.DimAgencyDTO; +import com.epmet.dto.DimGridDTO; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.form.user.UserIncrTrendFormDTO; +import com.epmet.dto.form.user.UserSubAgencyFormDTO; +import com.epmet.dto.form.user.UserSubGridFormDTO; +import com.epmet.dto.form.user.UserSummaryInfoFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.dto.result.user.*; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.user.UserAnalysisService; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +/** + * 组织能力用户相关接口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:23 + */ +@Service +public class UserAnalysisServiceImpl implements UserAnalysisService { + private static final Logger logger = LoggerFactory.getLogger(UserAnalysisServiceImpl.class); + @Autowired + private LoginUserUtil loginUserUtil; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private UserAnalysisDao userAnalysisDao; + DecimalFormat decimalFormat = new DecimalFormat("0.00"); + /** + * @return java.lang.String + * @param + * @author yinzuomei + * @description 查询当前用户直属机关单位id + * @Date 2020/6/22 14:19 + **/ + public String getMyAgency(){ + LoginUserDetailsFormDTO loginUserDetailsFormDTO=new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp(loginUserUtil.getLoginUserApp()); + loginUserDetailsFormDTO.setClient(loginUserUtil.getLoginUserClient()); + loginUserDetailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); + Result result=epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); + if(!result.success()){ + throw new RenException(UserAnalysisConstant.QUERY_USER_AGENCY_FAILED); + } + if(result.success()){ + if (null == result.getData() || StringUtils.isBlank(result.getData().getAgencyId())) { + throw new RenException(UserAnalysisConstant.QUERY_USER_AGENCY_FAILED); + } + } + return result.getData().getAgencyId(); + } + /** + * @param formDTO + * @return com.epmet.user.result.UserSummaryInfoResultDTO + * @author yinzuomei + * @description 用户汇总信息查询 + * @Date 2020/6/22 13:41 + **/ + @Override + public UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO) { + UserSummaryInfoResultDTO userSummaryInfoResultDTO=new UserSummaryInfoResultDTO(); + String myAgencyId=this.getMyAgency(); + if(UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())){ + //参与用户 + userSummaryInfoResultDTO=userAnalysisDao.selectParticipationUserSummaryInfo(myAgencyId); + }else{ + //注册用户 + userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); + } + if(null!=userSummaryInfoResultDTO){ + userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),".")); + //提取出工具类 + String partyMemberProStr=decimalFormat.format(userSummaryInfoResultDTO.getPartymemberProportionValue()); + userSummaryInfoResultDTO.setPartymemberProportion(partyMemberProStr.concat("%")); + String warmProStr=decimalFormat.format(userSummaryInfoResultDTO.getWarmHeartedProportionValue()); + userSummaryInfoResultDTO.setWarmHeartedProportion(warmProStr.concat("%")); + } + logger.info(String.format("查询用户汇总信息返参%s",JSON.toJSONString(userSummaryInfoResultDTO))); + return userSummaryInfoResultDTO; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubAgencyResultDTO + * @author yinzuomei + * @description 直属机关柱状图查询 + * @Date 2020/6/22 13:42 + **/ + @Override + public List subAgency(UserSubAgencyFormDTO formDTO) { + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + //初始化横坐标(用户所机关的下级机关列表) + List dimList = this.initUserSubAgencyResultDTO(myAgencyId); + if(CollectionUtils.isEmpty(dimList)){ + logger.info(String.format("当前机关(agencyId=%s)下没有下级机关",myAgencyId)); + return new ArrayList<>(); + } + //根据入参,查询注册用户或者参与用户的(机关、按日的查询结果) + List userSubAgencyResDTOList=new ArrayList<>(); + if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())) { + //参与用户 + userSubAgencyResDTOList = userAnalysisDao.selectParticipationSubAgencyRes(formDTO.getDateId(), + myAgencyId); + } else { + //注册用户 + userSubAgencyResDTOList = userAnalysisDao.selectRegSubAgencyRes(formDTO.getDateId(), + myAgencyId); + } + //根据维度表进行对比 + for(UserSubAgencyResultDTO dimInitResultDto:dimList){ + boolean flag=false; + for(UserSubAgencyResDTO userSubAgencyResDTO:userSubAgencyResDTOList){ + if(dimInitResultDto.getAgencyId().equals(userSubAgencyResDTO.getAgencyId())){ + flag=true; + //居民、热心居民、党员总数,用于排序 + if(null==userSubAgencyResDTO.getPartymemberTotal()){ + userSubAgencyResDTO.setPartymemberTotal(0); + } + if(null==userSubAgencyResDTO.getWarmHeartedTotal()){ + userSubAgencyResDTO.setWarmHeartedTotal(0); + } + if(null==userSubAgencyResDTO.getResiTotal()){ + userSubAgencyResDTO.setResiTotal(0); + } + dimInitResultDto.setTotal(userSubAgencyResDTO.getPartymemberTotal() + +userSubAgencyResDTO.getWarmHeartedTotal() + +userSubAgencyResDTO.getResiTotal()); + switch(dimInitResultDto.getType()){ + case UserAnalysisConstant.REGISTERED_RESI: + dimInitResultDto.setValue(userSubAgencyResDTO.getResiTotal()); + break; + case UserAnalysisConstant.WARMHEARTED: + dimInitResultDto.setValue(userSubAgencyResDTO.getWarmHeartedTotal()); + break; + case UserAnalysisConstant.PARTYMEMBER: + dimInitResultDto.setValue(userSubAgencyResDTO.getPartymemberTotal()); + break; + default: + break; + } + logger.info(String.format("找到当前机关(agencyId=%s,agencyName=%s)对应的数据,当前循环",dimInitResultDto.getAgencyId(),dimInitResultDto.getName())); + break; + } + } + if(!flag){ + logger.error(String.format("各机关注册用户数缺少记录:date_id=%s,agencyId=%s",formDTO.getDateId(),dimInitResultDto.getAgencyId())); + } + } + logger.info("排序前"); + for(UserSubAgencyResultDTO m:dimList){ + logger.info("机关名:"+m.getName()+",总数="+m.getTotal()); + } + //返回集合按照total降序排序 + Collections.sort(dimList, new Comparator() { + @Override + public int compare(UserSubAgencyResultDTO o1, UserSubAgencyResultDTO o2) { + int i=o2.getTotal()-o1.getTotal();//降序 + return i; + } + }); + logger.info("排序后"); + for(UserSubAgencyResultDTO m:dimList){ + logger.info("机关名:"+m.getName()+",总数="+m.getTotal()); + } + return dimList; + } + + private List initUserSubAgencyResultDTO(String myAgencyId) { + List list=new ArrayList<>(); + List dimAgencyDTOS=userAnalysisDao.selectSubAgencyList(myAgencyId); + for(DimAgencyDTO agencyDTO:dimAgencyDTOS){ + //居民 + UserSubAgencyResultDTO resi=new UserSubAgencyResultDTO(); + resi.setAgencyId(agencyDTO.getId()); + resi.setName(agencyDTO.getAgencyName()); + resi.setValue(NumConstant.ZERO); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setTotal(NumConstant.ZERO); + list.add(resi); + //热心居民 + UserSubAgencyResultDTO warm=new UserSubAgencyResultDTO(); + warm.setAgencyId(agencyDTO.getId()); + warm.setName(agencyDTO.getAgencyName()); + warm.setValue(NumConstant.ZERO); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setTotal(NumConstant.ZERO); + list.add(warm); + //党员 + UserSubAgencyResultDTO party=new UserSubAgencyResultDTO(); + party.setAgencyId(agencyDTO.getId()); + party.setName(agencyDTO.getAgencyName()); + party.setValue(NumConstant.ZERO); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setTotal(NumConstant.ZERO); + list.add(party); + } + return list; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubGridResultDTO + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:42 + **/ + @Override + public List subGrid(UserSubGridFormDTO formDTO) { + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + //初始化横坐标(用户所机关的直属网格) + List dimList = this.initUserSubGridResultDTO(myAgencyId); + if(CollectionUtils.isEmpty(dimList)){ + logger.info(String.format("当前机关(agencyId=%s)下没有网格",myAgencyId)); + return new ArrayList<>(); + } + //根据入参,查询注册用户或者参与用户的(机关、按日的查询结果) + List userSubGridResDTOS=new ArrayList<>(); + if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())) { + //参与用户 + userSubGridResDTOS=userAnalysisDao.selectParticipationSubGridRes(formDTO.getDateId(),myAgencyId); + } else { + //注册用户 + userSubGridResDTOS=userAnalysisDao.selectRegSubGridRes(formDTO.getDateId(),myAgencyId); + } + //根据维度表进行对比 + for(UserSubGridResultDTO dimInitResultDto:dimList){ + boolean flag=false; + for(UserSubGridResDTO userSubGridResDTO:userSubGridResDTOS){ + if(dimInitResultDto.getGridId().equals(userSubGridResDTO.getGridId())){ + flag=true; + //居民、热心居民、党员总数,用于排序 + if(null==userSubGridResDTO.getPartymemberTotal()){ + userSubGridResDTO.setPartymemberTotal(0); + } + if(null==userSubGridResDTO.getWarmHeartedTotal()){ + userSubGridResDTO.setWarmHeartedTotal(0); + } + if(null==userSubGridResDTO.getResiTotal()){ + userSubGridResDTO.setResiTotal(0); + } + dimInitResultDto.setTotal(userSubGridResDTO.getPartymemberTotal() + +userSubGridResDTO.getWarmHeartedTotal() + +userSubGridResDTO.getResiTotal()); + switch(dimInitResultDto.getType()){ + case UserAnalysisConstant.REGISTERED_RESI: + dimInitResultDto.setValue(userSubGridResDTO.getResiTotal()); + break; + case UserAnalysisConstant.WARMHEARTED: + dimInitResultDto.setValue(userSubGridResDTO.getWarmHeartedTotal()); + break; + case UserAnalysisConstant.PARTYMEMBER: + dimInitResultDto.setValue(userSubGridResDTO.getPartymemberTotal()); + break; + default: + break; + } + } + logger.info(String.format("找到当前网格(gridId=%s,gridName=%s)对应的数据,当前循环",dimInitResultDto.getGridId(),dimInitResultDto.getName())); + break; + } + if(!flag){ + logger.error(String.format("直属网格注册用户数缺少记录:date_id=%s,gridId=%s",formDTO.getDateId(),dimInitResultDto.getGridId())); + } + } + logger.info("排序前"); + for(UserSubGridResultDTO m:dimList){ + logger.info("网格名:"+m.getName()+",总数="+m.getTotal()); + } + //返回集合按照total降序排序 + Collections.sort(dimList, new Comparator() { + @Override + public int compare(UserSubGridResultDTO o1, UserSubGridResultDTO o2) { + int i=o2.getTotal()-o1.getTotal();//降序 + return i; + } + }); + logger.info("排序后"); + for(UserSubGridResultDTO m:dimList){ + logger.info("网格名:"+m.getName()+",总数="+m.getTotal()); + } + return dimList; + } + + private List initUserSubGridResultDTO(String myAgencyId) { + List list=new ArrayList<>(); + List gridList=userAnalysisDao.selectSubGridList(myAgencyId); + for(DimGridDTO grid:gridList){ + //居民 + UserSubGridResultDTO resi=new UserSubGridResultDTO(); + resi.setGridId(grid.getId()); + resi.setName(grid.getGridName()); + resi.setValue(NumConstant.ZERO); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setTotal(NumConstant.ZERO); + list.add(resi); + //热心居民 + UserSubGridResultDTO warm=new UserSubGridResultDTO(); + warm.setGridId(grid.getId()); + warm.setName(grid.getGridName()); + warm.setValue(NumConstant.ZERO); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setTotal(NumConstant.ZERO); + list.add(warm); + //党员 + UserSubGridResultDTO party=new UserSubGridResultDTO(); + party.setGridId(grid.getId()); + party.setName(grid.getGridName()); + party.setValue(NumConstant.ZERO); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setTotal(NumConstant.ZERO); + list.add(party); + } + return list; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserIncrTrendResultDTO + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:42 + **/ + @Override + public List incrTrend(UserIncrTrendFormDTO formDTO) { + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + List dimList = this.initUserIncrTrendResultDTO(formDTO.getType()); + if(CollectionUtils.isEmpty(dimList)){ + logger.error("横坐标初始失败"); + return new ArrayList<>(); + } + List list=new ArrayList<>(); + if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + //注册用户数、日 + list=userAnalysisDao.selectRegDayIncr(myAgencyId); + } else if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + //注册用户数、月 + list=userAnalysisDao.selectRegMonthIncr(myAgencyId); + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + //参与用户数、日 + list=userAnalysisDao.selectParticipationUserDayIncr(myAgencyId); + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + //参与用户数、月 + list=userAnalysisDao.selectParticipationUserMonthIncr(myAgencyId); + } else { + logger.error("参数错误"); + return new ArrayList<>(); + } + for(UserIncrTrendResultDTO dim:dimList){ + boolean flag=false; + for(UserIncrTrendResDTO userIncrTrendResDTO:list){ + if(dim.getDateOrMonthId().equals(userIncrTrendResDTO.getDateIdOrMonthId())){ + flag=true; + //居民、热心居民、党员总数,用于排序 + switch(dim.getType()){ + case UserAnalysisConstant.REGISTERED_RESI: + dim.setValue(userIncrTrendResDTO.getRegIncr()); + break; + case UserAnalysisConstant.WARMHEARTED: + dim.setValue(userIncrTrendResDTO.getWarmIncr()); + break; + case UserAnalysisConstant.PARTYMEMBER: + dim.setValue(userIncrTrendResDTO.getPartymemberIncr()); + break; + default: + break; + } + logger.info(String.format("找到当前日期(dateorMonthId=%s)对应的数据,跳出当前循环",dim.getDateOrMonthId())); + break; + } + } + if(!flag){ + logger.error(String.format("机关id%s缺少记录dateOrMonthId=%s",myAgencyId,dim.getDateOrMonthId())); + } + } + return dimList; + } + + @Override + public List incrTrendV2(UserIncrTrendFormDTO formDTO) { + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + List resultList=new ArrayList<>(); + List list=new ArrayList<>(); + if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + //注册用户数、日 + list=userAnalysisDao.selectRegDayIncr(myAgencyId); + } else if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + //注册用户数、月 + list=userAnalysisDao.selectRegMonthIncr(myAgencyId); + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + //参与用户数、日 + list=userAnalysisDao.selectParticipationUserDayIncr(myAgencyId); + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + //参与用户数、月 + list=userAnalysisDao.selectParticipationUserMonthIncr(myAgencyId); + } else { + logger.error("参数错误"); + return new ArrayList<>(); + } + for(UserIncrTrendResDTO userIncrTrendResDTO:list){ + String date=""; + if(UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())){ + date=DateUtils.getxAxisDatePattern(userIncrTrendResDTO.getDateIdOrMonthId(),"/"); + }else if(UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())){ + date=DateUtils.getxAxisDatePattern(userIncrTrendResDTO.getDateIdOrMonthId(),"/"); + } + //居民、热心居民、党员总数,用于排序 + UserIncrTrendResultDTO reg=new UserIncrTrendResultDTO(); + reg.setDateOrMonthId(userIncrTrendResDTO.getDateIdOrMonthId()); + reg.setDate(date); + reg.setType(UserAnalysisConstant.REGISTERED_RESI); + reg.setValue(userIncrTrendResDTO.getRegIncr()); + resultList.add(reg); + + UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); + warm.setDateOrMonthId(userIncrTrendResDTO.getDateIdOrMonthId()); + warm.setDate(date); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setValue(userIncrTrendResDTO.getWarmIncr()); + resultList.add(warm); + + UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); + party.setDateOrMonthId(userIncrTrendResDTO.getDateIdOrMonthId()); + party.setDate(date); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setValue(userIncrTrendResDTO.getPartymemberIncr()); + resultList.add(party); + } + return resultList; + } + + private List initUserIncrTrendResultDTO(String type) { + List list=new ArrayList<>(); + if(UserAnalysisConstant.DAY_TYPE.equals(type)){ + List dateIdList= DateUtils.getDaysBetween(DateUtils.getBeforeNDay(90), + DateUtils.getBeforeNDay(1)); + for(String dateId:dateIdList){ + String date=DateUtils.getxAxisDatePattern(dateId,"/"); + //居民 + UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO(); + resi.setDate(date); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setValue(NumConstant.ZERO); + resi.setDateOrMonthId(dateId); + //热心居民 + UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); + warm.setDate(date); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setValue(NumConstant.ZERO); + warm.setDateOrMonthId(dateId); + //党员 + UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); + party.setDate(date); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setValue(NumConstant.ZERO); + party.setDateOrMonthId(dateId); + list.add(resi); + list.add(warm); + list.add(party); + } + }else if(UserAnalysisConstant.MONTH_TYPE.equals(type)){ + List monthList= DateUtils.getMonthBetween(DateUtils.getBeforeNMonth(12), + DateUtils.getBeforeNMonth(0)); + for(String monthId:monthList){ + String date=DateUtils.getxAxisDatePattern(monthId,"/"); + //居民 + UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO(); + resi.setDate(date); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setValue(NumConstant.ZERO); + resi.setDateOrMonthId(monthId); + //热心居民 + UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); + warm.setDate(date); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setValue(NumConstant.ZERO); + warm.setDateOrMonthId(monthId); + //党员 + UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); + party.setDate(date); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setValue(NumConstant.ZERO); + party.setDateOrMonthId(monthId); + list.add(resi); + list.add(warm); + list.add(party); + } + } + return list; + } + + + /*public static void main(String[] args) { +// System.out.println("前一天"+DateUtils.getBeforeNDay(1)); +// System.out.println("前90天"+DateUtils.getBeforeNDay(90)); + List list= DateUtils.getDaysBetween("201912","202005"); + for(String m:list){ + System.out.println(m); + } +// System.out.println(list.size()); + System.out.println("上个月"+DateUtils.getBeforeNMonth(1)); + System.out.println("前8个月"+DateUtils.getBeforeNMonth(8)); + + }*/ + +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..19e6e4b584 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -0,0 +1,119 @@ +server: + port: @server.port@ + servlet: + context-path: /data/report + +spring: + main: + allow-bean-definition-overriding: true + application: + name: data-report-server + #环境 dev|test|prod + profiles: + active: dev + 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 + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.url@ + username: @datasource.druid.username@ + password: @datasource.druid.password@ + 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 + #指定共享配置,且支持动态刷新 + # ext-config: + # - data-id: datasource.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + # - data-id: common.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + + # 数据迁移工具flyway + flyway: + enabled: false + locations: classpath:db/migration + url: @datasource.druid.url@ + user: @datasource.druid.username@ + password: @datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: INPUT + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +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 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..ad10364cb5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -0,0 +1,175 @@ + + + + + + + + + + ${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-module/data-report/data-report-server/src/main/resources/mapper/group/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml new file mode 100644 index 0000000000..6bee70e94b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml new file mode 100644 index 0000000000..468f4c7a89 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml new file mode 100644 index 0000000000..5f78474374 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml new file mode 100644 index 0000000000..cd536caa30 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 0000000000..69386bd324 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml new file mode 100644 index 0000000000..0d593b8379 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/pom.xml b/epmet-module/data-report/pom.xml new file mode 100644 index 0000000000..d85eb578fd --- /dev/null +++ b/epmet-module/data-report/pom.xml @@ -0,0 +1,20 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + data-report + pom + + data-report-client + data-report-server + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/pom.xml b/epmet-module/data-statistical/data-statistical-client/pom.xml new file mode 100644 index 0000000000..1e128a8adf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/pom.xml @@ -0,0 +1,22 @@ + + + + data-statistical + com.epmet + 2.0.0 + + 4.0.0 + + data-statistical-client + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java new file mode 100644 index 0000000000..920fc14e14 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -0,0 +1,14 @@ +package com.epmet.constant; + +public interface DataSourceConstant { + + String GOV_ORG = "govOrg"; + String STATS = "stats"; + String GOV_ISSUE = "govIssue"; + String GOV_PROJECT = "govProject"; + String GOV_VOICE = "govVoice"; + String OPER_CRM = "operCrm"; + String RESI_GROUP = "resiGroup"; + String EPMET_USER = "epmetuser"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java new file mode 100644 index 0000000000..b447c1f2da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java @@ -0,0 +1,10 @@ +package com.epmet.constant; + +public interface DimAgencyConstant { + + String TYPE_ALL = "all"; + String TYPE_SELF = "self"; + + String TYPE_SELF_ID_SUFFIX = "-self"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java new file mode 100644 index 0000000000..c5bd28f916 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java @@ -0,0 +1,36 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:02 + */ +public interface GroupConstant { + + /** + * eg: 2020W10 = 2020年第10周 + */ + String W = "W"; + + /** + * eg: 2020Q01 = 2020年第一季度 + */ + String Q = "Q"; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级: province + */ + String COMMUNITY = "community"; + String STREET = "street"; + String DISTRICT = "district"; + String CITY = "city"; + String PROVINCE = "province"; + + String STATS_FAILED_GRID_DAILY = "统计数据方法groupGridDaily【网格小组统计-网格-日】执行失败,客户ID:%s,统计日期:%s,异常信息:%s"; + + String STATS_FAILED_AGENCY_DAILY = "统计数据方法groupAgencyDaily【网格小组统计-机关-日】执行失败,客户ID:%s,统计日期:%s,异常信息:%s"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java new file mode 100644 index 0000000000..338b35e1a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java @@ -0,0 +1,29 @@ +package com.epmet.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 17:23 + */ +public interface IssueConstant { + /** + *表决中 + */ + String VOTING = "voting"; + /** + *已转项目 + */ + String SHIFT_PROJECT = "shift_project"; + /** + *已关闭 + */ + String CLOSED = "closed"; + /** + *已解决 + */ + String RESLOVED = "resloved"; + /** + *未解决 + */ + String UNRESLOVED = "unresloved"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/RobotConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/RobotConstant.java new file mode 100644 index 0000000000..e548b35a1a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/RobotConstant.java @@ -0,0 +1,5 @@ +package com.epmet.constant; + +public interface RobotConstant { + String DIMENSION_ROBOT = "DimensionRobot"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java new file mode 100644 index 0000000000..4573d9daf8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java @@ -0,0 +1,66 @@ +package com.epmet.constant; + +public interface StatsSubject { + String DIM_AGENCY = "dim_agency"; + String DIM_CUSTOMER = "dim_customer"; + String DIM_DATE = "dim_date"; + String DIM_DEPARTMENT = "dim_department"; + String DIM_GRID = "dim_grid"; + String DIM_MONTH = "dim_month"; + String DIM_QUARTER = "dim_quarter"; + String DIM_TOPIC_STATUS = "dim_topic_status"; + String DIM_WEEK = "dim_week"; + String DIM_YEAR = "dim_year"; + String FACT_AGENCY_PROJECT_DAILY = "fact_agency_project_daily"; + String FACT_AGENCY_PROJECT_MONTHLY = "fact_agency_project_monthly"; + String FACT_ARTICLE_PUBLISHED_AGENCY_DAILY = "fact_article_published_agency_daily"; + String FACT_ARTICLE_PUBLISHED_DEPARTMENT_DAILY = "fact_article_published_department_daily"; + String FACT_ARTICLE_PUBLISHED_GRID_DAILY = "fact_article_published_grid_daily"; + String FACT_GRID_PROJECT_DAILY = "fact_grid_project_daily"; + String FACT_GRID_PROJECT_MONTHLY = "fact_grid_project_monthly"; + String FACT_GROUP_AGENCY_DAILY = "fact_group_agency_daily"; + String FACT_GROUP_AGENCY_MONTHLY = "fact_group_agency_monthly"; + String FACT_GROUP_GRID_DAILY = "fact_group_grid_daily"; + String FACT_ISSUE_AGENCY_DAILY = "fact_issue_agency_daily"; + String FACT_ISSUE_AGENCY_MONTHLY = "fact_issue_agency_monthly"; + String FACT_ISSUE_GRID_DAILY = "fact_issue_grid_daily"; + String FACT_ISSUE_GRID_MONTHLY = "fact_issue_grid_monthly"; + String FACT_PARTICIPATION_USER_AGENCY_DAILY = "fact_participation_user_agency_daily"; + String FACT_PARTICIPATION_USER_AGENCY_MONTHLY = "fact_participation_user_agency_monthly"; + String FACT_PARTICIPATION_USER_GRID_DAILY = "fact_participation_user_grid_daily"; + String FACT_PARTICIPATION_USER_GRID_MONTHLY = "fact_participation_user_grid_monthly"; + String FACT_REG_USER_AGENCY_DAILY = "fact_reg_user_agency_daily"; + String FACT_REG_USER_AGENCY_MONTHLY = "fact_reg_user_agency_monthly"; + String FACT_REG_USER_GRID_DAILY = "fact_reg_user_grid_daily"; + String FACT_REG_USER_GRID_MONTHLY = "fact_reg_user_grid_monthly"; + String FACT_TAG_USED_AGENCY_DAILY = "fact_tag_used_agency_daily"; + String FACT_TAG_USED_AGENCY_MONTHLY = "fact_tag_used_agency_monthly"; + String FACT_TAG_USED_AGENCY_QUARTERLY = "fact_tag_used_agency_quarterly"; + String FACT_TAG_USED_AGENCY_YEARLY = "fact_tag_used_agency_yearly"; + String FACT_TAG_USED_DEPARTMENT_DAILY = "fact_tag_used_department_daily"; + String FACT_TAG_USED_DEPARTMENT_MONTHLY = "fact_tag_used_department_monthly"; + String FACT_TAG_USED_DEPARTMENT_QUARTERLY = "fact_tag_used_department_quarterly"; + String FACT_TAG_USED_DEPARTMENT_YEARLY = "fact_tag_used_department_yearly"; + String FACT_TAG_USED_GRID_DAILY = "fact_tag_used_grid_daily"; + String FACT_TAG_USED_GRID_MONTHLY = "fact_tag_used_grid_monthly"; + String FACT_TAG_USED_GRID_QUARTERLY = "fact_tag_used_grid_quarterly"; + String FACT_TAG_USED_GRID_YEARLY = "fact_tag_used_grid_yearly"; + String FACT_TAG_VIEWED_AGENCY_DAILY = "fact_tag_viewed_agency_daily"; + String FACT_TAG_VIEWED_AGENCY_MONTHLY = "fact_tag_viewed_agency_monthly"; + String FACT_TAG_VIEWED_AGENCY_QUARTERLY = "fact_tag_viewed_agency_quarterly"; + String FACT_TAG_VIEWED_AGENCY_YEARLY = "fact_tag_viewed_agency_yearly"; + String FACT_TAG_VIEWED_GRID_DAILY = "fact_tag_viewed_grid_daily"; + String FACT_TAG_VIEWED_GRID_MONTHLY = "fact_tag_viewed_grid_monthly"; + String FACT_TAG_VIEWED_GRID_QUARTERLY = "fact_tag_viewed_grid_quarterly"; + String FACT_TAG_VIEWED_GRID_YEARLY = "fact_tag_viewed_grid_yearly"; + String FACT_TOPIC_ISSUE_AGENCY_DAILY = "fact_topic_issue_agency_daily"; + String FACT_TOPIC_ISSUE_AGENCY_MONTHLY = "fact_topic_issue_agency_monthly"; + String FACT_TOPIC_ISSUE_GRID_DAILY = "fact_topic_issue_grid_daily"; + String FACT_TOPIC_ISSUE_GRID_MONTHLY = "fact_topic_issue_grid_monthly"; + String FACT_TOPIC_STATUS_AGENCY_DAILY = "fact_topic_status_agency_daily"; + String FACT_TOPIC_STATUS_AGENCY_MONTHLY = "fact_topic_status_agency_monthly"; + String FACT_TOPIC_STATUS_GRID_DAILY = "fact_topic_status_grid_daily"; + String FACT_TOPIC_TOTAL_AGENCY_DAILY = "fact_topic_total_agency_daily"; + String FACT_TOPIC_TOTAL_GRID_DAILY = "fact_topic_total_grid_daily"; + String LAST_EXEC_RECORD = "last_exec_record"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubDeptTreeDto.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubDeptTreeDto.java new file mode 100644 index 0000000000..c854859bc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubDeptTreeDto.java @@ -0,0 +1,61 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName AgencySubDeptTreeDto + * @Auth wangc + * @Date 2020-06-18 16:06 + */ +@Data +public class AgencySubDeptTreeDto implements Serializable { + private static final long serialVersionUID = -8179035699122094719L; + /** + * 机构Id + * */ + private String agencyId; + + /** + * 机构名称 + * */ + private String agencyName; + + /** + * 直属网格Id + * */ + List gridIds; + + /** + * 直属部门Id + * */ + List deptIds; + + /** + * 客户Id + * */ + String customerId; + + /** + * 父级机关Id,当为最顶层是pid为0 + * */ + String pid; + + /** + * 级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + * */ + String level; + + /** + * 下级机关集合 + * */ + List subAgencies; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java new file mode 100644 index 0000000000..d582cdfccc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java @@ -0,0 +1,56 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName AgencySubTreeDto + * @Auth wangc + * @Date 2020-06-16 16:51 + */ +@Data +public class AgencySubTreeDto implements Serializable { + private static final long serialVersionUID = 312765293830315198L; + /** + * 机构Id + * */ + private String agencyId; + + /** + * 机构名称 + * */ + private String agencyName; + + /** + * 直属网格Id + * */ + List gridIds; + + /** + * 客户Id + * */ + String customerId; + + /** + * 父级机关Id,当为最顶层是pid为0 + * */ + String pid; + + /** + * 级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + * */ + String level; + + /** + * 下级机关集合 + * */ + List subAgencies; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/AgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/AgencyDTO.java new file mode 100644 index 0000000000..767adaad61 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/AgencyDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.group; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 11:06 + */ +@Data +public class AgencyDTO implements Serializable { + + private static final long serialVersionUID = -1644032762160525169L; + + /** + * 组织ID AGENCY_ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + private String level; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyGridTotalCountFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyGridTotalCountFormDTO.java new file mode 100644 index 0000000000..5990fd7de5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyGridTotalCountFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 14:39 + */ +@Data +public class AgencyGridTotalCountFormDTO implements Serializable { + + private static final long serialVersionUID = -4219157085337388583L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java new file mode 100644 index 0000000000..ec00bcc11f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java @@ -0,0 +1,121 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/6/19 21:22 + */ +@Data +public class AgencyMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = -5920961528060576749L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份ID 关联月份dim表 + */ + private String monthId; + + /** + * 统计季度ID + */ + private String quarterId; + + /** + * 统计年份ID + */ + private String yearId; + + /** + * 网格数 截至到月末的机关下网格数 + */ + private Integer gridTotal = 0; + + /** + * 小组数 截止到月末的新增数(该月内所有的新增数字之和) + */ + private Integer groupTotal = 0; + + /** + * 机关下网格组内总人数 不去重 + */ + private Integer groupMemberTotal = 0; + + /** + * 小组平均人数 月末一天的平均数 + */ + private Integer groupMemberAvgCount = 0; + + /** + * 小组中位数 月末一天的中位数(人) + */ + private Integer groupMedian = 0; + + /** + * 小组增量 + */ + private Integer groupIncr = 0; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount = 0; + + /** + * 成员最多小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount = 0; + + /** + * 成员最少小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag = "0"; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java new file mode 100644 index 0000000000..a6c73d386f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:34 + */ +@Data +public class GridGroupPeopleFormDTO implements Serializable { + + private static final long serialVersionUID = -3634745091993094743L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 小组状态 + */ + private String state = "approved"; + + /** + * 人员状态 + */ + private String status = "removed"; + + /** + * dateID + */ + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java new file mode 100644 index 0000000000..b36204f1b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:34 + */ +@Data +public class GridGroupPeopleTotalFormDTO implements Serializable { + + private static final long serialVersionUID = -6415141711878464704L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 小组状态 + */ + private String state = "approved"; + + /** + * 人员状态 + */ + private String status = "removed"; + + /** + * dateID + */ + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java new file mode 100644 index 0000000000..f39002e5ad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:34 + */ +@Data +public class GridGroupTotalFormDTO implements Serializable { + + private static final long serialVersionUID = 4605386326533905365L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 小组状态 + */ + private String state = "approved"; + + /** + * dateID + */ + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java new file mode 100644 index 0000000000..79ac84ff44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/17 16:45 + */ +@Data +public class GroupIncrFormDTO implements Serializable { + + private static final long serialVersionUID = 4498126701378094617L; + + /** + * 小组状态 只算 state = “approved” + */ + private String state = "approved"; + + /** + * 客户ID + */ + private String customerId; + + /** + * dateID + */ + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleResultDTO.java new file mode 100644 index 0000000000..9c96b40583 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class AgencyGridGroupPeopleResultDTO implements Serializable { + + private static final long serialVersionUID = 225708056690809761L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组ID + */ + private String groupId; + + /** + * 网格下-每个小组内成员的数量【人员状态 不为 removed】 + */ + private Integer groupCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleTotalResultDTO.java new file mode 100644 index 0000000000..5d1b2f259e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleTotalResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class AgencyGridGroupPeopleTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -8693107487048855351L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格下的小组成员总数量 + */ + private Integer gridGroupPeopleTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridInfoResultDTO.java new file mode 100644 index 0000000000..ea51f65bf4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridInfoResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 14:35 + */ +@Data +public class AgencyGridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -1979735889806617714L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridTotalCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridTotalCountResultDTO.java new file mode 100644 index 0000000000..73ccde44d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridTotalCountResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 14:35 + */ +@Data +public class AgencyGridTotalCountResultDTO implements Serializable { + + private static final long serialVersionUID = -3528033317344272299L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 机关下的网格数量 + */ + private Integer gridTotal; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java new file mode 100644 index 0000000000..139917240b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java @@ -0,0 +1,131 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 10:09 + */ +@Data +public class AgencyGroupDailyResultDTO implements Serializable { + + private static final long serialVersionUID = 7862398525119326819L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格总数 截至统计日期 + */ + private Integer gridTotal = 0; + + /** + * 网格小组数(包含所有下级机关的网格小组) 截至统计日期 + */ + private Integer groupTotalCount = 0; + + /** + * 机关下网格小组人数总计 不去重 + */ + private Integer groupMemberTotalCount = 0; + + /** + * 小组平均人数 截至统计日期 + */ + private Integer groupMemberAvgCount = 0; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian = 0; + + /** + * 当天小组增量 + */ + private Integer groupIncr = 0; + + /** + * 小组最大成员数 + */ + private Integer groupMemberMaxCount = 0; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组最小成员数 + */ + private Integer groupMemberMinCount = 0; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag = "0"; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupIncrResultDTO.java new file mode 100644 index 0000000000..dcf9a9694c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupIncrResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/17 16:48 + */ +@Data +public class AgencyGroupIncrResultDTO implements Serializable { + + private static final long serialVersionUID = 8397311844636364561L; + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组日增数 + */ + private Integer groupIncr = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupMonthlyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupMonthlyResultDTO.java new file mode 100644 index 0000000000..354eb918e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupMonthlyResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/19 22:12 + */ +@Data +public class AgencyGroupMonthlyResultDTO implements Serializable { + + private static final long serialVersionUID = 8436524201080875660L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 小组月增长数量 + */ + private Integer monthGroupIncr; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupTotalCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupTotalCountResultDTO.java new file mode 100644 index 0000000000..069bddcfd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupTotalCountResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 17:35 + */ +@Data +public class AgencyGroupTotalCountResultDTO implements Serializable { + + private static final long serialVersionUID = 1166957004076377211L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 每个网格下的小组数 + */ + private Integer gridGroupCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/CustomerGridInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/CustomerGridInfoResultDTO.java new file mode 100644 index 0000000000..e81d03439f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/CustomerGridInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 14:48 + */ +@Data +public class CustomerGridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 6635092874863425910L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格所属机关ID + */ + private String agencyId; + + /** + * 客户ID + */ + private String customerId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java new file mode 100644 index 0000000000..e0bd6c6c6c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/17 19:16 + */ +@Data +public class DimTimeResultDTO implements Serializable { + + private static final long serialVersionUID = -2863598069938303232L; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月Id + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleResultDTO.java new file mode 100644 index 0000000000..ce1667a123 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class GridGroupPeopleResultDTO implements Serializable { + + private static final long serialVersionUID = -7251423227553175946L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组ID + */ + private String groupId; + + /** + * 网格下-每个小组内成员的数量【人员状态 不为 removed】 + */ + private Integer groupCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleTotalResultDTO.java new file mode 100644 index 0000000000..ae7bc8a19f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleTotalResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class GridGroupPeopleTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -6131166787256682153L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格下的小组成员总数量 + */ + private Integer gridGroupPeopleTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupTotalResultDTO.java new file mode 100644 index 0000000000..055fd3f947 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupTotalResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class GridGroupTotalResultDTO implements Serializable { + + private static final long serialVersionUID = 1099735509481708988L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格下的小组数量 + */ + private Integer gridGroupTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java new file mode 100644 index 0000000000..4c2f1033c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/23 13:54 + */ +@Data +public class GridIdListByCustomerResultDTO implements Serializable { + + private static final long serialVersionUID = -4170349451726088582L; + + /** + * 网格ID + */ + private String GridId; + + /** + * 机关ID + */ + private String agencyId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java new file mode 100644 index 0000000000..b95bedeb9b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java @@ -0,0 +1,130 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 17:25 + */ +@Data +public class GroupGridDailyResultDTO implements Serializable { + + private static final long serialVersionUID = 3206418216410331158L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 年ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 网格数 当前网格下的网格数 + */ + private Integer gridTotal = 0; + + /** + * 小组数 + */ + private Integer groupTotal = 0; + + /** + * 网格下所有组内总人数 不去重 + */ + private Integer groupMemberTotal = 0; + + /** + * 小组平均人数 + */ + private Integer groupMemberAvgCount = 0; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian = 0; + + /** + * 小组增量 + */ + private Integer groupIncr = 0; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount = 0; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount = 0; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag = "0"; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupIncrResultDTO.java new file mode 100644 index 0000000000..df09ee4bf3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupIncrResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/17 16:48 + */ +@Data +public class GroupIncrResultDTO implements Serializable { + + private static final long serialVersionUID = 5536872354876581582L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组日增数 + */ + private Integer groupIncr = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupPeopleCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupPeopleCountResultDTO.java new file mode 100644 index 0000000000..6cfa4ed9f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupPeopleCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/19 15:43 + */ +@Data +public class GroupPeopleCountResultDTO implements Serializable { + + private static final long serialVersionUID = 7804052387414894768L; + + /** + * 小组ID + */ + private String groupId; + + /** + * 网格下-每个小组内成员的数量【人员状态 不为 removed】 + */ + private Integer groupCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/SubAgencyIdResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/SubAgencyIdResultDTO.java new file mode 100644 index 0000000000..8690179371 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/SubAgencyIdResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/19 10:41 + */ +@Data +public class SubAgencyIdResultDTO implements Serializable { + + private static final long serialVersionUID = -5375229459340391098L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 下级机关ID + */ + private String subAgencyId; + + /** + * 网格数量 + */ + private Integer gridTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java new file mode 100644 index 0000000000..065f10279f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 14:06 + */ +@Data +public class IssueAgencyDTO implements Serializable { + private static final long serialVersionUID = 8258586413692513595L; + /** + * 组织ID + */ + private String agencyId; + /** + * 上级ID + */ + private String pId; + /** + * 所有上级ID + */ + private String pIds; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java new file mode 100644 index 0000000000..de7bacf7a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 13:56 + */ +@Data +public class IssueGridDTO implements Serializable { + private static final long serialVersionUID = 4681179503519406263L; + /** + * 组织ID + */ + private String agencyId; + /** + * 上级ID + */ + private String gridId; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java new file mode 100644 index 0000000000..5381b77c8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 17:28 + */ +@Data +public class IssueProjectDTO implements Serializable { + private static final long serialVersionUID = -6457792985830058324L; + /** + * 议题ID + */ + private String issueId; + /** + * 项目ID + */ + private String projectId; + /** + * 网格ID + */ + private String gridId; + /** + * 状态 + */ + private String status; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java new file mode 100644 index 0000000000..add4fd14ff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/18 16:48 + */ +@Data +public class ProjectAgencyDTO implements Serializable { + private static final long serialVersionUID = 4581232825130630169L; + /** + * 组织ID + */ + private String agencyId; + /** + * 所有上级ID + */ + private String pIds; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java new file mode 100644 index 0000000000..982bce9a87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 16:58 + */ +@Data +public class ProjectGridDTO implements Serializable { + private static final long serialVersionUID = 7176541257563571224L; + /** + * 项目ID + */ + private String projectId; + /** + * 组织ID + */ + private String agencyId; + /** + * 议题ID + */ + private String issueId; + /** + * 状态 + */ + private String status; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java new file mode 100644 index 0000000000..b0ff888330 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.project.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author sun + * 查询项目机关过去一个月的日统计数据 + */ +@Data +public class MonthProjectListFormDTO implements Serializable { + + private static final long serialVersionUID = -3634745091993094743L; + + /** + * 客户Id + */ + private String customerId; + /** + * 月维度Id + */ + private String monthId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/.gitkeep b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimAgencyDTO.java new file mode 100644 index 0000000000..8a8204cc54 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimAgencyDTO.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织IDAGENCY_ID + */ + private String id; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java new file mode 100644 index 0000000000..86aff5d046 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimCustomerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * CUSTOMER_ID + */ + private String id; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java new file mode 100644 index 0000000000..e539cda274 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 日期维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimDateDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 日期eg:20200101 + */ + private String id; + + /** + * eg: 2020年01月01日 + */ + private String dateName; + + /** + * 周几:Monday、Tuesday、Wednesday、Thursday、Friday、Saturday、Sunday + */ + private String dayOfWeek; + + /** + * 周几:星期一、星期二、星期三、星期四、星期五、星期六、星期日 + */ + private String dayOfWeekName; + + /** + * dim_week.week_id + */ + private String weekId; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private String monthId; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDepartmentDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDepartmentDTO.java new file mode 100644 index 0000000000..80e89b4784 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDepartmentDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户部门维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * DEPARTMENT_ID + */ + private String id; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 所属机关ID(customer_agency_dimension.id) + */ + private String agencyId; + + /** + * 来源于customer_dimension + */ + private String customerId; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimGridDTO.java new file mode 100644 index 0000000000..9b526935f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimGridDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * GRID_ID + */ + private String id; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimMonthDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimMonthDTO.java new file mode 100644 index 0000000000..40fa150485 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimMonthDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 月份维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimMonthDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 月:yyyyMM eg:202001 + */ + private String id; + + /** + * eg: 2020年01月 + */ + private String monthName; + + /** + * 1-12 + */ + private Integer monthOrder; + + /** + * yyyy-MM-dd eg:2020-01-01 + */ + private Date startDate; + + /** + * yyyy-MM-dd eg:2020-01-31 + */ + private Date endDate; + + /** + * 来源于dim_quarter.id + */ + private String quarterId; + + /** + * 来源于dim_year.id + */ + private String yearId; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimQuarterDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimQuarterDTO.java new file mode 100644 index 0000000000..b681ef2c15 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimQuarterDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 季度维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimQuarterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String id; + + /** + * eg: 2020年第一季度、2020年第二季度、2020 + */ + private String quarterName; + + /** + * 1、2、3、4 + */ + private Integer quarterOrder; + + /** + * yyyy-MM-dd + */ + private Date startDate; + + /** + * yyyy-MM-dd + */ + private Date endDate; + + /** + * 来源于dim_year.id + */ + private String yearId; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimTopicStatusDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimTopicStatusDTO.java new file mode 100644 index 0000000000..bfd5b3a79f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimTopicStatusDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimTopicStatusDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 话题状态ID"discussing"、"hidden"、"closed" + */ + private String id; + + /** + * 状态描述 讨论中 已屏蔽 已关闭 + */ + private String statusDesc; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimWeekDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimWeekDTO.java new file mode 100644 index 0000000000..630c9834f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimWeekDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 周维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimWeekDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 2020W01 本年度的第几周 + */ + private String id; + + /** + * eg: 2020年第1周 + */ + private String weekName; + + /** + * 1-52 + */ + private Integer weekOrder; + + /** + * yyyy-MM-dd eg:2020-01-01 + */ + private Date startDate; + + /** + * yyyy-MM-dd eg:2020-01-05 + */ + private Date endDate; + + /** + * 来源于dim_year.id + */ + private String yearId; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimYearDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimYearDTO.java new file mode 100644 index 0000000000..5c3d213c6d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimYearDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 年维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimYearDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyy eg: 2019 + */ + private String id; + + /** + * 2019年 + */ + private String yearName; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java new file mode 100644 index 0000000000..2a7e853f3a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java @@ -0,0 +1,182 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactAgencyProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectMonthlyDTO.java new file mode 100644 index 0000000000..3c56190036 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectMonthlyDTO.java @@ -0,0 +1,172 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactAgencyProjectMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedAgencyDailyDTO.java new file mode 100644 index 0000000000..36f35bdc12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedAgencyDailyDTO.java @@ -0,0 +1,122 @@ +/** + * 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.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactArticlePublishedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedDepartmentDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedDepartmentDailyDTO.java new file mode 100644 index 0000000000..622e88d01c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedDepartmentDailyDTO.java @@ -0,0 +1,122 @@ +/** + * 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.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactArticlePublishedDepartmentDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布文章单位所属机关ID 发布文章单位所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String depsartmentId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedGridDailyDTO.java new file mode 100644 index 0000000000..91f19b4517 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedGridDailyDTO.java @@ -0,0 +1,122 @@ +/** + * 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.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactArticlePublishedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布单位所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java new file mode 100644 index 0000000000..e1962507f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java @@ -0,0 +1,182 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactGridProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 网格Id 【dim_grid.id】 + */ + private String gridId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日网格下项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日网格下处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日网格下处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日网格下已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日网格下已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 当日网格下项目总数 【该网格下项目总数】 + */ + private Integer projectIncr; + + /** + * 当日网格下处理中项目数 【该网格下未结案项目总数】 + */ + private Integer pendingIncr; + + /** + * 当日网格下已结案项目数 【该网格下已结案项目总数】 + */ + private Integer closedIncr; + + /** + * 删除标识 【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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectMonthlyDTO.java new file mode 100644 index 0000000000..277e87e27e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectMonthlyDTO.java @@ -0,0 +1,172 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactGridProjectMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 网格Id 【dim_grid.id】 + */ + private String gridId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyDailyDTO.java new file mode 100644 index 0000000000..a33b74dac2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyDailyDTO.java @@ -0,0 +1,156 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 组-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactGroupAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格总数 截至统计日期 + */ + private Integer gridTotal; + + /** + * 网格小组数(包含所有下级机关的网格小组) 截至统计日期 + */ + private Integer groupTotalCount; + + /** + * 机关下网格小组人数总计 不去重 + */ + private Integer groupMemberTotalCount; + + /** + * 小组平均人数 截至统计日期 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 当天小组增量 + */ + private Integer groupIncr; + + /** + * 小组最大成员数 + */ + private String groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组最小成员数 + */ + private String groupMemberMinCount; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyMonthlyDTO.java new file mode 100644 index 0000000000..54b01164a4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyMonthlyDTO.java @@ -0,0 +1,146 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 组-机关月统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactGroupAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份ID 关联月份dim表 + */ + private String monthId; + + /** + * 统计季度ID + */ + private String quarterId; + + /** + * 统计年份ID + */ + private String yearId; + + /** + * 网格数 截至到月末的机关下网格数 + */ + private Integer gridTotal; + + /** + * 小组数 截止到月末的新增数(该月内所有的新增数字之和) + */ + private Integer groupTotal; + + /** + * 机关下网格组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 月末一天的平均数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 月末一天的中位数(人) + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 成员最多小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount; + + /** + * 成员最少小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupGridDailyDTO.java new file mode 100644 index 0000000000..48503b3623 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupGridDailyDTO.java @@ -0,0 +1,156 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 组-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactGroupGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 年ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 网格数 当前网格下的网格数 + */ + private Integer gridTotal; + + /** + * 小组数 + */ + private Integer groupTotal; + + /** + * 网格下所有组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java new file mode 100644 index 0000000000..b32a9d9b87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java @@ -0,0 +1,237 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java new file mode 100644 index 0000000000..ea2b5cd11f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.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.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java new file mode 100644 index 0000000000..c63ab13574 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java @@ -0,0 +1,237 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java new file mode 100644 index 0000000000..d79586998b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.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.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyDailyDTO.java new file mode 100644 index 0000000000..7b5d06b166 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyDailyDTO.java @@ -0,0 +1,127 @@ +/** + * 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.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyMonthlyDTO.java new file mode 100644 index 0000000000..6f6566c465 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyMonthlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyQuarterlyDTO.java new file mode 100644 index 0000000000..c052c70b33 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyQuarterlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedAgencyQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyYearlyDTO.java new file mode 100644 index 0000000000..568839ed7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyYearlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedAgencyYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentDailyDTO.java new file mode 100644 index 0000000000..d0b4a2d7ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentDailyDTO.java @@ -0,0 +1,132 @@ +/** + * 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.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedDepartmentDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentMonthlyDTO.java new file mode 100644 index 0000000000..5acf3c7452 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentMonthlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedDepartmentMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentQuarterlyDTO.java new file mode 100644 index 0000000000..01c5a63353 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentQuarterlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedDepartmentQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentYearlyDTO.java new file mode 100644 index 0000000000..c4867a89b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentYearlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedDepartmentYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridDailyDTO.java new file mode 100644 index 0000000000..f0fa8b8248 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridDailyDTO.java @@ -0,0 +1,127 @@ +/** + * 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.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridMonthlyDTO.java new file mode 100644 index 0000000000..7d0915cd48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridMonthlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridQuarterlyDTO.java new file mode 100644 index 0000000000..9a3fda80f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridQuarterlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedGridQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridYearlyDTO.java new file mode 100644 index 0000000000..b68737c5e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridYearlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedGridYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyDailyDTO.java new file mode 100644 index 0000000000..24eaf450de --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyDailyDTO.java @@ -0,0 +1,127 @@ +/** + * 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.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyMonthlyDTO.java new file mode 100644 index 0000000000..34bd1bd0a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyMonthlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyQuarterlyDTO.java new file mode 100644 index 0000000000..d8d0fd6e8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyQuarterlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedAgencyQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyYearlyDTO.java new file mode 100644 index 0000000000..5531dbf1b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyYearlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedAgencyYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridDailyDTO.java new file mode 100644 index 0000000000..22bb0f0e76 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridDailyDTO.java @@ -0,0 +1,127 @@ +/** + * 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.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridMonthlyDTO.java new file mode 100644 index 0000000000..1a9b7112d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridMonthlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridQuarterlyDTO.java new file mode 100644 index 0000000000..f73e782445 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridQuarterlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedGridQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridYearlyDTO.java new file mode 100644 index 0000000000..da404525e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridYearlyDTO.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.dto.stats; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedGridYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyDailyDTO.java new file mode 100644 index 0000000000..b780a3e50c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyDailyDTO.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.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 转议题话题-机关日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicIssueAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题数量 + */ + private Integer issueTotal; + + /** + * 已转议题当日增量 + */ + private Integer issueIncr; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyMonthlyDTO.java new file mode 100644 index 0000000000..6b3b99d300 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyMonthlyDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 转议题话题-机关月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicIssueAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级ID + */ + private String pid; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题总量 + */ + private Integer issueTotal; + + /** + * 已转议题增量 + */ + private Integer issueIncr; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridDailyDTO.java new file mode 100644 index 0000000000..e006c7c688 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridDailyDTO.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.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 转议题话题-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicIssueGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 新增转议题数 + */ + private Integer issueIncr; + + /** + * 转议题总数 + */ + private Integer issueTotal; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridMonthlyDTO.java new file mode 100644 index 0000000000..e2e373f485 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridMonthlyDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 转议题话题-网格月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicIssueGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题增量 + */ + private Integer issueIncr; + + /** + * 已转议题总量 + */ + private Integer issueTotal; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyDailyDTO.java new file mode 100644 index 0000000000..82215ebd12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyDailyDTO.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.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 状态话题-机关日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicStatusAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题状态ID 关联dim_topic_status表 +讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 指定状态的话题数量 + */ + private Integer topicCount; + + /** + * 话题状态百分比 指定状态话题数/话题总数 +总数在topic_total_agency_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 单位时间内的状态话题的增加数 + */ + private Integer topicIncrement; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyMonthlyDTO.java new file mode 100644 index 0000000000..a89cdf966c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyMonthlyDTO.java @@ -0,0 +1,127 @@ +/** + * 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.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 状态话题-机关月统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicStatusAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份 关联月度dm表 + */ + private String monthId; + + /** + * 季度ID 关联季度dm表 + */ + private String quarterId; + + /** + * 年ID 关联年度dm表 + */ + private String yearId; + + /** + * 话题状态 讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态占比 月末一天 +指定状态话题数/话题总数 +总数在topic_total_agency_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 单位时间内的话题状态增加数 + */ + private Integer topicIncr; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusGridDailyDTO.java new file mode 100644 index 0000000000..72fa98eb49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusGridDailyDTO.java @@ -0,0 +1,136 @@ +/** + * 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.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 状态话题-网格日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicStatusGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID 关联网格dm表 + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题状态ID 讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态占比 指定状态话题数/话题总数 +总数在topic_total_grid_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 + */ + private Integer topicIncrement; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalAgencyDailyDTO.java new file mode 100644 index 0000000000..fd06f45244 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalAgencyDailyDTO.java @@ -0,0 +1,131 @@ +/** + * 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.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicTotalAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题增量 + */ + private Integer topicIncr; + + /** + * 屏蔽话题数 + */ + private Integer hiddenTotalCount; + + /** + * 已转议题数 + */ + private Integer issueTotalCount; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalGridDailyDTO.java new file mode 100644 index 0000000000..343feb0c92 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalGridDailyDTO.java @@ -0,0 +1,131 @@ +/** + * 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.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicTotalGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总量 + */ + private Integer topicTotal; + + /** + * 话题增量 + */ + private Integer topicIncr; + + /** + * 屏蔽话题数量 + */ + private Integer hiddenTotalCount; + + /** + * 已转议题数量 + */ + private Integer issueTotalCount; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GridTopicData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GridTopicData.java new file mode 100644 index 0000000000..bbbc9d327f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GridTopicData.java @@ -0,0 +1,38 @@ +package com.epmet.dto.stats.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName GridTopicData + * @Auth wangc + * @Date 2020-06-22 17:31 + */ +@Data +public class GridTopicData implements Serializable { + private static final long serialVersionUID = -7427128491727512781L; + + private String gridId; + + private Integer topicIncr = 0; + + private Integer discussingIncr = 0; + + private Integer hiddenIncr = 0; + + private Integer closedIncr = 0; + + private Integer total = 0; + + private Integer discussingTotal = 0; + + private Integer hiddenTotal = 0; + + private Integer closedTotal = 0; + + private Integer issueIncr = 0; + + private Integer issueTotal = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GroupTopicData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GroupTopicData.java new file mode 100644 index 0000000000..9da8d5a4ea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GroupTopicData.java @@ -0,0 +1,38 @@ +package com.epmet.dto.stats.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName GroupTopicData + * @Auth wangc + * @Date 2020-06-22 15:29 + */ +@Data +public class GroupTopicData implements Serializable { + private static final long serialVersionUID = -7968684838832002029L; + + private String groupId; + + private Integer topicIncr = 0; + + private Integer discussingIncr = 0; + + private Integer hiddenIncr = 0; + + private Integer closedIncr = 0; + + private Integer total = 0; + + private Integer discussingTotal = 0; + + private Integer hiddenTotal = 0; + + private Integer closedTotal = 0; + + private Integer issueIncr = 0; + + private Integer issueTotal = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicStatisticalData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicStatisticalData.java new file mode 100644 index 0000000000..a5fa7f5279 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicStatisticalData.java @@ -0,0 +1,43 @@ +package com.epmet.dto.stats.topic.result; + +import com.epmet.dto.stats.topic.*; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 话题统计数据对象 + * @ClassName TopicStatisticalDataResultDTO + * @Auth wangc + * @Date 2020-06-22 13:16 + */ +@Data +public class TopicStatisticalData implements Serializable { + private static final long serialVersionUID = 3690257892396607149L; + + private List issueAgencyDailyList ; + + private List issueAgencyMonthlyList ; + + private List issueGridDailyList ; + + private List issueGridMonthlyList ; + + private List topicAgencyDailyList ; + + private List topicAgencyMonthlyList ; + + private List topicGridDailyList; + + private List totalAgencyDailyList; + + private List totalGridDailyList; + + private String dateId; + + private String monthId; + + private String customerId; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.java new file mode 100644 index 0000000000..19d6f97b07 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.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.stats.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactParticipationUserAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日(参与用户中)党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日(参与用户中)注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日(参与用户中)热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日(参与用户中)党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.java new file mode 100644 index 0000000000..72f772c956 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.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.stats.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下(按月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactParticipationUserAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底(参与用户中)党员总数 + */ + private Integer partymemberTotal; + + /** + * 本月(参与用户中)注册居民月增量 + */ + private Integer regIncr; + + /** + * 本月(参与用户中)热心居民月增量 + */ + private Integer warmIncr; + + /** + * 本月(参与用户中)党员认证月增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java new file mode 100644 index 0000000000..a0d86d6164 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java @@ -0,0 +1,153 @@ +/** + * 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.stats.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactParticipationUserGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java new file mode 100644 index 0000000000..15221181a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java @@ -0,0 +1,152 @@ +/** + * 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.stats.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格下(月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactParticipationUserGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底的参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底的居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底的热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底的党员总数 + */ + private Integer partymemberTotal; + + /** + * 注册居民本月增量 + */ + private Integer regIncr; + + /** + * 热心居民本月增量 + */ + private Integer warmIncr; + + /** + * 党员认证本月增量 + */ + private Integer partymemberIncr; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.java new file mode 100644 index 0000000000..b5c7ef980c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.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.stats.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactRegUserAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日:居民总数=注册用户总数 + */ + private Integer resiTotal; + + /** + * 截止到本日:热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日:党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日:注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日:热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日:党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.java new file mode 100644 index 0000000000..a97d7b4b7b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.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.stats.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关(按月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactRegUserAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底:注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底:居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底:热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底:党员总数 + */ + private Integer partymemberTotal; + + /** + * 本月:注册居民月增量 + */ + private Integer regIncr; + + /** + * 本月:热心居民月增量 + */ + private Integer warmIncr; + + /** + * 本月:党员认证月增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java new file mode 100644 index 0000000000..cf2d64b687 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java @@ -0,0 +1,152 @@ +/** + * 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.stats.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactRegUserGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java new file mode 100644 index 0000000000..51308b4d4c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java @@ -0,0 +1,152 @@ +/** + * 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.stats.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格(月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactRegUserGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底的注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底的居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底的热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底的党员总数 + */ + private Integer partymemberTotal; + + /** + * 注册居民本月增量 + */ + private Integer regIncr; + + /** + * 热心居民本月增量 + */ + private Integer warmIncr; + + /** + * 党员认证本月增量 + */ + private Integer partymemberIncr; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java new file mode 100644 index 0000000000..e50824d0cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java @@ -0,0 +1,41 @@ +package com.epmet.dto.stats.user.result; + + +import com.epmet.dto.stats.user.*; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 用户统计数据对象 + * @ClassName UserStatisticalData + * @Auth wangc + * @Date 2020-06-19 15:02 + */ +@Data +public class UserStatisticalData implements Serializable { + private static final long serialVersionUID = 7423427555123585566L; + + private List partiAgencyDailyList; + + private List partiGridDailyList; + + private List partiAgencyMonthlyList; + + private List partiGridMonthlyList; + + private List regAgencyDailyList; + + private List regGridDailyList; + + private List regAgencyMonthlyList; + + private List regGridMonthlyList; + + private String customerId; + + private String dateId; + + private String monthId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiGroupTopicResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiGroupTopicResultDTO.java new file mode 100644 index 0000000000..33557cd396 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiGroupTopicResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 组-话题对象 + * @ClassName ResiGroupTopicResultDTO + * @Auth wangc + * @Date 2020-06-20 17:23 + */ +@Data +public class ResiGroupTopicResultDTO implements Serializable { + private static final long serialVersionUID = -6243796311184636458L; + + private String gridId; + + private String groupId; + + private String groupName; + + private String customerId; + + private List topics; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicOperationResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicOperationResultDTO.java new file mode 100644 index 0000000000..cd114f3ceb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicOperationResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 话题操作记录DTO + * @ClassName ResiTopicOperationResultDTO + * @Auth wangc + * @Date 2020-06-22 10:58 + */ +@Data +public class ResiTopicOperationResultDTO implements Serializable { + private static final long serialVersionUID = -7811429974017636134L; + + /** + * 话题Id + * */ + private String topicId; + + /** + * 操作状态 + * */ + private String status; + + /** + * 操作时间 yyyy-MM-dd + * */ + private String createdTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicResultDTO.java new file mode 100644 index 0000000000..e5bfffdc2d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 话题对象 + * @ClassName ResiTopicResultDTO + * @Auth wangc + * @Date 2020-06-20 17:22 + */ +@Data +public class ResiTopicResultDTO implements Serializable { + private static final long serialVersionUID = 6818736495648532514L; + + private String topicId; + + private String status; + + private boolean shiftIssue; + + private String incrFlag; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CommonTotalAndIncCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CommonTotalAndIncCountResultDTO.java new file mode 100644 index 0000000000..7296a1b236 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CommonTotalAndIncCountResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName CommonTotalAndIncCountResultDTO + * @Auth wangc + * @Date 2020-06-18 17:28 + */ +@Data +public class CommonTotalAndIncCountResultDTO implements Serializable { + private static final long serialVersionUID = -5215017168317858826L; + + private Integer total; + + private Integer incr; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java new file mode 100644 index 0000000000..9596c7a2a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.voice; +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-17 16:43 + **/ + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:文章总数 统计返回结果 dto + * + * @author liujianjun + * @date 2020/6/17 16:43 + */ +@Data +public class ArticleGridPublishedSummaryDTO implements Serializable { + private static final long serialVersionUID = 6755654148306711602L; + + /** + * 客户id + */ + private String customerId; + /** + * 上级机关id,顶级为"0" + */ + private String pid; + /** + * 机关id + */ + private String agencyId; + /** + * 网格Id + */ + private String gridId; + /** + * 发布者Id publish_type类型为 部门时 是部门id;类型为 机关时 是机关Id + */ + private String publisherId; + + /** + * 发布文章总数 + */ + private Integer articleTotalCount; + + /** + * 今日发布文章数 + */ + private Integer publishedCount; + /** + * 状态为发布中的文章总数 + */ + private Integer articlePublishedCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java new file mode 100644 index 0000000000..6db2b70ef7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.voice; +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-17 16:43 + **/ + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:文章总数 统计返回结果 dto + * + * @author liujianjun + * @date 2020/6/17 16:43 + */ +@Data +public class ArticleViewedSummaryDTO implements Serializable { + + private static final long serialVersionUID = -6430902856772516776L; + /** + * 客户id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + /** + * 文章Id + */ + private String articleId; + + /** + * 该篇文章被阅读的次数和 + */ + private Integer viewedCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java new file mode 100644 index 0000000000..a7794e97e3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.voice; +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-17 16:43 + **/ + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:每个发布者发布的文章数 返回结果 dto + * + * @author liujianjun + * @date 2020/6/19 10:43 + */ +@Data +public class PublisherPublishedCountDTO implements Serializable { + private static final long serialVersionUID = 6755654148306711602L; + + /** + * 客户id + */ + private String customerId; + /** + * 机关id + */ + private String agencyId; + /** + * 网格Id + */ + private String gridId; + /** + * 发布者Id publish_type类型为 部门时 是部门id;类型为 机关时 是机关Id + */ + private String publisherId; + + /** + * 发布文章数 + */ + private Integer publishedCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java new file mode 100644 index 0000000000..045fca9844 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -0,0 +1,139 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * desc: 数据统计 对外feign client + * + * @return: + * @date: 2020/6/22 17:39 + * @author: jianjun liu + */ +@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = DataStatisticalOpenFeignClientFallBack.class) +public interface DataStatisticalOpenFeignClient { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/articleSummaryDailyStatsjob") + Result articleSummaryDailyStatsjob(); + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedDailyStatsjob") + Result tagUsedDailyStatsjob(); + + /** + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedMonthlyStatsjob") + Result tagUsedMonthlyStatsjob(); + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedQuarterlyStatsjob") + Result tagUsedQuarterlyStatsjob(); + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob") + Result tagViewedDailyStatsjob(); + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedMonthlyStatsjob") + Result tagViewedMonthlyStatsjob(); + + /** + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedQuarterlyStatsjob") + Result tagViewedQuarterlyStatsjob(); + + /** + * @Description 统计 “网格小组”, dim:【网格-日】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupgriddaily") + Result groupGridDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-日】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupagencydaily") + Result groupAgencyDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-月】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupagencymonthly") + Result groupAgencyMonthly(); + + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/23 14:34 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/data/stats/statsissue/issuestats") + Result agencyGridIssueStats(); + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @PostMapping("/data/stats/statsproject/agencyprojectstats") + Result agencyProjectStats(); + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @PostMapping("/data/stats/statsproject/gridprojectstats") + Result gridProjectStats(); + + /** + * 初始化所有维度 + * + * @return + */ + @PostMapping("/data/stats/dim/all/init") + Result initAllDims(); + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java new file mode 100644 index 0000000000..3a6c7e34c3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -0,0 +1,140 @@ +package com.epmet.feign.impl; + +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.DataStatisticalOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * desc: + * + * @return: + * @date: 2020/6/22 9:38 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Component +public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOpenFeignClient { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result articleSummaryDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "articleSummaryDailyStatsjob"); + } + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedDailyStatsjob"); + } + + /** + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedMonthlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedMonthlyStatsjob"); + } + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedQuarterlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedQuarterlyStatsjob"); + } + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedDailyStatsjob"); + } + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedMonthlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedMonthlyStatsjob"); + } + + /** + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedQuarterlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedQuarterlyStatsjob"); + } + + @Override + public Result groupGridDaily() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupGridDaily"); + } + + @Override + public Result groupAgencyDaily() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyDaily"); + } + + @Override + public Result groupAgencyMonthly() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyMonthly"); + } + + @Override + public Result agencyGridIssueStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStats"); + } + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @Override + public Result agencyProjectStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats"); + } + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @Override + public Result gridProjectStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats"); + } + + @Override + public Result initAllDims() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllDims"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/Dockerfile b/epmet-module/data-statistical/data-statistical-server/Dockerfile new file mode 100644 index 0000000000..e592acbf38 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8108 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..9f622320e1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + data-statistical-server: + container_name: data-statistical-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.7 + ports: + - "8108:8108" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..bbe6d5f891 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + data-statistical-server: + container_name: data-statistical-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.1 + ports: + - "8108:8108" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml new file mode 100644 index 0000000000..3cb1ed3e57 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -0,0 +1,251 @@ + + + 0.3.7 + + data-statistical + com.epmet + 2.0.0 + + 4.0.0 + + data-statistical-server + + + + com.epmet + data-statistical-client + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.epmet + epmet-commons-service-call + 0.3.1 + + + + + com.epmet + epmet-commons-dynamic-datasource + 2.0.0 + + + com.epmet + epmet-user-client + 2.0.0 + compile + + + + + ${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 + + + 8108 + dev + + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + + + + epmet_gov_voice_user + EpmEt-db-UsEr + + + + + epmet_oper_crm_user + EpmEt-db-UsEr + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + + + + epmet_user_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + false + + + 5 + 8 + 10 + 30 + + + + test + + + 8108 + test + + + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + + + + epmet + elink@8473066 + + + + + epmet + elink@8473066 + + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + + true + + + 5 + 8 + 10 + 30 + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java new file mode 100644 index 0000000000..ad4e2110fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -0,0 +1,15 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.scheduling.annotation.EnableAsync; + +@SpringBootApplication (exclude = {DataSourceAutoConfiguration.class}) +@EnableAsync +public class DataStatsApplication { + + public static void main(String[] args) { + SpringApplication.run(DataStatsApplication.class ,args); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-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/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java new file mode 100644 index 0000000000..ba50e40a30 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/AsyncConfig.java @@ -0,0 +1,49 @@ +package com.epmet.config; + +import com.epmet.properties.ThreadProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * 线程池配置类 + */ +@Configuration +@EnableConfigurationProperties(ThreadProperties.class) +@EnableAsync +public class AsyncConfig { + + @Autowired + private ThreadProperties threadProperties; + + @Bean + public Executor executor() { + ThreadProperties.ThreadPoolProperties threadPoolProps = threadProperties.getThreadPool(); + + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(threadPoolProps.getCorePoolSize()); + executor.setMaxPoolSize(threadPoolProps.getMaxPoolSize()); + executor.setQueueCapacity(threadPoolProps.getQueueCapacity()); + executor.setThreadNamePrefix("data-stats-"); + // rejection-policy:当pool已经达到max size的时候,如何处理新任务 + // CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行 + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); //对拒绝task的处理策略 + executor.setKeepAliveSeconds(threadPoolProps.getKeepAlive()); + executor.initialize(); + return executor; + } + + @Bean + public ExecutorService executorService() { + ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor(); + return executor.getThreadPoolExecutor(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/DatasourceConfig.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/DatasourceConfig.java new file mode 100644 index 0000000000..b201ae72e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/DatasourceConfig.java @@ -0,0 +1,11 @@ +package com.epmet.config; + +import com.epmet.properties.DatasourceProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableConfigurationProperties(value = DatasourceProperties.class) +public class DatasourceConfig { + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..be1b632462 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "data-statistical"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java new file mode 100644 index 0000000000..cf30b35552 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -0,0 +1,56 @@ +package com.epmet.constant; + +/** + * @author sun + * @dscription 数据-项目-常量 + */ +public interface ProjectConstant { + + /** + * 状态-待处理 + */ + String PENDING = "pending"; + /** + * 状态-结案 + */ + String CLOSED = "closed"; + /** + * 结案状态-已解决 + */ + String RESOLVED = "resolved"; + /** + * 结案状态-未解决 + */ + String UNRESOLVED = "unresolved"; + /** + * 项目处理进展-创建项目 + */ + String CREATED = "created"; + /** + * 项目处理进展-结案 + */ + String CLOSE = "close"; + /** + * 发布单位类型 机关:agency + */ + String PUBLISHER_TYPE_AGENCY = "agency"; + /** + * 发布单位类型 部门:department + */ + String PUBLISHER_TYPE_DEPT = "department"; + /** + * 发布单位类型 网格:grid + */ + String PUBLISHER_TYPE_GRID = "grid"; + + /** + * 执行失败钉钉消息模版 + */ + String EXE_FAILED_MSG = "统计数据方法【%s】执行失败,客户ID:%s,统计日期:%s,异常信息:%s"; + + /** + * 统计数据执行失败日志前缀 + */ + String STATS_FAILED_PREFIX = "统计数据执行失败:%s 客户ID:%s,统计日期:%s,异常信息:%s"; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java new file mode 100644 index 0000000000..2f6e7ac226 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -0,0 +1,86 @@ +package com.epmet.controller; + +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.service.StatsDemoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDateTime; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; + +import java.util.List; + +@RequestMapping("demo") +@RestController +public class DemoController { + + @Autowired + private StatsDemoService demoService; + + @Autowired + private ExecutorService executorService; + + @GetMapping("testtx") + public void testTx() { + demoService.testTx(); + } + + /** + * 异步方式1,手动submit + */ + @GetMapping("testthreadpool") + public void testThreadPool() { + System.out.println(LocalDateTime.now().getSecond());; + System.out.println("----------->>"); + Future future1 = executorService.submit(() -> demoService.testThreadPool()); + + Future future2 = executorService.submit(() -> demoService.testThreadPool()); + + Future future3 = executorService.submit(() -> demoService.testThreadPool()); + + try { + // 可以获取返回值,此处会阻塞 + Boolean o1 = future1.get(); + System.out.println(LocalDateTime.now().getSecond()); + + + + Boolean o2 = future2.get(); + System.out.println(LocalDateTime.now().getSecond()); + + Boolean o3 = future3.get(); + System.out.println(LocalDateTime.now().getSecond()); + + System.out.println("<<-----------"); + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (ExecutionException e) { + e.printStackTrace(); + } + } + + /** + * 异步方式2,service方法中加注解@Async + */ + @GetMapping("testthreadpoolasyncs") + public void testThreadPoolAsync() { + System.out.println(LocalDateTime.now().getSecond()); + System.out.println("----------->>"); + + demoService.testThreadPoolAsync(); + demoService.testThreadPoolAsync(); + demoService.testThreadPoolAsync(); + demoService.testThreadPoolAsync(); + demoService.testThreadPoolAsync(); + } + + @GetMapping("cascadegencyinfo") + public List selectAllAgency(){ + List result = demoService.getAllAgency(); + return result; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java new file mode 100644 index 0000000000..81ee884d47 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java @@ -0,0 +1,263 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.AgencySubDeptTreeDto; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.service.StatsDimService; +import com.epmet.service.stats.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("dim") +public class DimController { + + Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private DimDateService dimDateService; + + @Autowired + private DimMonthService dimMonthService; + + @Autowired + private DimQuarterService quarterService; + + @Autowired + private DimYearService dimYearService; + + @Autowired + private DimWeekService dimWeekService; + + @Autowired + private StatsDimService statsDimService; + + @Autowired + private DimAgencyService dimAgencyService; + + /** + * 初始化所有维度 + * + * @return + */ + @PostMapping("/all/init") + public Result initAllDims() { + try { + dimDateService.initDimDate(); + logger.info("初始化按日维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化按日维度失败:%s", errorStackTrace)); + } + try { + statsDimService.initGridDim(); + logger.info("初始化网格维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化网格维度失败:%s", errorStackTrace)); + } + try { + statsDimService.initAgencyDim(); + logger.info("初始化机关维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化机关维度失败:%s", errorStackTrace)); + } + try { + statsDimService.initCustomerDim(); + logger.info("初始化客户维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化客户维度失败:%s", errorStackTrace)); + } + try { + statsDimService.initDepartmentDim(); + logger.info("初始化部门维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化部门维度失败:%s", errorStackTrace)); + } + try { + dimMonthService.initMonthDim(); + logger.info("初始化按月维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化按月维度失败:%s", errorStackTrace)); + } + try { + quarterService.initQuarterDim(); + logger.info("初始化季度维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化季度维度失败:%s", errorStackTrace)); + } + try { + dimYearService.initYearDim(); + logger.info("初始化年度维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化年度维度失败:%s", errorStackTrace)); + } + try { + dimWeekService.initWeekDim(); + logger.info("初始化按周维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化按周维度失败:%s", errorStackTrace)); + } + return new Result(); + } + + /** + * 初始化按日维度 + * + * @return + */ + @PostMapping("/date/init") + public Result initDateDim() { + dimDateService.initDimDate(); + return new Result(); + } + + /** + * 初始化网格维度 + * + * @return + */ + @PostMapping("/grid/init") + public Result initGridDim() { + statsDimService.initGridDim(); + return new Result(); + } + + /** + * 初始化机关单位维度 + * + * @return + */ + @PostMapping("/agency/init") + public Result intiAgencyDim() { + statsDimService.initAgencyDim(); + return new Result(); + } + + /** + * 客户维度 + * + * @return + */ + @PostMapping("/customer/init") + public Result intiCustomerDim() { + statsDimService.initCustomerDim(); + return new Result(); + } + + /** + * 部门维度 + * + * @return + */ + @PostMapping("/department/init") + public Result intiDepartmentDim() { + statsDimService.initDepartmentDim(); + return new Result(); + } + + /** + * 月维度 + * + * @return + */ + @PostMapping("/month/init") + public Result initMonthDim() { + dimMonthService.initMonthDim(); + return new Result(); + } + + /** + * 季度维度 + * + * @return + */ + @PostMapping("/quarter/init") + public Result initQuarterDim() { + quarterService.initQuarterDim(); + return new Result(); + } + + /** + * 年度维度 + * + * @return + */ + @PostMapping("/year/init") + public Result initYearDim() { + dimYearService.initYearDim(); + return new Result(); + } + + /** + * 按周维度 + * + * @return + */ + @PostMapping("/week/init") + public Result initWeekDim() { + dimWeekService.initWeekDim(); + return new Result(); + } + + /** + * @param + * @return + * @Description 所有机构 + * @author wangc + * @date 2020.06.18 10:34 + **/ + @GetMapping("allagency") + public List allAgency(@PathVariable String customerId) { + return dimAgencyService.getAllAgency(customerId); + } + + /** + * @param + * @return + * @Description 顶级机构 + * @author wangc + * @date 2020.06.18 10:34 + **/ + @GetMapping("topagency") + public List topAgency(@PathVariable String customerId) { + return dimAgencyService.getTopAgency(customerId); + } + + /** + * @Description 所有机构 - 带部门 + * @param + * @return + * @author wangc + * @date 2020.06.18 10:34 + **/ + @GetMapping("allagencydept") + public List allAgencyDept(){ + return dimAgencyService.getAllAgencyWithDept(); + } + + /** + * @Description 顶级机构 - 带部门 + * @param + * @return + * @author wangc + * @date 2020.06.18 10:34 + **/ + @GetMapping("topagencydept") + public List topAgencyDept(){ + return dimAgencyService.getTopAgencyWithDept(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java new file mode 100644 index 0000000000..b2f6f399f7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java @@ -0,0 +1,59 @@ +package com.epmet.controller; + +import com.epmet.service.StatsGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/6/16 13:21 + */ +@RestController +@RequestMapping("statsgroup") +public class StatsGroupController { + + @Autowired + private StatsGroupService statsGroupService; + + /** + * 网格数、小组数、网格下所有组内人数(不去重) + * 小组平均人数、小组人数中位数、小组增量 + * 小组成员最大数、最多成员小组ID + * 小组成员最小数、最少成员小组ID + */ + + /** + * @Description 统计 “网格小组”, dim:【网格-日】 + * @author zxc + */ + @PostMapping("groupgriddaily") + public void groupGridDaily(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupGridDaily(date); + } + + /** + * @Description 统计 “网格小组”, dim:【机关-日】 + * @param + * @author zxc + */ + @PostMapping("groupagencydaily") + public void groupAgencyDaily(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupAgencyDaily(date); + } + + /** + * @Description 统计 “网格小组”, dim:【机关-月】 + * @param + * @author zxc + */ + @PostMapping("groupagencymonthly") + public void groupAgencyMonthly(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupAgencyMonthly(date); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java new file mode 100644 index 0000000000..850c3b7a75 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java @@ -0,0 +1,33 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:26 + */ +@RequestMapping("statsissue") +@RestController +public class StatsIssueController { + @Autowired + private StatsIssueService statsIssueService; + + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/22 14:28 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("issuestats") + public Result agencyGridIssueStats() { + statsIssueService.agencyGridIssueStats(); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java new file mode 100644 index 0000000000..0b1bd0eb47 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java @@ -0,0 +1,41 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 数据统计-项目 + * @author sun + */ +@RequestMapping("statsproject") +@RestController +public class StatsProjectController { + + @Autowired + private StatsProjectService statsProjectService; + + /** + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + @PostMapping("agencyprojectstats") + public Result agencyProjectStats() { + statsProjectService.agencyProjectStats(); + return new Result(); + } + + /** + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + @PostMapping("gridprojectstats") + public Result gridProjectStats() { + statsProjectService.gridProjectStats(); + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java new file mode 100644 index 0000000000..79ca1d0acf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -0,0 +1,102 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; +import java.util.concurrent.ExecutorService; + +/** + * desc:宣传能力controller + */ +@RequestMapping("statspublicity") +@RestController +public class StatsPublicityController { + + @Autowired + private StatsPublicityService statsPublicityService; + + @Autowired + private ExecutorService executorService; + + /** + * desc:【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "articleSummaryDailyStatsjob") + public Result articleSummaryDailyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.articleSummaryDailyStatsjob(statsDate)); + } + + /** + * desc:【日】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedDailyStatsjob") + public Result tagUsedDailyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedDailyStatsjob(statsDate)); + } + + /** + * desc:【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedMonthlyStatsjob") + public Result tagUsedMonthlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedMonthlyStatsjob(statsDate)); + } + + /** + * desc:【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedQuarterlyStatsjob") + public Result tagUsedQuarterlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedQuarterlyStatsjob(statsDate)); + } + + /** + * desc:【日】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedDailyStatsjob") + public Result tagViewedDailyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedDailyStatsjob(statsDate)); + } + + /** + * desc:【月】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedMonthlyStatsjob") + public Result tagViewedMonthlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedMonthlyStatsjob(statsDate)); + } + + /** + * desc:【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedQuarterlyStatsjob") + public Result tagViewedQuarterlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedQuarterlyStatsjob(statsDate)); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java new file mode 100644 index 0000000000..b2eb12c054 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java @@ -0,0 +1,31 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsTopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +/** + * @Description + * @ClassName StatsTopicController + * @Auth wangc + * @Date 2020-06-23 15:19 + */ +@RestController +@RequestMapping("statstopic") +public class StatsTopicController { + + @Autowired + private StatsTopicService statsTopicService; + + @PostMapping("execute") + public Result execute(@RequestParam(value = "date",required = false) Date date){ + statsTopicService.partition(date); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java new file mode 100644 index 0000000000..dd4a29fb9d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java @@ -0,0 +1,31 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +/** + * @Description 用户统计 + * @ClassName StatsUserController + * @Auth wangc + * @Date 2020-06-23 15:18 + */ +@RestController +@RequestMapping("statsuser") +public class StatsUserController { + + @Autowired + private StatsUserService statsUserService; + + @RequestMapping("execute") + public Result execute(@RequestParam(value = "date",required = false) Date date){ + statsUserService.partition(date); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.java new file mode 100644 index 0000000000..bfe699c25e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.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.crm; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.crm.CustomerEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 客户表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-11 + */ +@Mapper +public interface CustomerDao extends BaseDao { + + /** + * 根据创建时间起止查询有效客户列表 + * @param createTimeFrom + * @param createTimeTo + * @return + */ + List listValidCustomersByCreateTime( + @Param("createTimeFrom") Date createTimeFrom, + @Param("createTimeTo") Date createTimeTo); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java new file mode 100644 index 0000000000..28703e70e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -0,0 +1,83 @@ +package com.epmet.dao.group; + +import com.epmet.dto.group.form.GridGroupPeopleFormDTO; +import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; +import com.epmet.dto.group.form.GridGroupTotalFormDTO; +import com.epmet.dto.group.form.GroupIncrFormDTO; +import com.epmet.dto.group.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/16 13:22 + */ +@Mapper +public interface GroupDataDao { + + /** + * @Description 查询网格下的小组总数,状态为 “approved” + * @param formDTO + * @author zxc + */ + List selectGridGroupTotal(GridGroupTotalFormDTO formDTO); + + /** + * @Description 查询网格下的小组成员总数 , 人员状态不为 “removed” + * @param formDTO + * @author zxc + */ + List selectGridGroupPeopleTotal(GridGroupPeopleTotalFormDTO formDTO); + + /** + * @Description 查询每个小组的人数 + * @param formDTO + * @author zxc + */ + List selectEveryGroupPeopleCount(GridGroupPeopleFormDTO formDTO); + + /** + * @Description 查询网格下的小组日增数 + * @param formDTO + * @author zxc + */ + List selectGroupIncr(GroupIncrFormDTO formDTO); + + /** + * @Description 获取机关下网格下的小组数量 【待优化】 + * @param + * @author zxc + */ + List getAgencyGroupTotalCount(@Param("allGrid") List allGrid,@Param("dateId")String dateId); + + /** + * @Description 查询机关下网格内的小组人数 【待优化】 + * @param + * @author zxc + */ + List selectAgencyGridGroupPeopleTotal(@Param("allGrid") List allGrid,@Param("dateId")String dateId); + + /** + * @Description 查询机关下每个小组的人数 【待优化】 + * @param + * @author zxc + */ + List selectAgencyEveryGroupPeopleCount(@Param("allGrid") List allGrid,@Param("dateId")String dateId); + + /** + * @Description 查询机关下的小组日增数 【待优化】 + * @param + * @param dateId + * @author zxc + */ + List selectAgencyGroupIncr(@Param("allGrid") List allGrid,@Param("dateId")String dateId); + + /** + * @Description 查询机关下所有网格小组人数 + * @param gridIds + * @author zxc + */ + List getAgencyGrid(@Param("gridIds")List gridIds); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java new file mode 100644 index 0000000000..98d2e0e96d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -0,0 +1,114 @@ +package com.epmet.dao.issue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.entity.issue.IssueEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface StatsIssueDao extends BaseDao { + + + /** + * 获取当前日期组织下议题统计结果 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/17 14:13 + */ + List selectAgencyIssueTotal(@Param("customerId") String customerId); + + /** + * 获取当前日期组织下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:55 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * @param customerId + * @return + * @Author sun + * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 + **/ + List selectGridProjectList(@Param("customerId") String customerId); + /** + * 获取当前日期网格下议题统计结果 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/17 14:13 + */ + List selectGridIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 获取当前日期网格下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:55 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 查询客户下议题和项目关系 + * @author zhaoqifeng + * @date 2020/6/19 17:34 + * @param customerId + * @return java.util.List + */ + List selectIssueProjectList(@Param("customerId") String customerId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.java new file mode 100644 index 0000000000..2b9b4705ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.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.dao.org; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.org.CustomerDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Mapper +public interface CustomerDepartmentDao extends BaseDao { + + List listDepartmentsByCreatedTime( + @Param("createdTimeFrom") Date createdTimeFrom, + @Param("createdTimeTo") Date createdTimeTo); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java new file mode 100644 index 0000000000..faccf553a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.org; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; +import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.entity.org.CustomerGridEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerGridDao extends BaseDao { + + /** + * 根据创建时间,截取时间段内的网格 + * @param start + * @param end + * @return + */ + List listGridsByCreateTime(@Param("start") Date start, @Param("end") Date end); + + /** + * @Description 查询机关下的网格总数 + * @param formDto + * @author zxc + */ + List selectAgencyGridTotalCount(@Param("formDto") List formDto, @Param("dateId")String dateId); + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + List getCustomerGridIdList(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java new file mode 100644 index 0000000000..b3de9cfd02 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -0,0 +1,23 @@ +package com.epmet.dao.org; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.entity.org.CustomerAgencyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface StatsCustomerAgencyDao extends BaseDao { + + List listAllEntities(); + + List listAgenciesByCreateTime( + @Param("statsStartTime") Date statsStartTime, + @Param("statsEndTime") Date statsEndTime); + List selectAllAgency(); + + List selectSubAgencyByPid(@Param("pid")String pid); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java new file mode 100644 index 0000000000..a50874c99e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.project; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.entity.project.ProjectEntity; +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-05-11 + */ +@Mapper +public interface ProjectDao extends BaseDao { + + /** + * @param projectEntity + * @Author sun + * @Description 根据客户Id查询客户项目业务表有效数据 + **/ + List selectProjectList(ProjectEntity projectEntity); + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedProjectTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); + + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedProjectTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java new file mode 100644 index 0000000000..ad0c1ca057 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.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.dao.project; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.entity.project.ProjectProcessEntity; +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-05-11 + */ +@Mapper +public interface ProjectProcessDao extends BaseDao { + + /** + * @param projectEntity + * @Author sun + * @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + **/ + List selectProcessList(ProjectEntity projectEntity); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java new file mode 100644 index 0000000000..7ed92bc461 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.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.dao.stats; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.AgencySubDeptTreeDto; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.stats.DimAgencyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimAgencyDao extends BaseDao { + + int insertOne(DimAgencyEntity entity); + + /** + * @param dto + * @return + * @Author sun + * @Description 根据客户Id查询机关维度列表数据 + **/ + List selectDimAgencyList(DimAgencyDTO dto); + + /** + * @param + * @return List + * @Description 获取所有机关 + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectAllAgency(@Param("customerId") String customerId); + + /** + * @param pid + * @return List + * @Description 根据PID获取下级机关 + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectSubAgencyByPid(@Param("pid") String pid); + + /** + * @param + * @return List + * @Description 获取顶层级机关机关 + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectTopAgency(@Param("customerId")String customerId); + + /** + * desc:根据客户id 获取机关列表 + * @param customerId + * @return + */ + List getAgencyListByCustomerId(@Param("customerId") String customerId); + + + /** + * @Description 带部门 获取所有机关 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectAllAgencyWithDept(); + + /** + * @Description 带部门 根据PID获取下级机关 + * @param pid + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectSubAgencyWithDeptByPid(@Param("pid")String pid); + + /** + * @Description 带部门 获取顶层级机关机关 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectTopAgencyWithDept(); + + /** + * @Description 查询所有客户的机关数据 + * @author zxc + */ + List selectDimAgencyByCustomerId(@Param("customerId")String customerId); + + /** + * @Description 根据机关Id获取上级机关ID + * @param agencyId + * @author zxc + */ + String getPidByAgencyId(@Param("agencyId") String agencyId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java new file mode 100644 index 0000000000..b20779cd4c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimCustomerEntity; +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-16 + */ +@Mapper +public interface DimCustomerDao extends BaseDao { + + /** + * desc: 分页获取客户id + * + * @param pageSize + * @param offset return: List + * @date: 2020/6/17 16:33 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List selectCustomerIdPage(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize); + + void insertOne(DimCustomerEntity dim); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java new file mode 100644 index 0000000000..1075290163 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.result.DimTimeResultDTO; +import com.epmet.dto.stats.DimDateDTO; +import com.epmet.entity.stats.DimDateEntity; +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-16 + */ +@Mapper +public interface DimDateDao extends BaseDao { + + /** + * 最新的按日维度 + */ + DimDateDTO getLatestDimDate(); + + int insertOne(DimDateEntity dimDateEntity); + + DimTimeResultDTO selectDimTime(@Param("dateId")String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java new file mode 100644 index 0000000000..c7848dffcb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimDepartmentEntity; +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-16 + */ +@Mapper +public interface DimDepartmentDao extends BaseDao { + int insertOne(DimDepartmentEntity dim); + + /** + * desc:根据客户Id获取所有的部门信息 + * @param customerId + * @return + */ + List getDepartmentListByCustomerId(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java new file mode 100644 index 0000000000..669e8a08a0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridInfoResultDTO; +import com.epmet.dto.group.result.SubAgencyIdResultDTO; +import com.epmet.entity.stats.DimGridEntity; +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-16 + */ +@Mapper +public interface DimGridDao extends BaseDao { + + DimGridEntity getLastCreatedGridDimEntity(); + + /** + * desc:根据客户Id获取 该客户下的网格数据 + * @param customerId + * @return + */ + List getGridListByCustomerId(@Param("customerId") String customerId); + + /** + * @Description 查询机关下的网格 + * @param formDTO + * @author zxc + */ + List selectAgencyGridInfo(@Param("formDTO") List formDTO); + + /** + * @Description 根据当前机关ID查询下级机关ID + * @param formDTO + * @author zxc + */ + List selectSubAgencyId(@Param("formDTO")List formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimMonthDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimMonthDao.java new file mode 100644 index 0000000000..b12c76a4f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimMonthDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimMonthEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 月份维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimMonthDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimQuarterDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimQuarterDao.java new file mode 100644 index 0000000000..f2ec40f5ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimQuarterDao.java @@ -0,0 +1,34 @@ +/** + * 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.stats; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimQuarterEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 季度维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimQuarterDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimTopicStatusDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimTopicStatusDao.java new file mode 100644 index 0000000000..cbc26f7a33 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimTopicStatusDao.java @@ -0,0 +1,34 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; + +import com.epmet.entity.stats.DimTopicStatusEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimTopicStatusDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimWeekDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimWeekDao.java new file mode 100644 index 0000000000..ffabc979d6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimWeekDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimWeekEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 周维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimWeekDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimYearDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimYearDao.java new file mode 100755 index 0000000000..7cfbedc4bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimYearDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimYearEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 年维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-15 + */ +@Mapper +public interface DimYearDao extends BaseDao { + int insertOne(DimYearEntity entity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java new file mode 100644 index 0000000000..2fbabdec6c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java @@ -0,0 +1,49 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactAgencyProjectDailyDao extends BaseDao { + + /** + * @param formDTO + * @Author sun + * @Description 查询上一月机关日统计数据,按时间倒序 + **/ + List selectMonthProjectList(MonthProjectListFormDTO formDTO); + + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateProject(FactAgencyProjectDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java new file mode 100644 index 0000000000..e6fb0c37b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactAgencyProjectMonthlyDao extends BaseDao { + + /** + * @param delEntity + * @return + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除可能存在的历史数据 + **/ + void delMonthProject(FactAgencyProjectMonthlyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java new file mode 100644 index 0000000000..5a7e9dbfc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactArticlePublishedAgencyDailyDao extends BaseDao { + /** + * desc:删除数据 + * + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java new file mode 100644 index 0000000000..1cff4fa1a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactArticlePublishedDepartmentDailyDao extends BaseDao { + + /** + * desc:根据客户id,日期 删除数据 + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java new file mode 100644 index 0000000000..24b8ca6115 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java @@ -0,0 +1,54 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; +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-18 + */ +@Mapper +public interface FactArticlePublishedGridDailyDao extends BaseDao { + + /** + * desc:获取客户 指定日期内的数据 + * + * @param customerId + * @param dateId + * @return + */ + List getByBeforeDay(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc:根据日期删除 数据 + * + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java new file mode 100644 index 0000000000..eae7df214a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java @@ -0,0 +1,50 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; +import com.epmet.entity.stats.FactGridProjectDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactGridProjectDailyDao extends BaseDao { + + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateProject(FactAgencyProjectDailyEntity delEntity); + + /** + * @param formDTO + * @Author sun + * @Description 查询上一月网格日统计数据,按时间倒序 + **/ + List selectMonthProjectList(MonthProjectListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java new file mode 100644 index 0000000000..e2ae56868e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; +import com.epmet.entity.stats.FactGridProjectMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactGridProjectMonthlyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除一下可能存在的历史数据 + **/ + void delMonthProject(FactAgencyProjectMonthlyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java new file mode 100644 index 0000000000..4a41fe25a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java @@ -0,0 +1,67 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; +import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; +import com.epmet.entity.stats.FactGroupAgencyDailyEntity; +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-16 + */ +@Mapper +public interface FactGroupAgencyDailyDao extends BaseDao { + + /** + * @Description 插入网格小组数据 【机关-日】 + * @param agencyList + * @author zxc + */ + void insertGroupAgencyDaily(@Param("agencyList") List agencyList); + + /** + * @Description 获取 网格小组【机关-日统计】的最后一天数据 + * @param + * @author zxc + */ + List getLastDayAgency(@Param("monthId") String monthId); + + /** + * @Description 查询 月的小组增量 + * @param monthId + * @author zxc + */ + List getMonthGroupIncr(@Param("monthId")String monthId); + + /** + * @Description 删除当天已存在数据 + * @param dateId + * @author zxc + */ + void deleteInsertAgencyDailyByDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java new file mode 100644 index 0000000000..cf43e681ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; +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-16 + */ +@Mapper +public interface FactGroupAgencyMonthlyDao extends BaseDao { + + /** + * @Description 统计网格小组 【机关-月】 + * @param agencyMonth + * @author zxc + */ + void insertAgencyGroupMonthly(@Param("agencyMonth") List agencyMonth); + + /** + * @Description 删除已存在的月数据 + * @param monthId + * @author zxc + */ + void deleteInsertAgencyMonthlyByMonthId(@Param("monthId")String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java new file mode 100644 index 0000000000..c97f5c8120 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.entity.stats.FactGroupGridDailyEntity; +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-16 + */ +@Mapper +public interface FactGroupGridDailyDao extends BaseDao { + + /** + * @Description 插入小组【网格-日】 + * @param formDto + * @author zxc + */ + void insertGroupGridDaily(@Param("formDto") List formDto); + + /** + * @Description 删除已存在的数据【当天】防止当天数据多条 + * @param dateId + * @author zxc + */ + void deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java new file mode 100644 index 0000000000..c6ee47eb10 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactIssueAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactIssueAgencyDailyDao extends BaseDao { + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param dateId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java new file mode 100644 index 0000000000..6f9933bf1a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java @@ -0,0 +1,55 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +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-17 + */ +@Mapper +public interface FactIssueAgencyMonthlyDao extends BaseDao { + /** + * 统计机关议题各个指标月度增量 + * @author zhaoqifeng + * @date 2020/6/19 10:13 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java new file mode 100644 index 0000000000..595131257d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactIssueGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactIssueGridDailyDao extends BaseDao { + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param dateId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java new file mode 100644 index 0000000000..502363d1b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java @@ -0,0 +1,55 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; +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-17 + */ +@Mapper +public interface FactIssueGridMonthlyDao extends BaseDao { + /** + * 统计网格议题各个指标月度增量 + * @author zhaoqifeng + * @date 2020/6/19 10:41 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java new file mode 100644 index 0000000000..bb53792085 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +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-18 + */ +@Mapper +public interface FactTagUsedAgencyDailyDao extends BaseDao { + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc:根据客户Id 和月份id 获取月的统计数 + * + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java new file mode 100644 index 0000000000..1bc98abe5f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +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-18 + */ +@Mapper +public interface FactTagUsedAgencyMonthlyDao extends BaseDao { + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java new file mode 100644 index 0000000000..9d51f34d49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedAgencyQuarterlyDao extends BaseDao { + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java new file mode 100644 index 0000000000..0d8c942e5a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedAgencyYearlyDao extends BaseDao { + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java new file mode 100644 index 0000000000..2c74977270 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; +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-18 + */ +@Mapper +public interface FactTagUsedDepartmentDailyDao extends BaseDao { + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc:获取部门月 统计数 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java new file mode 100644 index 0000000000..9b6a3b89cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; +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-18 + */ +@Mapper +public interface FactTagUsedDepartmentMonthlyDao extends BaseDao { + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java new file mode 100644 index 0000000000..6ac52ec583 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedDepartmentQuarterlyDao extends BaseDao { + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java new file mode 100644 index 0000000000..d6908b860e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedDepartmentYearlyDao extends BaseDao { + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java new file mode 100644 index 0000000000..423d8baea0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; +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-18 + */ +@Mapper +public interface FactTagUsedGridDailyDao extends BaseDao { + + /** + * desc:根据dateId 删除数据 + * + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagUsedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java new file mode 100644 index 0000000000..b8eb0d9095 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; +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-18 + */ +@Mapper +public interface FactTagUsedGridMonthlyDao extends BaseDao { + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java new file mode 100644 index 0000000000..f23190191c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedGridQuarterlyDao extends BaseDao { + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java new file mode 100644 index 0000000000..eb76936645 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedGridYearlyDao extends BaseDao { + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java new file mode 100644 index 0000000000..4a9a248298 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; +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-18 + */ +@Mapper +public interface FactTagViewedAgencyDailyDao extends BaseDao { + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagViewedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java new file mode 100644 index 0000000000..eea98354b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; +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-18 + */ +@Mapper +public interface FactTagViewedAgencyMonthlyDao extends BaseDao { + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + List getTagViewedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java new file mode 100644 index 0000000000..17c7c064a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedAgencyQuarterlyDao extends BaseDao { + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java new file mode 100644 index 0000000000..54d0564f18 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedAgencyYearlyDao extends BaseDao { + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java new file mode 100644 index 0000000000..8824b13ccc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedGridDailyEntity; +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-18 + */ +@Mapper +public interface FactTagViewedGridDailyDao extends BaseDao { + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagViewedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java new file mode 100644 index 0000000000..d504edb591 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; +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-18 + */ +@Mapper +public interface FactTagViewedGridMonthlyDao extends BaseDao { + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + List getTagViewCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java new file mode 100644 index 0000000000..8e7318fba0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedGridQuarterlyDao extends BaseDao { + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java new file mode 100644 index 0000000000..a85ead0f93 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedGridYearlyDao extends BaseDao { + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java new file mode 100755 index 0000000000..b6adba1ec7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.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.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.LastExecRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; + +/** + * 最后一次执行记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface LastExecRecordDao extends BaseDao { + + LastExecRecordEntity getLastExecRecord(@Param("statsSubject") String statsSubject); + + /** + * 更新统计主体的执行时间 + * @param date + * @param subject + * @return + */ + int updateExecTimeBySubject(@Param("date") Date date, @Param("subject") String subject); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyDailyDao.java new file mode 100644 index 0000000000..5089e9b642 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyDailyDao.java @@ -0,0 +1,40 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicIssueAgencyDailyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyMonthlyDao.java new file mode 100644 index 0000000000..08ad42c187 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity; +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-20 + */ +@Mapper +public interface FactTopicIssueAgencyMonthlyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridDailyDao.java new file mode 100644 index 0000000000..bfb369626f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicIssueGridDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridMonthlyDao.java new file mode 100644 index 0000000000..8f819b001b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridMonthlyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity; +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-20 + */ +@Mapper +public interface FactTopicIssueGridMonthlyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyDailyDao.java new file mode 100644 index 0000000000..218b21cd52 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyDailyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicStatusAgencyDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyMonthlyDao.java new file mode 100644 index 0000000000..742d92bd65 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyMonthlyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity; +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-20 + */ +@Mapper +public interface FactTopicStatusAgencyMonthlyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusGridDailyDao.java new file mode 100644 index 0000000000..666a54f995 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicStatusGridDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalAgencyDailyDao.java new file mode 100644 index 0000000000..445aa9a30f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalAgencyDailyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicTotalAgencyDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java new file mode 100644 index 0000000000..7276945b90 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * 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.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicTotalGridDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java new file mode 100644 index 0000000000..4a5b254b8f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.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.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; +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-17 + */ +@Mapper +public interface FactParticipationUserAgencyDailyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java new file mode 100644 index 0000000000..d52897c4b9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.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.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactParticipationUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity; +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-17 + */ +@Mapper +public interface FactParticipationUserAgencyMonthlyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java new file mode 100644 index 0000000000..d39a6088e1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.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.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; +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-17 + */ +@Mapper +public interface FactParticipationUserGridDailyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java new file mode 100644 index 0000000000..b67adec9dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * 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.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactParticipationUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity; +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-17 + */ +@Mapper +public interface FactParticipationUserGridMonthlyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java new file mode 100644 index 0000000000..e22a094565 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.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.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactRegUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity; +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-17 + */ +@Mapper +public interface FactRegUserAgencyDailyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java new file mode 100644 index 0000000000..e59f48e8c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * 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.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; +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-17 + */ +@Mapper +public interface FactRegUserAgencyMonthlyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java new file mode 100644 index 0000000000..f06c4c1179 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.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.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactRegUserGridDailyDTO; +import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; +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-17 + */ +@Mapper +public interface FactRegUserGridDailyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java new file mode 100644 index 0000000000..940609d9bc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.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.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; +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-17 + */ +@Mapper +public interface FactRegUserGridMonthlyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java new file mode 100644 index 0000000000..9244b799b1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -0,0 +1,59 @@ +package com.epmet.dao.topic; + +/** + * 话题Dao ResiGroup + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ + +import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; +import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface TopicDao { + + /** + * @Description 将组按照网格Id排序 + * @param targetDate + * @param customerId + * @return List + * @author wangc + * @date 2020.06.22 11:05 + **/ + List selectGroupOrderByGrid(@Param("targetDate")Date targetDate, @Param("customerId")String customerId); + + /** + * @Description 查询话题的操作记录,如果返回结果中没有对应Id的话题说明当日话题没有操作记录 + * @param targetDate + * @return List + * @author wangc + * @date 2020.06.22 11:07 + **/ + List selectTopicOperationRecord(@Param("targetDate")Date targetDate); + + + /** + * @Description 将组按照网格Id排序 + * @param + * @param customerId + * @return List + * @author wangc + * @date 2020.06.22 11:05 + **/ + List selectGroupOrderByGridBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate, @Param("customerId")String customerId); + + /** + * @Description 查询话题的操作记录,如果返回结果中没有对应Id的话题说明当日话题没有操作记录 + * @param + * @return List + * @author wangc + * @date 2020.06.22 11:07 + **/ + List selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java new file mode 100644 index 0000000000..d96d1787e1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -0,0 +1,100 @@ +package com.epmet.dao.user; + +import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Set; + +/** + * 用户Dao EpmetUser + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface UserDao { + + /** + * @Description 查询注册用户的总量与增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + CommonTotalAndIncCountResultDTO selectResiTotalAndIncrByLevel(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate")Date targetDate); + + /** + * @Description 查询党员的总量与增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + CommonTotalAndIncCountResultDTO selectPartyTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("targetDate") Date targetDate); + + /** + * @Description 查询热心居民的总量与增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + CommonTotalAndIncCountResultDTO selectWarmTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + + /** + * @Description 查询指定网格范围下单位时间内新增的注册用户Id + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + List selectIncrUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + + /** + * @Description 查询指定网格范围下截至指定位时间累计的注册用户Id + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + List selectTotalUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + + /** + * @Description 查询指定时间范围内网格新增的注册/参与用户Id + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + List selectIncrUserIdsWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate")Date startDate,@Param("endDate")Date endDate); + + /** + * @Description 查询指定时间范围内注册/参与用户增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + Integer selectResiIncrWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate")Date startDate,@Param("endDate")Date endDate); + + /** + * @Description 查询指定时间范围内党员的增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + Integer selectPartyIncrWithinTimeRange(@Param("incrUserIds")List incrUserIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate); + + /** + * @Description 查询指定时间范围内热心居民的增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds")List incrUserIds,@Param("gridIds") Set gridIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java new file mode 100644 index 0000000000..8ad5156de5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java @@ -0,0 +1,55 @@ +/** + * 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.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticleEntity; +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-17 + */ +@Mapper +public interface ArticleDao extends BaseDao { + + /** + * desc:根据客户Id 和发布时间 获取文章总数 + * + * @param customerId + * @param publishDate + * @param publisherType + * @return + */ + List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") String publishDate, @Param("publisherType") String publisherType); + + /** + * desc:根据客户Id 和发布时间 获取文章数据 + * + * @param customerId + * @param publishDate + * @return + */ + List getPublishedArticleByDay(@Param("customerId") String customerId, @Param("publishDate") String publishDate); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleOperateRecordDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleOperateRecordDao.java new file mode 100644 index 0000000000..30c8117e51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleOperateRecordDao.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.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.voice.ArticleOperateRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticleOperateRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java new file mode 100644 index 0000000000..f8ff0e359b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.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.dao.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticlePublishRangeDao extends BaseDao { + + /** + * desc:查询网格发布文章总数及状态为发布中的文章总数 + * + * @param customerId + * @param createDate + * @return + */ + List getAllPublishedCount(@Param("customerId") String customerId, @Param("createDate") Date createDate); + + /** + * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 + * + * @param customerId + * @param startDate + * @param endDate + * @return: List + */ + List getOneDayPublishedCount(@Param("customerId") String customerId, @Param("startDate") Date startDate, @Param("endDate") Date endDate); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java new file mode 100644 index 0000000000..b25b86e2b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.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.dao.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.voice.ArticleTagsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticleTagsDao extends BaseDao { + + /** + * desc:根据客户id 创建时间 获取文章标签数据 + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleTagsByDay(@Param("customerId") String customerId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); + + List getArticleTagsByArticleId(@Param("customerId") String customerId, @Param("articleId") String articleId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java new file mode 100644 index 0000000000..174ea937ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java @@ -0,0 +1,39 @@ +/** + * 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.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticleVisitRecordDao extends BaseDao { + + List getArticleVisitByCreateTime(@Param("customerId") String customerId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java new file mode 100644 index 0000000000..a2fa408a43 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.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.entity.crm; + +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-03-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer") +public class CustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 产品标题 显示在产品顶端的标题 + */ + private String title; + + /** + * 组织机构代码 + */ + private String organizationNumber; + + /** + * 组织机构代码证图片 + */ + private String organizationImg; + + /** + * 有效期 + */ + private Date validityTime; + + /** + * 客户管理员 + */ + private String customerAdmin; + + /** + * 密码 加密存储 + */ + private String customerPassword; + + /** + * 客户组织级别:机关级别 + * (社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String organizationLevel; + + /** + * 客户logo + */ + private String logo; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueEntity.java new file mode 100644 index 0000000000..3982fb5798 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueEntity.java @@ -0,0 +1,120 @@ +/** + * 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.issue; + +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-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue") +public class IssueEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题状态 表决中:voting 已转项目:shift_project 已关闭:closed + */ + private String issueStatus; + + /** + * 来源类型 eg:resi_topic + */ + private String sourceType; + + /** + * 来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID) + */ + private String sourceId; + + /** + * 关闭理由 【未关闭时可以为空】关闭话题时必填的理由,转项目后而且已经结案,这个字段不回写 + */ + private String closeReason; + + /** + * 解决类型 【未关闭时可以为空】已解决resloved、未解决unresloved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写 + */ + private String resolveType; + + /** + * 议题名称 最多20字 + */ + private String issueTitle; + + /** + * 建议 建议 + */ + private String suggestion; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 网格ID 居民端议题对应一个网格iId + */ + private String gridId; + + /** + * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 + */ + private String orgIdPath; + + /** + * 组织ID 【数据权限-非必填】agencyId + */ + private String orgId; + + /** + * 表决截止日期 表决截止日期 + */ + private Date votingDeadline; + + /** + * 表决发起日期(转议题日期) 表决发起日期(转议题日期) + */ + private Date decidedTime; + + /** + * 转项目日期 转项目日期(服务间调用日期一致性) + */ + private Date shiftedTime; + + /** + * 关闭日期 关闭日期 + */ + private Date closedTime; + + /** + * sun-项目id + */ + private String projectId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java new file mode 100644 index 0000000000..7381034578 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java @@ -0,0 +1,97 @@ +/** + * 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.org; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_agency") +public class CustomerAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 地区编码 + */ + private String areaCode; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 区县 + */ + private String district; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java new file mode 100644 index 0000000000..0f46e25ffd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.org; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_department") +public class CustomerDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + /** + * 总人数 + */ + private Integer totalUser; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java new file mode 100644 index 0000000000..6c01df7df8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java @@ -0,0 +1,82 @@ +/** + * 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.org; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_grid") +public class CustomerGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java new file mode 100644 index 0000000000..cd696e25c6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.project; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project") +public class ProjectEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 来源:议题issue + */ + private String origin; + + /** + * 来源ID + */ + private String originId; + + /** + * 项目标题 + */ + private String title; + + /** + * 状态:待处理 pending,结案closed + */ + private String status; + + /** + * 结案状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 所属机关 11:22:33(本机关以及上级所有机关ID) + */ + private String orgIdPath; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java new file mode 100644 index 0000000000..d6f4cd5467 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java @@ -0,0 +1,90 @@ +/** + * 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.project; + +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-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_process") +public class ProjectProcessEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 项目所属机关Id + */ + private String agencyId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 部门名 + */ + private String departmentName; + + /** + * 负负责人ID + */ + private String staffId; + + /** + * 处理:结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + + /** + * 处理名 + */ + private String operationName; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 结束时间 + */ + private Date endTime; + + /** + * 耗费天数 + */ + private String costWorkdays; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java new file mode 100644 index 0000000000..28b471f0a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.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.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_agency") +public class DimAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等 + */ + private String agencyDimType; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java new file mode 100644 index 0000000000..a287006414 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_customer") +public class DimCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java new file mode 100644 index 0000000000..c6281eecca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + + +/** + * 日期维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_date") +public class DimDateEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * eg: 2020年01月01日 + */ + private String dateName; + + /** + * 周几:Monday、Tuesday、Wednesday、Thursday、Friday、Saturday、Sunday + */ + private String dayOfWeek; + + /** + * 周几:星期一、星期二、星期三、星期四、星期五、星期六、星期日 + */ + private String dayOfWeekName; + + /** + * dim_week.week_id + */ + private String weekId; + + private String monthId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java new file mode 100644 index 0000000000..da22ff4fe7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + + +/** + * 客户部门维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_department") +public class DimDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 所属机关ID(customer_agency_dimension.id) + */ + private String agencyId; + + /** + * 来源于customer_dimension + */ + private String customerId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java new file mode 100644 index 0000000000..8c49f7f9d9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java @@ -0,0 +1,60 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_grid") +public class DimGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimMonthEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimMonthEntity.java new file mode 100644 index 0000000000..d1d43f2b2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimMonthEntity.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.stats; + +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-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_month") +public class DimMonthEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * eg: 2020年01月 + */ + private String monthName; + + /** + * 1-12 + */ + private Integer monthOrder; + + /** + * yyyy-MM-dd eg:2020-01-01 + */ + private Date startDate; + + /** + * yyyy-MM-dd eg:2020-01-31 + */ + private Date endDate; + + /** + * 来源于dim_quarter.id + */ + private String quarterId; + + /** + * 来源于dim_year.id + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimQuarterEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimQuarterEntity.java new file mode 100644 index 0000000000..b0a4ef21f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimQuarterEntity.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.stats; + +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-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_quarter") +public class DimQuarterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * eg: 2020年第一季度、2020年第二季度、2020 + */ + private String quarterName; + + /** + * 1、2、3、4 + */ + private Integer quarterOrder; + + /** + * yyyy-MM-dd + */ + private Date startDate; + + /** + * yyyy-MM-dd + */ + private Date endDate; + + /** + * 来源于dim_year.id + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java new file mode 100644 index 0000000000..4bce308c22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + + +/** + * 话题状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_topic_status") +public class DimTopicStatusEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 状态描述 讨论中 已屏蔽 已关闭 + */ + private String statusDesc; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimWeekEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimWeekEntity.java new file mode 100644 index 0000000000..2069e37477 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimWeekEntity.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.stats; + +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-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_week") +public class DimWeekEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * eg: 2020年第1周 + */ + private String weekName; + + /** + * 1-52 + */ + private Integer weekOrder; + + /** + * yyyy-MM-dd eg:2020-01-01 + */ + private Date startDate; + + /** + * yyyy-MM-dd eg:2020-01-05 + */ + private Date endDate; + + /** + * 来源于dim_year.id + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimYearEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimYearEntity.java new file mode 100755 index 0000000000..ed89aa07a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimYearEntity.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.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 年维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_year") +public class DimYearEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 2019年 + */ + private String yearName; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java new file mode 100644 index 0000000000..9f609723f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java @@ -0,0 +1,152 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_project_daily") +public class FactAgencyProjectDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java new file mode 100644 index 0000000000..8b147a3f18 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java @@ -0,0 +1,142 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_project_monthly") +public class FactAgencyProjectMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java new file mode 100644 index 0000000000..1bd71f4989 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_agency_daily") +public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 今日发布文章数 + */ + private Integer publishedCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java new file mode 100644 index 0000000000..114dd2d8d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_department_daily") +public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布文章单位所属机关ID 发布文章单位所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 今日发布文章数 + */ + private Integer publishedCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java new file mode 100644 index 0000000000..d1cd23de07 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_grid_daily") +public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布单位所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 今日发布文章数 + */ + private Integer publishedCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java new file mode 100644 index 0000000000..93c1f71499 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java @@ -0,0 +1,152 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_grid_project_daily") +public class FactGridProjectDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 网格Id 【dim_grid.id】 + */ + private String gridId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日网格下项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日网格下处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日网格下处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日网格下已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日网格下已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 当日网格下项目总数 【该网格下项目总数】 + */ + private Integer projectIncr; + + /** + * 当日网格下处理中项目数 【该网格下未结案项目总数】 + */ + private Integer pendingIncr; + + /** + * 当日网格下已结案项目数 【该网格下已结案项目总数】 + */ + private Integer closedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java new file mode 100644 index 0000000000..dd79ecc9fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java @@ -0,0 +1,142 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_grid_project_monthly") +public class FactGridProjectMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 网格Id 【dim_grid.id】 + */ + private String gridId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyDailyEntity.java new file mode 100644 index 0000000000..e3ee31e7ec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyDailyEntity.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.stats; + +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-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_agency_daily") +public class FactGroupAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格总数 截至统计日期 + */ + private Integer gridTotal; + + /** + * 网格小组数(包含所有下级机关的网格小组) 截至统计日期 + */ + private Integer groupTotalCount; + + /** + * 机关下网格小组人数总计 不去重 + */ + private Integer groupMemberTotalCount; + + /** + * 小组平均人数 截至统计日期 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 当天小组增量 + */ + private Integer groupIncr; + + /** + * 小组最大成员数 + */ + private String groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组最小成员数 + */ + private String groupMemberMinCount; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyMonthlyEntity.java new file mode 100644 index 0000000000..b7902589c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyMonthlyEntity.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.stats; + +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-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_agency_monthly") +public class FactGroupAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份ID 关联月份dim表 + */ + private String monthId; + + /** + * 统计季度ID + */ + private String quarterId; + + /** + * 统计年份ID + */ + private String yearId; + + /** + * 网格数 截至到月末的机关下网格数 + */ + private Integer gridTotal; + + /** + * 小组数 截止到月末的新增数(该月内所有的新增数字之和) + */ + private Integer groupTotal; + + /** + * 机关下网格组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 月末一天的平均数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 月末一天的中位数(人) + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 成员最多小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount; + + /** + * 成员最少小组ID + */ + private String minMemberGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupGridDailyEntity.java new file mode 100644 index 0000000000..3c23206bc8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupGridDailyEntity.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.stats; + +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-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_grid_daily") +public class FactGroupGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 年ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 网格数 当前网格下的网格数 + */ + private Integer gridTotal; + + /** + * 小组数 + */ + private Integer groupTotal; + + /** + * 网格下所有组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java new file mode 100644 index 0000000000..377757ab2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java @@ -0,0 +1,207 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_agency_daily") +public class FactIssueAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java new file mode 100644 index 0000000000..a06e51b59d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java @@ -0,0 +1,197 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_agency_monthly") +public class FactIssueAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java new file mode 100644 index 0000000000..50d7d2ddaf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java @@ -0,0 +1,207 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_grid_daily") +public class FactIssueGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java new file mode 100644 index 0000000000..713d48f3f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java @@ -0,0 +1,197 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_grid_monthly") +public class FactIssueGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyDailyEntity.java new file mode 100644 index 0000000000..51b1c1cf47 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_agency_daily") +public class FactTagUsedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java new file mode 100644 index 0000000000..992db40143 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_agency_monthly") +public class FactTagUsedAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java new file mode 100644 index 0000000000..60de929fde --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_agency_quarterly") +public class FactTagUsedAgencyQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyYearlyEntity.java new file mode 100644 index 0000000000..dcdc366f74 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_agency_yearly") +public class FactTagUsedAgencyYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentDailyEntity.java new file mode 100644 index 0000000000..7087d8dd5f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentDailyEntity.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_department_daily") +public class FactTagUsedDepartmentDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java new file mode 100644 index 0000000000..d2309ee1fd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java @@ -0,0 +1,82 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_department_monthly") +public class FactTagUsedDepartmentMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java new file mode 100644 index 0000000000..61050668a0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_department_quarterly") +public class FactTagUsedDepartmentQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentYearlyEntity.java new file mode 100644 index 0000000000..62b2bb91c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_department_yearly") +public class FactTagUsedDepartmentYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridDailyEntity.java new file mode 100644 index 0000000000..8dcdb3f73c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_grid_daily") +public class FactTagUsedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java new file mode 100644 index 0000000000..8315bfe68d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_grid_monthly") +public class FactTagUsedGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java new file mode 100644 index 0000000000..cf7f435b2d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_grid_quarterly") +public class FactTagUsedGridQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridYearlyEntity.java new file mode 100644 index 0000000000..b502950800 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_grid_yearly") +public class FactTagUsedGridYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyDailyEntity.java new file mode 100644 index 0000000000..6df781bc22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_daily") +public class FactTagViewedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java new file mode 100644 index 0000000000..204cd7016a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_monthly") +public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java new file mode 100644 index 0000000000..089be76e1d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_quarterly") +public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyYearlyEntity.java new file mode 100644 index 0000000000..1850099d9d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_yearly") +public class FactTagViewedAgencyYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridDailyEntity.java new file mode 100644 index 0000000000..97457851dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_daily") +public class FactTagViewedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java new file mode 100644 index 0000000000..949e60222a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_monthly") +public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java new file mode 100644 index 0000000000..b6b3c57a61 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_quarterly") +public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridYearlyEntity.java new file mode 100644 index 0000000000..eaf149fc22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * 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.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_yearly") +public class FactTagViewedGridYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java new file mode 100755 index 0000000000..833954276d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +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-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("last_exec_record") +public class LastExecRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 执行主体,即每一个统计表 + */ + private String subject; + + /** + * 最后一次执行时间 + */ + private Date execTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyDailyEntity.java new file mode 100644 index 0000000000..b8118c7dd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyDailyEntity.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.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_issue_agency_daily") +public class FactTopicIssueAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题数量 + */ + private Integer issueTotal; + + /** + * 已转议题当日增量 + */ + private Integer issueIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyMonthlyEntity.java new file mode 100644 index 0000000000..5f782d0779 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyMonthlyEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_issue_agency_monthly") +public class FactTopicIssueAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级ID + */ + private String pid; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题总量 + */ + private Integer issueTotal; + + /** + * 已转议题增量 + */ + private Integer issueIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridDailyEntity.java new file mode 100644 index 0000000000..90ecdb3b42 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridDailyEntity.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.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_issue_grid_daily") +public class FactTopicIssueGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 新增转议题数 + */ + private Integer issueIncr; + + /** + * 转议题总数 + */ + private Integer issueTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridMonthlyEntity.java new file mode 100644 index 0000000000..ff1a767364 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridMonthlyEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_issue_grid_monthly") +public class FactTopicIssueGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题增量 + */ + private Integer issueIncr; + + /** + * 已转议题总量 + */ + private Integer issueTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyDailyEntity.java new file mode 100644 index 0000000000..a70533c5b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyDailyEntity.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.entity.stats.topic; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 状态话题-机关日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_status_agency_daily") +public class FactTopicStatusAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题状态ID 关联dim_topic_status表 +讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 指定状态的话题数量 + */ + private Integer topicCount; + + /** + * 话题状态百分比 指定状态话题数/话题总数 +总数在topic_total_agency_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 单位时间内的状态话题的增加数 + */ + private Integer topicIncrement; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyMonthlyEntity.java new file mode 100644 index 0000000000..41b867b6af --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyMonthlyEntity.java @@ -0,0 +1,97 @@ +/** + * 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.stats.topic; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 状态话题-机关月统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_status_agency_monthly") +public class FactTopicStatusAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份 关联月度dm表 + */ + private String monthId; + + /** + * 季度ID 关联季度dm表 + */ + private String quarterId; + + /** + * 年ID 关联年度dm表 + */ + private String yearId; + + /** + * 话题状态 讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态占比 月末一天 +指定状态话题数/话题总数 +总数在topic_total_agency_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 单位时间内的话题状态增加数 + */ + private Integer topicIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusGridDailyEntity.java new file mode 100644 index 0000000000..9761626845 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusGridDailyEntity.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.entity.stats.topic; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 状态话题-网格日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_status_grid_daily") +public class FactTopicStatusGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID 关联网格dm表 + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题状态ID 讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态占比 指定状态话题数/话题总数 +总数在topic_total_grid_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 + */ + private Integer topicIncrement; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalAgencyDailyEntity.java new file mode 100644 index 0000000000..9ee374426f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalAgencyDailyEntity.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.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_total_agency_daily") +public class FactTopicTotalAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题增量 + */ + private Integer topicIncr; + + /** + * 屏蔽话题数 + */ + private Integer hiddenTotalCount; + + /** + * 已转议题数 + */ + private Integer issueTotalCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalGridDailyEntity.java new file mode 100644 index 0000000000..f9976295ea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalGridDailyEntity.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.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_total_grid_daily") +public class FactTopicTotalGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总量 + */ + private Integer topicTotal; + + /** + * 话题增量 + */ + private Integer topicIncr; + + /** + * 屏蔽话题数量 + */ + private Integer hiddenTotalCount; + + /** + * 已转议题数量 + */ + private Integer issueTotalCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.java new file mode 100644 index 0000000000..512ff89b3e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.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.entity.stats.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_participation_user_agency_daily") +public class FactParticipationUserAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日(参与用户中)党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日(参与用户中)注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日(参与用户中)热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日(参与用户中)党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.java new file mode 100644 index 0000000000..7e261e70e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.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.entity.stats.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下(按月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_participation_user_agency_monthly") +public class FactParticipationUserAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底(参与用户中)党员总数 + */ + private Integer partymemberTotal; + + /** + * 本月(参与用户中)注册居民月增量 + */ + private Integer regIncr; + + /** + * 本月(参与用户中)热心居民月增量 + */ + private Integer warmIncr; + + /** + * 本月(参与用户中)党员认证月增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java new file mode 100644 index 0000000000..18f6b295f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java @@ -0,0 +1,122 @@ +/** + * 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.stats.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_participation_user_grid_daily") +public class FactParticipationUserGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java new file mode 100644 index 0000000000..8fc4d93d16 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java @@ -0,0 +1,122 @@ +/** + * 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.stats.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格下(月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_participation_user_grid_monthly") +public class FactParticipationUserGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底的参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底的居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底的热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底的党员总数 + */ + private Integer partymemberTotal; + + /** + * 注册居民本月增量 + */ + private Integer regIncr; + + /** + * 热心居民本月增量 + */ + private Integer warmIncr; + + /** + * 党员认证本月增量 + */ + private Integer partymemberIncr; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.java new file mode 100644 index 0000000000..aeffaeb3c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.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.entity.stats.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_reg_user_agency_daily") +public class FactRegUserAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日:居民总数=注册用户总数 + */ + private Integer resiTotal; + + /** + * 截止到本日:热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日:党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日:注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日:热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日:党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.java new file mode 100644 index 0000000000..daa07e392d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.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.entity.stats.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关(按月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_reg_user_agency_monthly") +public class FactRegUserAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底:注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底:居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底:热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底:党员总数 + */ + private Integer partymemberTotal; + + /** + * 本月:注册居民月增量 + */ + private Integer regIncr; + + /** + * 本月:热心居民月增量 + */ + private Integer warmIncr; + + /** + * 本月:党员认证月增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java new file mode 100644 index 0000000000..17e41d1a65 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java @@ -0,0 +1,122 @@ +/** + * 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.stats.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_reg_user_grid_daily") +public class FactRegUserGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java new file mode 100644 index 0000000000..9030105ef1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java @@ -0,0 +1,122 @@ +/** + * 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.stats.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格(月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_reg_user_grid_monthly") +public class FactRegUserGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底的注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底的居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底的热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底的党员总数 + */ + private Integer partymemberTotal; + + /** + * 注册居民本月增量 + */ + private Integer regIncr; + + /** + * 热心居民本月增量 + */ + private Integer warmIncr; + + /** + * 党员认证本月增量 + */ + private Integer partymemberIncr; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java new file mode 100644 index 0000000000..98d9beb507 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java @@ -0,0 +1,125 @@ +/** + * 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.voice; + +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-17 + */ +@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; + + /** + * 是否置顶 1是;0否; + */ + 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/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleOperateRecordEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleOperateRecordEntity.java new file mode 100644 index 0000000000..3efa67d17f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleOperateRecordEntity.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.voice; + +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-17 + */ +@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; + + /** + * 网格ID,下线文章时,多个以英文:隔开 + */ + private String gridIds; + + /** + * 执行人 xx街道-xx中心-姓名 + */ + private String opUser; + + /** + * 操作内容 操作内容,eg:重新编辑文章; + */ + private String content; + + /** + * 操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settop;下线文章:offline;修改文章发布范围:updatepublishrange + */ + private String opType; + + /** + * 操作时间 + */ + private Date opTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java new file mode 100644 index 0000000000..1aac103337 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.voice; + +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-17 + */ +@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; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String publishStatus; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java new file mode 100644 index 0000000000..be590e8b19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.voice; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@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/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java new file mode 100644 index 0000000000..630b9e2685 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.voice; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@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/data-statistical/data-statistical-server/src/main/java/com/epmet/properties/DatasourceProperties.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/properties/DatasourceProperties.java new file mode 100644 index 0000000000..21d3665add --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/properties/DatasourceProperties.java @@ -0,0 +1,67 @@ +package com.epmet.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.List; + +/** + * 数据源属性 + */ +@Data +@ConfigurationProperties(prefix = "stats") +public class DatasourceProperties { + + private List datasources; + + /** + * 数据源配置内部类 + */ + public static class DatasourceInfo { + private String name; + private String driverClassName; + private String url; + private String username; + private String password; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDriverClassName() { + return driverClassName; + } + + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/properties/ThreadProperties.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/properties/ThreadProperties.java new file mode 100644 index 0000000000..aaec7cb719 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/properties/ThreadProperties.java @@ -0,0 +1,25 @@ +package com.epmet.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 线程池属性类 + */ +@ConfigurationProperties(prefix = "thread") +@Data +public class ThreadProperties { + + private ThreadPoolProperties threadPool; + + @Data + public static class ThreadPoolProperties { + private int corePoolSize; + private int maxPoolSize; + private int queueCapacity; + private int keepAlive; + + public ThreadPoolProperties() { + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java new file mode 100644 index 0000000000..c6b8a8bee0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -0,0 +1,111 @@ +package com.epmet.service.Issue; + +import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.entity.issue.IssueEntity; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 16:01 + */ +public interface IssueService { + /** + * 获取以组织为单位议题统计结果 + * @author zhaoqifeng + * @date 2020/6/17 16:04 + * @param customerId + * @return java.util.List + */ + List getAgencyIssueTotal(String customerId); + + /** + * 获取当前日期组织下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyIssueInc(String customerId, String date); + + /** + * 获取截止当前日期组织下已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyClosedIssueTotal(String customerId, String date); + + /** + * 获取当前日期组织下已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyClosedIssueInc(String customerId, String date); + + /** + * @param customerId + * @return + * @Author sun + * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 + **/ + List getGridProjectList(String customerId); + + /** + * 获取以网格为单位议题统计结果 + * @author zhaoqifeng + * @date 2020/6/19 14:34 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridIssueTotal(String customerId, String date); + + /** + * 获取当前日期网格下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridIssueInc(String customerId, String date); + + /** + * 获取截止当前日期网格下已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedIssueTotal(String customerId, String date); + + /** + * 获取当前日期网格下已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedIssueInc(String customerId, String date); + + /** + * 获取议题项目关系 + * @author zhaoqifeng + * @date 2020/6/19 17:40 + * @param customerId + * @return java.util.List + */ + List getIssueProjectList(String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java new file mode 100644 index 0000000000..9cef7c5340 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -0,0 +1,103 @@ +package com.epmet.service.Issue.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.issue.StatsIssueDao; +import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.entity.issue.IssueEntity; +import com.epmet.service.Issue.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 16:02 + */ +@Service +@DataSource(DataSourceConstant.GOV_ISSUE) +public class IssueServiceImpl implements IssueService { + + @Autowired + private StatsIssueDao statsIssueDao; + + @Override + public List getAgencyIssueTotal(String customerId) { + List list = statsIssueDao.selectAgencyIssueTotal(customerId); + list.forEach(dto -> { + String[] pIds = dto.getPIds().split(":"); + dto.setPId(pIds[pIds.length - 2]); + }); + return list; + } + + @Override + public List getAgencyIssueInc(String customerId, String date) { + List list = statsIssueDao.selectAgencyIssueInc(customerId, date); + list.forEach(dto -> { + String[] pIds = dto.getPIds().split(":"); + dto.setPId(pIds[pIds.length - 2]); + }); + return list; + } + + @Override + public List getAgencyClosedIssueTotal(String customerId, String date) { + List list = statsIssueDao.selectAgencyClosedIssueTotal(customerId, date); + list.forEach(dto -> { + String[] pIds = dto.getPIds().split(":"); + dto.setPId(pIds[pIds.length - 2]); + }); + return list; + } + + @Override + public List getAgencyClosedIssueInc(String customerId, String date) { + List list = statsIssueDao.selectAgencyClosedIssueInc(customerId, date); + list.forEach(dto -> { + String[] pIds = dto.getPIds().split(":"); + dto.setPId(pIds[pIds.length - 2]); + }); + return list; + } + + /** + * @param customerId + * @return + * @Author sun + * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 + **/ + @Override + public List getGridProjectList(String customerId) { + return statsIssueDao.selectGridProjectList(customerId); + } + + @Override + public List getGridIssueTotal(String customerId, String date) { + return statsIssueDao.selectGridIssueTotal(customerId, date); + } + + @Override + public List getGridIssueInc(String customerId, String date) { + return statsIssueDao.selectGridIssueInc(customerId, date); + } + + @Override + public List getGridClosedIssueTotal(String customerId, String date) { + return statsIssueDao.selectGridClosedIssueTotal(customerId, date); + } + + @Override + public List getGridClosedIssueInc(String customerId, String date) { + return statsIssueDao.selectGridClosedIssueInc(customerId, date); + } + + @Override + public List getIssueProjectList(String customerId) { + return statsIssueDao.selectIssueProjectList(customerId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java new file mode 100644 index 0000000000..e03d5844ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java @@ -0,0 +1,14 @@ +package com.epmet.service; + +import com.epmet.dto.AgencySubTreeDto; + +import java.util.List; + +public interface StatsDemoService { + + void testTx(); + Boolean testThreadPool(); + void testThreadPoolAsync(); + + List getAllAgency(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java new file mode 100644 index 0000000000..1e2f05991b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java @@ -0,0 +1,13 @@ +package com.epmet.service; + + +public interface StatsDimService { + + void initGridDim(); + + void initAgencyDim(); + + void initCustomerDim(); + + void initDepartmentDim(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java new file mode 100644 index 0000000000..b3444d34d4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -0,0 +1,29 @@ +package com.epmet.service; + +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/6/16 14:14 + */ +public interface StatsGroupService { + + /** + * @Description 统计 “小组” 有关数据, dim:【网格-日】 + * @author zxc + */ + void groupGridDaily(Date date); + + /** + * @Description 统计 “小组” 有关数据, dim:【机关-日】 + * @author zxc + */ + void groupAgencyDaily(Date date); + + /** + * @Description 统计 “小组” 有关数据, dim:【机关-月】 + * @author zxc + */ + void groupAgencyMonthly(Date date); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java new file mode 100644 index 0000000000..5d0e6b4292 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -0,0 +1,59 @@ +package com.epmet.service; + +import java.util.Date; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 16:51 + */ +public interface StatsIssueService { + /** + * 机关和网格议题统计 + * @author zhaoqifeng + * @date 2020/6/22 10:58 + * @param + * @return void + */ + void agencyGridIssueStats(); + + /** + * 机关下议题日统计 + * @author zhaoqifeng + * @date 2020/6/17 16:53 + * @param customerId + * @param date + * @return void + */ + void saveIssueAgencyDaily(String customerId, Date date); + + /** + * 机关下议题月统计 + * @author zhaoqifeng + * @date 2020/6/18 17:39 + * @param customerId + * @param date + * @return void + */ + void saveIssueAgencyMonthly(String customerId, Date date); + + /** + * 机关下网格议题日统计 + * @author zhaoqifeng + * @date 2020/6/19 13:53 + * @param customerId + * @param date + * @return void + */ + void saveIssueGridDaily(String customerId, Date date); + + /** + * 机关下网格议题月统计 + * @author zhaoqifeng + * @date 2020/6/19 13:53 + * @param customerId + * @param date + * @return void + */ + void saveIssueGridMonthly(String customerId, Date date); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java new file mode 100644 index 0000000000..739e69a780 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -0,0 +1,20 @@ +package com.epmet.service; + +/** + * 数据统计-项目 + * @author sun + */ +public interface StatsProjectService { + + /** + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + void agencyProjectStats(); + + /** + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + void gridProjectStats(); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java new file mode 100644 index 0000000000..772d48e788 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -0,0 +1,74 @@ +package com.epmet.service; + + +import java.util.Date; + +public interface StatsPublicityService { + /** + * desc: 统计宣传能力的汇总信息 + * + * @return: Boolean + * @date: 2020/6/17 16:11 + * @author: jianjun liu + */ + Boolean articleSummaryDailyStatsjob(Date statsDate); + + /** + * desc: 按日 统计每个标签被引用的使用文章数 + * + * @return: Boolean + * @date: 2020/6/17 16:11 + * @author: jianjun liu + */ + Boolean tagUsedDailyStatsjob(Date statsDate); + + /** + * desc: 按月 统计每个标签被引用的使用文章数 + * + * @param + * @return: + * @date: 2020/6/19 18:44 + * @author: jianjun liu + */ + Boolean tagUsedMonthlyStatsjob(Date statsDate); + + /** + * desc: 按季年统计标签被使用次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagUsedQuarterlyStatsjob(Date statsDate); + + /** + * desc: 按日 统计每个标签的阅读数 + * + * @param statsDate + * @return: Boolean + * @date: 2020/6/20 8:40 + * @author: jianjun liu + */ + Boolean tagViewedDailyStatsjob(Date statsDate); + + /** + * desc: 按月统计标签被查看次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagViewedMonthlyStatsjob(Date statsDate); + + /** + * desc: 按季年统计标签被查看次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagViewedQuarterlyStatsjob(Date statsDate); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java new file mode 100644 index 0000000000..847a7d9923 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java @@ -0,0 +1,8 @@ +package com.epmet.service; + +import java.util.Date; + +public interface StatsTopicService { + + void partition(Date date); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java new file mode 100644 index 0000000000..7e98b2178f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java @@ -0,0 +1,8 @@ +package com.epmet.service; + +import java.util.Date; + +public interface StatsUserService { + + void partition(Date date); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java new file mode 100644 index 0000000000..e562a08365 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java @@ -0,0 +1,12 @@ +package com.epmet.service.crm; + +import com.epmet.entity.crm.CustomerEntity; + +import java.util.Date; +import java.util.List; + +public interface CustomerService { + + List listValidCustomersByCreateTime(Date createTimeFrom, Date createTimeTo); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java new file mode 100644 index 0000000000..3db2f197bd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java @@ -0,0 +1,25 @@ +package com.epmet.service.crm.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.crm.CustomerDao; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.service.crm.CustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +@DataSource(DataSourceConstant.OPER_CRM) +public class CustomerServiceImpl implements CustomerService { + + @Autowired + private CustomerDao customerDao; + + @Override + public List listValidCustomersByCreateTime(Date createTimeFrom, Date createTimeTo) { + return customerDao.listValidCustomersByCreateTime(createTimeFrom, createTimeTo); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java new file mode 100644 index 0000000000..a6d61a756e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -0,0 +1,58 @@ +package com.epmet.service.group; + +import com.epmet.dto.group.result.*; +import com.epmet.util.DimIdGenerator; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/16 13:22 + */ +public interface GroupDataService { + + /** + * @Description 统计 “小组” 有关数据, dim:【网格-日】 + * @param customerId + * @author zxc + */ + List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimIdBean, List gridsInfo); + + /** + * @Description 获取同级机关下网格下的小组数量 + * @param allGrid + * @author zxc + */ + List getAgencyGroupTotalCount(List allGrid,String dateId); + + /** + * @Description 查询机关下网格内的小组人数 + * @param + * @author zxc + */ + List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId); + + /** + * @Description 查询机关下每个小组的人数 + * @param + * @author zxc + */ + List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId); + + /** + * @Description 查询机关下的小组日增数 + * @param + * @param yesterday + * @author zxc + */ + List selectAgencyGroupIncr(List allGrid,String yesterday); + + /** + * @Description 查询机关下所有网格小组人数 + * @param gridIds + * @author zxc + */ + List getAgencyGrid(@Param("gridIds") List gridIds); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java new file mode 100644 index 0000000000..1cdc3acdcf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -0,0 +1,195 @@ +package com.epmet.service.group.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.group.GroupDataDao; +import com.epmet.dto.group.form.GridGroupPeopleFormDTO; +import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; +import com.epmet.dto.group.form.GridGroupTotalFormDTO; +import com.epmet.dto.group.form.GroupIncrFormDTO; +import com.epmet.dto.group.result.*; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.service.group.GroupDataService; +import com.epmet.util.DimIdGenerator; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @CreateTime 2020/6/16 13:23 + */ +@Service +@DataSource(DataSourceConstant.RESI_GROUP) +public class GroupDataServiceImpl implements GroupDataService { + + @Autowired + private GroupDataDao groupDataDao; + + /** + * @Description 统计 “小组” 有关数据, dim:【网格-日】 + * @param customerId + * @author zxc + */ + @Override + public List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimTime, List gridsInfo) { + List result = new ArrayList<>(); + if (gridsInfo.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + String dateId = dimTime.getDateId(); + gridsInfo.forEach(grid -> { + GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); + BeanUtils.copyProperties(dimTime,dailyResult); + dailyResult.setAgencyId(grid.getAgencyId()); + dailyResult.setGridId(grid.getGridId()); + dailyResult.setCustomerId(customerId); + result.add(dailyResult); + }); + + // 1. 网格下有多少小组,只算 state = ‘approved’ + GridGroupTotalFormDTO formDTO = new GridGroupTotalFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setDateId(dateId); + List gridGroupTotalResultDTOS = groupDataDao.selectGridGroupTotal(formDTO); + if (gridGroupTotalResultDTOS.size() == NumConstant.ZERO){ + result.forEach(grid -> { + grid.setGroupTotal(NumConstant.ZERO); + }); + }else { + result.forEach(grid -> { + gridGroupTotalResultDTOS.forEach(groupTotal -> { + if (grid.getGridId().equals(groupTotal.getGridId())) { + grid.setGroupTotal(groupTotal.getGridGroupTotal()); + } + }); + + }); + } + // 2. 网格下所有组内人数和(不需要去重) 人员状态 != "removed" + GridGroupPeopleTotalFormDTO peopleTotalFormDTO = new GridGroupPeopleTotalFormDTO(); + peopleTotalFormDTO.setCustomerId(customerId); + peopleTotalFormDTO.setDateId(dateId); + List gridGroupPeopleTotalResultDTOS = groupDataDao.selectGridGroupPeopleTotal(peopleTotalFormDTO); + result.forEach(grid -> { + gridGroupPeopleTotalResultDTOS.forEach(groupPeopleTotal -> { + if (grid.getGridId().equals(groupPeopleTotal.getGridId())){ + grid.setGroupMemberTotal(groupPeopleTotal.getGridGroupPeopleTotal()); + } + }); + }); + // 3. 网格下小组平均人数 + result.forEach(grid -> { + grid.setGroupMemberAvgCount(grid.getGroupTotal() == NumConstant.ZERO ? NumConstant.ZERO : grid.getGroupMemberTotal()/grid.getGroupTotal()); + }); + // 4. 网格下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID + GridGroupPeopleFormDTO everyGroupPeople = new GridGroupPeopleFormDTO(); + everyGroupPeople.setCustomerId(customerId); + everyGroupPeople.setDateId(dateId); + List everyGroupPeopleCount = groupDataDao.selectEveryGroupPeopleCount(everyGroupPeople); + Map> collect = everyGroupPeopleCount.stream().collect(Collectors.groupingBy(every -> every.getGridId())); + Set>> entries = collect.entrySet(); + entries.forEach(everyGroup -> { + List value = everyGroup.getValue(); + List groupPeopleSorted = value.stream().sorted(Comparator.comparing(GridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); + Integer groupPeopleMedian = groupPeopleSorted.size() % 2 == 0 ? + (groupPeopleSorted.get(groupPeopleSorted.size() / 2 - 1).getGroupCount() + groupPeopleSorted.get(groupPeopleSorted.size() / 2).getGroupCount()) / 2 : + groupPeopleSorted.get(groupPeopleSorted.size() / 2).getGroupCount(); + result.forEach(grid -> { + if (groupPeopleSorted.get(0).getGridId().equals(grid.getGridId())){ + grid.setGroupMedian(groupPeopleMedian);//中位数 + //网格下小组成员最大数 + grid.setGroupMemberMaxCount(groupPeopleSorted.get(NumConstant.ZERO).getGroupCount()); + //最多成员小组ID + grid.setMaxMemberGroupId(groupPeopleSorted.get(NumConstant.ZERO).getGroupId()); + //网格下小组成员最小数 + grid.setGroupMemberMinCount(groupPeopleSorted.get(groupPeopleSorted.size()-NumConstant.ONE).getGroupCount()); + //最少成员小组ID + grid.setMinMemberGroupId(groupPeopleSorted.get(groupPeopleSorted.size()-NumConstant.ONE).getGroupId()); + } + }); + }); + // 5. 网格下小组增量 + GroupIncrFormDTO groupIncr = new GroupIncrFormDTO(); + groupIncr.setCustomerId(customerId); + groupIncr.setDateId(dateId); + List groupIncrResult = groupDataDao.selectGroupIncr(groupIncr); + result.forEach(grid -> { + groupIncrResult.forEach(gridIncr -> { + if (grid.getGridId().equals(gridIncr.getGridId())){ + grid.setGroupIncr(gridIncr.getGroupIncr()); + } + }); + }); + return result; + } + + /** + * @Description 获取同级机关下网格下的小组数量 + * @param + * @author zxc + */ + public List getAgencyGroupTotalCount(List allGrid,String dateId){ + if (allGrid.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.getAgencyGroupTotalCount(allGrid,dateId); + } + + /** + * @Description 查询机关下网格内的小组人数 + * @param + * @author zxc + */ + @Override + public List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId) { + if (allGrid.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.selectAgencyGridGroupPeopleTotal(allGrid,dateId); + } + + /** + * @Description 查询机关下每个小组的人数 + * @param + * @author zxc + */ + public List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId){ + if (allGrid.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.selectAgencyEveryGroupPeopleCount(allGrid,dateId); + } + + /** + * @Description 查询机关下的小组日增数 + * @param + * @param dateId + * @author zxc + */ + public List selectAgencyGroupIncr(List allGrid,String dateId){ + if (allGrid.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.selectAgencyGroupIncr(allGrid, dateId); + } + + /** + * @Description 查询机关下所有网格小组人数 + * @param gridIds + * @author zxc + */ + @Override + public List getAgencyGrid(List gridIds) { + if (gridIds.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.getAgencyGrid(gridIds); + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java new file mode 100644 index 0000000000..a549215ccd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -0,0 +1,63 @@ +package com.epmet.service.impl; + +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.service.StatsDemoService; +import com.epmet.service.org.DemoGovOrgService; +import com.epmet.service.stats.DemoDataStatsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 独立于任何具体数据源外层的service + */ +@Service +public class StatsDemoServiceImpl implements StatsDemoService { + + @Autowired + private DemoGovOrgService demoGovOrgService; + + @Autowired + private DemoDataStatsService demoDataStatsService; + + //该service不加事务 + //@Transactional(rollbackFor = Exception.class) + @Override + public void testTx() { + demoDataStatsService.testTx(); + } + + @Override + public Boolean testThreadPool() { + try { + Thread.sleep(2000l); + } catch (InterruptedException e) { + System.err.println("睡眠发生异常"); + e.printStackTrace(); + } + return true; + } + + /** + * 推荐 + */ + @Async //注意此处注解 + @Override + public void testThreadPoolAsync() { + try { + Thread.sleep(2000l); + System.out.println(LocalDateTime.now().getSecond()); + } catch (InterruptedException e) { + System.err.println("睡眠发生异常"); + e.printStackTrace(); + } + } + + @Override + public List getAllAgency(){ + return demoGovOrgService.getAllAgency(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java new file mode 100644 index 0000000000..ff97cf767b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -0,0 +1,162 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.entity.org.CustomerDepartmentEntity; +import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.LastExecRecordEntity; +import com.epmet.service.StatsDimService; +import com.epmet.service.crm.CustomerService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerDepartmentService; +import com.epmet.service.org.CustomerGridService; +import com.epmet.service.stats.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class StatsDimServiceImpl implements StatsDimService { + + @Autowired + private DimGridService dimGridService; + + @Autowired + private DimAgencyService dimAgencyService; + + @Autowired + private CustomerGridService customerGridService; + + @Autowired + private LastExecRecordService lastExecRecordService; + + @Autowired + private CustomerAgencyService customerAgencyService; + + @Autowired + private CustomerService customerService; + + @Autowired + private DimCustomerService dimCustomerService; + + @Autowired + private CustomerDepartmentService departmentService; + + @Autowired + private DimDepartmentService dimDepartmentService; + + @Override + public void initGridDim() { + DimGridEntity lastCreatedGridDim = dimGridService.getLastCreatedGridDim(); + List grids; + if (lastCreatedGridDim == null) { + // 首次初始化 + grids = customerGridService.listGridsByCreateTime(null, null); + } else { + // 非首次初始化 + // 结束时间边界与开始时间边界,包含开始时间不包含结束时间。结束时间可以为空,则查询从开始时间往后的所有新创建网格 + Date startTimeBorder = DateUtils.parse(DateUtils.format(lastCreatedGridDim.getCreatedTime(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD); + Date endTimeBorder = DateUtils.parse(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD); + + grids = customerGridService.listGridsByCreateTime(startTimeBorder, endTimeBorder); + } + + List gridDims = convertCustomerGrid2GridDim(grids); + if (!CollectionUtils.isEmpty(gridDims)) { + dimGridService.initGridDims(gridDims); + } + } + + /** + * 将网格信息转换成网格维度信息 + * @param grids + * @return + */ + private List convertCustomerGrid2GridDim(List grids) { + return grids.stream().map(grid -> { + DimGridEntity dimGrid = new DimGridEntity(); + dimGrid.setAgencyId(grid.getPid()); + dimGrid.setAreaCode(grid.getAreaCode()); + dimGrid.setCustomerId(grid.getCustomerId()); + dimGrid.setGridName(grid.getGridName()); + dimGrid.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dimGrid.setId(grid.getId()); + dimGrid.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + return dimGrid; + }).collect(Collectors.toList()); + } + + /** + * 初始化机关单位维度 + */ + @Override + public void initAgencyDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_AGENCY); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_AGENCY); + } + + Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsStartTime = null; + if (lastExecRecord.getExecTime() != null) { + statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + + List agencies = customerAgencyService.listAgenciesByCreateTime(statsStartTime, statsEndTime); + if (!CollectionUtils.isEmpty(agencies)) { + dimAgencyService.initAgencyDims(agencies); + } + } + + /** + * 初始化网格维度 + */ + @Override + public void initCustomerDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_CUSTOMER); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_CUSTOMER); + } + + Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsStartTime = null; + if (lastExecRecord.getExecTime() != null) { + statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + + List customers = customerService.listValidCustomersByCreateTime(statsStartTime, statsEndTime); + if (!CollectionUtils.isEmpty(customers)) { + dimCustomerService.initCustomerDims(customers); + } + } + + @Override + public void initDepartmentDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_DEPARTMENT); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_DEPARTMENT); + } + + Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsStartTime = null; + if (lastExecRecord.getExecTime() != null) { + statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + + List departments = departmentService.listDepartmentsByCreatedTime(statsStartTime, statsEndTime); + if (!CollectionUtils.isEmpty(departments)) { + dimDepartmentService.initDepartmentDims(departments); + lastExecRecord.setExecTime(new Date()); + // 记录最后一次统计时间 + lastExecRecordService.updateById(lastExecRecord); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java new file mode 100644 index 0000000000..7eba9840e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -0,0 +1,292 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.GroupConstant; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.group.result.*; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.service.StatsGroupService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerGridService; +import com.epmet.service.stats.*; +import com.epmet.util.DimIdGenerator; +import com.epmet.util.ModuleConstant; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @CreateTime 2020/6/16 14:14 + */ +@Service +@Slf4j +public class StatsGroupServiceImpl implements StatsGroupService { + + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private GroupDataService groupDataService; + @Autowired + private FactGroupGridDailyService factGroupGridDailyService; + @Autowired + private FactGroupAgencyDailyService factGroupAgencyDailyService; + @Autowired + private FactGroupAgencyMonthlyService factGroupAgencyMonthlyService; + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private CustomerGridService customerGridService; + + /** + * @Description 统计【网格-日】 + * @param + * @author zxc + */ + @Override + public void groupGridDaily(Date date) { + Integer pageNo = NumConstant.ONE; + Integer pageSize = NumConstant.ONE_HUNDRED; + List customerIds; + do { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + if (customerIds.size() != NumConstant.ZERO){ + customerIds.forEach(customerId -> { + try { + List gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId()); + List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); + } catch (Exception e) { + log.error(String.format(GroupConstant.STATS_FAILED_GRID_DAILY,customerId,LocalDate.now(),e)); + } + }); + } + + }while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); + } + + /** + * @Description 统计 “小组” 有关数据, dim:【机关-日】 + * @author zxc + */ + @Override + public void groupAgencyDaily(Date date) { + Integer pageNo = NumConstant.ONE; + Integer pageSize = NumConstant.ONE_HUNDRED; + List customerIds; + do { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo++,pageSize); + if (customerIds.size() != NumConstant.ZERO){ + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + customerIds.forEach(customerId -> { + try { + List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); + } catch (Exception e) { + log.error(String.format(GroupConstant.STATS_FAILED_AGENCY_DAILY,customerId,LocalDate.now(),e)); + } + }); + } + }while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); + } + + /** + * @Description 统计 “小组” 有关数据, dim:【机关-月】 + * @author zxc String customerId + */ + @Override + public void groupAgencyMonthly(Date date) { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + String monthId = dimIdBean.getMonthId(); + List lastDayAgency = factGroupAgencyDailyService.getLastDayAgency(monthId); + List monthGroupIncr = factGroupAgencyDailyService.getMonthGroupIncr(monthId); + if (monthGroupIncr.size() == NumConstant.ZERO){ + lastDayAgency.forEach(agency -> { + agency.setGroupIncr(NumConstant.ZERO); + }); + }else { + lastDayAgency.forEach(agency -> { + monthGroupIncr.forEach(monthIncr -> { + if (agency.getAgencyId().equals(monthIncr.getAgencyId())){ + agency.setGroupIncr(monthIncr.getMonthGroupIncr()); + } + }); + }); + } + factGroupAgencyMonthlyService.insertAgencyGroupMonthly(lastDayAgency); + } + + public List getAgencyGroupDaily(List customerAgencyInfos, DimIdGenerator.DimIdBean timeDim,String customerId){ + if (customerAgencyInfos.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + List result = new ArrayList<>(); + String dateId = timeDim.getDateId(); + List agencyList = dimAgencyService.getAgencyListByCustomerId(customerId); + agencyList.forEach(agency -> { + AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); + String agencyId = agency.getId(); + agencyResult.setAgencyId(agencyId); + agencyResult.setCustomerId(customerId); + BeanUtils.copyProperties(timeDim,agencyResult); + //机关下的所有网格(包括直属网格) + List allGrid = this.getAllGrid(agencyId); + String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); + agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); + // TODO 1. 机关下有多少网格 + List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); + AtomicReference gridSize = new AtomicReference<>(0); + if (customerGridIdList.size() != NumConstant.ZERO){ + customerGridIdList.forEach(gridId -> { + allGrid.forEach(allAgencyGrid -> { + if (gridId.getGridId().equals(allAgencyGrid)){ + gridSize.updateAndGet(v -> v + NumConstant.ONE); + } + }); + }); + agencyResult.setGridTotal(gridSize.get()); + }else { + agencyResult.setGridTotal(NumConstant.ZERO); + } + + // TODO 2. 机关下有多少小组,只算 state = ‘approved’ + List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid,dateId); + Integer groupCount = agencyGroupTotalCount.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); + agencyResult.setGroupTotalCount(groupCount); + // TODO 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" + List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid,dateId); + Integer groupPeopleCount = agencyGridGroupPeopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); + agencyResult.setGroupMemberTotalCount(groupPeopleCount); + + // TODO 4. 机关下小组平均人数 + agencyResult.setGroupMemberAvgCount( + agencyResult.getGroupTotalCount() == NumConstant.ZERO ? NumConstant.ZERO : + agencyResult.getGroupMemberTotalCount()/agencyResult.getGroupTotalCount()); + + // TODO 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID + List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid,dateId); + List sorted = agencyGridGroupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); + Integer groupPeopleMedian; + if (sorted.size() == NumConstant.ONE){ + agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMinMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + }else if (sorted.size() >= NumConstant.TWO){ + groupPeopleMedian = sorted.size() % NumConstant.TWO == NumConstant.ZERO ? + (sorted.get(sorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : + sorted.get(sorted.size() / NumConstant.TWO).getGroupCount(); + agencyResult.setGroupMedian(groupPeopleMedian); + + agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + agencyResult.setGroupMemberMinCount(sorted.get(sorted.size() - NumConstant.ONE).getGroupCount()); + agencyResult.setMinMemberGroupId(sorted.get(sorted.size() - NumConstant.ONE).getGroupId()); + } + // TODO 6. 机关下小组增量 + List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, dateId); + Integer groupIncr = agencyGroupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr)); + agencyResult.setGroupIncr(groupIncr); + result.add(agencyResult); + }); + return result; + } + + /** + * @Description 根据当前机关ID,查询出直属网格和所有下级机关的网格 + * @param agencyId + * @author zxc + */ + public List getAllGrid(String agencyId){ + List result = new ArrayList<>(); + List allAgency = dimAgencyService.getAllAgency(null); + + Map> subGridOfAgency = new HashMap<>(); + allAgency.forEach(agency -> { + this.initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); + }); + Set>> entries = subGridOfAgency.entrySet(); + entries.forEach(entry -> { + String key = entry.getKey(); + Set value = entry.getValue(); + if (key.equals(agencyId)){ + result.addAll(value); + } + }); + return result; + } + + /** + * @Description 递归获取机关下的网格id【包括直属机关】 + * @param pid + * @param agency + * @param subGridOfAgency + * @author zxc + */ + void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map> subGridOfAgency){ + + //向map中放入数据 + if(subGridOfAgency.containsKey(pid)){ + //包含key + Set grids = subGridOfAgency.get(pid); + if(null == grids){ + grids = new HashSet<>(); + subGridOfAgency.put(pid,grids); + } + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + grids.addAll(agency.getGridIds()); + } + }else{ + //不包含key + Set grids = new HashSet<>(agency.getGridIds()); + subGridOfAgency.put(pid,grids); + } + + //定义递归出口 + if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){ + return ; + } + + + //定义递归入口 + agency.getSubAgencies().forEach(obj -> { + initAgencyGridMap(pid,obj,subGridOfAgency); + }); + } + + /** + * @Description 获取时间维度 dateId--weekId--monthId--quarterId--yearId + * 如果有自定义时间,根据自定义时间获取时间维度 + * 没有自定义时间,默认获取前一天的时间维度 + * @param + * @author zxc + */ + public DimIdGenerator.DimIdBean getDimIdBean(Date date){ + if (date != null){ + return DimIdGenerator.getDimIdBean(date); + } + ZoneId zoneId = ZoneId.systemDefault(); + LocalDate localDate = LocalDate.now().minusDays(NumConstant.ONE); + ZonedDateTime zdt = localDate.atStartOfDay(zoneId); + Date result = Date.from(zdt.toInstant()); + return DimIdGenerator.getDimIdBean(result); + } + + public List getAgencyAllGrid(String customerId,String agencyId){ + + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java new file mode 100644 index 0000000000..ab38ff305a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -0,0 +1,1009 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.IssueConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.*; +import com.epmet.service.Issue.IssueService; +import com.epmet.service.StatsIssueService; +import com.epmet.service.project.ProjectService; +import com.epmet.service.stats.*; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 16:51 + */ +@Slf4j +@Service +public class StatsIssueServiceImpl implements StatsIssueService { + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private IssueService issueService; + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private DimGridService dimGridService; + @Autowired + private ProjectService projectService; + @Autowired + private FactIssueAgencyDailyService factIssueAgencyDailyService; + @Autowired + private FactIssueAgencyMonthlyService factIssueAgencyMonthlyService; + @Autowired + private FactIssueGridDailyService factIssueGridDailyService; + @Autowired + private FactIssueGridMonthlyService factIssueGridMonthlyService; + + @Override + public void agencyGridIssueStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + try { + customerStats(customerId, date); + } catch(Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", DateUtils.format(date), e.getMessage())); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + /** + * 一个客户一个线程, 分别统计机关日/月数据和网格日/月数据 + * @author zhaoqifeng + * @date 2020/6/22 11:03 + * @param customerId + * @return void + */ + private void customerStats(String customerId, Date date) { + //机关议题日统计 + saveIssueAgencyDaily(customerId, date); + //机关议题月统计 + saveIssueAgencyMonthly(customerId, date); + //网格议题日统计 + saveIssueGridDaily(customerId, date); + //网格议题月统计 + saveIssueGridMonthly(customerId, date); + } + + @Override + public void saveIssueAgencyDaily(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueAgencyDailyService.deleteByCustomerId(customerId, dimId.getDateId()); + //获取当前客户下所有机关 + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + //获取机关下议题各种状态的数目统计 + List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId); + //获取机关下议题各种状态的数目增量 + List issueAgencyIncList = issueService.getAgencyIssueInc(customerId, dateString); + //获取机关下已关闭议题统计 + List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); + //获取机关下已关闭议题增量 + List issueAgencyClosedIncList = issueService.getAgencyClosedIssueInc(customerId, dateString); + //已结案项目统计 + List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); + //已结案项目增量 + List projectAgencyClosedIncList = projectService.getAgencyClosedProjectInc(customerId, dateString); + + List list = new ArrayList<>(); + for (DimAgencyDTO agency : agencyList) { + FactIssueAgencyDailyEntity entity = initIssueAgencyDaily(dimId); + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + + String pIds; + if (null == agency.getPids() || agency.getPids().isEmpty()) { + pIds = agency.getPid().concat(":").concat(agency.getId()); + } else { + pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId()); + } + //总量统计 + saveTotal(issueAgencyTotalList, agency, entity, pIds); + //增量统计 + saveInc(issueAgencyIncList, agency, entity, pIds); + //已关闭议题已解决未解决统计 + if (entity.getClosedTotal() > NumConstant.ZERO) { + saveClosedTotal(issueAgencyClosedTotalList, agency, entity, pIds); + //已关闭议题已解决未解决增量统计 + if (entity.getClosedIncr() > NumConstant.ZERO) { + saveClosedInc(issueAgencyClosedIncList, agency, entity, pIds); + } + } + //已关闭项目已解决未解决统计 + if (entity.getShiftProjectTotal() > NumConstant.ZERO) { + saveClosedProjectTotal(projectAgencyClosedTotalList, agency, entity, pIds); + //已关闭项目已解决未解决增量统计 + if (entity.getClosedCaseTotal() > NumConstant.ZERO) { + saveClosedProjectInc(projectAgencyClosedIncList, agency, entity, pIds); + } + } + list.add(entity); + } + //批量插入 + factIssueAgencyDailyService.saveList(list); + } + + @Override + public void saveIssueAgencyMonthly(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueAgencyMonthlyService.deleteByCustomerId(customerId, dimId.getMonthId()); + //获取当前客户下所有机关 + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + //获取机关下议题各种状态的数目统计 + List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId); + //获取机关下已关闭议题统计 + List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); + //已结案项目统计 + List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); + //统计机关下议题各个指标月度增量 + List issueAgencyMonthlyIncList = factIssueAgencyMonthlyService.getAgencyMonthlyInc(customerId, dimId.getMonthId()); + List list = new ArrayList<>(); + for (DimAgencyDTO agency : agencyList) { + FactIssueAgencyDailyEntity daily = initIssueAgencyDaily(dimId); + FactIssueAgencyMonthlyEntity monthly = initIssueAgencyMonthly(dimId); + + String pIds; + if (null == agency.getPids() || agency.getPids().isEmpty()) { + pIds = agency.getPid().concat(":").concat(agency.getId()); + } else { + pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId()); + } + //总量统计 + saveTotal(issueAgencyTotalList, agency, daily, pIds); + //已关闭议题已解决未解决统计 + if (daily.getClosedTotal() > NumConstant.ZERO) { + saveClosedTotal(issueAgencyClosedTotalList, agency, daily, pIds); + } + //已关闭项目已解决未解决统计 + if (daily.getShiftProjectTotal() > NumConstant.ZERO) { + saveClosedProjectTotal(projectAgencyClosedTotalList, agency, daily, pIds); + } + monthly = ConvertUtils.sourceToTarget(daily, FactIssueAgencyMonthlyEntity.class); + //各指标增量统计 + for (int i = 0; i < issueAgencyMonthlyIncList.size(); i++) { + FactIssueAgencyMonthlyDTO dto = issueAgencyMonthlyIncList.get(i); + if (agency.getId().equals(dto.getAgencyId())) { + monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); + monthly.setClosedIncr(dto.getClosedIncr()); + monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); + monthly.setClosedUnresolvedIncr(dto.getClosedUnresolvedIncr()); + monthly.setClosedCaseIncr(dto.getClosedCaseIncr()); + monthly.setClosedCaseResolvedIncr(dto.getClosedCaseResolvedIncr()); + monthly.setClosedCaseUnresolvedIncr(dto.getClosedCaseUnresolvedIncr()); + issueAgencyMonthlyIncList.remove(i); + break; + } + } + monthly.setCustomerId(agency.getCustomerId()); + monthly.setAgencyId(agency.getId()); + monthly.setPid(agency.getPid()); + + list.add(monthly); + } + //批量插入 + factIssueAgencyMonthlyService.saveList(list); + } + + @Override + public void saveIssueGridDaily(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueGridDailyService.deleteByCustomerId(customerId, dimId.getDateId()); + //获取客户下所有网格数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + //获取网格下议题各种状态的数目统计 + List gridTotalList = issueService.getGridIssueTotal(customerId, dateString); + //获取网格下议题各种状态的增量统计 + List gridIncList = issueService.getGridIssueInc(customerId, dateString); + //获取网格下已关闭议题各种状态的数目统计 + List gridClosedTotalList = issueService.getGridClosedIssueTotal(customerId, dateString); + //获取网格下已关闭议题各种状态的增量统计 + List gridClosedIncList = issueService.getGridClosedIssueInc(customerId, dateString); + //项目议题关系 + List issueProjectList = issueService.getIssueProjectList(customerId); + //已结案项目统计 + List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); + //已结案项目增量 + List closedProjectIncList = projectService.getGridClosedProjectTotal(customerId, dateString); + + Map resolveMap= new HashMap<>(); + Map unResolveMap = new HashMap<>(); + Map resolveIncMap = new HashMap<>(); + Map unResolveIncMap = new HashMap<>(); + if (null != issueProjectList) { + List totalList = issueProjectList.stream().flatMap(ip -> + closedProjectTotalList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> totalMap = + totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveList = totalMap.get(IssueConstant.RESLOVED); + List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); + if (null != resolveList) { + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveList) { + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } + List incList = issueProjectList.stream().flatMap(ip -> + closedProjectIncList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> incMap = + incList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveIncList = incMap.get(IssueConstant.RESLOVED); + List unResolveIncList = incMap.get(IssueConstant.UNRESLOVED); + if (null != resolveIncList) { + resolveIncMap = resolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveIncList) { + unResolveIncMap = unResolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } + } + + List list = new ArrayList<>(); + + for (DimGridEntity grid : gridList) { + FactIssueGridDailyEntity entity = initIssueGridDaily(dimId); + entity.setCustomerId(grid.getCustomerId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + //总量统计 + saveGridTotal(gridTotalList, grid, entity); + //增量统计 + saveGridInc(gridIncList, grid, entity); + + if (entity.getClosedTotal() > NumConstant.ZERO) { + //已关闭议题已解决未解决数量统计 + saveGridClosedTotal(gridClosedTotalList, grid, entity); + + if (entity.getClosedIncr() > NumConstant.ZERO) { + //已关闭议题已解决未解决增量统计 + saveGridClosedInc(gridClosedIncList, grid, entity); + } + } + //已关闭项目已解决未解决统计 + saveClosedProject(resolveMap, unResolveMap, resolveIncMap, unResolveIncMap, grid, entity); + list.add(entity); + } + factIssueGridDailyService.saveList(list); + } + + @Override + public void saveIssueGridMonthly(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueGridMonthlyService.deleteByCustomerId(customerId, dimId.getMonthId()); + //获取客户下所有网格数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + //获取网格下议题各种状态的数目统计 + List gridTotalList = issueService.getGridIssueTotal(customerId, dateString); + //获取网格下已关闭议题各种状态的数目统计 + List gridClosedTotalList = issueService.getGridClosedIssueTotal(customerId, dateString); + //增量统计 + List gridMonthlyIncListList = factIssueGridMonthlyService.getGridMonthlyInc(customerId, dimId.getMonthId()); + //项目议题关系 + List issueProjectList = issueService.getIssueProjectList(customerId); + //已结案项目统计 + List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); + Map resolveMap= new HashMap<>(); + Map unResolveMap = new HashMap<>(); + if (null != issueProjectList) { + List totalList = issueProjectList.stream().flatMap(ip -> + closedProjectTotalList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> totalMap = + totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveList = totalMap.get(IssueConstant.RESLOVED); + List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); + if (null != resolveList) { + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveList) { + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } + } + + List list = new ArrayList<>(); + + for (DimGridEntity grid : gridList) { + FactIssueGridDailyEntity daily = initIssueGridDaily(dimId); + FactIssueGridMonthlyEntity monthly = initIssueGridMonthly(dimId); + + //总量统计 + saveGridTotal(gridTotalList, grid, daily); + + if (daily.getClosedTotal() > NumConstant.ZERO) { + //已关闭议题已解决未解决数量统计 + saveGridClosedTotal(gridClosedTotalList, grid, daily); + } + monthly = ConvertUtils.sourceToTarget(daily, FactIssueGridMonthlyEntity.class); + + //已关闭项目已解决未解决统计 + int resolve = null == resolveMap.get(grid.getId())?0:resolveMap.get(grid.getId()).intValue(); + int unResolve = null == unResolveMap.get(grid.getId())?0:unResolveMap.get(grid.getId()).intValue(); + int total = resolve + unResolve; + monthly.setClosedCaseTotal(total); + monthly.setClosedCaseResolvedTotal(resolve); + monthly.setClosedCaseUnresolvedTotal(unResolve); + if(total > NumConstant.ZERO) { + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + monthly.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + monthly.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //各指标增量统计 + for (int i = 0; i < gridMonthlyIncListList.size(); i++) { + FactIssueGridMonthlyDTO dto = gridMonthlyIncListList.get(i); + if (grid.getId().equals(dto.getGridId())) { + monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); + monthly.setClosedIncr(dto.getClosedIncr()); + monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); + monthly.setClosedUnresolvedIncr(dto.getClosedUnresolvedIncr()); + monthly.setClosedCaseIncr(dto.getClosedCaseIncr()); + monthly.setClosedCaseResolvedIncr(dto.getClosedCaseResolvedIncr()); + monthly.setClosedCaseUnresolvedIncr(dto.getClosedCaseUnresolvedIncr()); + gridMonthlyIncListList.remove(i); + break; + } + } + + monthly.setCustomerId(grid.getCustomerId()); + monthly.setAgencyId(grid.getAgencyId()); + monthly.setGridId(grid.getId()); + list.add(monthly); + } + factIssueGridMonthlyService.saveList(list); + } + + /** + * 已关闭项目已解决未解决统计 + * @author zhaoqifeng + * @date 2020/6/22 10:35 + * @param resolveMap + * @param unResolveMap + * @param resolveIncMap + * @param unResolveIncMap + * @param grid + * @param entity + * @return void + */ + private void saveClosedProject(Map resolveMap, Map unResolveMap, Map resolveIncMap, + Map unResolveIncMap, DimGridEntity grid, FactIssueGridDailyEntity entity) { + int resolve = null == resolveMap.get(grid.getId())?0:resolveMap.get(grid.getId()).intValue(); + int unResolve = null == unResolveMap.get(grid.getId())?0:unResolveMap.get(grid.getId()).intValue(); + int resolveInc = null == resolveIncMap.get(grid.getId())?0:resolveIncMap.get(grid.getId()).intValue(); + int unResolveInc = null == unResolveIncMap.get(grid.getId())?0:unResolveIncMap.get(grid.getId()).intValue(); + int total = resolve + unResolve; + int inc = resolveInc + unResolveInc; + entity.setClosedCaseTotal(total); + entity.setClosedCaseResolvedTotal(resolve); + entity.setClosedCaseUnresolvedTotal(unResolve); + entity.setClosedCaseIncr(inc); + entity.setClosedCaseResolvedIncr(resolveInc); + entity.setClosedCaseUnresolvedIncr(unResolveInc); + if(total != NumConstant.ZERO) { + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + entity.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + } + } + + /** + * 已关闭议题已解决未解决增量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:56 + */ + private void saveGridClosedInc(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //已解决数 + int resolvedInc = NumConstant.ZERO; + //未解决数 + int unresolvedInc = NumConstant.ZERO; + + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.RESLOVED.equals(dto.getStatus())) { + //表决中议题数量 + resolvedInc = dto.getCount(); + } else if (IssueConstant.UNRESLOVED.equals(dto.getStatus())) { + //已转项目议题数量 + unresolvedInc = dto.getCount(); + } + } + } + entity.setClosedResolvedIncr(resolvedInc); + entity.setClosedUnresolvedIncr(unresolvedInc); + } + + /** + * 已关闭议题已解决未解决总量级占比统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:56 + */ + private void saveGridClosedTotal(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.RESLOVED.equals(dto.getStatus())) { + //已解决议题数量 + resolvedCount = dto.getCount(); + } else if (IssueConstant.UNRESLOVED.equals(dto.getStatus())) { + //未解决议题数量 + unresolvedCount = dto.getCount(); + } + } + } + entity.setClosedResolvedTotal(resolvedCount); + entity.setClosedUnresolvedTotal(unresolvedCount); + if(entity.getClosedTotal() > NumConstant.ZERO) { + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + } + } + + /** + * 网格议题增量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:57 + */ + private void saveGridInc(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //表决中增量 + int votingInc = NumConstant.ZERO; + //已转项目增量 + int shiftInc = NumConstant.ZERO; + //已关闭增量 + int closedInc = NumConstant.ZERO; + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.VOTING.equals(dto.getStatus())) { + //表决中议题数量 + votingInc = dto.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(dto.getStatus())) { + //已转项目议题数量 + shiftInc = dto.getCount(); + } else { + //已关闭议题数量 + closedInc = dto.getCount(); + } + } + } + int issueInc = votingInc + shiftInc + closedInc; + entity.setVotingIncr(votingInc); + entity.setShiftProjectIncr(shiftInc); + entity.setClosedIncr(closedInc); + entity.setIssueIncr(issueInc); + } + + /** + * 网格议题总量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:57 + */ + private void saveGridTotal(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //表决中数量 + Integer votingCount = NumConstant.ZERO; + //已转项目数量 + Integer shiftCount = NumConstant.ZERO; + //已关闭数量 + Integer closedCount = NumConstant.ZERO; + for (IssueGridDTO dto : list) { + if (dto.getGridId().equals(grid.getId())) { + if (IssueConstant.VOTING.equals(dto.getStatus())) { + //表决中议题数量 + votingCount = dto.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(dto.getStatus())) { + //已转项目议题数量 + shiftCount = dto.getCount(); + } else { + //已关闭议题数量 + closedCount = dto.getCount(); + } + } + } + int issueTotal = votingCount + shiftCount + closedCount; + entity.setVotingTotal(votingCount); + entity.setShiftProjectTotal(shiftCount); + entity.setClosedTotal(closedCount); + entity.setIssueTotal(issueTotal); + if (NumConstant.ZERO != issueTotal) { + BigDecimal voting = new BigDecimal(votingCount); + BigDecimal shift = new BigDecimal(shiftCount); + BigDecimal closed = new BigDecimal(closedCount); + BigDecimal total = new BigDecimal(issueTotal); + entity.setVotingPercent(voting.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + + } + } + + /** + * 已关闭项目已解决未解决增量统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 17:23 + */ + private void saveClosedProjectInc(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (ProjectAgencyDTO project : list) { + if (agency.getId().equals(project.getAgencyId()) || project.getPIds().contains(pIds)) { + if (IssueConstant.RESLOVED.equals(project.getStatus())) { + //已解决数量 + resolvedCount = resolvedCount + project.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(project.getStatus())) { + //未解决数量 + unresolvedCount = unresolvedCount + project.getCount(); + } + } + } + int total = resolvedCount + unresolvedCount; + entity.setClosedCaseResolvedIncr(resolvedCount); + entity.setClosedCaseUnresolvedIncr(unresolvedCount); + entity.setClosedCaseIncr(total); + } + + /** + * 已关闭项目已解决未解决统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 17:23 + */ + private void saveClosedProjectTotal(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (ProjectAgencyDTO project : list) { + if (agency.getId().equals(project.getAgencyId()) || project.getPIds().contains(pIds)) { + if (IssueConstant.RESLOVED.equals(project.getStatus())) { + //已解决数量 + resolvedCount = resolvedCount + project.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(project.getStatus())) { + //未解决数量 + unresolvedCount = unresolvedCount + project.getCount(); + } + } + } + int total = resolvedCount + unresolvedCount; + entity.setClosedCaseResolvedTotal(resolvedCount); + entity.setClosedCaseUnresolvedTotal(unresolvedCount); + entity.setClosedCaseTotal(total); + if (total > NumConstant.ZERO) { + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(total); + entity.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + } + } + + /** + * 议题各状态增量统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 15:55 + */ + private void saveInc(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //表决中增量 + int votingInc = NumConstant.ZERO; + //已转项目增量 + int shiftInc = NumConstant.ZERO; + //已关闭增量 + int closedInc = NumConstant.ZERO; + for (IssueAgencyDTO issueAgency : list) { + if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { + if (IssueConstant.VOTING.equals(issueAgency.getStatus())) { + //表决中议题数量 + votingInc = votingInc + issueAgency.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + //已转项目议题数量 + shiftInc = shiftInc + issueAgency.getCount(); + } else { + //已关闭议题数量 + closedInc = closedInc + issueAgency.getCount(); + } + } + } + int issueInc = votingInc + shiftInc + closedInc; + entity.setVotingIncr(votingInc); + entity.setShiftProjectIncr(shiftInc); + entity.setClosedIncr(closedInc); + entity.setIssueIncr(issueInc); + } + + /** + * 议题各状态数量统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 15:54 + */ + private void saveTotal(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //表决中数量 + Integer votingCount = NumConstant.ZERO; + //已转项目数量 + Integer shiftCount = NumConstant.ZERO; + //已关闭数量 + Integer closedCount = NumConstant.ZERO; + + for (IssueAgencyDTO issueAgency : list) { + if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { + if (IssueConstant.VOTING.equals(issueAgency.getStatus())) { + //表决中议题数量 + votingCount = votingCount + issueAgency.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + //已转项目议题数量 + shiftCount = shiftCount + issueAgency.getCount(); + } else { + //已关闭议题数量 + closedCount = closedCount + issueAgency.getCount(); + } + } + } + int issueTotal = votingCount + shiftCount + closedCount; + entity.setVotingTotal(votingCount); + entity.setShiftProjectTotal(shiftCount); + entity.setClosedTotal(closedCount); + entity.setIssueTotal(issueTotal); + if (NumConstant.ZERO != issueTotal) { + BigDecimal voting = new BigDecimal(votingCount); + BigDecimal shift = new BigDecimal(shiftCount); + BigDecimal closed = new BigDecimal(closedCount); + BigDecimal total = new BigDecimal(issueTotal); + entity.setVotingPercent(voting.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + + } + } + + /** + * 已关闭议题中已解决和未解决总数统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 15:48 + */ + private void saveClosedTotal(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (IssueAgencyDTO issueAgency : list) { + if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { + if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) { + //表决中议题数量 + resolvedCount = resolvedCount + issueAgency.getCount(); + } else if (IssueConstant.UNRESLOVED.equals(issueAgency.getStatus())) { + //已转项目议题数量 + unresolvedCount = unresolvedCount + issueAgency.getCount(); + } + } + } + entity.setClosedResolvedTotal(resolvedCount); + entity.setClosedUnresolvedTotal(unresolvedCount); + if (entity.getClosedTotal() > NumConstant.ZERO) { + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + } + } + + /** + * 已关闭议题中已解决和未解决增量统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 15:48 + */ + private void saveClosedInc(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //已解决数 + int resolvedInc = NumConstant.ZERO; + //未解决数 + int unresolvedInc = NumConstant.ZERO; + + for (IssueAgencyDTO issueAgency : list) { + if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { + if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) { + //表决中议题数量 + resolvedInc = resolvedInc + issueAgency.getCount(); + } else if (IssueConstant.UNRESLOVED.equals(issueAgency.getStatus())) { + //已转项目议题数量 + unresolvedInc = unresolvedInc + issueAgency.getCount(); + } + } + } + entity.setClosedResolvedIncr(resolvedInc); + entity.setClosedUnresolvedIncr(unresolvedInc); + } + + + /** + * 初始化数据 + * + * @param dimIdBean + * @return com.epmet.entity.stats.FactIssueAgencyDailyEntity + * @author zhaoqifeng + * @date 2020/6/18 10:57 + */ + private FactIssueAgencyDailyEntity initIssueAgencyDaily(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueAgencyDailyEntity entity = new FactIssueAgencyDailyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setWeekId(dimIdBean.getWeekId()); + entity.setDateId(dimIdBean.getDateId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } + + /** + * 初始化数据 + * + * @param dimIdBean + * @return com.epmet.entity.stats.FactIssueAgencyMonthlyEntity + * @author zhaoqifeng + * @date 2020/6/18 10:58 + */ + private FactIssueAgencyMonthlyEntity initIssueAgencyMonthly(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueAgencyMonthlyEntity entity = new FactIssueAgencyMonthlyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } + + private FactIssueGridDailyEntity initIssueGridDaily(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueGridDailyEntity entity = new FactIssueGridDailyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setWeekId(dimIdBean.getWeekId()); + entity.setDateId(dimIdBean.getDateId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } + + private FactIssueGridMonthlyEntity initIssueGridMonthly(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueGridMonthlyEntity entity = new FactIssueGridMonthlyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java new file mode 100644 index 0000000000..0c4793e565 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -0,0 +1,664 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.issue.IssueEntity; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.entity.project.ProjectProcessEntity; +import com.epmet.entity.stats.*; +import com.epmet.service.Issue.IssueService; +import com.epmet.service.StatsProjectService; +import com.epmet.service.project.ProjectProcessService; +import com.epmet.service.project.ProjectService; +import com.epmet.service.stats.*; +import com.epmet.util.DimIdGenerator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 数据统计-项目(独立于任何具体数据源外层的service) + * + * @author sun + */ +@Service +public class StatsProjectServiceImpl implements StatsProjectService { + + protected static final Logger log = LoggerFactory.getLogger(StatsProjectServiceImpl.class); + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private DimGridService dimGridService; + @Autowired + private ProjectService projectService; + @Autowired + private ProjectProcessService projectProcessService; + @Autowired + private IssueService issueService; + @Autowired + private FactAgencyProjectDailyService factAgencyProjectDailyService; + @Autowired + private FactAgencyProjectMonthlyService factAgencyProjectMonthlyService; + @Autowired + private FactGridProjectDailyService factGridProjectDailyService; + @Autowired + private FactGridProjectMonthlyService factGridProjectMonthlyService; + + /** + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + @Override + public void agencyProjectStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计机关-项目-日月数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + customerAgencyStats(customerId); + } catch (Exception e) { + log.error("项目-机关-数据统计程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + /** + * @Author sun + * @Description 分别统计机关日/月数据 + **/ + public void customerAgencyStats(String customerId) { + Date date = yesterDay(); + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询机关维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + + //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) + log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目业务表已结案数据,对应客户Id:" + customerId); + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(customerId); + projectEntity.setCreatedTime(date); + projectEntity.setStatus(ProjectConstant.CLOSED); + List projectList = projectService.getProjectList(projectEntity); + + //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) + log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目进展表业务数据,对应客户Id:" + customerId); + List processList = projectProcessService.getProcessList(projectEntity); + + //5:机关层级日月统计 + if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) { + //5.1:执行机关日数据统计 + try { + log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关日统计方法,方法名:agencyDateProjectStats,客户Id:" + customerId); + agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyDateProjectStats", customerId, dimId.getDateId(), e.getMessage())); + } + + //5.2:执行机关月数据统计 + //if (Calendar.getInstance().get(Calendar.DATE) == 1) { + try { + log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关月统计方法,方法名:agencyMonthProjectStats,客户Id:" + customerId); + agencyMonthProjectStats(customerId, dimId, dimAgencyList); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyMonthProjectStats", customerId, dimId.getMonthId(), e.getMessage())); + } + //} + } + + } + + /** + * @param customerId + * @Author sun + * @Description 数据-项目-机关日统计 + **/ + private String agencyDateProjectStats(String customerId, DimIdGenerator.DimIdBean dimId, List dimAgencyList, List projectList, List processList) { + Date date = yesterDay(); + //批量机关日统计新增对象 + List projectDateEntityList = new ArrayList<>(); + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(6); + + //1:遍历机关维度数据,统计每个机关各项指标数 + for (DimAgencyDTO agency : dimAgencyList) { + //1.1:存放当前机关及所有下级机关Id + Map map = new HashMap<>(); + map.put(agency.getId(), agency.getId()); + String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId()); + dimAgencyList.forEach(sub -> { + if (sub.getPids().contains(subPids)) { + map.put(sub.getId(), sub.getId()); + } + }); + //机关下截止当前日期的项目总数、已结案总数、已结案已解决总数、已结案未解决总数 + AtomicInteger projectTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger resolvedTotal = new AtomicInteger(0); + AtomicInteger unResolvedTotal = new AtomicInteger(0); + //日增量中项目总数、已结案总数、已结案已解决总数、已结案未解决总数 + AtomicInteger projectIncr = new AtomicInteger(0); + AtomicInteger closedIncr = new AtomicInteger(0); + AtomicInteger resolvedIncr = new AtomicInteger(0); + AtomicInteger unResolvedIncr = new AtomicInteger(0); + //存放已结案项目Id,用于统计已结案中已解决、未解决数 + Map closeMap = new HashMap<>(); + //存放前一日已结案项目Id,用于统计日增量中已结案项目的已解决、未解决数量 + Map closeDateMap = new HashMap<>(); + //1.2:遍历进展数据,统计截止当日的项目总量、处理中总量、已结案总量以及日增量中的项目总量、处理中总量、已结案总量 + processList.forEach(process -> { + //当前机关及下级 + if (map.containsKey(process.getAgencyId())) { + //进展表中是创建项目状态的数据总数即为客户该机关下项目总数 + if (ProjectConstant.CREATED.equals(process.getOperation())) { + projectTotal.addAndGet(1); + if (date.equals(process.getCreatedTime())) { + //日增量总数 + projectIncr.addAndGet(1); + } + } + if (ProjectConstant.CLOSE.equals(process.getOperation())) { + //截止当前日期的结案总数 + closedTotal.addAndGet(1); + closeMap.put(process.getProjectId(), process.getProjectId()); + if (date.equals(process.getCreatedTime())) { + //日增量已结案总数 + closedIncr.addAndGet(1); + closeDateMap.put(process.getProjectId(), process.getProjectId()); + } + } + } + }); + //1.3:遍历项目业务数据,统计截止当日的已结案已解决总量、已结案未解决总量以及日增量中的已结案已解决总量、已结案未解决总量 + projectList.forEach(project -> { + //当前机关及下级 + if (map.containsKey(project.getAgencyId())) { + if (closeMap.containsKey(project.getId())) { + //已结案已解决 + if (ProjectConstant.RESOLVED.equals(project.getClosedStatus())) { + //截止当日的已结案已解决总量 + resolvedTotal.addAndGet(1); + if (closeDateMap.containsKey(project.getId())) { + //日增量中的已结案已解决总量 + resolvedIncr.addAndGet(1); + } + } + //已结案未解决 + if (ProjectConstant.UNRESOLVED.equals(project.getClosedStatus())) { + //截止当日的已结案未解决总量 + unResolvedTotal.addAndGet(1); + if (closeDateMap.containsKey(project.getId())) { + //日增量中的已结案未解决总量 + unResolvedIncr.addAndGet(1); + } + } + } + } + }); + + //1.4:封装机关日数据对象 + FactAgencyProjectDailyEntity agencyDailyEntity = new FactAgencyProjectDailyEntity(); + agencyDailyEntity.setCustomerId(customerId); + agencyDailyEntity.setAgencyId(agency.getId()); + agencyDailyEntity.setParentId(agency.getPid()); + agencyDailyEntity.setDateId(dimId.getDateId()); + agencyDailyEntity.setWeekId(dimId.getWeekId()); + agencyDailyEntity.setMonthId(dimId.getMonthId()); + agencyDailyEntity.setQuarterId(dimId.getQuarterId()); + agencyDailyEntity.setYearId(dimId.getYearId()); + agencyDailyEntity.setProjectTotal(projectTotal.intValue()); + agencyDailyEntity.setPendingTotal(projectTotal.intValue() - closedTotal.intValue()); + agencyDailyEntity.setClosedTotal(closedTotal.intValue()); + agencyDailyEntity.setResolvedTotal(resolvedTotal.intValue()); + agencyDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); + if (projectTotal.intValue() > NumConstant.ZERO) { + agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) agencyDailyEntity.getPendingTotal() / (float) projectTotal.intValue()))); + agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue()))); + } + if (closedTotal.intValue() > NumConstant.ZERO) { + agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue()))); + agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue()))); + } + agencyDailyEntity.setProjectIncr(projectIncr.intValue()); + agencyDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); + agencyDailyEntity.setClosedIncr(closedIncr.intValue()); + agencyDailyEntity.setResolvedIncr(resolvedIncr.intValue()); + agencyDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue()); + + projectDateEntityList.add(agencyDailyEntity); + } + + //2:批量保存数据,先删后增 + if (null != projectDateEntityList && projectDateEntityList.size() > NumConstant.ZERO) { + //2.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsProjectServiceImpl.agencyDateProjectStats-根据客户Id、日维度Id批量删除机关项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factAgencyProjectDailyService.delDateProject(delEntity); + + //2.2:批量保存机关日统计数据 + log.info("StatsProjectServiceImpl.agencyDateProjectStats-批量新增机关项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factAgencyProjectDailyService.insertBatch(projectDateEntityList); + } + + return null; + } + + /** + * @param customerId + * @Author sun + * @Description 数据-项目-机关月统计 + **/ + private String agencyMonthProjectStats(String customerId, DimIdGenerator.DimIdBean dimId, List dimAgencyList) { + Date date = yesterDay(); + //批量月数据新增对象 + List monthlyEntityList = new ArrayList<>(); + + //1:获取昨天日期所在月份的起始日期和结束日期 + MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setMonthId(dimId.getMonthId()); + + //2:遍历机关维度数据,分别统计每个组织月数据 + for (DimAgencyDTO agency : dimAgencyList) { + //2.1:查询上一月机关日统计数据,按时间倒序 + formDTO.setAgencyId(agency.getId()); + List projectDailyList = factAgencyProjectDailyService.getMonthProjectList(formDTO); + + //2.2:汇总统计上一月机关月统计数据 + //月增量中项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 + int pendingIncr = 0; + int closedIncr = 0; + int resolvedIncr = 0; + int unResolvedIncr = 0; + for (FactAgencyProjectDailyEntity daily : projectDailyList) { + pendingIncr += daily.getPendingIncr(); + closedIncr += daily.getClosedIncr(); + resolvedIncr += daily.getResolvedIncr(); + unResolvedIncr += daily.getUnresolvedIncr(); + } + //2.3:实体字段属性赋值 + FactAgencyProjectMonthlyEntity monthlyEntity = new FactAgencyProjectMonthlyEntity(); + monthlyEntity.setCustomerId(customerId); + monthlyEntity.setAgencyId(agency.getId()); + monthlyEntity.setParentId(agency.getPid()); + monthlyEntity.setMonthId(dimId.getMonthId()); + monthlyEntity.setQuarterId(dimId.getQuarterId()); + monthlyEntity.setYearId(dimId.getYearId()); + if (null != projectDailyList && projectDailyList.size() > NumConstant.ZERO) { + FactAgencyProjectDailyEntity entity = projectDailyList.get(0); + monthlyEntity.setProjectTotal(entity.getProjectTotal()); + monthlyEntity.setPendingTotal(entity.getPendingTotal()); + monthlyEntity.setPendingRatio(entity.getPendingRatio()); + monthlyEntity.setClosedTotal(entity.getClosedTotal()); + monthlyEntity.setClosedRatio(entity.getClosedRatio()); + monthlyEntity.setResolvedTotal(entity.getResolvedTotal()); + monthlyEntity.setResolvedRatio(entity.getResolvedRatio()); + monthlyEntity.setUnresolvedTotal(entity.getUnresolvedTotal()); + monthlyEntity.setUnresolvedRatio(entity.getUnresolvedRatio()); + monthlyEntity.setProjectIncr(pendingIncr + closedIncr); + monthlyEntity.setPendingIncr(pendingIncr); + monthlyEntity.setClosedIncr(closedIncr); + monthlyEntity.setResolvedIncr(resolvedIncr); + monthlyEntity.setUnresolvedIncr(unResolvedIncr); + } + + monthlyEntityList.add(monthlyEntity); + } + + //3:批量新增数据,先删后增 + if (null != monthlyEntityList && monthlyEntityList.size() > NumConstant.ZERO) { + //3.1:根据客户Id、月份Id批量删除一下可能存在的历史数据 + FactAgencyProjectMonthlyEntity delEntity = new FactAgencyProjectMonthlyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setMonthId(dimId.getMonthId()); + log.info("StatsProjectServiceImpl.agencyMonthProjectStats-根据客户Id、月维度Id批量删除机关项目月统计表数据,对应客户Id:" + customerId + ",月维度Id:" + dimId.getMonthId()); + factAgencyProjectMonthlyService.delMonthProject(delEntity); + + //3.2:批量保存机关月统计数据 + log.info("StatsProjectServiceImpl.agencyMonthProjectStats-批量新增机关项目月统计表数据,对应客户Id:" + customerId + ",月维度Id:" + dimId.getMonthId()); + factAgencyProjectMonthlyService.insertBatch(monthlyEntityList); + } + + return null; + } + + + /** + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + @Override + public void gridProjectStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计网格-项目-日月数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + customerGridStats(customerId); + } catch (Exception e) { + log.error("项目-网格-数据统计程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + /** + * @Author sun + * @Description 分别统计网格日/月数据 + **/ + public void customerGridStats(String customerId) { + Date date = yesterDay(); + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询网格维度表数据 + log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId); + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) + log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目业务表已结案数据,对应客户Id:" + customerId); + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(customerId); + projectEntity.setCreatedTime(date); + projectEntity.setStatus(ProjectConstant.CLOSED); + List projectList = projectService.getProjectList(projectEntity); + + //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) + log.info("StatsProjectServiceImpl.customerGridStats-根据客户Id查询项目进展表业务数据,对应客户Id:" + customerId); + List processList = projectProcessService.getProcessList(projectEntity); + + //5:网格层级日月统计 + if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { + //5.1:执行网格日数据统计 + try { + log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关日统计方法,方法名:gridDateProjectStats,客户Id:" + customerId); + gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridDateProjectStats", customerId, dimId.getDateId(), e.getMessage())); + } + + //5.2:执行网格月数据统计 + //if (Calendar.getInstance().get(Calendar.DATE) == 1) { + try { + log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关月统计方法,方法名:gridMonthProjectStats,客户Id:" + customerId); + gridMonthProjectStats(customerId, dimId, dimGridList); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridMonthProjectStats", customerId, dimId.getMonthId(), e.getMessage())); + } + //} + } + + } + + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-网格日统计 + **/ + private String gridDateProjectStats(String customerId, DimIdGenerator.DimIdBean dimId, List dimGridList, List projectList, List processList) { + Date date = yesterDay(); + //批量网格日统计新增对象 + List gridDateEntityList = new ArrayList<>(); + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(6); + + //1:根据客户Id查询议题库已转项目的网格项目关系数据 + List gridProjectList = issueService.getGridProjectList(customerId); + + //2:遍历网格维度数据,统计每个网格各项指标数据 + for (DimGridEntity grid : dimGridList) { + //2.1:存放网格下的项目Id + Map map = new HashMap<>(); + gridProjectList.forEach(gridProject -> { + if (grid.getId().equals(gridProject.getGridId())) { + map.put(gridProject.getProjectId(), gridProject.getGridId()); + } + }); + //网格下截止当前日期的项目总数、已结案总数、已结案已解决总数、已结案未解决总数 + AtomicInteger projectTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger resolvedTotal = new AtomicInteger(0); + AtomicInteger unResolvedTotal = new AtomicInteger(0); + //网格日增量中项目总数、已结案总数、已结案已解决总数、已结案未解决总数 + AtomicInteger projectIncr = new AtomicInteger(0); + AtomicInteger closedIncr = new AtomicInteger(0); + AtomicInteger resolvedIncr = new AtomicInteger(0); + AtomicInteger unResolvedIncr = new AtomicInteger(0); + //存放已结案项目Id,用于统计已结案中已解决、未解决数 + Map closeMap = new HashMap<>(); + //存放前一日已结案项目Id,用于统计日增量中已结案项目的已解决、未解决数量 + Map closeDateMap = new HashMap<>(); + //2.2:遍历进展数据,统计截止当日的项目总量、处理中总量、已结案总量以及日增量中的项目总量、处理中总量、已结案总量 + //截止当日项目总数 + projectTotal.addAndGet(map.size()); + processList.forEach(process -> { + //是网格下的项目,且是已结案的 + if (map.containsKey(process.getProjectId())) { + //进展表中是创建项目状态的数据总数即为该网格下项目总数 + if (ProjectConstant.CREATED.equals(process.getOperation()) && date.equals(process.getCreatedTime())) { + //日增量总数 + projectIncr.addAndGet(1); + } + if (ProjectConstant.CLOSE.equals(process.getOperation())) { + //截止当日的已结案总数 + closedTotal.addAndGet(1); + closeMap.put(process.getProjectId(), process.getProjectId()); + if (date.equals(process.getCreatedTime())) { + //日增量中已结案总数 + closedIncr.addAndGet(1); + closeDateMap.put(process.getProjectId(), process.getProjectId()); + } + } + } + }); + //2.3:遍历项目业务数据,统计截止当日的已结案已解决总量、已结案未解决总量以及日增量中的已结案已解决总量、已结案未解决总量 + projectList.forEach(project -> { + //当前机关及下级 + if (map.containsKey(project.getId())) { + if (closeMap.containsKey(project.getId())) { + //已结案已解决 + if (ProjectConstant.RESOLVED.equals(project.getClosedStatus())) { + //截止当日的已结案已解决总量 + resolvedTotal.addAndGet(1); + if (closeDateMap.containsKey(project.getId())) { + //日增量中的已结案已解决总量 + resolvedIncr.addAndGet(1); + } + } + //已结案未解决 + if (ProjectConstant.UNRESOLVED.equals(project.getClosedStatus())) { + //截止当日的已结案未解决总量 + unResolvedTotal.addAndGet(1); + if (closeDateMap.containsKey(project.getId())) { + //日增量中的已结案未解决总量 + unResolvedIncr.addAndGet(1); + } + } + } + } + }); + + //2.4:封装日数据对象 + FactGridProjectDailyEntity gridDailyEntity = new FactGridProjectDailyEntity(); + gridDailyEntity.setCustomerId(customerId); + gridDailyEntity.setAgencyId(grid.getAgencyId()); + gridDailyEntity.setGridId(grid.getId()); + gridDailyEntity.setDateId(dimId.getDateId()); + gridDailyEntity.setWeekId(dimId.getWeekId()); + gridDailyEntity.setMonthId(dimId.getMonthId()); + gridDailyEntity.setQuarterId(dimId.getQuarterId()); + gridDailyEntity.setYearId(dimId.getYearId()); + gridDailyEntity.setProjectTotal(projectTotal.intValue()); + gridDailyEntity.setPendingTotal(projectTotal.intValue() - closedTotal.intValue()); + gridDailyEntity.setClosedTotal(closedTotal.intValue()); + gridDailyEntity.setResolvedTotal(resolvedTotal.intValue()); + gridDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); + if (projectTotal.intValue() > NumConstant.ZERO) { + gridDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) gridDailyEntity.getPendingTotal() / (float) projectTotal.intValue()))); + gridDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue()))); + } + if (closedTotal.intValue() > NumConstant.ZERO) { + gridDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue()))); + gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue()))); + } + gridDailyEntity.setProjectIncr(projectIncr.intValue()); + gridDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); + gridDailyEntity.setClosedIncr(closedIncr.intValue()); + gridDailyEntity.setResolvedIncr(resolvedIncr.intValue()); + gridDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue()); + + gridDateEntityList.add(gridDailyEntity); + } + + //3:批量新增数据,先删后增 + if (null != gridDateEntityList && gridDateEntityList.size() > NumConstant.ZERO) { + //3.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsProjectServiceImpl.gridDateProjectStats-根据客户Id、日维度Id批量删除网格项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGridProjectDailyService.delDateProject(delEntity); + + //3.2:批量保存网格日统计数据 + log.info("StatsProjectServiceImpl.gridDateProjectStats-批量新增网格项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGridProjectDailyService.insertBatch(gridDateEntityList); + } + + return null; + } + + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-网格月统计 + **/ + private String gridMonthProjectStats(String customerId, DimIdGenerator.DimIdBean dimId, List dimGridList) { + //批量月数据新增对象 + List monthlyEntityList = new ArrayList<>(); + + //1:查询客户网格月份内日统计数据 + MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setMonthId(dimId.getMonthId()); + + //2:遍历网格维度数据,分别统计每个网格月数据 + for (DimGridEntity grid : dimGridList) { + //2.1:查询当前月网格日统计数据,按时间倒序 + formDTO.setGridId(grid.getId()); + List projectDailyList = factGridProjectDailyService.getMonthProjectList(formDTO); + + //2.2:汇总统计上一月网格月统计数据 + //月增量中项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 + int pendingIncr = 0; + int closedIncr = 0; + int resolvedIncr = 0; + int unResolvedIncr = 0; + for (FactGridProjectDailyEntity date : projectDailyList) { + pendingIncr += date.getPendingIncr(); + closedIncr += date.getClosedIncr(); + resolvedIncr += date.getResolvedIncr(); + unResolvedIncr += date.getUnresolvedIncr(); + } + //2.3:实体字段属性赋值 + FactGridProjectMonthlyEntity monthlyEntity = new FactGridProjectMonthlyEntity(); + monthlyEntity.setCustomerId(customerId); + monthlyEntity.setAgencyId(grid.getAgencyId()); + monthlyEntity.setGridId(grid.getId()); + monthlyEntity.setMonthId(dimId.getMonthId()); + monthlyEntity.setQuarterId(dimId.getQuarterId()); + monthlyEntity.setYearId(dimId.getYearId()); + if (null != projectDailyList && projectDailyList.size() > NumConstant.ZERO) { + FactGridProjectDailyEntity entity = projectDailyList.get(0); + monthlyEntity.setProjectTotal(entity.getProjectTotal()); + monthlyEntity.setPendingTotal(entity.getPendingTotal()); + monthlyEntity.setPendingRatio(entity.getPendingRatio()); + monthlyEntity.setClosedTotal(entity.getClosedTotal()); + monthlyEntity.setClosedRatio(entity.getClosedRatio()); + monthlyEntity.setResolvedTotal(entity.getResolvedTotal()); + monthlyEntity.setResolvedRatio(entity.getResolvedRatio()); + monthlyEntity.setUnresolvedTotal(entity.getUnresolvedTotal()); + monthlyEntity.setUnresolvedRatio(entity.getUnresolvedRatio()); + monthlyEntity.setProjectIncr(pendingIncr + closedIncr); + monthlyEntity.setPendingIncr(pendingIncr); + monthlyEntity.setClosedIncr(closedIncr); + monthlyEntity.setResolvedIncr(resolvedIncr); + monthlyEntity.setUnresolvedIncr(unResolvedIncr); + } + + monthlyEntityList.add(monthlyEntity); + } + + //3:批量新增数据,先删后增 + if (null != monthlyEntityList && monthlyEntityList.size() > NumConstant.ZERO) { + //3.1:根据客户Id、月份Id批量物理删除一下可能存在的历史数据 + FactAgencyProjectMonthlyEntity delEntity = new FactAgencyProjectMonthlyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setMonthId(dimId.getMonthId()); + log.info("StatsProjectServiceImpl.gridMonthProjectStats-根据客户Id、月维度Id批量删除网格项目月统计表数据,对应客户Id:" + customerId + ",月维度Id:" + dimId.getMonthId()); + factGridProjectMonthlyService.delMonthProject(delEntity); + + //3.2:批量保存机关月统计数据 + log.info("StatsProjectServiceImpl.gridMonthProjectStats-批量新增网格项目月统计表数据,对应客户Id:" + customerId + ",月维度Id:" + dimId.getMonthId()); + factGridProjectMonthlyService.insertBatch(monthlyEntityList); + } + + return null; + } + + /** + * @Author sun + * @Description 获取当前日期的前一天日期(yyyy-mm-dd) + **/ + private Date yesterDay() { + Date date = new Date(); + try { + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, -24); + String str = sdf.format(calendar.getTime()); + date = sdf.parse(str); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java new file mode 100644 index 0000000000..72b5ce2b1b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -0,0 +1,1124 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DimAgencyConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.stats.*; +import com.epmet.entity.voice.ArticleEntity; +import com.epmet.entity.voice.ArticleTagsEntity; +import com.epmet.service.StatsPublicityService; +import com.epmet.service.stats.*; +import com.epmet.service.voice.ArticleOperateRecordService; +import com.epmet.service.voice.ArticleService; +import com.epmet.service.voice.ArticleTagsService; +import com.epmet.service.voice.ArticleVisitRecordService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.stream.Collectors; + +/** + * desc: 宣传能力数据统计 service + * + * @date: 2020/6/17 16:08 + * @author: jianjun liu + */ +@Slf4j +@Service +public class StatsPublicityServiceImpl implements StatsPublicityService { + + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private DimGridService dimGridService; + @Autowired + private DimDepartmentService dimDepartmentService; + @Autowired + private ArticleTagsService articleTagsService; + @Autowired + private ArticleService articleService; + @Autowired + private ArticleVisitRecordService articleVisitRecordService; + @Autowired + private ArticleOperateRecordService articleOperateRecordService; + @Autowired + private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; + @Autowired + private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; + @Autowired + private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; + @Autowired + private FactTagUsedGridDailyService factTagUsedGridDailyService; + @Autowired + private FactTagUsedDepartmentDailyService factTagUsedDepartmentDailyService; + @Autowired + private FactTagUsedAgencyDailyService factTagUsedAgencyDailyService; + @Autowired + private FactTagUsedGridMonthlyService factTagUsedGridMonthlyService; + @Autowired + private FactTagUsedDepartmentMonthlyService factTagUsedDepartmentMonthlyService; + @Autowired + private FactTagUsedAgencyMonthlyService factTagUsedAgencyMonthlyService; + @Autowired + private FactTagUsedGridQuarterlyService factTagUsedGridQuarterlyService; + @Autowired + private FactTagUsedDepartmentQuarterlyService factTagUsedDepartmentQuarterlyService; + @Autowired + private FactTagUsedAgencyQuarterlyService factTagUsedAgencyQuarterlyService; + @Autowired + private FactTagUsedGridYearlyService factTagUsedGridYearlyService; + @Autowired + private FactTagUsedDepartmentYearlyService factTagUsedDepartmentYearlyService; + @Autowired + private FactTagUsedAgencyYearlyService factTagUsedAgencyYearlyService; + @Autowired + private FactTagViewedGridDailyService factTagViewedGridDailyService; + @Autowired + private FactTagViewedAgencyDailyService factTagViewedAgencyDailyService; + @Autowired + private FactTagViewedGridMonthlyService factTagViewedGridMonthlyService; + @Autowired + private FactTagViewedAgencyMonthlyService factTagViewedAgencyMonthlyService; + @Autowired + private FactTagViewedGridQuarterlyService factTagViewedGridQuarterlyService; + @Autowired + private FactTagViewedAgencyQuarterlyService factTagViewedAgencyQuarterlyService; + @Autowired + private FactTagViewedGridYearlyService factTagViewedGridYearlyService; + @Autowired + private FactTagViewedAgencyYearlyService factTagViewedAgencyYearlyService; + @Autowired + private ExecutorService executorService; + + @Override + public Boolean articleSummaryDailyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //查询的是昨天及以前的数据 + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -1), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + String statsDateStr = DateUtils.format(statsDate); + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + //key:所在机关Id + Map agencySummaryMap = new HashMap<>(); + statsPublishedGridDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); + statsPublishedDepartmentDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); + statsPublishedAgencyDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); + } catch (Exception e) { + log.error("articlePublishedCountDayStats exception", e); + } + + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagUsedDailyStatsjob(Date statsDate) { + + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + Date finalStatsDate = statsDate; + //统计 + try { + statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagUsedMonthlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId(), e.getMessage())); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagViewedDailyStatsjob(Date statsDate) { + + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + statsTagViewedDaily(statsDate, dimIdBean, customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagViewedMonthlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagUsedQuarterlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedQuarterly", customerId, dimIdBean.getQuarterId(), e.getMessage())); + } + }); + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedYearly", customerId, dimIdBean.getYearId(), e.getMessage())); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagViewedQuarterlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + executorService.submit(() -> { + try { + log.debug("start === statsTagViewedQuarterly "); + statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getQuarterId(), e.getMessage())); + } + }); + executorService.submit(() -> { + try { + log.debug("start === statsTagViewedYearly "); + statsTagViewedYearly(dimIdBean.getYearId(), customerId); + + + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getYearId(), e.getMessage())); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + private void statsPublishedDepartmentDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //获取所有客户 + List departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId); + if (CollectionUtils.isEmpty(departmentDTOList)) { + log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId); + return; + } + + try { + //转换为 需要插入的Entity + Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, statsDate); + + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); + } + } + boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate, e.getMessage())); + } + + } + + /** + * desc:同一个机关下的数据进行类型处理 + * + * @param result + * @param summaryDTO + */ + private void buildAgencySummaryData(Map result, ArticleGridPublishedSummaryDTO summaryDTO) { + //同一个机关下数据累加 + ArticleGridPublishedSummaryDTO publishedSummaryDTO = result.get(summaryDTO.getAgencyId()); + if (publishedSummaryDTO == null) { + ArticleGridPublishedSummaryDTO summary = new ArticleGridPublishedSummaryDTO(); + summary.setCustomerId(summaryDTO.getCustomerId()); + summary.setAgencyId(summaryDTO.getAgencyId()); + summary.setGridId(summaryDTO.getGridId()); + summary.setPublisherId(summaryDTO.getPublisherId()); + summary.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + summary.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + summary.setPublishedCount(summaryDTO.getPublishedCount()); + result.put(summaryDTO.getPublisherId(), summaryDTO); + } else { + publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount() + summaryDTO.getArticlePublishedCount()); + publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount() + summaryDTO.getArticlePublishedCount()); + publishedSummaryDTO.setPublishedCount(publishedSummaryDTO.getPublishedCount() + summaryDTO.getPublishedCount()); + } + } + + /** + * desc:按日统计 文章总数数据 + * + * @param statsDate + * @param dimIdBean + * @param customerId + * @param agencySummaryMap + */ + private void statsPublishedGridDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //获取所有网格 + List gridDTOList = dimGridService.getGridListByCustomerId(customerId); + if (CollectionUtils.isEmpty(gridDTOList)) { + log.warn("publicitySummary getGridListByCustomerId return empty,customerId:{}", customerId); + return; + } + + try { + //转换为 需要插入的Entity + Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntity == null) { + log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); + continue; + } + gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + gridDailyEntity.setPublishedCount(summaryDTO.getPublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); + } + } + boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate, e.getMessage())); + } + + + } + + private void statsPublishedAgencyDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //获取所有机关 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); + return; + } + try { + //转换为 需要插入的Entity + Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); + Map haveDataAgencyDailyMap = new HashMap<>(); + Map haveDataAgencyDailySelfMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount()); + haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); + //同一个机关下数据累加 + //buildAgencySummaryData(agencySummaryMap, summaryDTO); + //构建机关自己的数据 + FactArticlePublishedAgencyDailyEntity selfDaily = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class); + selfDaily.setCustomerId(gridDailyEntities.getCustomerId()); + selfDaily.setPid(gridDailyEntities.getPid()); + selfDaily.setAgencyId(summaryDTO.getAgencyId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX)); + selfDaily.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + selfDaily.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + selfDaily.setPublishedCount(summaryDTO.getPublishedCount()); + haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily); + } + } + //数据向上级机关添加 + if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { + for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); + FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); + if (dailyEntity == null) { + log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); + } + } + //将机关本身的数据插入 + if (!CollectionUtils.isEmpty(haveDataAgencyDailySelfMap)) { + agencyDailyEntityMap.putAll(haveDataAgencyDailySelfMap); + } + log.debug("statsPublishedAgencyDaily insert:{}", JSON.toJSONString(agencyDailyEntityMap.values())); + boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate, e.getMessage())); + } + } + + /** + * desc:按日统计 标签被使用的次数 + * + * @param statsDate + * @param dimIdBean + * @param customerId + */ + private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { + + //1.业务数据来源 发布时间为统计时间的 + // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 + // 1.1查出今天所有的文章标签 根据网格Id + // 1.2 + //获取所有网格 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); + return; + } + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId + Map tagUsedGridDailyMap = new HashMap<>(); + Map tagUsedDeptDailyMap = new HashMap<>(); + Map tagUsedAgencyDailyMap = new HashMap<>(); + Map tagUsedAgencyDailySelfMap = new HashMap<>(); + //获取当天的业务数据 + //1获取文章及机关id,网格Id + List publishedArticleList = articleService.getPublishedArticleByPublishTime(customerId, DateUtils.format(statsDate)); + if (CollectionUtils.isEmpty(publishedArticleList)) { + return; + } + //KEY 文章Id + Map articleMap = publishedArticleList.stream().collect(Collectors.toMap(ArticleEntity::getId, o -> o)); + Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + //2 获取文章标签 + List articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime); + if (CollectionUtils.isEmpty(articleTagsList)) { + log.error("publicitySummary getArticleTagsByCreateTime customerId:{} have not articleTags,publishedArticleList:{}", customerId, JSON.toJSONString(publishedArticleList)); + return; + } + //tagId + for (ArticleTagsEntity tagEntity : articleTagsList) { + ArticleEntity articleEntity = articleMap.get(tagEntity.getArticleId()); + if (articleEntity == null) { + log.error("publicitySummary articleMap articleId:{} ", tagEntity.getArticleId()); + return; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(articleEntity.getOrgId()); + convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); + switch (articleEntity.getPublisherType()) { + case ProjectConstant.PUBLISHER_TYPE_GRID: + convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); + break; + case ProjectConstant.PUBLISHER_TYPE_DEPT: + convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); + break; + case ProjectConstant.PUBLISHER_TYPE_AGENCY: + convertTagUsedAgencyDailySelfEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean); + break; + } + } + + factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); + factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values()); + //向上级机关递归添加 数据 + Map finalTagUsedAgencyDailyMap = new HashMap<>(); + finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); + for (Map.Entry entry : tagUsedAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey().split(StrConstant.UNDER_LINE)[0]; + FactTagUsedAgencyDailyEntity currentEntity = entry.getValue(); + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + if (dimAgencyEntity == null) { + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + } + if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)) { + finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap); + } + factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); + + } + + /** + * desc:按日统计 标签被阅读的次数 + * + * @param statsDate + * @param dimIdBean + * @param customerId + */ + private void statsTagViewedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { + + //1.业务数据来源 发布时间为统计时间的 + // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 + // 1.1查出今天所有的文章标签 根据网格Id + // 1.2 + //获取所有机关 用于后面想上级添加数据 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.debug("statsTagViewedDaily customerId:{} have any agency", customerId); + return; + } + + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + if (CollectionUtils.isEmpty(dimGridList)) { + log.debug("statsTagViewedDaily customerId:{} have any grid", customerId); + return; + } + Map dimGridEntityMap = dimGridList.stream().collect(Collectors.toMap(DimGridEntity::getId, o -> o)); + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId + Map tagViewedGridDailyMap = new HashMap<>(); + Map tagViewedAgencyDailyMap = new HashMap<>(); + Map tagViewedAgencyDailySelfMap = new HashMap<>(); + //获取当天的业务数据 + //1获取今天文章的阅读记录数 + Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime); + if (CollectionUtils.isEmpty(visitRecordList)) { + return; + } + + for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { + List articleTagsList = articleTagsService.getArticleTagsByArticleId(customerId, viewedSummaryDTO.getArticleId()); + if (CollectionUtils.isEmpty(articleTagsList)) { + continue; + } + ArticleEntity articleEntity = articleService.selectArticleById(viewedSummaryDTO.getArticleId()); + if (articleEntity == null) { + continue; + } + boolean isAgencyPublished = false; + if (ProjectConstant.PUBLISHER_TYPE_AGENCY.equals(articleEntity.getPublisherType())) { + isAgencyPublished = true; + } + String gridId = viewedSummaryDTO.getGridId(); + DimGridEntity dimGridEntity = dimGridEntityMap.get(gridId); + + if (dimGridEntity == null) { + log.error("statsTagViewedDaily viewedRecord gridId:{} not exist in dimGridMap", gridId); + continue; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(dimGridEntity.getAgencyId()); + for (ArticleTagsEntity articleTag : articleTagsList) { + convertTagViewedGridDailyEntity(dimAgencyEntity, tagViewedGridDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + convertTagViewedAgencyDailyEntity(dimAgencyEntity, tagViewedAgencyDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + if (isAgencyPublished) { + convertTagViewedAgencyDailySelfEntity(dimAgencyEntity, tagViewedAgencyDailySelfMap, articleTag, viewedSummaryDTO, dimIdBean); + } + } + } + + factTagViewedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagViewedGridDailyMap.values()); + + //向上级机关递归添加 数据 + Map finalTagUsedAgencyDailyMap = new HashMap<>(); + finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap); + for (Map.Entry entry : tagViewedAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactTagViewedAgencyDailyEntity currentEntity = entry.getValue(); + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + if (dimAgencyEntity == null) { + + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setTagViewedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + } + if (!CollectionUtils.isEmpty(tagViewedAgencyDailySelfMap)) { + finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailySelfMap); + } + factTagViewedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); + } + + /** + * desc:按月统计 标签使用数 + * + * @param monthId + * @param customerId + */ + private void statsTagUsedMonthly(String monthId, String customerId) { + List gridDailyList = factTagUsedGridDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(gridDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagUsedGridMonthlyEntity.class); + factTagUsedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); + } + List deptDailyList = factTagUsedDepartmentDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(deptDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); + factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); + } + List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(agencyDailyList)) { + List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); + factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); + } + } + + /** + * desc:按月统计 标签使用数 + * + * @param monthId + * @param customerId + */ + private void statsTagViewedMonthly(String monthId, String customerId) { + + List gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(gridDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class); + factTagViewedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); + } + + List agencyDailyList = factTagViewedAgencyDailyService.getTagViewedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(agencyDailyList)) { + List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class); + factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); + } + + } + + /** + * desc:按季统计 标签使用数 + * + * @param quarterId + * @param customerId + */ + private void statsTagUsedQuarterly(String quarterId, String customerId) { + + List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class); + factTagUsedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); + } + List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(deptMonthlyList)) { + List deptQuarterlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentQuarterlyEntity.class); + factTagUsedDepartmentQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, deptQuarterlyList); + } + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); + factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); + } + + } + + /** + * desc:按季统计 标签查看数 + * + * @param quarterId + * @param customerId + */ + private void statsTagViewedQuarterly(String quarterId, String customerId) { + + List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); + factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); + } + + List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); + factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); + } + + } + + /** + * desc:按年统计 标签使用数 + * + * @param yearId + * @param customerId + */ + private void statsTagUsedYearly(String yearId, String customerId) { + + List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class); + factTagUsedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); + } + List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(deptMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentYearlyEntity.class); + factTagUsedDepartmentYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); + } + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); + factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); + } + + } + + /** + * desc:按年统计 标签阅读数 + * + * @param yearId + * @param customerId + */ + private void statsTagViewedYearly(String yearId, String customerId) { + + + List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); + factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); + } + List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); + factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); + } + + } + + private void setTagUsedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagUsedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) { + String pid = currentEntity.getPid(); + String tagId = currentEntity.getTagId(); + String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); + DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); + if (currentDimAgency == null) { + return; + } + if (parentAgencyDailyEntity == null) { + parentAgencyDailyEntity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + parentAgencyDailyEntity.setCustomerId(currentEntity.getCustomerId()); + parentAgencyDailyEntity.setPid(currentDimAgency.getPid()); + parentAgencyDailyEntity.setAgencyId(currentDimAgency.getId()); + parentAgencyDailyEntity.setTagId(currentEntity.getTagId()); + parentAgencyDailyEntity.setTagName(currentEntity.getTagName()); + parentAgencyDailyEntity.setUsedCount(currentEntity.getUsedCount()); + agencyDailyEntityMap.put(key, parentAgencyDailyEntity); + } else { + parentAgencyDailyEntity.setUsedCount(parentAgencyDailyEntity.getUsedCount() + currentEntity.getUsedCount()); + } + pid = currentDimAgency.getPid(); + if (!NumConstant.ZERO_STR.equals(pid)) { + setTagUsedData2ParentAgency(dimAgencyEntityMap, agencyDailyEntityMap, parentAgencyDailyEntity, dimIdBean); + } + } + + private void setTagViewedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagViewedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) { + String pid = currentEntity.getPid(); + String tagId = currentEntity.getTagId(); + String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); + DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); + if (currentDimAgency == null) { + return; + } + if (parentAgencyDailyEntity == null) { + parentAgencyDailyEntity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + parentAgencyDailyEntity.setCustomerId(currentEntity.getCustomerId()); + parentAgencyDailyEntity.setPid(currentDimAgency.getPid()); + parentAgencyDailyEntity.setAgencyId(currentDimAgency.getId()); + parentAgencyDailyEntity.setTagId(currentEntity.getTagId()); + parentAgencyDailyEntity.setTagName(currentEntity.getTagName()); + parentAgencyDailyEntity.setTagReadCount(currentEntity.getTagReadCount()); + agencyDailyEntityMap.put(key, parentAgencyDailyEntity); + } else { + parentAgencyDailyEntity.setTagReadCount(parentAgencyDailyEntity.getTagReadCount() + currentEntity.getTagReadCount()); + } + pid = currentDimAgency.getPid(); + if (!NumConstant.ZERO_STR.equals(pid)) { + setTagViewedData2ParentAgency(dimAgencyEntityMap, agencyDailyEntityMap, parentAgencyDailyEntity, dimIdBean); + } + } + + private void setPublishedData2ParentAgency(Map agencyDailyEntityMap, FactArticlePublishedAgencyDailyEntity agencySummary, FactArticlePublishedAgencyDailyEntity summary) { + String pid = summary.getPid(); + FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); + if (parentAgency == null) { + return; + } + parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount()); + parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount() + agencySummary.getArticlePublishedCount()); + parentAgency.setPublishedCount(parentAgency.getPublishedCount() + agencySummary.getPublishedCount()); + pid = parentAgency.getPid(); + if (!NumConstant.ZERO_STR.equals(pid)) { + setPublishedData2ParentAgency(agencyDailyEntityMap, agencySummary, parentAgency); + } + } + + /** + * desc:将网格对象构建为 gridDaily 对象 + * + * @param dimGridEntities + * @param dimIdBean + * @return + */ + private Map convertGridDailyEntity(List dimGridEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimGridEntities.forEach(dimGridEntity -> { + FactArticlePublishedGridDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedGridDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setAgencyId(dimGridEntity.getAgencyId()); + entity.setGridId(dimGridEntity.getId()); + entity.setArticleTotalCount(0); + entity.setArticlePublishedCount(0); + entity.setPublishedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } + + /** + * desc:将网格对象构建为 gridDaily 对象 + * + * @param dimDepartmentEntities + * @param dimIdBean + * @return + */ + private Map convertDepartmentDailyEntity(List dimDepartmentEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimDepartmentEntities.forEach(dimGridEntity -> { + FactArticlePublishedDepartmentDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedDepartmentDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setAgencyId(dimGridEntity.getAgencyId()); + entity.setDepartmentId(dimGridEntity.getId()); + entity.setArticleTotalCount(0); + entity.setArticlePublishedCount(0); + entity.setPublishedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } + + /** + * desc:将机关卫队对象构建为 agencyDaily 对象 + * + * @param dimDepartmentEntities + * @param dimIdBean + * @return + */ + private Map convertAgencyDailyEntity(List dimDepartmentEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimDepartmentEntities.forEach(dimGridEntity -> { + FactArticlePublishedAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setPid(dimGridEntity.getPid()); + entity.setAgencyId(dimGridEntity.getId()); + entity.setArticleTotalCount(0); + entity.setArticlePublishedCount(0); + entity.setPublishedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } + + + /** + * desc:将网格对象构建为 tagUsedGridDaily 对象 + * + * @param dimGridEntities + * @param dimIdBean + * @return + */ + private Map convertTagUsedGridDailyEntity(List dimGridEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimGridEntities.forEach(dimGridEntity -> { + FactTagUsedGridDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedGridDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setAgencyId(dimGridEntity.getAgencyId()); + entity.setGridId(dimGridEntity.getId()); + entity.setTagId(""); + entity.setTagName(""); + entity.setUsedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } + + private void convertTagUsedGridDailyEntity(Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String gridId = articleEntity.getPublisherId(); + String tagId = tagEntity.getTagId(); + String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedGridDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedGridDailyEntity.class); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(articleEntity.getOrgId()); + entity.setGridId(gridId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + + private void convertTagUsedDepartmentDailyEntity(Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String publisherId = articleEntity.getPublisherId(); + String tagId = tagEntity.getTagId(); + String key = publisherId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedDepartmentDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedDepartmentDailyEntity.class); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(articleEntity.getOrgId()); + entity.setDepartmentId(publisherId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + + private void convertTagUsedAgencyDailyEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String agencyId = articleEntity.getOrgId(); + String tagId = tagEntity.getTagId(); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + entity.setPid(pid); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(agencyId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + + private void convertTagUsedAgencyDailySelfEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String agencyId = articleEntity.getOrgId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); + String tagId = tagEntity.getTagId(); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + entity.setPid(pid); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(agencyId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + + private void convertTagViewedGridDailyEntity(DimAgencyEntity dimAgencyEntity, Map result, + ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { + String gridId = viewedSummaryDTO.getGridId(); + String tagId = tagEntity.getTagId(); + String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + FactTagViewedGridDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedGridDailyEntity.class); + entity.setGridId(gridId); + entity.setCustomerId(tagEntity.getCustomerId()); + entity.setAgencyId(dimAgencyEntity.getId()); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setTagReadCount(viewedCount); + result.put(key, entity); + } else { + entity.setTagReadCount(entity.getTagReadCount() + viewedCount); + } + } + + private void convertTagViewedAgencyDailyEntity(DimAgencyEntity dimAgencyEntity, Map result, + ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { + String agencyId = dimAgencyEntity.getId(); + String tagId = tagEntity.getTagId(); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + FactTagViewedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + entity.setPid(dimAgencyEntity.getPid()); + entity.setCustomerId(tagEntity.getCustomerId()); + entity.setAgencyId(agencyId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setTagReadCount(viewedCount); + result.put(key, entity); + } else { + entity.setTagReadCount(entity.getTagReadCount() + viewedCount); + } + } + + private void convertTagViewedAgencyDailySelfEntity(DimAgencyEntity dimAgencyEntity, Map result, + ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { + String agencyId = dimAgencyEntity.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); + String tagId = tagEntity.getTagId(); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + FactTagViewedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + entity.setPid(dimAgencyEntity.getPid()); + entity.setCustomerId(tagEntity.getCustomerId()); + entity.setAgencyId(agencyId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setTagReadCount(viewedCount); + result.put(key, entity); + } else { + entity.setTagReadCount(entity.getTagReadCount() + viewedCount); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java new file mode 100644 index 0000000000..e481f0a596 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java @@ -0,0 +1,98 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.service.StatsTopicService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.service.stats.DimTopicStatusService; +import com.epmet.service.stats.topic.TopicStatisticalService; +import com.epmet.service.topic.TopicService; +import com.epmet.util.DimIdGenerator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.*; + +/** + * @Description + * @ClassName StatsTopicServiceImpl + * @Auth wangc + * @Date 2020-06-23 15:22 + */ +@Service +public class StatsTopicServiceImpl implements StatsTopicService { + + protected static final Logger log = LoggerFactory.getLogger(StatsTopicServiceImpl.class); + + @Autowired + private DimCustomerService dimCustomerService; + + @Autowired + private DimAgencyService dimAgencyService; + + @Autowired + private DimTopicStatusService dimTopicStatusService; + + @Autowired + private TopicService topicService; + + @Autowired + private TopicStatisticalService topicStatisticalService; + + @Override + public void partition(Date date) { + + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + generate(customerId,date); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + + } + + void generate(String customerId,Date date){ + //1.初始化时间参数 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE, NumConstant.ONE_NEG); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + //2.初始化时间维度 + DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); + + //3.初始化话题状态维度 + Map topicStatusParams = new HashMap<>(); + topicStatusParams.put(FieldConstant.DEL_FLAG_HUMP, NumConstant.ZERO_STR); + List topicStatusDimension = dimTopicStatusService.list(topicStatusParams); + + //4.初始化机关维度 + List agencies = dimAgencyService.getAllAgency(customerId); + + //5.计算统计数据 + try { + TopicStatisticalData data = + topicService.compute(agencies, date, timeDimension, customerId, topicStatusDimension); + //6.生成唯一性统计数据 + topicStatisticalService.insertUniquely(data); + }catch(Exception e){ + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "topicStats", customerId, new Date().toString(), e.getMessage())); + } + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java new file mode 100644 index 0000000000..04101bc378 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -0,0 +1,98 @@ +package com.epmet.service.impl; + + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.service.StatsUserService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.service.stats.user.UserStatisticalService; +import com.epmet.service.user.UserService; +import com.epmet.util.DimIdGenerator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + + +/** + * @Description 生成用户统计信息 + * @ClassName StatsUserServiceImpl + * @Auth wangc + * @Date 2020-06-23 15:21 + */ +@Service +public class StatsUserServiceImpl implements StatsUserService { + + protected static final Logger log = LoggerFactory.getLogger(StatsUserServiceImpl.class); + + @Autowired + private DimCustomerService dimCustomerService; + + @Autowired + private DimAgencyService dimAgencyService; + + @Autowired + private UserService userService; + + @Autowired + private UserStatisticalService userStatisticalService; + + @Override + public void partition(Date date) { + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + generate(customerId,date); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + + } + + void generate(String customerId,Date date){ + //1.初始化时间参数 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + //获取当日的零点 + calendar.add(Calendar.DATE, NumConstant.ONE_NEG); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + + //2.初始化时间维度 + DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); + + //3.初始化机关维度 + List agencies = dimAgencyService.getAllAgency(customerId); + //List topAgencies = dimAgencyService.getTopAgency(customerId); + + //4.计算机关统计数据、生成唯一性统计数据 + try { + UserStatisticalData agencyData = userService.traverseAgencyUser(agencies, date, timeDimension); + userStatisticalService.insertUniquely(agencyData); + }catch(Exception e){ + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyUserStats", customerId, new Date().toString(), e.getMessage())); + } + + //5.计算网格统计数据、生成唯一性统计数据 + try { + UserStatisticalData gridData = userService.traverseGridUser(agencies, date, timeDimension); + userStatisticalService.insertUniquely(gridData); + }catch(Exception e){ + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridUserStats", customerId, new Date().toString(), e.getMessage())); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java new file mode 100644 index 0000000000..034499e955 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -0,0 +1,10 @@ +package com.epmet.service.org; + +import com.epmet.entity.org.CustomerAgencyEntity; + +import java.util.Date; +import java.util.List; + +public interface CustomerAgencyService { + List listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java new file mode 100644 index 0000000000..1aa2c2f7db --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java @@ -0,0 +1,11 @@ +package com.epmet.service.org; + +import com.epmet.entity.org.CustomerDepartmentEntity; + +import java.util.Date; +import java.util.List; + +public interface CustomerDepartmentService { + + List listDepartmentsByCreatedTime(Date createdTimeFrom, Date createdTimeTo); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java new file mode 100644 index 0000000000..00b46e8b75 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -0,0 +1,35 @@ +package com.epmet.service.org; + +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; +import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.entity.org.CustomerGridEntity; + +import java.util.Date; +import java.util.List; + +public interface CustomerGridService { + /** + * 根据创建时间,截取时间段内的网格 + * @param start + * @param end + * @return + * @Param("start") Date start, @Param("end") Date end + */ + List listGridsByCreateTime(Date start, Date end); + + /** + * @Description 查询机关下有多少网格 + * @param community + * @author zxc + */ + List selectAgencyGridTotalCount(List community, String dateId); + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + List getCustomerGridIdList(String customerId, String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java new file mode 100644 index 0000000000..d5086c6b4e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java @@ -0,0 +1,12 @@ +package com.epmet.service.org; + +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.entity.org.CustomerAgencyEntity; + +import java.util.List; + +public interface DemoGovOrgService { + List listAllEntities(); + + List getAllAgency(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java new file mode 100644 index 0000000000..2912ca0cca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -0,0 +1,25 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.StatsCustomerAgencyDao; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.org.CustomerAgencyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +@DataSource(DataSourceConstant.GOV_ORG) +public class CustomerAgencyServiceImpl implements CustomerAgencyService { + + @Autowired + private StatsCustomerAgencyDao customerAgencyDao; + + @Override + public List listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime) { + return customerAgencyDao.listAgenciesByCreateTime(statsStartTime, statsEndTime); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java new file mode 100644 index 0000000000..ac430a3abd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java @@ -0,0 +1,31 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.CustomerDepartmentDao; +import com.epmet.entity.org.CustomerDepartmentEntity; +import com.epmet.service.org.CustomerDepartmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +@DataSource(DataSourceConstant.GOV_ORG) +public class CustomerDepartmentServiceImpl implements CustomerDepartmentService { + + @Autowired + private CustomerDepartmentDao departmentDao; + + /** + * 根据创建时间查询部门列表 + * @param createdTimeFrom + * @param createdTimeTo + * @return + */ + @Override + public List listDepartmentsByCreatedTime(Date createdTimeFrom, Date createdTimeTo) { + return departmentDao.listDepartmentsByCreatedTime(createdTimeFrom, createdTimeTo); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java new file mode 100644 index 0000000000..fc95a3de29 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -0,0 +1,49 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.CustomerGridDao; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; +import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.service.org.CustomerGridService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +@DataSource(DataSourceConstant.GOV_ORG) +public class CustomerGridServiceImpl implements CustomerGridService { + + @Autowired + private CustomerGridDao customerGridDao; + + @Override + public List listGridsByCreateTime(Date start, Date end) { + return customerGridDao.listGridsByCreateTime(start, end); + } + + /** + * @Description 查询机关下有多少网格 + * @param community + * @author zxc + */ + @Override + public List selectAgencyGridTotalCount(List community, String dateId) { + return customerGridDao.selectAgencyGridTotalCount(community,dateId); + } + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + @Override + public List getCustomerGridIdList(String customerId, String dateId) { + return customerGridDao.getCustomerGridIdList(customerId, dateId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java new file mode 100644 index 0000000000..0d1f46e0cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java @@ -0,0 +1,29 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.StatsCustomerAgencyDao; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.org.DemoGovOrgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@DataSource(DataSourceConstant.GOV_ORG) +public class DemoGovOrgServiceImpl implements DemoGovOrgService { + @Autowired + private StatsCustomerAgencyDao govOrgDao; + + @Override + public List listAllEntities() { + return govOrgDao.listAllEntities(); + } + + @Override + public List getAllAgency() { + return govOrgDao.selectAllAgency(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java new file mode 100644 index 0000000000..729e724267 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -0,0 +1,40 @@ +/** + * 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.project; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.entity.project.ProjectProcessEntity; + +import java.util.List; + +/** + * 项目处理进展表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +public interface ProjectProcessService extends BaseService { + + /** + * @param projectEntity + * @Author sun + * @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + **/ + List getProcessList(ProjectEntity projectEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java new file mode 100644 index 0000000000..45929aebb7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.project; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.entity.project.ProjectEntity; + +import java.util.List; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +public interface ProjectService extends BaseService { + + /** + * @param projectEntity + * @Author sun + * @Description 根据客户Id查询客户项目业务表有效数据 + **/ + List getProjectList(ProjectEntity projectEntity); + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyClosedProjectTotal(String customerId, String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyClosedProjectInc(String customerId, String date); + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedProjectTotal(String customerId, String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedProjectInc(String customerId, String date); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java new file mode 100644 index 0000000000..de1a52e1c2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -0,0 +1,50 @@ +/** + * 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.project.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.project.ProjectProcessDao; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.entity.project.ProjectProcessEntity; +import com.epmet.service.project.ProjectProcessService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目处理进展表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.GOV_PROJECT) +public class ProjectProcessServiceImpl extends BaseServiceImpl implements ProjectProcessService { + + /** + * @param projectEntity + * @Author sun + * @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + **/ + @Override + public List getProcessList(ProjectEntity projectEntity) { + return baseDao.selectProcessList(projectEntity); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java new file mode 100644 index 0000000000..0a5bac27b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -0,0 +1,73 @@ +/** + * 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.project.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.project.ProjectDao; +import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.service.project.ProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.GOV_PROJECT) +public class ProjectServiceImpl extends BaseServiceImpl implements ProjectService { + + /** + * @param projectEntity + * @Author sun + * @Description 根据客户Id查询客户项目业务表有效数据 + **/ + @Override + public List getProjectList(ProjectEntity projectEntity) { + return baseDao.selectProjectList(projectEntity); + } + + @Override + public List getAgencyClosedProjectTotal(String customerId, String date) { + return baseDao.selectAgencyClosedProjectTotal(customerId, date); + } + + @Override + public List getAgencyClosedProjectInc(String customerId, String date) { + return baseDao.selectAgencyClosedProjectInc(customerId, date); + } + + @Override + public List getGridClosedProjectTotal(String customerId, String date) { + return baseDao.selectGridClosedProjectTotal(customerId, date); + } + + @Override + public List getGridClosedProjectInc(String customerId, String date) { + return baseDao.selectGridClosedProjectInc(customerId, date); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemoDataStatsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemoDataStatsService.java new file mode 100644 index 0000000000..3c279b489a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemoDataStatsService.java @@ -0,0 +1,7 @@ +package com.epmet.service.stats; + +public interface DemoDataStatsService { + + void testTx(); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java new file mode 100644 index 0000000000..8d4e8d938d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -0,0 +1,176 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.AgencySubDeptTreeDto; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.entity.stats.DimAgencyEntity; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimAgencyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimAgencyDTO + * @author generator + * @date 2020-06-16 + */ + DimAgencyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimAgencyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimAgencyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + /** + * @param dto + * @return + * @Author sun + * @Description 根据客户Id查询机关维度列表数据 + **/ + List getDimAgencyList(DimAgencyDTO dto); + + /** + * 初始化机关维度 + * @param agencies + */ + void initAgencyDims(List agencies); + + /** + * @Description 查询所有机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + List getAllAgency(String customerId); + + /** + * @Description 查询顶级机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + List getTopAgency(String customerId); + + /** + * desc: 根据客户Id 获取机关列表数据 + * + * @param customerId + * @return: + * @date: 2020/6/18 17:54 + * @author: jianjun liu + */ + List getAgencyListByCustomerId(String customerId); + + + + /** + * @Description 带部门 查询所有机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + List getAllAgencyWithDept(); + + + /** + * @Description 带部门 查询顶级机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + List getTopAgencyWithDept(); + + /** + * @Description 根据customerId获取机关信息 + * @param customerId + * @author zxc + */ + List getAgencyInfoByCustomerId(String customerId); + + /** + * @Description 根据机关Id获取上级机关ID + * @param agencyId + * @author zxc + */ + String getPidByAgencyId(String agencyId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java new file mode 100644 index 0000000000..a2d7aadaf5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimCustomerDTO; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.entity.org.CustomerDepartmentEntity; +import com.epmet.entity.stats.DimCustomerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimCustomerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimCustomerDTO + * @author generator + * @date 2020-06-16 + */ + DimCustomerDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimCustomerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimCustomerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + /** + * desc: 分页获取 客户id + * + * @param pageNo + * @param pageSize + * return: List + * @date: 2020/6/17 16:26 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List selectCustomerIdPage(Integer pageNo, Integer pageSize); + + /** + * 添加客户维度 + * @param customers + */ + void initCustomerDims(List customers); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java new file mode 100644 index 0000000000..02f644be46 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimDateDTO; +import com.epmet.entity.stats.DimDateEntity; + +import java.util.List; +import java.util.Map; + +/** + * 日期维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimDateService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimDateDTO + * @author generator + * @date 2020-06-16 + */ + DimDateDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimDateDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimDateDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + void initDimDate(); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java new file mode 100644 index 0000000000..7bf0b63b7c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java @@ -0,0 +1,108 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimDepartmentDTO; +import com.epmet.entity.org.CustomerDepartmentEntity; +import com.epmet.entity.stats.DimDepartmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户部门维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimDepartmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimDepartmentDTO + * @author generator + * @date 2020-06-16 + */ + DimDepartmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimDepartmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimDepartmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + void initDepartmentDims(List departments); + + /** + * desc: 根据客户Id获取 部门数据 + * + * @param null + * @return: + * @date: 2020/6/18 17:45 + * @author: jianjun liu + */ + List getDepartmentListByCustomerId(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java new file mode 100644 index 0000000000..312659eb96 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java @@ -0,0 +1,131 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridInfoResultDTO; +import com.epmet.dto.group.result.SubAgencyIdResultDTO; +import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.LastExecRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimGridService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimGridDTO + * @author generator + * @date 2020-06-16 + */ + DimGridDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimGridDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimGridDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + DimGridEntity getLastCreatedGridDim(); + + /** + * 初始化网格维度 + * @param gridDims + */ + void initGridDims(List gridDims); + + /** + * desc: 根据客户Id获取 该客户下所有的网格数据 + * + * @param customerId + * @return: List + * @date: 2020/6/18 10:28 + * @author: jianjun liu + */ + List getGridListByCustomerId(String customerId); + + /** + * @Description 查询机关下的网格 + * @param formDTO + * @author zxc + */ + List selectAgencyGridInfo(List formDTO); + + /** + * @Description 根据当前机关ID查询下级机关ID + * @param formDTO + * @author zxc + */ + List selectSubAgencyId(List formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java new file mode 100644 index 0000000000..d6f8a75943 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java @@ -0,0 +1,97 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimMonthDTO; +import com.epmet.entity.stats.DimMonthEntity; + +import java.util.List; +import java.util.Map; + +/** + * 月份维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimMonthService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimMonthDTO + * @author generator + * @date 2020-06-16 + */ + DimMonthDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimMonthDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimMonthDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + void initMonthDim(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimQuarterService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimQuarterService.java new file mode 100644 index 0000000000..5e6fb31998 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimQuarterService.java @@ -0,0 +1,97 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimQuarterDTO; +import com.epmet.entity.stats.DimQuarterEntity; + +import java.util.List; +import java.util.Map; + +/** + * 季度维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimQuarterService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimQuarterDTO + * @author generator + * @date 2020-06-16 + */ + DimQuarterDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimQuarterDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimQuarterDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + void initQuarterDim(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimTopicStatusService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimTopicStatusService.java new file mode 100644 index 0000000000..98d38951a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimTopicStatusService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.entity.stats.DimTopicStatusEntity; + +import java.util.List; +import java.util.Map; + +/** + * 话题状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimTopicStatusService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimTopicStatusDTO + * @author generator + * @date 2020-06-16 + */ + DimTopicStatusDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimTopicStatusDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimTopicStatusDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java new file mode 100644 index 0000000000..1737b3354b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java @@ -0,0 +1,97 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimWeekDTO; +import com.epmet.entity.stats.DimWeekEntity; + +import java.util.List; +import java.util.Map; + +/** + * 周维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimWeekService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimWeekDTO + * @author generator + * @date 2020-06-16 + */ + DimWeekDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimWeekDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimWeekDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + void initWeekDim(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java new file mode 100644 index 0000000000..ed840f7636 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimYearDTO; +import com.epmet.entity.stats.DimYearEntity; + +import java.util.List; +import java.util.Map; + +/** + * 年维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimYearService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimYearDTO + * @author generator + * @date 2020-06-16 + */ + DimYearDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimYearDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimYearDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + + void initYearDim(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java new file mode 100644 index 0000000000..f7df122755 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.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.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; + +import java.util.List; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactAgencyProjectDailyService extends BaseService { + + /** + * @param formDTO + * @Author sun + * @Description 查询上一月机关日统计数据,按时间倒序 + **/ + List getMonthProjectList(MonthProjectListFormDTO formDTO); + + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateProject(FactAgencyProjectDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java new file mode 100644 index 0000000000..e1e6ebdc25 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactAgencyProjectMonthlyService extends BaseService { + + /** + * @param delEntity + * @return + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除可能存在的历史数据 + **/ + void delMonthProject(FactAgencyProjectMonthlyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java new file mode 100644 index 0000000000..dc9d7e3d63 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.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.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; + +import java.util.Collection; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactArticlePublishedAgencyDailyService extends BaseService { + + /** + * desc: 删除并插入数据 + * + * @param customerId + * @param dateId + * @param values + * @return: + * @date: 2020/6/18 18:59 + * @author: jianjun liu + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java new file mode 100644 index 0000000000..40ae1d8002 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.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.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; + +import java.util.Collection; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactArticlePublishedDepartmentDailyService extends BaseService { + + /** + * desc: 删除并插入数据 + * + * @param dateId + * @param values + * @return: + * @date: 2020/6/18 14:54 + * @author: jianjun liu + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java new file mode 100644 index 0000000000..d19038fa4e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.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.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactArticlePublishedGridDailyService extends BaseService { + + /** + * desc: 根据客户Id 获取统计日期的 数据 + * + * @param customerId + * @param dateId + * @return: List + * @date: 2020/6/18 9:53 + * @author: jianjun liu + */ + @Deprecated + List getByBeforeDay(String customerId, String dateId); + + /** + * desc: 删除并插入数据 + * + * @param dateId + * @param values + * @return: + * @date: 2020/6/18 14:54 + * @author: jianjun liu + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java new file mode 100644 index 0000000000..f9d0e69145 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.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.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; +import com.epmet.entity.stats.FactGridProjectDailyEntity; + +import java.util.List; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGridProjectDailyService extends BaseService { + + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateProject(FactAgencyProjectDailyEntity delEntity); + + /** + * @param formDTO + * @Author sun + * @Description 查询上一月网格日统计数据,按时间倒序 + **/ + List getMonthProjectList(MonthProjectListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java new file mode 100644 index 0000000000..502ea11e62 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java @@ -0,0 +1,37 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; +import com.epmet.entity.stats.FactGridProjectMonthlyEntity; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGridProjectMonthlyService extends BaseService { + + /** + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除一下可能存在的历史数据 + **/ + void delMonthProject(FactAgencyProjectMonthlyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java new file mode 100644 index 0000000000..913525715a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java @@ -0,0 +1,119 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; +import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; +import com.epmet.dto.stats.FactGroupAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 组-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGroupAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupAgencyDailyDTO + * @author generator + * @date 2020-06-16 + */ + FactGroupAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(FactGroupAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(FactGroupAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + /** + * @Description 插入网格小组数据 【机关-日】 + * @param agencyList + * @author zxc + */ + void insertGroupAgencyDaily(List agencyList,String customerId); + + /** + * @Description 获取 网格小组【机关-日统计】的最后一天数据 + * @param + * @author zxc + */ + List getLastDayAgency(String monthId); + + /** + * @Description 查询 月的小组增量 + * @param monthId + * @author zxc + */ + List getMonthGroupIncr(String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java new file mode 100644 index 0000000000..75e43242c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.stats.FactGroupAgencyMonthlyDTO; +import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 组-机关月统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGroupAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupAgencyMonthlyDTO + * @author generator + * @date 2020-06-16 + */ + FactGroupAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(FactGroupAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(FactGroupAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + /** + * @Description 统计网格小组 【机关-月】 + * @param agencyMonth + * @author zxc + */ + void insertAgencyGroupMonthly(List agencyMonth); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java new file mode 100644 index 0000000000..bcf2157ecd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.dto.stats.FactGroupGridDailyDTO; +import com.epmet.entity.stats.FactGroupGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 组-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGroupGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupGridDailyDTO + * @author generator + * @date 2020-06-16 + */ + FactGroupGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(FactGroupGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(FactGroupGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + /** + * @Description 统计小组【网格-日】 + * @param formDto + * @author zxc + */ + void statisticsGroupGridDaily(List formDto,String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java new file mode 100644 index 0000000000..9334a5637c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactIssueAgencyDailyDTO; +import com.epmet.entity.stats.FactIssueAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactIssueAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactIssueAgencyDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactIssueAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactIssueAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactIssueAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); + + /** + * 根据客户ID删除 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param customerId + * @param dateId + * @return void + */ + void deleteByCustomerId(String customerId, String dateId); + + /** + * 批量保存 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param list + * @return void + */ + void saveList(List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java new file mode 100644 index 0000000000..b388e8ee58 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java @@ -0,0 +1,124 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactIssueAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactIssueAgencyMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactIssueAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactIssueAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactIssueAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); + + /** + * 统计网格议题各个指标月度增量 + * @author zhaoqifeng + * @date 2020/6/19 10:53 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getAgencyMonthlyInc(String customerId, String monthId); + + /** + * 根据客户ID删除 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(String customerId, String monthId); + + /** + * 批量保存 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param list + * @return void + */ + void saveList(List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java new file mode 100644 index 0000000000..786f71ac90 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactIssueGridDailyDTO; +import com.epmet.entity.stats.FactIssueGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactIssueGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactIssueGridDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactIssueGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactIssueGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactIssueGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); + + /** + * 根据客户ID删除 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param customerId + * @param dateId + * @return void + */ + void deleteByCustomerId(String customerId, String dateId); + + /** + * 批量保存 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param list + * @return void + */ + void saveList(List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java new file mode 100644 index 0000000000..a40b8c7236 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java @@ -0,0 +1,124 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactIssueGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactIssueGridMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactIssueGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactIssueGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactIssueGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); + + /** + * 议题增量月统计 + * @author zhaoqifeng + * @date 2020/6/19 15:26 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getGridMonthlyInc(String customerId, String monthId); + + /** + * 根据客户ID删除 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(String customerId, String monthId); + + /** + * 批量保存 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param list + * @return void + */ + void saveList(List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java new file mode 100644 index 0000000000..da57ca03b9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java @@ -0,0 +1,50 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyDailyService extends BaseService { + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据月份获取 机关汇总数据 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java new file mode 100644 index 0000000000..3c90d2003a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; + +import java.util.List; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java new file mode 100644 index 0000000000..81c04f9735 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; + +import java.util.List; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyQuarterlyService extends BaseService { + + + boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java new file mode 100644 index 0000000000..83f4049722 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java @@ -0,0 +1,36 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; + +import java.util.List; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyYearlyService extends BaseService { + + int deleteByYearId(String customerId, String yearId); + + Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java new file mode 100644 index 0000000000..c13158859e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java @@ -0,0 +1,49 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentDailyService extends BaseService { + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据客户Id,月份Id 按照部门Id 标签Id分组 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java new file mode 100644 index 0000000000..3eae455daa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; + +import java.util.List; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java new file mode 100644 index 0000000000..849a7c3d4e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; + +import java.util.List; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentQuarterlyService extends BaseService { + + + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List deptQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java new file mode 100644 index 0000000000..672940a9fb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; + +import java.util.List; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentYearlyService extends BaseService { + + + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java new file mode 100644 index 0000000000..b86c537b27 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java @@ -0,0 +1,50 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridDailyService extends BaseService { + + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据客户Id 获取网格 某月数据,按照网格分组 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java new file mode 100644 index 0000000000..36917fcba2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; + +import java.util.List; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java new file mode 100644 index 0000000000..468c28a2de --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java @@ -0,0 +1,34 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; + +import java.util.List; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridQuarterlyService extends BaseService { + + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java new file mode 100644 index 0000000000..027b00a376 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.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.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; + +import java.util.List; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridYearlyService extends BaseService { + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java new file mode 100644 index 0000000000..bd24b1afd7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyDailyService extends BaseService { + + + Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + List getTagViewedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java new file mode 100644 index 0000000000..02c2604600 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyMonthlyService extends BaseService { + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList); + + List getTagViewedCountByQuarterId(String customerId, String quarterId); + + List getTagViewedCountByYearId(String customerId, String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java new file mode 100644 index 0000000000..e32ca8ad7e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java @@ -0,0 +1,34 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyQuarterlyService extends BaseService { + + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java new file mode 100644 index 0000000000..abd0e42e08 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java @@ -0,0 +1,35 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyYearlyService extends BaseService { + + + Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java new file mode 100644 index 0000000000..dbd488ade2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java @@ -0,0 +1,37 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridDailyService extends BaseService { + + Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + List getTagViewedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java new file mode 100644 index 0000000000..6c5ccc8840 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java @@ -0,0 +1,38 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridMonthlyService extends BaseService { + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); + + List getTagViewedCountByQuarterId(String customerId, String quarterId); + + List getTagViewedCountByYearId(String customerId, String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java new file mode 100644 index 0000000000..9e224c8802 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java @@ -0,0 +1,34 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridQuarterlyService extends BaseService { + + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java new file mode 100644 index 0000000000..c18d0a7385 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java @@ -0,0 +1,34 @@ +/** + * 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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridYearlyService extends BaseService { + + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java new file mode 100644 index 0000000000..35bf90a324 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java @@ -0,0 +1,10 @@ +package com.epmet.service.stats; + +import com.epmet.entity.stats.LastExecRecordEntity; + +public interface LastExecRecordService { + LastExecRecordEntity getLastExecRecord(String statsSubject); + LastExecRecordEntity createLastExecRecord(String statsSubject); + + void updateById(LastExecRecordEntity lastExecRecord); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java new file mode 100644 index 0000000000..698a7c2881 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java @@ -0,0 +1,39 @@ +package com.epmet.service.stats.impl; + + +import com.epmet.dao.stats.DimYearDao; +import com.epmet.entity.stats.DimYearEntity; +import com.epmet.service.stats.DemoDataStatsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; + +/** + * 默认为统计数据源,不需要手动指定 + */ +@Service +public class DemoDataStatsServiceImpl implements DemoDataStatsService { + + @Autowired + private DimYearDao dimYearDao; + + /** + * 此service可以加事务 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void testTx() { + DimYearEntity dimYearEntity = new DimYearEntity(); + dimYearEntity.setYearName("1"); + dimYearEntity.setId("bbb"); + dimYearEntity.setCreatedBy(""); + dimYearEntity.setDelFlag(""); + dimYearEntity.setRevision(0); + dimYearEntity.setUpdatedBy(""); + dimYearEntity.setUpdatedTime(new Date()); + dimYearDao.insertOne(dimYearEntity); + dimYearDao.insert(dimYearEntity); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java new file mode 100644 index 0000000000..fe45c20ddc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -0,0 +1,249 @@ +/** + * 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.stats.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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DimAgencyConstant; +import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimAgencyDao; +import com.epmet.dao.stats.LastExecRecordDao; +import com.epmet.dto.AgencySubDeptTreeDto; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.service.stats.DimAgencyService; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class DimAgencyServiceImpl extends BaseServiceImpl implements DimAgencyService { + + @Autowired + private LastExecRecordDao lastExecRecordDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimAgencyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimAgencyDTO.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 DimAgencyDTO get(String id) { + DimAgencyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimAgencyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimAgencyDTO dto) { + DimAgencyEntity entity = ConvertUtils.sourceToTarget(dto, DimAgencyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimAgencyDTO dto) { + DimAgencyEntity entity = ConvertUtils.sourceToTarget(dto, DimAgencyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param dto + * @return + * @Author sun + * @Description 根据客户Id查询机关维度列表数据 + **/ + @Override + public List getDimAgencyList(DimAgencyDTO dto) { + return baseDao.selectDimAgencyList(dto); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initAgencyDims(List agencies) { + for (CustomerAgencyEntity agency : agencies) { + initAgencyAllDim(agency); + initAgencySelfDim(agency); + } + + lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_AGENCY); + } + + public void initAgencyAllDim(CustomerAgencyEntity agency) { + DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); + dimAgencyEntity.setAgencyName(agency.getOrganizationName()); + dimAgencyEntity.setAllParentName(agency.getAllParentName()); + dimAgencyEntity.setCustomerId(agency.getCustomerId()); + dimAgencyEntity.setLevel(agency.getLevel()); + dimAgencyEntity.setAgencyDimType(DimAgencyConstant.TYPE_ALL); + dimAgencyEntity.setPid(agency.getPid()); + dimAgencyEntity.setPids(agency.getPids()); + dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setId(agency.getId()); + baseDao.insert(dimAgencyEntity); + } + + /** + * 初始化机关单位本身的维度(不包含本身) + * @param agency + */ + public void initAgencySelfDim(CustomerAgencyEntity agency) { + DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); + dimAgencyEntity.setAgencyName(agency.getOrganizationName()); + dimAgencyEntity.setAllParentName(agency.getAllParentName()); + dimAgencyEntity.setCustomerId(agency.getCustomerId()); + dimAgencyEntity.setLevel(agency.getLevel()); + dimAgencyEntity.setPid(agency.getId()); + dimAgencyEntity.setAgencyDimType(DimAgencyConstant.TYPE_SELF); + dimAgencyEntity.setPids(agency.getPids().concat(":").concat(agency.getId())); + dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setId(agency.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX)); + baseDao.insert(dimAgencyEntity); + } + + /** + * @Description 查询所有机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + @Override + public List getAllAgency(String customerId) { + return baseDao.selectAllAgency(customerId); + } + + + /** + * @Description 查询顶级机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + @Override + public List getTopAgency(String customerId) { + return baseDao.selectTopAgency(customerId); + } + + @Override + public List getAgencyListByCustomerId(String customerId) { + if (StringUtils.isBlank(customerId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getAgencyListByCustomerId(customerId); + } + + + + /** + * @Description 带部门 查询所有机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + @Override + public List getAllAgencyWithDept() { + return baseDao.selectAllAgencyWithDept(); + } + + + /** + * @Description 带部门 查询顶级机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + @Override + public List getTopAgencyWithDept() { + return baseDao.selectTopAgencyWithDept(); + } + + /** + * @Description 根据customerId获取机关信息 + * @param customerId + * @author zxc + */ + @Override + public List getAgencyInfoByCustomerId(String customerId) { + return baseDao.selectDimAgencyByCustomerId(customerId); + } + + /** + * @Description 根据机关Id获取上级机关ID + * @param agencyId + * @author zxc + */ + @Override + public String getPidByAgencyId(String agencyId) { + return baseDao.getPidByAgencyId(agencyId); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java new file mode 100644 index 0000000000..71663ccc5a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java @@ -0,0 +1,134 @@ +/** + * 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.stats.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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimCustomerDao; +import com.epmet.dao.stats.LastExecRecordDao; +import com.epmet.dto.stats.DimCustomerDTO; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.entity.stats.DimCustomerEntity; +import com.epmet.service.stats.DimCustomerService; +import lombok.extern.slf4j.Slf4j; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +@Slf4j +public class DimCustomerServiceImpl extends BaseServiceImpl implements DimCustomerService { + + @Autowired + private LastExecRecordDao lastExecRecordDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimCustomerDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimCustomerDTO.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 DimCustomerDTO get(String id) { + DimCustomerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimCustomerDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimCustomerDTO dto) { + DimCustomerEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimCustomerDTO dto) { + DimCustomerEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List selectCustomerIdPage(Integer pageNo, Integer pageSize) { + if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 0) { + log.error("selectCustomerIdPage param error,pageNo:{},pageSize:{}", pageNo, pageSize); + throw new RenException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(), EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getMsg()); + } + return baseDao.selectCustomerIdPage((pageNo - 1) * pageSize,pageSize); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initCustomerDims(List customers) { + for (CustomerEntity customer : customers) { + DimCustomerEntity dim = new DimCustomerEntity(); + dim.setCustomerName(customer.getCustomerName()); + dim.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setId(customer.getId()); + baseDao.insert(dim); + } + lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_CUSTOMER); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java new file mode 100644 index 0000000000..f6f0d9ee55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -0,0 +1,185 @@ +/** + * 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.stats.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.commons.tools.utils.DateUtils; +import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimDateDao; +import com.epmet.dto.stats.DimDateDTO; +import com.epmet.entity.stats.DimDateEntity; +import com.epmet.entity.stats.LastExecRecordEntity; +import com.epmet.service.stats.DimDateService; +import com.epmet.service.stats.LastExecRecordService; +import com.epmet.util.DimIdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.joda.time.LocalDate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 日期维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class DimDateServiceImpl extends BaseServiceImpl implements DimDateService { + + @Autowired + private LastExecRecordService lastExecRecordService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimDateDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimDateDTO.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 DimDateDTO get(String id) { + DimDateEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimDateDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimDateDTO dto) { + DimDateEntity entity = ConvertUtils.sourceToTarget(dto, DimDateEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimDateDTO dto) { + DimDateEntity entity = ConvertUtils.sourceToTarget(dto, DimDateEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initDimDate() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_DATE); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_DATE); + } + + Date now = new Date(); + + Date targetDate = DateUtils.addDateDays(DateUtils.parse( + DateUtils.format(now, DateUtils.DATE_PATTERN_YYYYMMDD), + DateUtils.DATE_PATTERN_YYYYMMDD), -1); + + Date lastDimDate = null; + + if ((lastDimDate = lastExecRecord.getExecTime()) == null) { + // 首次初始化按日维度 + initDimDate(targetDate); + lastExecRecord.setExecTime(now); + lastExecRecordService.updateById(lastExecRecord); + } else { + if (targetDate.equals(lastDimDate) || targetDate.after(lastDimDate)) { + initDimDate(lastDimDate, targetDate); + lastExecRecord.setExecTime(now); + lastExecRecordService.updateById(lastExecRecord); + } + } + } + + /** + * 连续初始化 + * @param startDate + * @param targetDate + */ + private void initDimDate(Date startDate, Date targetDate) { + LocalDate localStartDate = new LocalDate(startDate); + LocalDate localTargetDate = new LocalDate(targetDate); + while (localTargetDate.isEqual(localStartDate) || localTargetDate.isAfter(localStartDate)) { + initDimDate(localStartDate.toDate()); + localStartDate = localStartDate.plusDays(1); + } + } + + /** + * 初始化单日 + * @param targetDate + */ + public void initDimDate(Date targetDate) { + DimDateEntity dimDateEntity = generateDimDate(targetDate); + baseDao.insert(dimDateEntity); + } + + public DimDateEntity generateDimDate(Date targetDate) { + // 日期id + String id = DimIdGenerator.getDateDimId(targetDate); + // 月份id + String monthId = DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYYMM); + // 日期名称字符串 + String dateNameStr = DateUtils.format(targetDate, DateUtils.DATE_NAME_PATTERN); + // 星期几 + String chineseWeekName = DateUtils.getWeekNameOfWeek(targetDate, DateUtils.WEEK_TYPE_CHINESE); + String englishWeekName = DateUtils.getWeekNameOfWeek(targetDate, DateUtils.WEEK_TYPE_ENGLISH); + // 一年的第几周 + String weekId = DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(targetDate))); + + DimDateEntity dimDateEntity = new DimDateEntity(); + dimDateEntity.setId(id); + dimDateEntity.setDateName(dateNameStr); + dimDateEntity.setDayOfWeek(englishWeekName); + dimDateEntity.setDayOfWeekName(chineseWeekName); + dimDateEntity.setWeekId(weekId); + dimDateEntity.setMonthId(monthId); + dimDateEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dimDateEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + return dimDateEntity; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java new file mode 100644 index 0000000000..276908d48d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java @@ -0,0 +1,133 @@ +/** + * 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.stats.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.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimDepartmentDao; +import com.epmet.dao.stats.LastExecRecordDao; +import com.epmet.dto.stats.DimDepartmentDTO; +import com.epmet.entity.org.CustomerDepartmentEntity; +import com.epmet.entity.stats.DimDepartmentEntity; +import com.epmet.service.stats.DimDepartmentService; +import lombok.extern.slf4j.Slf4j; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 客户部门维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Slf4j +@Service +public class DimDepartmentServiceImpl extends BaseServiceImpl implements DimDepartmentService { + + @Autowired + private LastExecRecordDao lastExecRecordDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimDepartmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimDepartmentDTO.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 DimDepartmentDTO get(String id) { + DimDepartmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimDepartmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimDepartmentDTO dto) { + DimDepartmentEntity entity = ConvertUtils.sourceToTarget(dto, DimDepartmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimDepartmentDTO dto) { + DimDepartmentEntity entity = ConvertUtils.sourceToTarget(dto, DimDepartmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initDepartmentDims(List departments) { + for (CustomerDepartmentEntity department : departments) { + DimDepartmentEntity dim = new DimDepartmentEntity(); + dim.setAgencyId(department.getAgencyId()); + dim.setCustomerId(department.getCustomerId()); + dim.setDepartmentName(department.getDepartmentName()); + dim.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setId(department.getId()); + baseDao.insert(dim); + } + lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_DEPARTMENT); + } + + @Override + public List getDepartmentListByCustomerId(String customerId) { + if (StringUtils.isBlank(customerId)){ + log.warn("getDepartmentListByCustomerId param is blank "); + } + return baseDao.getDepartmentListByCustomerId(customerId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java new file mode 100644 index 0000000000..72bdafb3c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java @@ -0,0 +1,159 @@ +/** + * 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.stats.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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimGridDao; +import com.epmet.dao.stats.LastExecRecordDao; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridInfoResultDTO; +import com.epmet.dto.group.result.SubAgencyIdResultDTO; +import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.LastExecRecordEntity; +import com.epmet.service.stats.DimGridService; +import com.epmet.service.stats.LastExecRecordService; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class DimGridServiceImpl extends BaseServiceImpl implements DimGridService { + + @Autowired + private LastExecRecordDao lastExecRecordDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimGridDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimGridDTO.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 DimGridDTO get(String id) { + DimGridEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimGridDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimGridDTO dto) { + DimGridEntity entity = ConvertUtils.sourceToTarget(dto, DimGridEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimGridDTO dto) { + DimGridEntity entity = ConvertUtils.sourceToTarget(dto, DimGridEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public DimGridEntity getLastCreatedGridDim() { + return baseDao.getLastCreatedGridDimEntity(); + } + + /** + * 初始化网格维度 + * @param gridDims + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void initGridDims(List gridDims) { + for (DimGridEntity gridDim : gridDims) { + baseDao.insert(gridDim); + } + + lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_GRID); + } + + @Override + public List getGridListByCustomerId(String customerId) { + if (StringUtils.isBlank(customerId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getGridListByCustomerId(customerId); + } + + /** + * @Description 查询机关下的网格 + * @param formDTO + * @author zxc + */ + @Override + public List selectAgencyGridInfo(List formDTO) { + return baseDao.selectAgencyGridInfo(formDTO); + } + + /** + * @Description 根据当前机关ID查询下级机关ID + * @param formDTO + * @author zxc + */ + @Override + public List selectSubAgencyId(List formDTO) { + return baseDao.selectSubAgencyId(formDTO); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java new file mode 100644 index 0000000000..19eea4c1fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java @@ -0,0 +1,169 @@ +/** + * 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.stats.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.commons.tools.utils.DateUtils; +import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimMonthDao; +import com.epmet.dto.stats.DimMonthDTO; +import com.epmet.entity.stats.DimMonthEntity; +import com.epmet.entity.stats.LastExecRecordEntity; +import com.epmet.service.stats.DimMonthService; +import com.epmet.service.stats.LastExecRecordService; +import com.epmet.util.DimIdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.joda.time.LocalDate; +import org.joda.time.LocalTime; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 月份维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class DimMonthServiceImpl extends BaseServiceImpl implements DimMonthService { + + @Autowired + private LastExecRecordService lastExecRecordService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimMonthDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimMonthDTO.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 DimMonthDTO get(String id) { + DimMonthEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimMonthDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimMonthDTO dto) { + DimMonthEntity entity = ConvertUtils.sourceToTarget(dto, DimMonthEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimMonthDTO dto) { + DimMonthEntity entity = ConvertUtils.sourceToTarget(dto, DimMonthEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initMonthDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_MONTH); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_DEPARTMENT); + } + + Date now = new Date(); + Date startMonth;// 起始月份,包含该月份 + Date targetMonth = DateUtils.integrate(now, DateUtils.DATE_PATTERN_YYYYMM);// 统计至当月,包含当月 + + if (lastExecRecord.getExecTime() == null) { + initMonthDim(targetMonth); + lastExecRecord.setExecTime(now); + lastExecRecordService.updateById(lastExecRecord); + } else { + startMonth = DateUtils.addDateMonths(DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMM), 1); + if (targetMonth.after(startMonth) || targetMonth.equals(startMonth)) { + initMonthDims(startMonth, targetMonth); + lastExecRecord.setExecTime(now); + lastExecRecordService.updateById(lastExecRecord); + } + } + } + + /** + * 按月维度连续生成 + * @param startMonth + * @param targetMonth + */ + public void initMonthDims(Date startMonth, Date targetMonth) { + LocalDate localstartMonth = new LocalDate(startMonth); + LocalDate localTargetMonth = new LocalDate(targetMonth); + while(localTargetMonth.isEqual(localstartMonth) || localTargetMonth.isAfter(localstartMonth)) { + initMonthDim(localstartMonth.toDate()); + localstartMonth = localstartMonth.plusMonths(1); + } + } + + public void initMonthDim(Date targetMonth) { + Date endDate = DateUtils.addDateDays(DateUtils.addDateMonths(targetMonth, 1), -1); + LocalDate localDate = new LocalDate(targetMonth); + + DimMonthEntity dim = new DimMonthEntity(); + dim.setStartDate(targetMonth); + dim.setEndDate(endDate); + dim.setMonthName(DateUtils.format(targetMonth, DateUtils.MONTH_NAME_PATTERN)); + dim.setMonthOrder(DateUtils.getMonthOfYear(targetMonth)); + dim.setQuarterId(localDate.getYear() + "Q" + DateUtils.getQuarterIndex(targetMonth)); + dim.setYearId(localDate.getYear() + ""); + dim.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setId(DimIdGenerator.getMonthDimId(targetMonth)); + baseDao.insert(dim); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java new file mode 100644 index 0000000000..3e49102d4c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java @@ -0,0 +1,210 @@ +/** + * 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.stats.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.commons.tools.utils.DateUtils; +import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimQuarterDao; +import com.epmet.dto.stats.DimQuarterDTO; +import com.epmet.entity.stats.DimQuarterEntity; +import com.epmet.entity.stats.LastExecRecordEntity; +import com.epmet.service.stats.DimQuarterService; +import com.epmet.service.stats.LastExecRecordService; +import com.epmet.util.DimIdGenerator; +import com.sun.org.apache.xpath.internal.operations.Bool; +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.*; + +/** + * 季度维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class DimQuarterServiceImpl extends BaseServiceImpl implements DimQuarterService { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private LastExecRecordService lastExecRecordService; + + @Autowired + private DimQuarterDao dimQuarterDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimQuarterDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimQuarterDTO.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 DimQuarterDTO get(String id) { + DimQuarterEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimQuarterDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimQuarterDTO dto) { + DimQuarterEntity entity = ConvertUtils.sourceToTarget(dto, DimQuarterEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimQuarterDTO dto) { + DimQuarterEntity entity = ConvertUtils.sourceToTarget(dto, DimQuarterEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initQuarterDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_QUARTER); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_QUARTER); + } + + Date now = new Date(); + //Date now = DateUtils.parse(now, DateUtils.DATE_PATTERN_YYYYMMDD); + + Date targetQMonth;//初始化至,包含当季 + Date startQMonth;//从该季开始初始化,不包含该季 + + targetQMonth = DateUtils.integrate(now, DateUtils.DATE_PATTERN_YYYYMM); + + if (lastExecRecord.getExecTime() == null) { + // 初始化上一个季度 + initQuarterDim(targetQMonth); + lastExecRecord.setExecTime(now); + lastExecRecordService.updateById(lastExecRecord); + } else { + // 连续初始化多个季度 + startQMonth = DateUtils.addDateMonths(DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMM), 3); + if (initQuarterDim(startQMonth, targetQMonth)) { + lastExecRecord.setExecTime(now); + lastExecRecordService.updateById(lastExecRecord); + } + } + } + + /** + * 连续初始化多个季度维度数据 + * @param startQday + * @param targetQday + * @return 是否产生新数据 + */ + public boolean initQuarterDim(Date startQday, Date targetQday) { + Boolean execed = false; + Integer startQuarterIdx; + Integer targetQuarterIdx; + while ((startQuarterIdx = Integer.valueOf(DateUtils.format(startQday, DateUtils.DATE_PATTERN_YYYY) + DateUtils.getQuarterIndex(startQday))) + <= (targetQuarterIdx = Integer.valueOf(DateUtils.format(targetQday, DateUtils.DATE_PATTERN_YYYY) + DateUtils.getQuarterIndex(targetQday)))) { + initQuarterDim(startQday); + startQday = DateUtils.addDateMonths(startQday, 3); + execed = true; + } + return execed; + } + /** + * 初始化指定月份维度数据 + */ + public void initQuarterDim(Date targetQday) { + DimQuarterEntity dim = new DimQuarterEntity(); + String quarterDimId = DimIdGenerator.getQuarterDimId(targetQday); + dim.setId(quarterDimId); + dim.setQuarterName(getQuarterName(targetQday)); + + String yyyy = DateUtils.format(targetQday, DateUtils.DATE_PATTERN_YYYY); + int quarter = DateUtils.getQuarterIndex(targetQday); + dim.setStartDate(DateUtils.getQuarterStartDate(yyyy, quarter)); + dim.setEndDate(DateUtils.getQuarterEndDate(yyyy, quarter)); + dim.setQuarterOrder(quarter); + dim.setYearId(yyyy); + dim.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dimQuarterDao.insert(dim); + logger.info("初始化季度数据,基于日期:" + targetQday + ",生成的DimId:" + quarterDimId); + } + + /** + * 季度名称 + * @param targetQday + * @return + */ + private String getQuarterName(Date targetQday) { + String yyyy = DateUtils.format(targetQday, DateUtils.DATE_PATTERN_YYYY); + int quarterIndex = DateUtils.getQuarterIndex(targetQday); + String quarterName; + switch (quarterIndex) { + case 1: + quarterName = "第一季度"; + break; + case 2: + quarterName = "第二季度"; + break; + case 3: + quarterName = "第三季度"; + break; + default: + quarterName = "第四季度"; + } + return yyyy.concat("年").concat(quarterName); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java new file mode 100644 index 0000000000..07c82cb9ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.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.stats.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.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.dao.stats.DimTopicStatusDao; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.entity.stats.DimTopicStatusEntity; +import com.epmet.service.stats.DimTopicStatusService; +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-16 + */ +@Service +public class DimTopicStatusServiceImpl extends BaseServiceImpl implements DimTopicStatusService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimTopicStatusDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimTopicStatusDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + String delFlag = (String)params.get(FieldConstant.DEL_FLAG_HUMP); + if(StringUtils.isBlank(delFlag)) delFlag = NumConstant.ZERO_STR; + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(FieldConstant.DEL_FLAG,delFlag); + return wrapper; + } + + @Override + public DimTopicStatusDTO get(String id) { + DimTopicStatusEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimTopicStatusDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimTopicStatusDTO dto) { + DimTopicStatusEntity entity = ConvertUtils.sourceToTarget(dto, DimTopicStatusEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimTopicStatusDTO dto) { + DimTopicStatusEntity entity = ConvertUtils.sourceToTarget(dto, DimTopicStatusEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java new file mode 100644 index 0000000000..46c00761af --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java @@ -0,0 +1,177 @@ +/** + * 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.stats.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.commons.tools.utils.DateUtils; +import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimWeekDao; +import com.epmet.dto.stats.DimWeekDTO; +import com.epmet.entity.stats.DimWeekEntity; +import com.epmet.entity.stats.LastExecRecordEntity; +import com.epmet.service.stats.DimWeekService; +import com.epmet.service.stats.LastExecRecordService; +import org.apache.commons.lang3.StringUtils; +import org.joda.time.LocalDate; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 周维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class DimWeekServiceImpl extends BaseServiceImpl implements DimWeekService { + + @Autowired + private LastExecRecordService lastExecRecordService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimWeekDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimWeekDTO.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 DimWeekDTO get(String id) { + DimWeekEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimWeekDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimWeekDTO dto) { + DimWeekEntity entity = ConvertUtils.sourceToTarget(dto, DimWeekEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimWeekDTO dto) { + DimWeekEntity entity = ConvertUtils.sourceToTarget(dto, DimWeekEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initWeekDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_WEEK); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_WEEK); + } + + Date now = new Date(); + Date startWeekDay; + Date targetWeekDay = DateUtils.getWeekStartAndEnd(now)[0]; + + if (lastExecRecord.getExecTime() == null) { + // 首次执行 + initWeekDim(targetWeekDay); + lastExecRecord.setExecTime(now); + lastExecRecordService.updateById(lastExecRecord); + } else { + startWeekDay = DateUtils.addDateWeeks(DateUtils.getWeekStartAndEnd(lastExecRecord.getExecTime())[0], 1); + if (targetWeekDay.equals(startWeekDay) || targetWeekDay.after(startWeekDay)) { + initWeekDim(startWeekDay, targetWeekDay); + lastExecRecord.setExecTime(now); + lastExecRecordService.updateById(lastExecRecord); + } + } + } + + /** + * 按周维度连续初始化 + * @param startWeekDay + * @param targetWeekDay + */ + private void initWeekDim(Date startWeekDay, Date targetWeekDay) { + LocalDate localStartWeekDay = new LocalDate(startWeekDay); + LocalDate localTargetWeekDay = new LocalDate(targetWeekDay); + + while (localTargetWeekDay.isEqual(localStartWeekDay) + || localTargetWeekDay.isAfter(localStartWeekDay)) { + + initWeekDim(localStartWeekDay.toDate()); + localStartWeekDay = localStartWeekDay.plusDays(7); + } + } + + /** + * 单周初始化 + * @param targetWeekDay + */ + private void initWeekDim(Date targetWeekDay) { + Date[] weekBorders = DateUtils.getWeekStartAndEnd(targetWeekDay); + String yyyy = DateUtils.format(targetWeekDay, DateUtils.DATE_PATTERN_YYYY); + int weekOfYear = DateUtils.getWeekOfYear(targetWeekDay); + + Date now = new Date(); + DimWeekEntity dim = new DimWeekEntity(); + dim.setEndDate(weekBorders[1]); + dim.setStartDate(weekBorders[0]); + dim.setWeekName(yyyy + "年第" + weekOfYear + "周"); + dim.setWeekOrder(weekOfYear); + dim.setYearId(yyyy); + dim.setId(yyyy.concat("W").concat(String.format("%02d", weekOfYear))); + dim.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + + baseDao.insert(dim); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java new file mode 100644 index 0000000000..e408eb81bc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java @@ -0,0 +1,170 @@ +/** + * 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.stats.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.commons.tools.utils.DateUtils; +import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.DimYearDao; +import com.epmet.dto.stats.DimYearDTO; +import com.epmet.entity.stats.DimYearEntity; +import com.epmet.entity.stats.LastExecRecordEntity; +import com.epmet.service.stats.DimYearService; +import com.epmet.service.stats.LastExecRecordService; +import org.apache.commons.lang3.StringUtils; +import org.joda.time.LocalDate; +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.Date; +import java.util.List; +import java.util.Map; + +/** + * 年维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class DimYearServiceImpl extends BaseServiceImpl implements DimYearService { + + @Autowired + private LastExecRecordService lastExecRecordService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimYearDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimYearDTO.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 DimYearDTO get(String id) { + DimYearEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimYearDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimYearDTO dto) { + DimYearEntity entity = ConvertUtils.sourceToTarget(dto, DimYearEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimYearDTO dto) { + DimYearEntity entity = ConvertUtils.sourceToTarget(dto, DimYearEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void initYearDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_YEAR); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_YEAR); + } + + Date now = new Date(); + + Date startYear; + Date targetYear; + + targetYear = DateUtils.integrate(now, DateUtils.DATE_PATTERN_YYYY); + if (lastExecRecord.getExecTime() == null) { + // 第一次执行统计 + initYearDim(targetYear); + lastExecRecord.setExecTime(now); + // 记录最后一次统计时间 + lastExecRecordService.updateById(lastExecRecord); + } else { + startYear = DateUtils.addDateYears(DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYY), 1); + if (targetYear.equals(startYear) || targetYear.after(startYear)) { + initYearDims(startYear, targetYear); + lastExecRecord.setExecTime(now); + // 记录最后一次统计时间 + lastExecRecordService.updateById(lastExecRecord); + } + } + } + + /** + * 按年连续初始化 + * @param startYear + * @param targetYear + */ + private void initYearDims(Date startYear, Date targetYear) { + LocalDate localStartYear = new LocalDate(startYear); + LocalDate localTargetYear = new LocalDate(targetYear); + while (localStartYear.getYear() <= localTargetYear.getYear()) { + initYearDim(localStartYear.toDate()); + localStartYear = localStartYear.plusYears(1); + } + } + + /** + * 俺年单次统计 + * @param targetYear + */ + public void initYearDim(Date targetYear) { + String yyyy = DateUtils.format(targetYear, DateUtils.DATE_PATTERN_YYYY); + + DimYearEntity dim = new DimYearEntity(); + dim.setId(yyyy); + dim.setYearName(yyyy.concat("年")); + dim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + baseDao.insert(dim); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java new file mode 100644 index 0000000000..bbb1b39e44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactAgencyProjectDailyDao; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; +import com.epmet.service.stats.FactAgencyProjectDailyService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactAgencyProjectDailyServiceImpl extends BaseServiceImpl implements FactAgencyProjectDailyService { + + + /** + * @param formDTO + * @Author sun + * @Description 查询上一月机关日统计数据,按时间倒序 + **/ + @Override + public List getMonthProjectList(MonthProjectListFormDTO formDTO) { + return baseDao.selectMonthProjectList(formDTO); + } + + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateProject(FactAgencyProjectDailyEntity delEntity) { + baseDao.delDateProject(delEntity); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java new file mode 100644 index 0000000000..df869107f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactAgencyProjectMonthlyDao; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; +import com.epmet.service.stats.FactAgencyProjectMonthlyService; +import org.springframework.stereotype.Service; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactAgencyProjectMonthlyServiceImpl extends BaseServiceImpl implements FactAgencyProjectMonthlyService { + + /** + * @param delEntity + * @return + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除可能存在的历史数据 + **/ + @Override + public void delMonthProject(FactAgencyProjectMonthlyEntity delEntity) { + baseDao.delMonthProject(delEntity); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..9068ca2bdb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -0,0 +1,55 @@ +/** + * 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.stats.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactArticlePublishedAgencyDailyDao; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedAgencyDailyService { + + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + log.debug("deleteAndInsertBatch insert customerId:{},values:{}", customerId, JSON.toJSONString(values)); + this.insertBatch(values, 100); + return true; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java new file mode 100644 index 0000000000..6f9e172dce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactArticlePublishedDepartmentDailyDao; +import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; +import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedDepartmentDailyService { + + + @Override + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java new file mode 100644 index 0000000000..c13a282916 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java @@ -0,0 +1,67 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactArticlePublishedGridDailyDao; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; +import com.epmet.service.stats.FactArticlePublishedGridDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactArticlePublishedGridDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedGridDailyService { + + + @Override + public List getByBeforeDay(String customerId, String dateId) { + log.debug("getByBeforeDay param customerId:{},dateId:{}", customerId, dateId); + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(dateId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getByBeforeDay(customerId, dateId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)) { + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); + this.insertBatch(values, 100); + return true; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java new file mode 100644 index 0000000000..1b54cd7686 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactGridProjectDailyDao; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; +import com.epmet.entity.stats.FactGridProjectDailyEntity; +import com.epmet.service.stats.FactGridProjectDailyService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactGridProjectDailyServiceImpl extends BaseServiceImpl implements FactGridProjectDailyService { + + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateProject(FactAgencyProjectDailyEntity delEntity) { + baseDao.delDateProject(delEntity); + } + + /** + * @param formDTO + * @Author sun + * @Description 查询上一月网格日统计数据,按时间倒序 + **/ + @Override + public List getMonthProjectList(MonthProjectListFormDTO formDTO) { + return baseDao.selectMonthProjectList(formDTO); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java new file mode 100644 index 0000000000..1d026d2891 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactGridProjectMonthlyDao; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; +import com.epmet.entity.stats.FactGridProjectMonthlyEntity; +import com.epmet.service.stats.FactGridProjectMonthlyService; +import org.springframework.stereotype.Service; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactGridProjectMonthlyServiceImpl extends BaseServiceImpl implements FactGridProjectMonthlyService { + + /** + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delMonthProject(FactAgencyProjectMonthlyEntity delEntity) { + baseDao.delMonthProject(delEntity); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..6dd5a0705b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -0,0 +1,142 @@ +/** + * 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.stats.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.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.dao.stats.FactGroupAgencyDailyDao; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; +import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; +import com.epmet.dto.stats.FactGroupAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupAgencyDailyEntity; +import com.epmet.service.stats.FactGroupAgencyDailyService; +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-16 + */ +@Service +public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl implements FactGroupAgencyDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupAgencyDailyDTO.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 FactGroupAgencyDailyDTO get(String id) { + FactGroupAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupAgencyDailyDTO dto) { + FactGroupAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupAgencyDailyDTO dto) { + FactGroupAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 插入网格小组数据 【机关-日】 先删除、再插入 + * @param agencyList + * @author zxc + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGroupAgencyDaily(List agencyList,String customerId) { + if (agencyList.size() != NumConstant.ZERO){ + baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId); + baseDao.insertGroupAgencyDaily(agencyList); + } + + } + + /** + * @Description 获取 网格小组【机关-日统计】的最后一天数据 + * @param + * @author zxc + */ + public List getLastDayAgency(String monthId){ + return baseDao.getLastDayAgency(monthId); + } + + /** + * @Description 查询 月的小组增量 + * @param monthId + * @author zxc + */ + @Override + public List getMonthGroupIncr(String monthId) { + if (StringUtils.isBlank(monthId)){ + return new ArrayList<>(); + } + return baseDao.getMonthGroupIncr(monthId); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..a9ba8ff7ac --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.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.stats.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.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.dao.stats.FactGroupAgencyMonthlyDao; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.stats.FactGroupAgencyMonthlyDTO; +import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; +import com.epmet.service.stats.FactGroupAgencyMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 组-机关月统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactGroupAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactGroupAgencyMonthlyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupAgencyMonthlyDTO.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 FactGroupAgencyMonthlyDTO get(String id) { + FactGroupAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupAgencyMonthlyDTO dto) { + FactGroupAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupAgencyMonthlyDTO dto) { + FactGroupAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupAgencyMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 统计网格小组 【机关-月】 + * @param agencyMonth + * @author zxc + */ + @Override + public void insertAgencyGroupMonthly(List agencyMonth) { + if (agencyMonth.size() == NumConstant.ZERO){ + return; + } + baseDao.deleteInsertAgencyMonthlyByMonthId(agencyMonth.get(NumConstant.ZERO).getMonthId()); + baseDao.insertAgencyGroupMonthly(agencyMonth); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java new file mode 100644 index 0000000000..6556ba92b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java @@ -0,0 +1,123 @@ +/** + * 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.stats.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.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.dto.stats.FactGroupGridDailyDTO; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactGroupGridDailyDao; +import com.epmet.entity.stats.FactGroupGridDailyEntity; +import com.epmet.service.StatsGroupService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.stats.FactGroupGridDailyService; +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-16 + */ +@Service +public class FactGroupGridDailyServiceImpl extends BaseServiceImpl implements FactGroupGridDailyService { + + @Autowired + private StatsGroupService statsGroupService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupGridDailyDTO.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 FactGroupGridDailyDTO get(String id) { + FactGroupGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupGridDailyDTO dto) { + FactGroupGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupGridDailyDTO dto) { + FactGroupGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 统计小组【网格-日】 + * @param + * @author zxc + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void statisticsGroupGridDaily(List formDto,String customerId) { + if (formDto.size() == NumConstant.ZERO){ + return; + } + String dateId = formDto.get(NumConstant.ZERO).getDateId(); + baseDao.deleteInsertDateId(dateId,customerId); + baseDao.insertGroupGridDaily(formDto); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..e6007e90d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.stats.FactIssueAgencyDailyDao; +import com.epmet.dto.stats.FactIssueAgencyDailyDTO; +import com.epmet.entity.stats.FactIssueAgencyDailyEntity; +import com.epmet.service.stats.FactIssueAgencyDailyService; +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-17 + */ +@Service +public class FactIssueAgencyDailyServiceImpl extends BaseServiceImpl implements FactIssueAgencyDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueAgencyDailyDTO.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 FactIssueAgencyDailyDTO get(String id) { + FactIssueAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueAgencyDailyDTO dto) { + FactIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueAgencyDailyDTO dto) { + FactIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByCustomerId(String customerId, String dateId) { + baseDao.deleteByCustomerId(customerId, dateId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveList(List list) { + insertBatch(list); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..7215ecb179 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java @@ -0,0 +1,118 @@ +/** + * 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.stats.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.stats.FactIssueAgencyMonthlyDao; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +import com.epmet.service.stats.FactIssueAgencyMonthlyService; +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-17 + */ +@Service +public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactIssueAgencyMonthlyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueAgencyMonthlyDTO.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 FactIssueAgencyMonthlyDTO get(String id) { + FactIssueAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueAgencyMonthlyDTO dto) { + FactIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueAgencyMonthlyDTO dto) { + FactIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List getAgencyMonthlyInc(String customerId, String monthId) { + return baseDao.selectAgencyMonthlyInc(customerId, monthId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByCustomerId(String customerId, String monthId) { + baseDao.deleteByCustomerId(customerId, monthId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveList(List list) { + insertBatch(list); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java new file mode 100644 index 0000000000..063e2ef8c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.stats.FactIssueGridDailyDao; +import com.epmet.dto.stats.FactIssueGridDailyDTO; +import com.epmet.entity.stats.FactIssueGridDailyEntity; +import com.epmet.service.stats.FactIssueGridDailyService; +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-17 + */ +@Service +public class FactIssueGridDailyServiceImpl extends BaseServiceImpl implements FactIssueGridDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueGridDailyDTO.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 FactIssueGridDailyDTO get(String id) { + FactIssueGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueGridDailyDTO dto) { + FactIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueGridDailyDTO dto) { + FactIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByCustomerId(String customerId, String dateId) { + baseDao.deleteByCustomerId(customerId, dateId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveList(List list) { + insertBatch(list); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..d3b0468011 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.stats.FactIssueGridMonthlyDao; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; +import com.epmet.service.stats.FactIssueGridMonthlyService; +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-17 + */ +@Service +public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl implements FactIssueGridMonthlyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueGridMonthlyDTO.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 FactIssueGridMonthlyDTO get(String id) { + FactIssueGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueGridMonthlyDTO dto) { + FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueGridMonthlyDTO dto) { + FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List getGridMonthlyInc(String customerId, String monthId) { + return baseDao.selectGridMonthlyInc(customerId, monthId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByCustomerId(String customerId, String monthId) { + baseDao.deleteByCustomerId(customerId, monthId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveList(List list) { + insertBatch(list); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..7eef72f9d7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedAgencyDailyDao; +import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; +import com.epmet.service.stats.FactTagUsedAgencyDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyDailyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyDailyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonth(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..85c51f9fdb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java @@ -0,0 +1,69 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedAgencyMonthlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyMonthlyService { + + @Override + public List getTagUsedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId, yearId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId, quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(agencyMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(agencyMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java new file mode 100644 index 0000000000..ec83b4b9b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedAgencyQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyQuarterlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyQuarterlyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(agencyQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(agencyQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java new file mode 100644 index 0000000000..32f24e5836 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedAgencyYearlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyYearlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyYearlyService { + + @Override + public int deleteByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.deleteByYearId(customerId, yearId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(agencyYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(agencyYearlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java new file mode 100644 index 0000000000..f88f1f330a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java @@ -0,0 +1,64 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedDepartmentDailyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentDailyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonthId(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java new file mode 100644 index 0000000000..e0411038be --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java @@ -0,0 +1,70 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedDepartmentMonthlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentMonthlyService { + + + @Override + public List getTagUsedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId,yearId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(gridMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(gridMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java new file mode 100644 index 0000000000..bb51750412 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedDepartmentQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedDepartmentQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentQuarterlyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List deptQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(deptQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(deptQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java new file mode 100644 index 0000000000..6614095001 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedDepartmentYearlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentYearlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentYearlyService { + + @Override + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java new file mode 100644 index 0000000000..95081992f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedGridDailyDao; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; +import com.epmet.service.stats.FactTagUsedGridDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedGridDailyServiceImpl extends BaseServiceImpl implements FactTagUsedGridDailyService { + + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonthId(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..05dc9a8942 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java @@ -0,0 +1,67 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedGridMonthlyDao; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; +import com.epmet.service.stats.FactTagUsedGridMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridMonthlyService { + + @Override + public List getTagUsedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId,yearId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(gridMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(gridMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java new file mode 100644 index 0000000000..4e6bf21e2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java @@ -0,0 +1,52 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedGridQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedGridQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridQuarterlyService { + + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(gridQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(gridQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java new file mode 100644 index 0000000000..02c7902ec2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedGridYearlyDao; +import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; +import com.epmet.service.stats.FactTagUsedGridYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridYearlyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..9e9500e96e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedAgencyDailyDao; +import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; +import com.epmet.service.stats.FactTagViewedAgencyDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagViewedAgencyDailyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyDailyService { + + @Override + public Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)) { + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagViewedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagViewedCountByMonthId(customerId, monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..0b7f08a6ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedAgencyMonthlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyMonthlyService { + + @Override + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(agencyMonthlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId, monthId); + return this.insertBatch(agencyMonthlyList, 100); + } + + @Override + public List getTagViewedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagViewedCountByQuarterId(customerId, quarterId); + } + + @Override + public List getTagViewedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId, yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java new file mode 100644 index 0000000000..ba226febc9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java @@ -0,0 +1,49 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedAgencyQuarterlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedAgencyQuarterlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyQuarterlyService { + + @Override + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(agencyQuarterlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId, quarterId); + return this.insertBatch(agencyQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java new file mode 100644 index 0000000000..d5a0f0c123 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java @@ -0,0 +1,49 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedAgencyYearlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedAgencyYearlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyYearlyService { + + @Override + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(agencyYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(agencyYearlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java new file mode 100644 index 0000000000..2f3d9c0781 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java @@ -0,0 +1,64 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedGridDailyDao; +import com.epmet.entity.stats.FactTagViewedGridDailyEntity; +import com.epmet.service.stats.FactTagViewedGridDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagViewedGridDailyServiceImpl extends BaseServiceImpl implements FactTagViewedGridDailyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)) { + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagViewedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagViewedCountByMonthId(customerId, monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..59e0726914 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedGridMonthlyDao; +import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; +import com.epmet.service.stats.FactTagViewedGridMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedGridMonthlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridMonthlyService { + + @Override + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(gridMonthlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId, monthId); + return this.insertBatch(gridMonthlyList, 100); + } + + @Override + public List getTagViewedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagViewCountByQuarterId(customerId, quarterId); + } + + @Override + public List getTagViewedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId, yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java new file mode 100644 index 0000000000..1671a6f4ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java @@ -0,0 +1,49 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedGridQuarterlyDao; +import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; +import com.epmet.service.stats.FactTagViewedGridQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedGridQuarterlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridQuarterlyService { + + @Override + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(gridQuarterlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId, quarterId); + return this.insertBatch(gridQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java new file mode 100644 index 0000000000..a7dd6a6242 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java @@ -0,0 +1,49 @@ +/** + * 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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedGridYearlyDao; +import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; +import com.epmet.service.stats.FactTagViewedGridYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridYearlyService { + + @Override + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java new file mode 100644 index 0000000000..ba6e33d157 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.service.stats.impl; + +import com.epmet.constant.RobotConstant; +import com.epmet.dao.stats.LastExecRecordDao; +import com.epmet.entity.stats.LastExecRecordEntity; +import com.epmet.service.stats.LastExecRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; + +@Service +public class LastExecRecordServiceImpl implements LastExecRecordService { + @Autowired + private LastExecRecordDao lastExecRecordDao; + + public LastExecRecordEntity getLastExecRecord(String statsSubject) { + return lastExecRecordDao.getLastExecRecord(statsSubject); + } + + /** + * 创建末次执行记录 + * @param statsSubject + * @return + */ + @Override + public LastExecRecordEntity createLastExecRecord(String statsSubject) { + LastExecRecordEntity entity = new LastExecRecordEntity(); + entity.setSubject(statsSubject); + entity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + entity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + lastExecRecordDao.insert(entity); + return entity; + } + + @Override + public void updateById(LastExecRecordEntity lastExecRecord) { + lastExecRecordDao.updateById(lastExecRecord); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyDailyService.java new file mode 100644 index 0000000000..c1246dfb38 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyDailyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 转议题话题-机关日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicIssueAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicIssueAgencyDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicIssueAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicIssueAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicIssueAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyMonthlyService.java new file mode 100644 index 0000000000..0d4a48ea5a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyMonthlyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 转议题话题-机关月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicIssueAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicIssueAgencyMonthlyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicIssueAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicIssueAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicIssueAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridDailyService.java new file mode 100644 index 0000000000..12e23274a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridDailyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 转议题话题-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicIssueGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicIssueGridDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicIssueGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicIssueGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicIssueGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridMonthlyService.java new file mode 100644 index 0000000000..3101304a62 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridMonthlyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 转议题话题-网格月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicIssueGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicIssueGridMonthlyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicIssueGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicIssueGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicIssueGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyDailyService.java new file mode 100644 index 0000000000..b653a4fee7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyDailyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 状态话题-机关日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicStatusAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicStatusAgencyDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicStatusAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicStatusAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicStatusAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyMonthlyService.java new file mode 100644 index 0000000000..55c0b5adf3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyMonthlyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 状态话题-机关月统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicStatusAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicStatusAgencyMonthlyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicStatusAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicStatusAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicStatusAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusGridDailyService.java new file mode 100644 index 0000000000..8a76bb9707 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusGridDailyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 状态话题-网格日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicStatusGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicStatusGridDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicStatusGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicStatusGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicStatusGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalAgencyDailyService.java new file mode 100644 index 0000000000..4a5800f3fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalAgencyDailyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 话题总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicTotalAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicTotalAgencyDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicTotalAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicTotalAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicTotalAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalGridDailyService.java new file mode 100644 index 0000000000..c4fc1cd71e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalGridDailyService.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.service.stats.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 话题总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicTotalGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicTotalGridDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicTotalGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicTotalGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicTotalGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/TopicStatisticalService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/TopicStatisticalService.java new file mode 100644 index 0000000000..6482b543b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/TopicStatisticalService.java @@ -0,0 +1,8 @@ +package com.epmet.service.stats.topic; + +import com.epmet.dto.stats.topic.result.TopicStatisticalData; + +public interface TopicStatisticalService { + + void insertUniquely(TopicStatisticalData data); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..614e95486e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyDailyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicIssueAgencyDailyDao; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity; +import com.epmet.service.stats.topic.FactTopicIssueAgencyDailyService; +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-20 + */ +@Service +public class FactTopicIssueAgencyDailyServiceImpl extends BaseServiceImpl implements FactTopicIssueAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicIssueAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicIssueAgencyDailyDTO.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 FactTopicIssueAgencyDailyDTO get(String id) { + FactTopicIssueAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicIssueAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicIssueAgencyDailyDTO dto) { + FactTopicIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicIssueAgencyDailyDTO dto) { + FactTopicIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..5e7e0c6d2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyMonthlyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicIssueAgencyMonthlyDao; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity; +import com.epmet.service.stats.topic.FactTopicIssueAgencyMonthlyService; +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-20 + */ +@Service +public class FactTopicIssueAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTopicIssueAgencyMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicIssueAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicIssueAgencyMonthlyDTO.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 FactTopicIssueAgencyMonthlyDTO get(String id) { + FactTopicIssueAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicIssueAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicIssueAgencyMonthlyDTO dto) { + FactTopicIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicIssueAgencyMonthlyDTO dto) { + FactTopicIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyMonthlyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridDailyServiceImpl.java new file mode 100644 index 0000000000..5d9e805fb8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridDailyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicIssueGridDailyDao; +import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity; +import com.epmet.service.stats.topic.FactTopicIssueGridDailyService; +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-20 + */ +@Service +public class FactTopicIssueGridDailyServiceImpl extends BaseServiceImpl implements FactTopicIssueGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicIssueGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicIssueGridDailyDTO.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 FactTopicIssueGridDailyDTO get(String id) { + FactTopicIssueGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicIssueGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicIssueGridDailyDTO dto) { + FactTopicIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicIssueGridDailyDTO dto) { + FactTopicIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..9f3004f690 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridMonthlyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicIssueGridMonthlyDao; +import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity; +import com.epmet.service.stats.topic.FactTopicIssueGridMonthlyService; +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-20 + */ +@Service +public class FactTopicIssueGridMonthlyServiceImpl extends BaseServiceImpl implements FactTopicIssueGridMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicIssueGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicIssueGridMonthlyDTO.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 FactTopicIssueGridMonthlyDTO get(String id) { + FactTopicIssueGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicIssueGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicIssueGridMonthlyDTO dto) { + FactTopicIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicIssueGridMonthlyDTO dto) { + FactTopicIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridMonthlyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..d6644f4c26 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyDailyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicStatusAgencyDailyDao; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity; +import com.epmet.service.stats.topic.FactTopicStatusAgencyDailyService; +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-20 + */ +@Service +public class FactTopicStatusAgencyDailyServiceImpl extends BaseServiceImpl implements FactTopicStatusAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicStatusAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicStatusAgencyDailyDTO.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 FactTopicStatusAgencyDailyDTO get(String id) { + FactTopicStatusAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicStatusAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicStatusAgencyDailyDTO dto) { + FactTopicStatusAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicStatusAgencyDailyDTO dto) { + FactTopicStatusAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..86c88ed82b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyMonthlyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicStatusAgencyMonthlyDao; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity; +import com.epmet.service.stats.topic.FactTopicStatusAgencyMonthlyService; +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-20 + */ +@Service +public class FactTopicStatusAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTopicStatusAgencyMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicStatusAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicStatusAgencyMonthlyDTO.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 FactTopicStatusAgencyMonthlyDTO get(String id) { + FactTopicStatusAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicStatusAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicStatusAgencyMonthlyDTO dto) { + FactTopicStatusAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicStatusAgencyMonthlyDTO dto) { + FactTopicStatusAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyMonthlyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusGridDailyServiceImpl.java new file mode 100644 index 0000000000..af4e77a184 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusGridDailyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicStatusGridDailyDao; +import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity; +import com.epmet.service.stats.topic.FactTopicStatusGridDailyService; +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-20 + */ +@Service +public class FactTopicStatusGridDailyServiceImpl extends BaseServiceImpl implements FactTopicStatusGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicStatusGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicStatusGridDailyDTO.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 FactTopicStatusGridDailyDTO get(String id) { + FactTopicStatusGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicStatusGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicStatusGridDailyDTO dto) { + FactTopicStatusGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicStatusGridDailyDTO dto) { + FactTopicStatusGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusGridDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..351a6f2e29 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalAgencyDailyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicTotalAgencyDailyDao; +import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity; +import com.epmet.service.stats.topic.FactTopicTotalAgencyDailyService; +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-20 + */ +@Service +public class FactTopicTotalAgencyDailyServiceImpl extends BaseServiceImpl implements FactTopicTotalAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicTotalAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicTotalAgencyDailyDTO.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 FactTopicTotalAgencyDailyDTO get(String id) { + FactTopicTotalAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicTotalAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicTotalAgencyDailyDTO dto) { + FactTopicTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicTotalAgencyDailyDTO dto) { + FactTopicTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalAgencyDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalGridDailyServiceImpl.java new file mode 100644 index 0000000000..53316ce9bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalGridDailyServiceImpl.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.service.stats.topic.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.stats.topic.FactTopicTotalGridDailyDao; +import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; +import com.epmet.service.stats.topic.FactTopicTotalGridDailyService; +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-20 + */ +@Service +public class FactTopicTotalGridDailyServiceImpl extends BaseServiceImpl implements FactTopicTotalGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicTotalGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicTotalGridDailyDTO.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 FactTopicTotalGridDailyDTO get(String id) { + FactTopicTotalGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicTotalGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicTotalGridDailyDTO dto) { + FactTopicTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicTotalGridDailyDTO dto) { + FactTopicTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalGridDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java new file mode 100644 index 0000000000..e70e4f7afe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java @@ -0,0 +1,124 @@ +package com.epmet.service.stats.topic.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.stats.topic.*; +import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.service.stats.topic.TopicStatisticalService; +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; + +/** + * @Description + * @ClassName TopicStatisticalServiceImpl + * @Auth wangc + * @Date 2020-06-23 14:29 + */ +@Service +public class TopicStatisticalServiceImpl implements TopicStatisticalService { + + private static final Logger logger = LoggerFactory.getLogger(TopicStatisticalServiceImpl.class); + + @Autowired + private FactTopicIssueAgencyDailyDao topicIssueAgencyDailyDao; + + @Autowired + private FactTopicIssueAgencyMonthlyDao topicIssueAgencyMonthlyDao; + + @Autowired + private FactTopicIssueGridDailyDao topicIssueGridDailyDao; + + @Autowired + private FactTopicIssueGridMonthlyDao topicIssueGridMonthlyDao; + + @Autowired + private FactTopicStatusAgencyDailyDao topicStatusAgencyDailyDao; + + @Autowired + private FactTopicStatusAgencyMonthlyDao topicStatusAgencyMonthlyDao; + + @Autowired + private FactTopicStatusGridDailyDao topicStatusGridDailyDao; + + @Autowired + private FactTopicTotalAgencyDailyDao topicTotalAgencyDailyDao; + + @Autowired + private FactTopicTotalGridDailyDao topicTotalGridDailyDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUniquely(TopicStatisticalData data) { + if(null == data) return; + + if(StringUtils.isBlank(data.getDateId()) || StringUtils.isBlank(data.getMonthId())){ + logger.warn("缺失重要参数:dateId或monthId"); + return ; + } + + if(null != data.getIssueAgencyDailyList() && data.getIssueAgencyDailyList().size() > NumConstant.ZERO){ + + topicIssueAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicIssueAgencyDailyDao.insertBatch(data.getIssueAgencyDailyList()); + } + + if(null != data.getIssueAgencyMonthlyList() && data.getIssueAgencyMonthlyList().size() > NumConstant.ZERO){ + + topicIssueAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + topicIssueAgencyMonthlyDao.insertBatch(data.getIssueAgencyMonthlyList()); + + } + + if(null != data.getIssueGridDailyList() && data.getIssueGridDailyList().size() > NumConstant.ZERO){ + + topicIssueGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicIssueGridDailyDao.insertBatch(data.getIssueGridDailyList()); + + } + + if(null != data.getIssueGridMonthlyList() && data.getIssueGridMonthlyList().size() > NumConstant.ZERO){ + + topicIssueGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + topicIssueGridMonthlyDao.insertBatch(data.getIssueGridMonthlyList()); + + } + + if(null != data.getTopicAgencyDailyList() && data.getTopicAgencyDailyList().size() > NumConstant.ZERO){ + + topicStatusAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicStatusAgencyDailyDao.insertBatch(data.getTopicAgencyDailyList()); + + } + + if(null != data.getTopicAgencyMonthlyList() && data.getTopicAgencyMonthlyList().size() > NumConstant.ZERO){ + + topicStatusAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + topicStatusAgencyMonthlyDao.insertBatch(data.getTopicAgencyMonthlyList()); + + } + + if(null != data.getTopicGridDailyList() && data.getTopicGridDailyList().size() > NumConstant.ZERO){ + + topicStatusGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicStatusGridDailyDao.insertBatch(data.getTopicGridDailyList()); + + } + + if(null != data.getTotalAgencyDailyList() && data.getTotalAgencyDailyList().size() > NumConstant.ZERO){ + + topicTotalAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicTotalAgencyDailyDao.insertBatch(data.getTotalAgencyDailyList()); + + } + + if(null != data.getTotalGridDailyList() && data.getTotalGridDailyList().size() > NumConstant.ZERO){ + + topicTotalGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicTotalGridDailyDao.insertBatch(data.getTotalGridDailyList()); + + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java new file mode 100644 index 0000000000..f489c17788 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.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.service.stats.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 机关下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactParticipationUserAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactParticipationUserAgencyDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactParticipationUserAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactParticipationUserAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactParticipationUserAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.java new file mode 100644 index 0000000000..913b9140f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.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.service.stats.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactParticipationUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 机关下(按月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactParticipationUserAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactParticipationUserAgencyMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactParticipationUserAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactParticipationUserAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactParticipationUserAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java new file mode 100644 index 0000000000..5b4ef692c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.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.service.stats.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 网格下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactParticipationUserGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactParticipationUserGridDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactParticipationUserGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactParticipationUserGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactParticipationUserGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.java new file mode 100644 index 0000000000..729f51a276 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.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.service.stats.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactParticipationUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 网格下(月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactParticipationUserGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactParticipationUserGridMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactParticipationUserGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactParticipationUserGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactParticipationUserGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.java new file mode 100644 index 0000000000..4b83259245 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.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.service.stats.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactRegUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 机关(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactRegUserAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactRegUserAgencyDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactRegUserAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactRegUserAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactRegUserAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java new file mode 100644 index 0000000000..6f5f7c4963 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.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.service.stats.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 机关(按月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactRegUserAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactRegUserAgencyMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactRegUserAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactRegUserAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactRegUserAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.java new file mode 100644 index 0000000000..b3ed088fb3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.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.service.stats.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactRegUserGridDailyDTO; +import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 网格(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactRegUserGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactRegUserGridDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactRegUserGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactRegUserGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactRegUserGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java new file mode 100644 index 0000000000..11c7dd2e12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.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.service.stats.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 网格(月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactRegUserGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactRegUserGridMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactRegUserGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactRegUserGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactRegUserGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/UserStatisticalService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/UserStatisticalService.java new file mode 100644 index 0000000000..92adebf81b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/UserStatisticalService.java @@ -0,0 +1,8 @@ +package com.epmet.service.stats.user; + +import com.epmet.dto.stats.user.result.UserStatisticalData; + +public interface UserStatisticalService { + + void insertUniquely(UserStatisticalData data); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..f606044f1f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.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.service.stats.user.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.stats.user.FactParticipationUserAgencyDailyDao; +import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; +import com.epmet.service.stats.user.FactParticipationUserAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 机关下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class FactParticipationUserAgencyDailyServiceImpl extends BaseServiceImpl implements FactParticipationUserAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactParticipationUserAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactParticipationUserAgencyDailyDTO.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 FactParticipationUserAgencyDailyDTO get(String id) { + FactParticipationUserAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactParticipationUserAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactParticipationUserAgencyDailyDTO dto) { + FactParticipationUserAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactParticipationUserAgencyDailyDTO dto) { + FactParticipationUserAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserAgencyDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..f9b7ac4b0c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyMonthlyServiceImpl.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.service.stats.user.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.stats.user.FactParticipationUserAgencyMonthlyDao; +import com.epmet.dto.stats.user.FactParticipationUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity; +import com.epmet.service.stats.user.FactParticipationUserAgencyMonthlyService; +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-17 + */ +@Service +public class FactParticipationUserAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactParticipationUserAgencyMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactParticipationUserAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactParticipationUserAgencyMonthlyDTO.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 FactParticipationUserAgencyMonthlyDTO get(String id) { + FactParticipationUserAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactParticipationUserAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactParticipationUserAgencyMonthlyDTO dto) { + FactParticipationUserAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactParticipationUserAgencyMonthlyDTO dto) { + FactParticipationUserAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserAgencyMonthlyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java new file mode 100644 index 0000000000..8d6915f6fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.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.service.stats.user.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.stats.user.FactParticipationUserGridDailyDao; +import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; +import com.epmet.service.stats.user.FactParticipationUserGridDailyService; +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-17 + */ +@Service +public class FactParticipationUserGridDailyServiceImpl extends BaseServiceImpl implements FactParticipationUserGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactParticipationUserGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactParticipationUserGridDailyDTO.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 FactParticipationUserGridDailyDTO get(String id) { + FactParticipationUserGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactParticipationUserGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactParticipationUserGridDailyDTO dto) { + FactParticipationUserGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactParticipationUserGridDailyDTO dto) { + FactParticipationUserGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserGridDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..e6068acf90 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridMonthlyServiceImpl.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.service.stats.user.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.stats.user.FactParticipationUserGridMonthlyDao; +import com.epmet.dto.stats.user.FactParticipationUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity; +import com.epmet.service.stats.user.FactParticipationUserGridMonthlyService; +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-17 + */ +@Service +public class FactParticipationUserGridMonthlyServiceImpl extends BaseServiceImpl implements FactParticipationUserGridMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactParticipationUserGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactParticipationUserGridMonthlyDTO.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 FactParticipationUserGridMonthlyDTO get(String id) { + FactParticipationUserGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactParticipationUserGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactParticipationUserGridMonthlyDTO dto) { + FactParticipationUserGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactParticipationUserGridMonthlyDTO dto) { + FactParticipationUserGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserGridMonthlyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..c97a763f61 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyDailyServiceImpl.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.service.stats.user.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.stats.user.FactRegUserAgencyDailyDao; +import com.epmet.dto.stats.user.FactRegUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity; +import com.epmet.service.stats.user.FactRegUserAgencyDailyService; +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-17 + */ +@Service +public class FactRegUserAgencyDailyServiceImpl extends BaseServiceImpl implements FactRegUserAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactRegUserAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactRegUserAgencyDailyDTO.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 FactRegUserAgencyDailyDTO get(String id) { + FactRegUserAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactRegUserAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactRegUserAgencyDailyDTO dto) { + FactRegUserAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactRegUserAgencyDailyDTO dto) { + FactRegUserAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserAgencyDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..55925a2b81 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.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.service.stats.user.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.stats.user.FactRegUserAgencyMonthlyDao; +import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; +import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService; +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-17 + */ +@Service +public class FactRegUserAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactRegUserAgencyMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactRegUserAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactRegUserAgencyMonthlyDTO.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 FactRegUserAgencyMonthlyDTO get(String id) { + FactRegUserAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactRegUserAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactRegUserAgencyMonthlyDTO dto) { + FactRegUserAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactRegUserAgencyMonthlyDTO dto) { + FactRegUserAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserAgencyMonthlyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridDailyServiceImpl.java new file mode 100644 index 0000000000..8aba7fbcd5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridDailyServiceImpl.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.service.stats.user.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.stats.user.FactRegUserGridDailyDao; +import com.epmet.dto.stats.user.FactRegUserGridDailyDTO; +import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; +import com.epmet.service.stats.user.FactRegUserGridDailyService; +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-17 + */ +@Service +public class FactRegUserGridDailyServiceImpl extends BaseServiceImpl implements FactRegUserGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactRegUserGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactRegUserGridDailyDTO.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 FactRegUserGridDailyDTO get(String id) { + FactRegUserGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactRegUserGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactRegUserGridDailyDTO dto) { + FactRegUserGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactRegUserGridDailyDTO dto) { + FactRegUserGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserGridDailyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..2054ea5909 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.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.service.stats.user.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.stats.user.FactRegUserGridMonthlyDao; +import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; +import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +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-17 + */ +@Service +public class FactRegUserGridMonthlyServiceImpl extends BaseServiceImpl implements FactRegUserGridMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactRegUserGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactRegUserGridMonthlyDTO.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 FactRegUserGridMonthlyDTO get(String id) { + FactRegUserGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactRegUserGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactRegUserGridMonthlyDTO dto) { + FactRegUserGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactRegUserGridMonthlyDTO dto) { + FactRegUserGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserGridMonthlyEntity.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/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java new file mode 100644 index 0000000000..f42f74645c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java @@ -0,0 +1,117 @@ +package com.epmet.service.stats.user.impl; + + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.stats.user.*; +import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.service.stats.user.UserStatisticalService; +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; + +/** + * @Description + * @ClassName UserStatisticalServiceImpl + * @Auth wangc + * @Date 2020-06-23 14:27 + */ +@Service +public class UserStatisticalServiceImpl implements UserStatisticalService { + + private static final Logger logger = LoggerFactory.getLogger(UserStatisticalServiceImpl.class); + + @Autowired + private FactParticipationUserAgencyDailyDao participationUserAgencyDailyDao; + + @Autowired + private FactParticipationUserAgencyMonthlyDao participationUserAgencyMonthlyDao; + + @Autowired + private FactParticipationUserGridDailyDao participationUserGridDailyDao; + + @Autowired + private FactParticipationUserGridMonthlyDao participationUserGridMonthlyDao; + + @Autowired + private FactRegUserAgencyDailyDao regUserAgencyDailyDao; + + @Autowired + private FactRegUserAgencyMonthlyDao regUserAgencyMonthlyDao; + + @Autowired + private FactRegUserGridDailyDao regUserGridDailyDao; + + @Autowired + private FactRegUserGridMonthlyDao regUserGridMonthlyDao; + + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUniquely(UserStatisticalData data) { + if (null == data) return ; + + if(StringUtils.isBlank(data.getDateId()) || StringUtils.isBlank(data.getMonthId())){ + logger.warn("缺失重要参数:dateId或monthId"); + return ; + } + + if(null != data.getPartiAgencyDailyList() && data.getPartiAgencyDailyList().size() > NumConstant.ZERO){ + + participationUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + participationUserAgencyDailyDao.insertBatch(data.getPartiAgencyDailyList()); + } + + if(null != data.getPartiAgencyMonthlyList() && data.getPartiAgencyMonthlyList().size() > NumConstant.ZERO){ + + participationUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + participationUserAgencyMonthlyDao.insertBatch(data.getPartiAgencyMonthlyList()); + + } + + if(null != data.getPartiGridMonthlyList() && data.getPartiGridMonthlyList().size() > NumConstant.ZERO){ + + participationUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + participationUserGridMonthlyDao.insertBatch(data.getPartiGridMonthlyList()); + + } + + if(null != data.getPartiGridDailyList() && data.getPartiGridDailyList().size() > NumConstant.ZERO){ + + participationUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + participationUserGridDailyDao.insertBatch(data.getPartiGridDailyList()); + + } + + if(null != data.getRegAgencyDailyList() && data.getRegAgencyDailyList().size() > NumConstant.ZERO){ + + regUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + regUserAgencyDailyDao.insertBatch(data.getRegAgencyDailyList()); + + } + + if(null != data.getRegAgencyMonthlyList() && data.getRegAgencyMonthlyList().size() > NumConstant.ZERO){ + + regUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + regUserAgencyMonthlyDao.insertBatch(data.getRegAgencyMonthlyList()); + + } + + if(null != data.getRegGridDailyList() && data.getRegGridDailyList().size() > NumConstant.ZERO){ + + regUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + regUserGridDailyDao.insertBatch(data.getRegGridDailyList()); + + } + + if(null != data.getRegGridMonthlyList() && data.getRegGridMonthlyList().size() > NumConstant.ZERO){ + + regUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + regUserGridMonthlyDao.insertBatch(data.getRegGridMonthlyList()); + + } + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java new file mode 100644 index 0000000000..a83bc3a5c0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -0,0 +1,28 @@ +package com.epmet.service.topic; + +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.util.DimIdGenerator; + +import java.util.Date; +import java.util.List; + +/** + * @Author wangc + * @CreateTime 2020/6/19 13:22 + */ +public interface TopicService { + + /** + * @Description 计算并生成统计数据 整合维度 : 机关 网格 组 话题 + * @param agencies + * @param targetDate + * @param timeDimension + * @return + * @author wangc + * @date 2020.06.22 11:12 + **/ + TopicStatisticalData compute(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List statusDimension); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java new file mode 100644 index 0000000000..296d66ee22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -0,0 +1,922 @@ +package com.epmet.service.topic.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.topic.TopicDao; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.*; +import com.epmet.dto.stats.topic.result.GridTopicData; +import com.epmet.dto.stats.topic.result.GroupTopicData; +import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; +import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; +import com.epmet.dto.topic.result.ResiTopicResultDTO; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.impl.UserServiceImpl; +import com.epmet.util.DimIdGenerator; +import com.epmet.util.ModuleConstant; +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 java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description + * @ClassName TopicServiceImpl + * @Auth wangc + * @Date 2020-06-20 17:00 + */ +@DataSource(DataSourceConstant.RESI_GROUP) +@Service +public class TopicServiceImpl implements TopicService { + + private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); + + @Autowired + private TopicDao topicDao; + + /** + * @Description 计算并生成统计数据 整合维度 : 机关 网格 组 话题 + * @param agencies + * @param targetDate + * @param timeDimension + * @return + * @author wangc + * @date 2020.06.22 11:12 + **/ + @Override + public TopicStatisticalData compute(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List statusDimension) { + if(null == agencies || agencies.size() == NumConstant.ZERO){ + logger.warn("没有相应的机关集合"); + return null; + } + + //Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + Map> subGridOfAgency = new HashMap<>(); + agencies.forEach(agency -> { + initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); + }); + + List topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); + topics.forEach(groupTopic -> { + if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ + groupTopic.setTopics(new ArrayList<>()); + } + }); + Map> gridGroupMap = + topics.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId)); + + return calculateAndSummarizeTopicStatisticalData(subGridOfAgency,agencies,gridGroupMap,targetDate,statusDimension,timeDimension,customerId); + + } + + /** + * @Description 初始化机关-所有下级网格Map + * @param pid - 固定一个机关Id + * @param agency - AgencySubTreeDto + * @param subGridOfAgency - Map> + * @return + * @author wangc + * @date 2020.06.18 15:54 + **/ + void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map> subGridOfAgency){ + + //向map中放入数据 + if(subGridOfAgency.containsKey(pid)){ + //包含key + Set grids = subGridOfAgency.get(pid); + if(null == grids){ + grids = new HashSet<>(); + subGridOfAgency.put(pid,grids); + } + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + grids.addAll(agency.getGridIds()); + } + }else{ + //不包含key + Set grids = new HashSet<>(agency.getGridIds()); + subGridOfAgency.put(pid,grids); + } + + //定义递归出口 + if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){ + return ; + } + + + //定义递归入口 + agency.getSubAgencies().forEach(obj -> { + initAgencyGridMap(pid,obj,subGridOfAgency); + }); + } + + /** + * @Description 计算并整合出每一个组内话题的数据 + * @param subGridOfAgency + * @param gridGroupMap + * @param targetDate + * @return + * @author wangc + * @date 2020.06.22 13:13 + **/ + TopicStatisticalData calculateAndSummarizeTopicStatisticalData(Map> subGridOfAgency, List agencies, Map> gridGroupMap, Date targetDate,List statusDimension ,DimIdGenerator.DimIdBean timeDimension ,String customerId){ + if(null == subGridOfAgency || subGridOfAgency.size() <= NumConstant.ZERO){ + return null; + } + if(null == gridGroupMap || gridGroupMap.size() <= NumConstant.ZERO){ + return null; + } + //定义数据包 - 返回对象 + TopicStatisticalData dataPacket = new TopicStatisticalData(); + + dataPacket.setDateId(timeDimension.getDateId()); + dataPacket.setMonthId(timeDimension.getMonthId()); + dataPacket.setCustomerId(customerId); + + //参数:subGridOfAgency 所有机关的下级网格信息 + + //参数:gridGroupMap 所有网格的组以及组内话题 + + //[所有]话题当日的操作记录 + List operations = + topicDao.selectTopicOperationRecord(targetDate); + //key:话题Id value:这个话题在当日的操作记录 + //操作类型有: ①discussing(发布) ②hidden(屏蔽) ③hidden_cancelled(取消屏蔽) ④closed(关闭) ⑤shift_issue(转议题) + //注意不要把【发布】和【取消屏蔽】混淆!!! + Map> topicOperationMap = + operations.stream().collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getTopicId)); + + analyzeTopic(subGridOfAgency,agencies,gridGroupMap,topicOperationMap,targetDate,dataPacket,statusDimension,timeDimension); + return dataPacket; + } + + /** + * @Description 生成话题统计数据 + * @param + * @return + * @author wangc + * @date 2020.06.22 13:45 + **/ + void analyzeTopic(Map> subGridOfAgency, List agencies, Map> gridGroupMap, Map> topicOperationMap, Date targetDate, TopicStatisticalData dataPacket, List statusDimension, DimIdGenerator.DimIdBean timeDimension){ + Boolean isMonthEnd = false; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + //前一天 + calendar.add(Calendar.DATE, NumConstant.ONE_NEG); + Date targetDateCheck = null == targetDate ? calendar.getTime() : targetDate; + + calendar.setTime(targetDateCheck); + //如果目标日期是当月的最后一天 + + + + if(calendar.get(Calendar.DATE) == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){ + //求出这个月的第一天 + calendar.setTime(new Date()); + calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); + + isMonthEnd = true; + } + + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + Map statusMap = new HashMap<>(); + statusDimension.forEach(status -> statusMap.put(status.getId(),status)); + Map agencyMap = new HashMap<>(); + agencies.forEach(agency -> {agencyMap.put(agency.getAgencyId(),agency);}); + + + List groupList = new LinkedList<>(); + for(Map.Entry> entry : gridGroupMap.entrySet()){ + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO) + groupList.addAll(entry.getValue()); + } + + //key -> groupId + Map groupTopicData = traverseGroupTopic(groupList,topicOperationMap); + Map gridDistinct = new HashMap<>(); + agencies.forEach(agency -> { + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + agency.getGridIds().forEach(grid -> { + gridDistinct.put(grid,false); + }); + } + }); + + for(Map.Entry> entry : subGridOfAgency.entrySet()){ + + FactTopicIssueAgencyDailyDTO issueAgencyD = new FactTopicIssueAgencyDailyDTO(); + FactTopicTotalAgencyDailyDTO totalAgencyD = new FactTopicTotalAgencyDailyDTO(); + FactTopicStatusAgencyDailyDTO topicAgencyD_discussing = new FactTopicStatusAgencyDailyDTO(); + FactTopicStatusAgencyDailyDTO topicAgencyD_hidden = new FactTopicStatusAgencyDailyDTO(); + FactTopicStatusAgencyDailyDTO topicAgencyD_closed = new FactTopicStatusAgencyDailyDTO(); + + initAgencyDailyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getPid(),agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed); + + + + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ + entry.getValue().forEach(gridId -> { + + FactTopicIssueGridDailyDTO issueGridD = new FactTopicIssueGridDailyDTO(); + FactTopicStatusGridDailyDTO topicGridD_discussing = new FactTopicStatusGridDailyDTO(); + FactTopicStatusGridDailyDTO topicGridD_hidden = new FactTopicStatusGridDailyDTO(); + FactTopicStatusGridDailyDTO topicGridD_closed = new FactTopicStatusGridDailyDTO(); + FactTopicTotalGridDailyDTO totalGirdD = new FactTopicTotalGridDailyDTO(); + + + + initGridDailyDTO(entry.getKey(),gridId,agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueGridD,totalGirdD,topicGridD_discussing,topicGridD_hidden,topicGridD_closed); + + + + + List groups = gridGroupMap.get(gridId); + if(null != groups && groups.size() > NumConstant.ZERO) { + groups.forEach(group -> { + if (null != group && StringUtils.isNotBlank(group.getGroupId())) { + + + issueAgencyD.setIssueIncr(issueAgencyD.getIssueIncr() + groupTopicData.get(group.getGroupId()).getIssueIncr()); + issueAgencyD.setIssueTotal(issueAgencyD.getIssueTotal() + groupTopicData.get(group.getGroupId()).getIssueTotal()); + + issueGridD.setIssueIncr(issueGridD.getIssueIncr() + groupTopicData.get(group.getGroupId()).getIssueIncr()); + issueGridD.setIssueTotal(issueGridD.getIssueTotal() + groupTopicData.get(group.getGroupId()).getIssueTotal()); + + totalAgencyD.setIssueTotalCount(issueAgencyD.getIssueTotal()); + totalAgencyD.setHiddenTotalCount(totalAgencyD.getHiddenTotalCount() + groupTopicData.get(group.getGroupId()).getHiddenTotal()); + totalAgencyD.setTopicIncr(totalAgencyD.getTopicIncr() + groupTopicData.get(group.getGroupId()).getTopicIncr()); + totalAgencyD.setTopicTotal(totalAgencyD.getTopicTotal() + groupTopicData.get(group.getGroupId()).getTotal()); + + + totalGirdD.setIssueTotalCount(issueGridD.getIssueTotal()); + totalGirdD.setHiddenTotalCount(totalGirdD.getHiddenTotalCount() + groupTopicData.get(group.getGroupId()).getHiddenTotal()); + totalGirdD.setTopicIncr(totalGirdD.getTopicIncr() + groupTopicData.get(group.getGroupId()).getTopicIncr()); + totalGirdD.setTopicTotal(totalGirdD.getTopicTotal() + groupTopicData.get(group.getGroupId()).getTotal()); + + + GroupTopicData data = groupTopicData.get(group.getGroupId()); + if (null != data) { + + + topicAgencyD_discussing.setTopicCount(topicAgencyD_discussing.getTopicCount() + data.getDiscussingTotal()); + topicAgencyD_discussing.setTopicIncrement(topicAgencyD_discussing.getTopicIncrement() + data.getDiscussingIncr()); + + topicAgencyD_hidden.setTopicCount(topicAgencyD_hidden.getTopicCount() + data.getHiddenTotal()); + topicAgencyD_hidden.setTopicIncrement(topicAgencyD_hidden.getTopicIncrement() + data.getHiddenIncr()); + + topicAgencyD_closed.setTopicCount(topicAgencyD_closed.getTopicCount() + data.getClosedTotal()); + topicAgencyD_closed.setTopicIncrement(topicAgencyD_closed.getTopicIncrement() + data.getClosedIncr()); + + + topicGridD_discussing.setTopicCount(topicGridD_discussing.getTopicCount() + data.getDiscussingTotal()); + topicGridD_discussing.setTopicIncrement(topicGridD_discussing.getTopicIncrement() + data.getDiscussingIncr()); + + topicGridD_hidden.setTopicCount(topicGridD_hidden.getTopicCount() + data.getHiddenTotal()); + topicGridD_hidden.setTopicIncrement(topicGridD_hidden.getTopicIncrement() + data.getHiddenIncr()); + + topicGridD_closed.setTopicCount(topicGridD_closed.getTopicCount() + data.getClosedTotal()); + topicGridD_closed.setTopicIncrement(topicGridD_closed.getTopicIncrement() + data.getClosedIncr()); + + + } + + } + + + }); + } + //网格-百分比 + setGridTopicProportion(numberFormat, topicGridD_discussing, topicGridD_hidden, topicGridD_closed, totalGirdD); + + if(!gridDistinct.get(gridId)) { + setGridDailyDataPacket(dataPacket, issueGridD, totalGirdD, topicGridD_discussing, topicGridD_hidden, topicGridD_closed); + } + gridDistinct.put(gridId,true); + }); + //机关-百分比 + setAgencyTopicProportion(numberFormat,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed,totalAgencyD); + + setAgencyDailyDataPacket(dataPacket,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed); + + } + + } + + + + if(isMonthEnd){ + + gridDistinct.forEach((k,v) -> { + gridDistinct.put(k,false); + }); + + List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDate,null); + Map> GridGroupMapBetweenTimeRange = + topicsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId)); + List groupListBetweenTimeRange = new LinkedList<>(); + + for(Map.Entry> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){ + if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO) + groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue()); + } + List operationsBetweenTimeRange = + topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDate); + + Map> topicOperationMapBetweenTimeRange = + operationsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getTopicId)); + Map groupTopicDataBetweenTimeRange = traverseGroupTopic(groupListBetweenTimeRange,topicOperationMapBetweenTimeRange); + + for(Map.Entry> entry : subGridOfAgency.entrySet()){ + + FactTopicIssueAgencyMonthlyDTO issueAgencyM = new FactTopicIssueAgencyMonthlyDTO(); + FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing = new FactTopicStatusAgencyMonthlyDTO(); + FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden = new FactTopicStatusAgencyMonthlyDTO(); + FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed = new FactTopicStatusAgencyMonthlyDTO(); + + + initAgencyMonthlyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getPid(),agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueAgencyM,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); + + + + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ + entry.getValue().forEach(gridId -> { + + FactTopicIssueGridMonthlyDTO issueGridM = new FactTopicIssueGridMonthlyDTO(); + initGridMonthlyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getCustomerId(),gridId,timeDimension,issueGridM); + + + List groups = gridGroupMap.get(gridId); + if(null != groups) { + groups.forEach(group -> { + if (null != group && StringUtils.isNotBlank(group.getGroupId())) { + + + issueAgencyM.setIssueIncr(issueAgencyM.getIssueIncr() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueIncr()); + issueAgencyM.setIssueTotal(issueAgencyM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal()); + + issueGridM.setIssueIncr(issueGridM.getIssueIncr() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueIncr()); + issueGridM.setIssueTotal(issueGridM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal()); + + + GroupTopicData data = groupTopicData.get(group.getGroupId()); + if (null != data) { + + + topicAgencyM_discussing.setTopicCount(topicAgencyM_discussing.getTopicCount() + data.getDiscussingTotal()); + topicAgencyM_discussing.setTopicIncr(topicAgencyM_discussing.getTopicIncr() + data.getDiscussingIncr()); + + topicAgencyM_hidden.setTopicCount(topicAgencyM_hidden.getTopicCount() + data.getHiddenTotal()); + topicAgencyM_hidden.setTopicIncr(topicAgencyM_hidden.getTopicIncr() + data.getHiddenIncr()); + + topicAgencyM_closed.setTopicCount(topicAgencyM_closed.getTopicCount() + data.getClosedTotal()); + topicAgencyM_closed.setTopicIncr(topicAgencyM_closed.getTopicIncr() + data.getClosedIncr()); + + } + + } + + + }); + } + if(!gridDistinct.get(gridId)) { + setGridMonthlyDataPacket(dataPacket, issueGridM); + } + gridDistinct.put(gridId,true); + }); + //机关-百分比 + setAgencyTopicMonthlyProportion(numberFormat,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); + + setAgencyMonthlyDataPacket(dataPacket,issueAgencyM,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); + + } + + } + + + + } + } + + + /** + * @Description 生成每个组的话题统计数据 + * @param + * @return Map key:groupId + * @author wangc + * @date 2020.06.22 16:03 + **/ + Map traverseGroupTopic(List groups, Map> topicOperationMap){ + if(null == groups || groups.size() < NumConstant.ONE) + return null; + + Map groupTopicStatistical = new HashMap<>(); + + groups.forEach(group -> { + + if (null != group) { + + GroupTopicData groupTopicData = new GroupTopicData(); + groupTopicData.setGroupId(group.getGroupId()); + + groupTopicData.setTotal(group.getTopics().size()); + + if (null == group.getTopics() || group.getTopics().size() == NumConstant.ZERO) { + groupTopicData.setTopicIncr(NumConstant.ZERO); + groupTopicData.setHiddenTotal(NumConstant.ZERO); + groupTopicData.setHiddenIncr(NumConstant.ZERO); + groupTopicData.setIssueIncr(NumConstant.ZERO); + groupTopicData.setClosedTotal(NumConstant.ZERO); + groupTopicData.setClosedIncr(NumConstant.ZERO); + groupTopicData.setDiscussingTotal(NumConstant.ZERO); + groupTopicData.setDiscussingIncr(NumConstant.ZERO); + groupTopicData.setIssueTotal(NumConstant.ZERO); + }else{ + + for (ResiTopicResultDTO topic : group.getTopics()) { + if(StringUtils.isBlank(topic.getTopicId())) continue; + if (StringUtils.equals(NumConstant.ONE_STR, topic.getIncrFlag())) { + groupTopicData.setTopicIncr(groupTopicData.getTopicIncr() + NumConstant.ONE); + } + List operations = topicOperationMap.get(topic.getTopicId()); + boolean operFlag = true; + if(null == operations || operations.size() < NumConstant.ZERO){ + operFlag = false; + } + Map> hiddenGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null; + + Map> hiddenCancelledGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden_cancelled",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null; + + + //对于话题,每个话题的操作记录中,【关闭】与【转议题】只会出现一次,而【屏蔽】与【取消屏蔽】会出现多次 + switch (topic.getStatus()) { + case "hidden": + groupTopicData.setHiddenTotal(groupTopicData.getHiddenTotal() + NumConstant.ONE); + if (operFlag) { + //如果在同一天内被多次屏蔽,只计算一次 + hiddenGroupByDate.forEach((k, v) -> { + if (null != v && v.size() > NumConstant.ZERO) { + groupTopicData.setHiddenIncr(groupTopicData.getHiddenIncr() + NumConstant.ONE); + } + }); + + for (ResiTopicOperationResultDTO operation : operations) { + if (StringUtils.equals(operation.getStatus(), "shift_issue")) + groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); + } + } + break; + case "closed": + + groupTopicData.setClosedTotal(groupTopicData.getClosedTotal() + NumConstant.ONE); + if (operFlag) { + for (ResiTopicOperationResultDTO operation : operations) { + if (StringUtils.equals(operation.getStatus(), "closed")) + groupTopicData.setClosedIncr(groupTopicData.getClosedIncr() + NumConstant.ONE); + if (StringUtils.equals(operation.getStatus(), "shift_issue")) + groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); + } + } + break; + case "discussing": + + groupTopicData.setDiscussingTotal(groupTopicData.getDiscussingTotal() + NumConstant.ONE); + + Set dateRelease = new HashSet<>(); + if(operFlag) { + if (null != hiddenGroupByDate && hiddenGroupByDate.size() > NumConstant.ZERO){ + hiddenGroupByDate.forEach((k, v) -> { + if (null != v && v.size() > NumConstant.ZERO) { + if (null != hiddenCancelledGroupByDate.get(k) && hiddenCancelledGroupByDate.get(k).size() > NumConstant.ZERO) { + if (hiddenCancelledGroupByDate.get(k).size() == v.size()) { + groupTopicData.setDiscussingIncr(groupTopicData.getDiscussingIncr() + NumConstant.ONE); + dateRelease.add(k); + return; //相当于continue,循环下一个日期 + } else { + //话题操作日志与话题状态不符 + + } + } + } + }); + } + + + if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "discussing") && !dateRelease.contains(operation.getCreatedTime())).findAny().isPresent()) { + groupTopicData.setDiscussingIncr(groupTopicData.getDiscussingIncr() + NumConstant.ONE); + } + + if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "shift_issue")).findAny().isPresent()) { + groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); + } + } + break; + } + + if (topic.isShiftIssue()) { + groupTopicData.setIssueTotal(groupTopicData.getIssueTotal() + NumConstant.ONE); + } + } + } + + groupTopicStatistical.put(group.getGroupId(), groupTopicData); + } + + }); + + return groupTopicStatistical; + } + + void initAgencyDailyDTO(String agencyId, String pid, String customerId,DimIdGenerator.DimIdBean timeDimension, Map statusMap, FactTopicIssueAgencyDailyDTO issueAgencyD, FactTopicTotalAgencyDailyDTO totalAgencyD, FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed){ + + + issueAgencyD.setAgencyId(agencyId); + issueAgencyD.setPid(pid); + issueAgencyD.setCustomerId(customerId); + issueAgencyD.setDateId(timeDimension.getDateId()); + issueAgencyD.setWeekId(timeDimension.getWeekId()); + issueAgencyD.setMonthId(timeDimension.getMonthId()); + issueAgencyD.setQuarterId(timeDimension.getQuarterId()); + issueAgencyD.setYearId(timeDimension.getYearId()); + issueAgencyD.setIssueIncr(NumConstant.ZERO); + issueAgencyD.setIssueTotal(NumConstant.ZERO); + issueAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + totalAgencyD.setAgencyId(agencyId); + totalAgencyD.setPid(pid); + totalAgencyD.setCustomerId(customerId); + totalAgencyD.setDateId(timeDimension.getDateId()); + totalAgencyD.setWeekId(timeDimension.getWeekId()); + totalAgencyD.setMonthId(timeDimension.getMonthId()); + totalAgencyD.setQuarterId(timeDimension.getQuarterId()); + totalAgencyD.setYearId(timeDimension.getYearId()); + totalAgencyD.setIssueTotalCount(NumConstant.ZERO); + totalAgencyD.setHiddenTotalCount(NumConstant.ZERO); + totalAgencyD.setTopicIncr(NumConstant.ZERO); + totalAgencyD.setTopicTotal(NumConstant.ZERO); + totalAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyD_discussing.setAgencyId(agencyId); + topicAgencyD_discussing.setPid(pid); + topicAgencyD_discussing.setCustomerId(customerId); + topicAgencyD_discussing.setDateId(timeDimension.getDateId()); + topicAgencyD_discussing.setWeekId(timeDimension.getWeekId()); + topicAgencyD_discussing.setMonthId(timeDimension.getMonthId()); + topicAgencyD_discussing.setQuarterId(timeDimension.getQuarterId()); + topicAgencyD_discussing.setYearId(timeDimension.getYearId()); + topicAgencyD_discussing.setTopicStatusId(statusMap.get("discussing").getId()); + topicAgencyD_discussing.setTopicIncrement(NumConstant.ZERO); + topicAgencyD_discussing.setTopicCount(NumConstant.ZERO); + topicAgencyD_discussing.setTopicProportion(BigDecimal.ZERO); + topicAgencyD_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyD_hidden.setAgencyId(agencyId); + topicAgencyD_hidden.setPid(pid); + topicAgencyD_hidden.setCustomerId(customerId); + topicAgencyD_hidden.setDateId(timeDimension.getDateId()); + topicAgencyD_hidden.setWeekId(timeDimension.getWeekId()); + topicAgencyD_hidden.setMonthId(timeDimension.getMonthId()); + topicAgencyD_hidden.setQuarterId(timeDimension.getQuarterId()); + topicAgencyD_hidden.setYearId(timeDimension.getYearId()); + topicAgencyD_hidden.setTopicStatusId(statusMap.get("hidden").getId()); + topicAgencyD_hidden.setTopicIncrement(NumConstant.ZERO); + topicAgencyD_hidden.setTopicCount(NumConstant.ZERO); + topicAgencyD_hidden.setTopicProportion(BigDecimal.ZERO); + topicAgencyD_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyD_closed.setAgencyId(agencyId); + topicAgencyD_closed.setPid(pid); + topicAgencyD_closed.setCustomerId(customerId); + topicAgencyD_closed.setDateId(timeDimension.getDateId()); + topicAgencyD_closed.setWeekId(timeDimension.getWeekId()); + topicAgencyD_closed.setMonthId(timeDimension.getMonthId()); + topicAgencyD_closed.setQuarterId(timeDimension.getQuarterId()); + topicAgencyD_closed.setYearId(timeDimension.getYearId()); + topicAgencyD_closed.setTopicStatusId(statusMap.get("closed").getId()); + topicAgencyD_closed.setTopicIncrement(NumConstant.ZERO); + topicAgencyD_closed.setTopicCount(NumConstant.ZERO); + topicAgencyD_closed.setTopicProportion(BigDecimal.ZERO); + topicAgencyD_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + + } + + void initGridDailyDTO(String agencyId, String gridId, String customerId ,DimIdGenerator.DimIdBean timeDimension,Map statusMap, FactTopicIssueGridDailyDTO issueGridD, FactTopicTotalGridDailyDTO totalGridD, FactTopicStatusGridDailyDTO topicGridD_discussing,FactTopicStatusGridDailyDTO topicGridD_hidden,FactTopicStatusGridDailyDTO topicGridD_closed){ + + issueGridD.setAgencyId(agencyId); + issueGridD.setGridId(gridId); + issueGridD.setCustomerId(customerId); + issueGridD.setDateId(timeDimension.getDateId()); + issueGridD.setWeekId(timeDimension.getWeekId()); + issueGridD.setMonthId(timeDimension.getMonthId()); + issueGridD.setQuarterId(timeDimension.getQuarterId()); + issueGridD.setYearId(timeDimension.getYearId()); + issueGridD.setIssueIncr(NumConstant.ZERO); + issueGridD.setIssueTotal(NumConstant.ZERO); + issueGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + totalGridD.setAgencyId(agencyId); + totalGridD.setGridId(gridId); + totalGridD.setCustomerId(customerId); + totalGridD.setDateId(timeDimension.getDateId()); + totalGridD.setWeekId(timeDimension.getWeekId()); + totalGridD.setMonthId(timeDimension.getMonthId()); + totalGridD.setQuarterId(timeDimension.getQuarterId()); + totalGridD.setYearId(timeDimension.getYearId()); + totalGridD.setHiddenTotalCount(NumConstant.ZERO); + totalGridD.setIssueTotalCount(NumConstant.ZERO); + totalGridD.setTopicIncr(NumConstant.ZERO); + totalGridD.setTopicTotal(NumConstant.ZERO); + totalGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + topicGridD_discussing.setAgencyId(agencyId); + topicGridD_discussing.setGridId(gridId); + topicGridD_discussing.setCustomerId(customerId); + topicGridD_discussing.setDateId(timeDimension.getDateId()); + topicGridD_discussing.setWeekId(timeDimension.getWeekId()); + topicGridD_discussing.setMonthId(timeDimension.getMonthId()); + topicGridD_discussing.setQuarterId(timeDimension.getQuarterId()); + topicGridD_discussing.setYearId(timeDimension.getYearId()); + topicGridD_discussing.setTopicStatusId(statusMap.get("discussing").getId()); + topicGridD_discussing.setTopicCount(NumConstant.ZERO); + topicGridD_discussing.setTopicIncrement(NumConstant.ZERO); + topicGridD_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + topicGridD_hidden.setAgencyId(agencyId); + topicGridD_hidden.setGridId(gridId); + topicGridD_hidden.setCustomerId(customerId); + topicGridD_hidden.setDateId(timeDimension.getDateId()); + topicGridD_hidden.setWeekId(timeDimension.getWeekId()); + topicGridD_hidden.setMonthId(timeDimension.getMonthId()); + topicGridD_hidden.setQuarterId(timeDimension.getQuarterId()); + topicGridD_hidden.setYearId(timeDimension.getYearId()); + topicGridD_hidden.setTopicStatusId(statusMap.get("hidden").getId()); + topicGridD_hidden.setTopicCount(NumConstant.ZERO); + topicGridD_hidden.setTopicIncrement(NumConstant.ZERO); + topicGridD_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + topicGridD_closed.setAgencyId(agencyId); + topicGridD_closed.setGridId(gridId); + topicGridD_closed.setCustomerId(customerId); + topicGridD_closed.setDateId(timeDimension.getDateId()); + topicGridD_closed.setWeekId(timeDimension.getWeekId()); + topicGridD_closed.setMonthId(timeDimension.getMonthId()); + topicGridD_closed.setQuarterId(timeDimension.getQuarterId()); + topicGridD_closed.setYearId(timeDimension.getYearId()); + topicGridD_closed.setTopicStatusId(statusMap.get("closed").getId()); + topicGridD_closed.setTopicCount(NumConstant.ZERO); + topicGridD_closed.setTopicIncrement(NumConstant.ZERO); + topicGridD_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + } + + void setGridTopicProportion(NumberFormat numberFormat,FactTopicStatusGridDailyDTO topicGridD_discussing, FactTopicStatusGridDailyDTO topicGridD_hidden, FactTopicStatusGridDailyDTO topicGridD_closed,FactTopicTotalGridDailyDTO totalGirdD){ + topicGridD_discussing.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicGridD_discussing.getTopicCount() / (float) totalGirdD.getTopicTotal() + ))); + + topicGridD_hidden.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicGridD_hidden.getTopicCount() / (float) totalGirdD.getTopicTotal() + ))); + + + topicGridD_closed.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicGridD_closed.getTopicCount() / (float) totalGirdD.getTopicTotal() + ))); + + + } + + void setAgencyTopicProportion(NumberFormat numberFormat,FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed,FactTopicTotalAgencyDailyDTO totalAgencyD){ + topicAgencyD_discussing.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyD_discussing.getTopicCount() / (float) totalAgencyD.getTopicTotal() + ))); + + topicAgencyD_hidden.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyD_hidden.getTopicCount() / (float) totalAgencyD.getTopicTotal() + ))); + + topicAgencyD_closed.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyD_closed.getTopicCount() / (float) totalAgencyD.getTopicTotal() + ))); + } + + void setAgencyDailyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueAgencyDailyDTO issueAgencyD, FactTopicTotalAgencyDailyDTO totalAgencyD, FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed){ + if(null == dataPacket.getIssueAgencyDailyList()){ + List issueAgencyDailyList = new LinkedList<>(); + issueAgencyDailyList.add(issueAgencyD); + dataPacket.setIssueAgencyDailyList(issueAgencyDailyList); + }else{ + dataPacket.getIssueAgencyDailyList().add(issueAgencyD); + } + + if(null == dataPacket.getTotalAgencyDailyList()){ + List totalAgencyDailyList = new LinkedList<>(); + totalAgencyDailyList.add(totalAgencyD); + dataPacket.setTotalAgencyDailyList(totalAgencyDailyList); + }else{ + dataPacket.getTotalAgencyDailyList().add(totalAgencyD); + } + + if(null == dataPacket.getTopicAgencyDailyList()){ + List topicAgencyDailyList = new LinkedList<>(); + topicAgencyDailyList.add(topicAgencyD_discussing); + topicAgencyDailyList.add(topicAgencyD_hidden); + topicAgencyDailyList.add(topicAgencyD_closed); + dataPacket.setTopicAgencyDailyList(topicAgencyDailyList); + }else{ + dataPacket.getTopicAgencyDailyList().add(topicAgencyD_discussing); + dataPacket.getTopicAgencyDailyList().add(topicAgencyD_hidden); + dataPacket.getTopicAgencyDailyList().add(topicAgencyD_closed); + } + } + + void setGridDailyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueGridDailyDTO issueGridD, FactTopicTotalGridDailyDTO totalGridD, FactTopicStatusGridDailyDTO topicGridD_discussing,FactTopicStatusGridDailyDTO topicGridD_hidden,FactTopicStatusGridDailyDTO topicGridD_closed){ + if(null == dataPacket.getIssueGridDailyList()){ + List issueGridDailyList = new LinkedList<>(); + issueGridDailyList.add(issueGridD); + dataPacket.setIssueGridDailyList(issueGridDailyList); + }else{ + dataPacket.getIssueGridDailyList().add(issueGridD); + } + + if(null == dataPacket.getTotalGridDailyList()){ + List totalGridDailyList = new LinkedList<>(); + totalGridDailyList.add(totalGridD); + dataPacket.setTotalGridDailyList(totalGridDailyList); + }else{ + dataPacket.getTotalGridDailyList().add(totalGridD); + } + + if(null == dataPacket.getTopicGridDailyList()){ + List topicGridDailyList = new LinkedList<>(); + topicGridDailyList.add(topicGridD_discussing); + topicGridDailyList.add(topicGridD_hidden); + topicGridDailyList.add(topicGridD_closed); + dataPacket.setTopicGridDailyList(topicGridDailyList); + }else{ + dataPacket.getTopicGridDailyList().add(topicGridD_discussing); + dataPacket.getTopicGridDailyList().add(topicGridD_hidden); + dataPacket.getTopicGridDailyList().add(topicGridD_closed); + } + } + + void initAgencyMonthlyDTO(String agencyId, String pid, String customerId,DimIdGenerator.DimIdBean timeDimension, Map statusMap,FactTopicIssueAgencyMonthlyDTO issueAgencyM ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){ + issueAgencyM.setAgencyId(agencyId); + issueAgencyM.setPid(pid); + issueAgencyM.setCustomerId(customerId); + issueAgencyM.setMonthId(timeDimension.getMonthId()); + issueAgencyM.setQuarterId(timeDimension.getQuarterId()); + issueAgencyM.setYearId(timeDimension.getYearId()); + issueAgencyM.setIssueIncr(NumConstant.ZERO); + issueAgencyM.setIssueTotal(NumConstant.ZERO); + issueAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + topicAgencyM_discussing.setAgencyId(agencyId); + topicAgencyM_discussing.setPid(pid); + topicAgencyM_discussing.setCustomerId(customerId); + topicAgencyM_discussing.setMonthId(timeDimension.getMonthId()); + topicAgencyM_discussing.setQuarterId(timeDimension.getQuarterId()); + topicAgencyM_discussing.setYearId(timeDimension.getYearId()); + topicAgencyM_discussing.setTopicStatusId(statusMap.get("discussing").getId()); + topicAgencyM_discussing.setTopicIncr(NumConstant.ZERO); + topicAgencyM_discussing.setTopicCount(NumConstant.ZERO); + topicAgencyM_discussing.setTopicProportion(BigDecimal.ZERO); + topicAgencyM_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyM_hidden.setAgencyId(agencyId); + topicAgencyM_hidden.setPid(pid); + topicAgencyM_hidden.setCustomerId(customerId); + topicAgencyM_hidden.setMonthId(timeDimension.getMonthId()); + topicAgencyM_hidden.setQuarterId(timeDimension.getQuarterId()); + topicAgencyM_hidden.setYearId(timeDimension.getYearId()); + topicAgencyM_hidden.setTopicStatusId(statusMap.get("hidden").getId()); + topicAgencyM_hidden.setTopicIncr(NumConstant.ZERO); + topicAgencyM_hidden.setTopicCount(NumConstant.ZERO); + topicAgencyM_hidden.setTopicProportion(BigDecimal.ZERO); + topicAgencyM_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyM_closed.setAgencyId(agencyId); + topicAgencyM_closed.setPid(pid); + topicAgencyM_closed.setCustomerId(customerId); + topicAgencyM_closed.setMonthId(timeDimension.getMonthId()); + topicAgencyM_closed.setQuarterId(timeDimension.getQuarterId()); + topicAgencyM_closed.setYearId(timeDimension.getYearId()); + topicAgencyM_closed.setTopicStatusId(statusMap.get("closed").getId()); + topicAgencyM_closed.setTopicIncr(NumConstant.ZERO); + topicAgencyM_closed.setTopicCount(NumConstant.ZERO); + topicAgencyM_closed.setTopicProportion(BigDecimal.ZERO); + topicAgencyM_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + } + + void initGridMonthlyDTO(String agencyId, String gridId,String customerId,DimIdGenerator.DimIdBean timeDimension,FactTopicIssueGridMonthlyDTO issueGridM){ + issueGridM.setAgencyId(agencyId); + issueGridM.setGridId(gridId); + issueGridM.setCustomerId(customerId); + issueGridM.setMonthId(timeDimension.getMonthId()); + issueGridM.setQuarterId(timeDimension.getQuarterId()); + issueGridM.setYearId(timeDimension.getYearId()); + issueGridM.setIssueIncr(NumConstant.ZERO); + issueGridM.setIssueTotal(NumConstant.ZERO); + issueGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + } + + void setAgencyTopicMonthlyProportion(NumberFormat numberFormat,FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing, FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden, FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){ + + Integer total = topicAgencyM_discussing.getTopicCount() + topicAgencyM_hidden.getTopicCount() + topicAgencyM_closed.getTopicCount(); + + topicAgencyM_discussing.setTopicProportion(total == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyM_discussing.getTopicCount() / (float) total + ))); + + topicAgencyM_hidden.setTopicProportion(total == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyM_hidden.getTopicCount() / (float) total + ))); + + topicAgencyM_closed.setTopicProportion(total == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyM_closed.getTopicCount() / (float) total + ))); + } + + void setAgencyMonthlyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueAgencyMonthlyDTO issueAgencyM, FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing, FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden, FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){ + if(null == dataPacket.getIssueAgencyMonthlyList()){ + List issueAgencyMonthlyList = new LinkedList<>(); + issueAgencyMonthlyList.add(issueAgencyM); + dataPacket.setIssueAgencyMonthlyList(issueAgencyMonthlyList); + }else{ + dataPacket.getIssueAgencyMonthlyList().add(issueAgencyM); + } + + + if(null == dataPacket.getTopicAgencyMonthlyList()){ + List topicAgencyMonthlyList = new LinkedList<>(); + topicAgencyMonthlyList.add(topicAgencyM_discussing); + topicAgencyMonthlyList.add(topicAgencyM_hidden); + topicAgencyMonthlyList.add(topicAgencyM_closed); + dataPacket.setTopicAgencyMonthlyList(topicAgencyMonthlyList); + }else{ + dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_discussing); + dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_hidden); + dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_closed); + } + } + + void setGridMonthlyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueGridMonthlyDTO issueGridM ){ + if(null == dataPacket.getIssueGridMonthlyList()){ + List issueGridMonthlyList = new LinkedList<>(); + issueGridMonthlyList.add(issueGridM); + dataPacket.setIssueGridMonthlyList(issueGridMonthlyList); + }else{ + dataPacket.getIssueGridMonthlyList().add(issueGridM); + } + + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java new file mode 100644 index 0000000000..cd4c70287b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -0,0 +1,30 @@ +package com.epmet.service.user; + +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.util.DimIdGenerator; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public interface UserService { + + /** + * @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制 + * @param agencies - List + * @return + * @author wangc + * @date 2020.06.18 10:03 + **/ + UserStatisticalData traverseAgencyUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension); + + /** + * @Description 遍历所有机关的直属网格统计注册用户参与用户的数据 + * @param agencies - List + * @return + * @author wangc + * @date 2020.06.18 10:03 + **/ + UserStatisticalData traverseGridUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java new file mode 100644 index 0000000000..2fca7b32fb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -0,0 +1,603 @@ +package com.epmet.service.user.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.user.UserDao; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.user.*; +import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; +import com.epmet.service.user.UserService; +import com.epmet.util.DimIdGenerator; +import com.epmet.util.ModuleConstant; +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 java.math.BigDecimal; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description 15直连epmet-user + * @ClassName UserServiceImpl + * @Auth wangc + * @Date 2020-06-18 09:55 + */ +@DataSource(DataSourceConstant.EPMET_USER) +@Service +public class UserServiceImpl implements UserService { + + private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); + + @Autowired + private UserDao userDao; + + /** + * @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制 + * @param agencies - List + * @return + * @author wangc + * @date 2020.06.18 10:03 + **/ + @Override + public UserStatisticalData traverseAgencyUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension) { + if(null == agencies || agencies.size() == NumConstant.ZERO){ + logger.warn("没有相应的机关集合"); + return null; + } + + UserStatisticalData dataPacket = new UserStatisticalData(); + dataPacket.setDateId(timeDimension.getDateId()); + dataPacket.setMonthId(timeDimension.getMonthId()); + //自上向下检索 + + Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + Map> subGridOfAgency = new HashMap<>(); + agencies.forEach(agency -> { + initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); + }); + + //对每一个机关进行数据统计 + if(subGridOfAgency.size() > NumConstant.ZERO){ + subGridOfAgency.forEach((k,v) -> { + queryUserData(ModuleConstant.DIM_SUB_AGENCY, + k, + (null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(k).get(NumConstant.ZERO).getPid(), + (null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? null : agencyMap.get(k).get(NumConstant.ZERO).getCustomerId(), + v, + targetDate, + dataPacket, + timeDimension); + }); + } + + return dataPacket; + } + + /** + * @Description 遍历所有机关的直属网格统计注册用户参与用户的数据 + * @param agencies - List + * @return + * @author wangc + * @date 2020.06.18 10:03 + **/ + @Override + public UserStatisticalData traverseGridUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension) { + if(null == agencies || agencies.size() == NumConstant.ZERO){ + logger.warn("没有相应的机关集合"); + return null; + } + + UserStatisticalData dataPacket = new UserStatisticalData(); + dataPacket.setMonthId(timeDimension.getMonthId()); + dataPacket.setDateId(timeDimension.getDateId()); + + //自上向下检索 + Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + if(null != agencyMap && agencyMap.size() > NumConstant.ZERO){ + agencyMap.forEach((k,v) -> { + if(null != v && v.size() > NumConstant.ZERO){ + queryUserData(ModuleConstant.DIM_BELONGING_GRID, + k, + v.get(NumConstant.ZERO).getPid(), + v.get(NumConstant.ZERO).getCustomerId(), + new HashSet<>(v.get(NumConstant.ZERO).getGridIds()), + targetDate, + dataPacket, + timeDimension); + } + }); + } + + return dataPacket; + } + + + /** + * @Description 初始化机关-所有下级网格Map + * @param pid - 固定一个机关Id + * @param agency - AgencySubTreeDto + * @param subGridOfAgency - Map> + * @return + * @author wangc + * @date 2020.06.18 15:54 + **/ + void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map> subGridOfAgency){ + + //向map中放入数据 + if(subGridOfAgency.containsKey(pid)){ + //包含key + Set grids = subGridOfAgency.get(pid); + if(null == grids){ + grids = new HashSet<>(); + subGridOfAgency.put(pid,grids); + } + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + grids.addAll(agency.getGridIds()); + } + }else{ + //不包含key + Set grids = new HashSet<>(agency.getGridIds()); + subGridOfAgency.put(pid,grids); + } + + //定义递归出口 + if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){ + return ; + } + + + //定义递归入口 + agency.getSubAgencies().forEach(obj -> { + initAgencyGridMap(pid,obj,subGridOfAgency); + }); + } + + /** + * @Description 执行查询用户数据统计的逻辑 + * @param relation - agency(下级机关加网格) | grid(直属网格) + * @param agencyId + * @param pid + * @param customerId + * @param gridIds - 机关下所有网格集合/机关下直属网格集合 + * @param targetDate + * @param dataPacket - 数据包 + * @param timeDimension DimIdGenerator.DimIdBean + * @return + * @author wangc + * @date 2020.06.19 10:01 + **/ + void queryUserData(String relation, String agencyId, String pid, String customerId, Set gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){ + + if(StringUtils.isBlank(pid)) + pid = NumConstant.ZERO_STR; + + dataPacket.setCustomerId(customerId); + + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + Boolean isMonthEnd = false; + Calendar calendar =Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE, NumConstant.ONE_NEG); + Date targetDateCheck = null == targetDate ? calendar.getTime() : targetDate; + + calendar.setTime(targetDateCheck); + //如果目标日期是当月的最后一天 + if(calendar.get(Calendar.DATE) == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){ + //求出这个月的第一天 + calendar.setTime(new Date()); + calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); + + isMonthEnd = true; + } + + if(StringUtils.equals(ModuleConstant.DIM_SUB_AGENCY,relation)){ + + + //默认查询注册用户 + + //1.计算机关下注册用户一个时间单位内的累计与增长 + CommonTotalAndIncCountResultDTO regData = + userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate); + //2.查询注册用户的Id列表 + List incrRegUsers = + userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate); + List totalRegUsers = + userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate); + //3.查询机关下一个时间单位内热心居民的累计与增量(注册用户) + CommonTotalAndIncCountResultDTO warmRegData = + userDao.selectWarmTotalAndIncr(totalRegUsers,incrRegUsers,gridIds,targetDate); + //4.查询机关下一个时间单位内党员的累计与增量(注册用户) + CommonTotalAndIncCountResultDTO partyRegData = + userDao.selectPartyTotalAndIncr(totalRegUsers,incrRegUsers,targetDate); + + + //参与用户 + //1.计算机关下参与用户一个时间单位内的累计与增长 + CommonTotalAndIncCountResultDTO partiData = + userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate); + //2.查询参与用户的Id列表 + List incrPartiUsers = + userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate); + List totalPartiUsers = + userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate); + //3.查询机关下一个时间单位内热心居民的累计与增量(参与用户) + CommonTotalAndIncCountResultDTO warmPartiData = + userDao.selectWarmTotalAndIncr(totalPartiUsers,incrPartiUsers,gridIds,targetDate); + //4.查询机关下一个时间单位内党员的累计与增量(参与用户) + CommonTotalAndIncCountResultDTO partyPartiData = + userDao.selectPartyTotalAndIncr(totalPartiUsers,incrPartiUsers,targetDate); + + + + //agency + FactRegUserAgencyDailyDTO regAgencyD = new FactRegUserAgencyDailyDTO(); + regAgencyD.setCustomerId(customerId); + regAgencyD.setAgencyId(agencyId); + regAgencyD.setDateId(timeDimension.getDateId()); + regAgencyD.setWeekId(timeDimension.getWeekId()); + regAgencyD.setYearId(timeDimension.getYearId()); + regAgencyD.setResiTotal(regData.getTotal()); + regAgencyD.setRegTotal(regData.getTotal()); + regAgencyD.setWarmHeartedTotal(warmRegData.getTotal()); + regAgencyD.setPartymemberTotal(partyRegData.getTotal()); + regAgencyD.setRegIncr(regData.getIncr()); + regAgencyD.setWarmIncr(warmRegData.getIncr()); + regAgencyD.setPartymemberIncr(partiData.getIncr()); + regAgencyD.setResiProportion(new BigDecimal(NumConstant.ONE)); + regAgencyD.setPartymemberProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyRegData.getTotal()/(float)regData.getTotal() ))); + regAgencyD.setWarmHeartedProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmRegData.getTotal()/(float)regData.getTotal() ))); + regAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + if(null != dataPacket.getRegAgencyDailyList()){ + dataPacket.getRegAgencyDailyList().add(regAgencyD); + }else{ + List list = new ArrayList<>(); + list.add(regAgencyD); + dataPacket.setRegAgencyDailyList(list); + } + + + FactParticipationUserAgencyDailyDTO partiAgencyD = new FactParticipationUserAgencyDailyDTO(); + partiAgencyD.setCustomerId(customerId); + partiAgencyD.setAgencyId(agencyId); + partiAgencyD.setDateId(timeDimension.getDateId()); + partiAgencyD.setWeekId(timeDimension.getWeekId()); + partiAgencyD.setYearId(timeDimension.getYearId()); + partiAgencyD.setResiTotal(partiData.getTotal()); + partiAgencyD.setRegTotal(partiData.getTotal()); + partiAgencyD.setWarmHeartedTotal(warmPartiData.getTotal()); + partiAgencyD.setPartymemberTotal(partyPartiData.getTotal()); + partiAgencyD.setRegIncr(partiData.getIncr()); + partiAgencyD.setWarmIncr(warmPartiData.getIncr()); + partiAgencyD.setPartymemberIncr(partyPartiData.getIncr()); + partiAgencyD.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiAgencyD.setPartymemberProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyPartiData.getTotal()/(float)partiData.getTotal() ))); + partiAgencyD.setWarmHeartedProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmPartiData.getTotal()/(float)partiData.getTotal() ))); + partiAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + if(null != dataPacket.getPartiAgencyDailyList()){ + dataPacket.getPartiAgencyDailyList().add(partiAgencyD); + }else{ + List list = new ArrayList<>(); + list.add(partiAgencyD); + dataPacket.setPartiAgencyDailyList(list); + } + + + //月末处理 + if(isMonthEnd){ + + + //本月注册用户增长数 + Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck); + //本月新增注册用户Id集合 + List incrRegIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck); + //本月新增党员数(注册用户) + Integer incrPartyOfRegMonthly = userDao.selectPartyIncrWithinTimeRange(incrRegIdsMonthly,calendar.getTime(),targetDateCheck); + //本月新增热心居民数(注册用户) + Integer incrWarmOfRegMonthly = userDao.selectWarmIncrWithinTimeRange(incrRegIdsMonthly,gridIds,calendar.getTime(),targetDateCheck); + + + //本月参与用户增长数 + Integer partiIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,calendar.getTime(),targetDateCheck); + //本月新增参与用户Id集合 + List incrPartiIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,calendar.getTime(),targetDateCheck); + //本月新增党员数(参与用户) + Integer incrPartyOfPartiMonthly = userDao.selectPartyIncrWithinTimeRange(incrPartiIdsMonthly,calendar.getTime(),targetDateCheck); + //本月新增热心居民数(参与用户) + Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,gridIds,calendar.getTime(),targetDateCheck); + + + FactRegUserAgencyMonthlyDTO regAgencyM = new FactRegUserAgencyMonthlyDTO(); + regAgencyM.setCustomerId(customerId); + regAgencyM.setAgencyId(agencyId); + regAgencyM.setMonthId(timeDimension.getMonthId()); + regAgencyM.setQuarterId(timeDimension.getQuarterId()); + regAgencyM.setYearId(timeDimension.getYearId()); + regAgencyM.setRegTotal(regData.getTotal()); + regAgencyM.setResiTotal(regData.getTotal()); + regAgencyM.setWarmHeartedTotal(warmRegData.getTotal()); + regAgencyM.setPartymemberTotal(partyRegData.getTotal()); + regAgencyM.setRegIncr(regIncrMonthly); + regAgencyM.setWarmIncr(incrWarmOfRegMonthly); + regAgencyM.setPartymemberIncr(incrPartyOfRegMonthly); + regAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); + regAgencyM.setPartymemberProportion(regAgencyD.getPartymemberProportion()); + regAgencyM.setWarmHeartedProportion(regAgencyD.getWarmHeartedProportion()); + regAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + if(null == dataPacket.getRegAgencyMonthlyList()){ + List list = new LinkedList<>(); + list.add(regAgencyM); + dataPacket.setRegAgencyMonthlyList(list); + }else{ + dataPacket.getRegAgencyMonthlyList().add(regAgencyM); + } + + + FactParticipationUserAgencyMonthlyDTO partiAgencyM = new FactParticipationUserAgencyMonthlyDTO(); + partiAgencyM.setCustomerId(customerId); + partiAgencyM.setAgencyId(agencyId); + partiAgencyM.setMonthId(timeDimension.getMonthId()); + partiAgencyM.setQuarterId(timeDimension.getQuarterId()); + partiAgencyM.setYearId(timeDimension.getYearId()); + partiAgencyM.setRegTotal(partiData.getTotal()); + partiAgencyM.setResiTotal(partiData.getTotal()); + partiAgencyM.setWarmHeartedTotal(warmPartiData.getTotal()); + partiAgencyM.setPartymemberTotal(partyPartiData.getTotal()); + partiAgencyM.setRegIncr(partiIncrMonthly); + partiAgencyM.setWarmIncr(incrWarmOfPartiMonthly); + partiAgencyM.setPartymemberIncr(incrPartyOfPartiMonthly); + partiAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiAgencyM.setPartymemberProportion(partiAgencyD.getPartymemberProportion()); + partiAgencyM.setWarmHeartedProportion(partiAgencyD.getWarmHeartedProportion()); + partiAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + if(null == dataPacket.getPartiAgencyMonthlyList()){ + List list = new LinkedList<>(); + list.add(partiAgencyM); + dataPacket.setPartiAgencyMonthlyList(list); + }else{ + dataPacket.getPartiAgencyMonthlyList().add(partiAgencyM); + } + + + } + + + }else{ + //直属网格数据 + + + Set singleGridIdSet = new HashSet<>(); + final boolean monthEndFlag = isMonthEnd; + //grid + gridIds.forEach(gridId -> { + + singleGridIdSet.add(gridId); + // START QUERY + + //1.计算机关下注册用户一个时间单位内的累计与增长 + CommonTotalAndIncCountResultDTO regData = + userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate); + //2.查询注册用户的Id列表 + List incrRegUsers = + userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate); + List totalRegUsers = + userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate); + //3.查询机关下一个时间单位内热心居民的累计与增量(注册用户) + CommonTotalAndIncCountResultDTO warmRegData = + userDao.selectWarmTotalAndIncr(totalRegUsers,incrRegUsers,singleGridIdSet,targetDate); + //4.查询机关下一个时间单位内党员的累计与增量(注册用户) + CommonTotalAndIncCountResultDTO partyRegData = + userDao.selectPartyTotalAndIncr(totalRegUsers,incrRegUsers,targetDate); + + + //参与用户 + //1.计算机关下参与用户一个时间单位内的累计与增长 + CommonTotalAndIncCountResultDTO partiData = + userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate); + //2.查询参与用户的Id列表 + List incrPartiUsers = + userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate); + List totalPartiUsers = + userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate); + //3.查询机关下一个时间单位内热心居民的累计与增量(参与用户) + CommonTotalAndIncCountResultDTO warmPartiData = + userDao.selectWarmTotalAndIncr(totalPartiUsers,incrPartiUsers,singleGridIdSet,targetDate); + //4.查询机关下一个时间单位内党员的累计与增量(参与用户) + CommonTotalAndIncCountResultDTO partyPartiData = + userDao.selectPartyTotalAndIncr(totalPartiUsers,incrPartiUsers,targetDate); + + + // END QUERY + + + //注册用户网格级别 + FactRegUserGridDailyDTO regGridD = new FactRegUserGridDailyDTO(); + + regGridD.setCustomerId(customerId); + regGridD.setGridId(gridId); + regGridD.setCustomerId(customerId); + regGridD.setAgencyId(agencyId);//网格直属得机关 + regGridD.setDateId(timeDimension.getDateId()); + regGridD.setWeekId(timeDimension.getWeekId()); + regGridD.setYearId(timeDimension.getYearId()); + regGridD.setResiTotal(regData.getTotal()); + regGridD.setRegTotal(regData.getTotal()); + regGridD.setWarmHeartedTotal(warmRegData.getTotal()); + regGridD.setPartymemberTotal(partyRegData.getTotal()); + regGridD.setRegIncr(regData.getIncr()); + regGridD.setWarmIncr(warmRegData.getIncr()); + regGridD.setPartymemberIncr(partyRegData.getIncr()); + regGridD.setResiProportion(new BigDecimal(NumConstant.ONE)); + regGridD.setPartymemberProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyRegData.getTotal()/(float)regData.getTotal() ))); + regGridD.setWarmHeartedProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmRegData.getTotal()/(float)regData.getTotal() ))); + regGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + if(null != dataPacket.getRegGridDailyList()){ + dataPacket.getRegGridDailyList().add(regGridD); + }else{ + List list = new ArrayList<>(); + list.add(regGridD); + dataPacket.setRegGridDailyList(list); + } + + + //参与用户网格级别 + FactParticipationUserGridDailyDTO partiGridD = new FactParticipationUserGridDailyDTO(); + + partiGridD.setCustomerId(customerId); + partiGridD.setGridId(gridId); + partiGridD.setAgencyId(agencyId); + partiGridD.setDateId(timeDimension.getDateId()); + partiGridD.setWeekId(timeDimension.getWeekId()); + partiGridD.setYearId(timeDimension.getYearId()); + partiGridD.setResiTotal(partiData.getTotal()); + partiGridD.setRegTotal(partiData.getTotal()); + partiGridD.setWarmHeartedTotal(warmPartiData.getTotal()); + partiGridD.setPartymemberTotal(partyPartiData.getTotal()); + partiGridD.setRegIncr(partiData.getIncr()); + partiGridD.setWarmIncr(warmPartiData.getIncr()); + partiGridD.setPartymemberIncr(partyPartiData.getIncr()); + partiGridD.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiGridD.setPartymemberProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyPartiData.getTotal()/(float)partiData.getTotal() ))); + partiGridD.setWarmHeartedProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmPartiData.getTotal()/(float)partiData.getTotal() ))); + partiGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + if(null != dataPacket.getPartiGridDailyList()){ + dataPacket.getPartiGridDailyList().add(partiGridD); + }else{ + List list = new ArrayList<>(); + list.add(partiGridD); + dataPacket.setPartiGridDailyList(list); + } + + + + if(monthEndFlag){ + //本月注册用户增长数 + Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,calendar.getTime(),targetDateCheck); + //本月新增注册用户Id集合 + List incrRegIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,calendar.getTime(),targetDateCheck); + //本月新增党员数(注册用户) + Integer incrPartyOfRegMonthly = userDao.selectPartyIncrWithinTimeRange(incrRegIdsMonthly,calendar.getTime(),targetDateCheck); + //本月新增热心居民数(注册用户) + Integer incrWarmOfRegMonthly = userDao.selectWarmIncrWithinTimeRange(incrRegIdsMonthly,singleGridIdSet,calendar.getTime(),targetDateCheck); + + + //本月参与用户增长数 + Integer partiIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,calendar.getTime(),targetDateCheck); + //本月新增参与用户Id集合 + List incrPartiIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,calendar.getTime(),targetDateCheck); + //本月新增党员数(参与用户) + Integer incrPartyOfPartiMonthly = userDao.selectPartyIncrWithinTimeRange(incrPartiIdsMonthly,calendar.getTime(),targetDateCheck); + //本月新增热心居民数(参与用户) + Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,singleGridIdSet,calendar.getTime(),targetDateCheck); + + FactRegUserGridMonthlyDTO regGridM = new FactRegUserGridMonthlyDTO(); + regGridM.setCustomerId(customerId); + regGridM.setAgencyId(agencyId); + regGridM.setGridId(gridId); + regGridM.setMonthId(timeDimension.getMonthId()); + regGridM.setQuarterId(timeDimension.getQuarterId()); + regGridM.setYearId(timeDimension.getYearId()); + regGridM.setRegTotal(regData.getTotal()); + regGridM.setResiTotal(regData.getTotal()); + regGridM.setWarmHeartedTotal(warmRegData.getTotal()); + regGridM.setPartymemberTotal(partyRegData.getTotal()); + regGridM.setRegIncr(regIncrMonthly); + regGridM.setWarmIncr(incrWarmOfRegMonthly); + regGridM.setPartymemberIncr(incrPartyOfRegMonthly); + regGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); + regGridM.setPartymemberProportion(regGridD.getPartymemberProportion()); + regGridM.setWarmHeartedProportion(regGridD.getWarmHeartedProportion()); + regGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + if(null != dataPacket.getRegGridMonthlyList()){ + dataPacket.getRegGridMonthlyList().add(regGridM); + }else{ + List list = new ArrayList<>(); + list.add(regGridM); + dataPacket.setRegGridMonthlyList(list); + } + + FactParticipationUserGridMonthlyDTO partiGridM = new FactParticipationUserGridMonthlyDTO(); + partiGridM.setCustomerId(customerId); + partiGridM.setAgencyId(agencyId); + partiGridM.setGridId(gridId); + partiGridM.setMonthId(timeDimension.getMonthId()); + partiGridM.setQuarterId(timeDimension.getQuarterId()); + partiGridM.setYearId(timeDimension.getYearId()); + partiGridM.setRegTotal(partiData.getTotal()); + partiGridM.setResiTotal(partiData.getTotal()); + partiGridM.setWarmHeartedTotal(warmPartiData.getTotal()); + partiGridM.setPartymemberTotal(partyPartiData.getTotal()); + partiGridM.setRegIncr(partiIncrMonthly); + partiGridM.setWarmIncr(incrWarmOfPartiMonthly); + partiGridM.setPartymemberIncr(incrPartyOfPartiMonthly); + partiGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiGridM.setPartymemberProportion(partiGridD.getPartymemberProportion()); + partiGridM.setWarmHeartedProportion(partiGridD.getWarmHeartedProportion()); + partiGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + if(null != dataPacket.getPartiGridMonthlyList()){ + dataPacket.getPartiGridMonthlyList().add(partiGridM); + }else{ + List list = new ArrayList<>(); + list.add(partiGridM); + dataPacket.setPartiGridMonthlyList(list); + } + + } + + + singleGridIdSet.clear(); + + }); + + } + + + + } + + + public static void main(String[] args) { + + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + //calendar.set(Calendar.DAY_OF_MONTH, 1); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + System.out.println(format.format(calendar.getTime())); + + + + calendar.setTime(calendar.getTime()); + calendar.add(Calendar.DATE, -1); + System.out.println(calendar.getTime()); + System.out.println(format.format(calendar.getTime())); + System.out.println(format2.format(calendar.getTime())); + } + + /** + * @Description 先查出所有的用户单位时间内新增的注册居民、党员、热心居民(跟随网格),然后查出单位时间内,每一个网格下的参与用户Id集合和注册用户Id集合 + * @param + * @return + * @author wangc + * @date 2020.06.23 00:32 + **/ +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleOperateRecordService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleOperateRecordService.java new file mode 100644 index 0000000000..3a63203083 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleOperateRecordService.java @@ -0,0 +1,31 @@ +/** + * 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.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.voice.ArticleOperateRecordEntity; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticleOperateRecordService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java new file mode 100644 index 0000000000..125e46e962 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.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.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticlePublishRangeService extends BaseService { + + /** + * desc: 根据客户Id 、创建日期查询 有史以来所有的发布文章总数 + * + * @param customerId + * @param createDate + * @return: List + * @date: 2020/6/17 16:59 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List getAllPublishedCount(String customerId, Date createDate); + + /** + * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 + * + * @param customerId + * @param startDate + * @param endDate + * @return: List + * @date: 2020/6/17 21:43 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List getOneDayPublishedCount(String customerId, Date startDate, Date endDate); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java new file mode 100644 index 0000000000..ce6025a17a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java @@ -0,0 +1,67 @@ +/** + * 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.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticleEntity; + +import java.util.List; + +/** + * desc: 数据统计文章service + * + * return: + * @date: 2020/6/17 15:28 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +public interface ArticleService extends BaseService { + + /** + * desc:根据客户id、发布时间 获取文章总数 + * @param customerId + * @param publishDate + * @return + */ + List getAllDepartmentPublishedCount(String customerId, String publishDate); + /** + * desc:根据客户id、发布时间 获取文章总数 + * @param customerId + * @param publishDate + * @return + */ + List getAllAgencyPublishedCount(String customerId, String publishDate); + /** + * desc:根据客户id、发布时间 获取文章总数 + * @param customerId + * @param publishDate + * @return + */ + List getAllGridPublishedCount(String customerId, String publishDate); + + /** + * desc:根据客户id,发布时间 获取文章数据 + * @param customerId + * @param publishDate + * @return + */ + List getPublishedArticleByPublishTime(String customerId, String publishDate); + + ArticleEntity selectArticleById(String articleId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java new file mode 100644 index 0000000000..07067cd1dd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.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.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.voice.ArticleTagsEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticleTagsService extends BaseService { + + /** + * desc:根据客户Id 创建时间获取 文章便签数据 + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime); + + List getArticleTagsByArticleId(String customerId, String articleId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java new file mode 100644 index 0000000000..69de820d79 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.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.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticleVisitRecordService extends BaseService { + + /** + * desc:根据客户Id + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleVisitByCreateTime(String customerId, Date startTime, Date endTime); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleOperateRecordServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleOperateRecordServiceImpl.java new file mode 100644 index 0000000000..f1d464824f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleOperateRecordServiceImpl.java @@ -0,0 +1,40 @@ +/** + * 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.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticleOperateRecordDao; +import com.epmet.entity.voice.ArticleOperateRecordEntity; +import com.epmet.service.voice.ArticleOperateRecordService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 文章操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleOperateRecordServiceImpl extends BaseServiceImpl implements ArticleOperateRecordService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java new file mode 100644 index 0000000000..8fc2f430cd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java @@ -0,0 +1,67 @@ +/** + * 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.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticlePublishRangeDao; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; +import com.epmet.service.voice.ArticlePublishRangeService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { + + + @Override + public List getAllPublishedCount(String customerId, Date createDate) { + log.debug("getAllPublishedCount param customerId:{},createDate:{}", customerId, createDate); + return baseDao.getAllPublishedCount(customerId, createDate); + } + + /** + * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 + * + * @param customerId + * @param startDate + * @param endDate + * @return: List + * @date: 2020/6/17 21:43 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + @Override + public List getOneDayPublishedCount(String customerId, Date startDate, Date endDate) { + log.debug("getOneDayPublishedCount param startDate:{},endDate:{}", startDate, endDate); + return baseDao.getOneDayPublishedCount(customerId, startDate, endDate); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java new file mode 100644 index 0000000000..2a9bd8d17e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dao.voice.ArticleDao; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticleEntity; +import com.epmet.service.voice.ArticleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { + + @Override + public List getAllDepartmentPublishedCount(String customerId, String publishDate) { + checkParam(customerId, publishDate); + return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_DEPT); + } + + @Override + public List getAllAgencyPublishedCount(String customerId, String publishDate) { + checkParam(customerId, publishDate); + return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_AGENCY); + } + + @Override + public List getAllGridPublishedCount(String customerId, String publishDate) { + checkParam(customerId, publishDate); + return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_GRID); + } + + + + @Override + public List getPublishedArticleByPublishTime(String customerId, String publishDate) { + checkParam(customerId, publishDate); + return baseDao.getPublishedArticleByDay(customerId,publishDate); + } + + @Override + public ArticleEntity selectArticleById(String articleId) { + if (StringUtils.isBlank(articleId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.selectById(articleId); + } + + private void checkParam(String customerId, String publishDate) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(publishDate)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java new file mode 100644 index 0000000000..52a8a43295 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.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.service.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticleTagsDao; +import com.epmet.entity.voice.ArticleTagsEntity; +import com.epmet.service.voice.ArticleTagsService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleTagsServiceImpl extends BaseServiceImpl implements ArticleTagsService { + + @Override + public List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime) { + this.checkParam(customerId, endTime, endTime); + return baseDao.getArticleTagsByDay(customerId, startTime, endTime); + } + + @Override + public List getArticleTagsByArticleId(String customerId, String articleId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(articleId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getArticleTagsByArticleId(customerId, articleId); + } + + private void checkParam(String customerId, Date starTime, Date endTime) { + if (StringUtils.isBlank(customerId) || starTime == null || endTime == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java new file mode 100644 index 0000000000..689a1a32e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java @@ -0,0 +1,54 @@ +/** + * 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.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticleVisitRecordDao; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; +import com.epmet.service.voice.ArticleVisitRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleVisitRecordServiceImpl extends BaseServiceImpl implements ArticleVisitRecordService { + + @Override + public List getArticleVisitByCreateTime(String customerId, Date startTime, Date endTime) { + if (StringUtils.isBlank(customerId) || startTime == null || endTime == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getArticleVisitByCreateTime(customerId, startTime, endTime); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java new file mode 100644 index 0000000000..35e1f6d99b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java @@ -0,0 +1,91 @@ +package com.epmet.util; + +import com.epmet.commons.tools.utils.DateUtils; +import lombok.Data; + +import java.util.Calendar; +import java.util.Date; + +public class DimIdGenerator { + + /** + * 生成日期维度ID + * @param targetDate + * @return + */ + public static String getDateDimId(Date targetDate) { + return DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYYMMDD); + } + + /** + * 获取月维度ID + * @param date + * @return + */ + public static String getMonthDimId(Date date) { + return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMM); + } + + /** + * 获取周维度ID ,每周的星期一为 周的开始 + * @param date + * @return + */ + public static String getWeekDimId(Date date) { + String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); + Calendar calendar = Calendar.getInstance(); + calendar.setFirstDayOfWeek(Calendar.MONDAY); + calendar.setTime(date); + return yyyy.concat("W").concat(calendar.get(Calendar.WEEK_OF_YEAR)+""); + } + + /** + * 获取季度维度ID + * @param date + * @return + */ + public static String getQuarterDimId(Date date) { + String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); + return yyyy.concat("Q").concat(DateUtils.getQuarterIndex(date) + ""); + } + + /** + * 获取年维度ID + * @param date + * @return + */ + public static String getYearDimId(Date date) { + return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); + } + + /** + * 获取封装了所有ID的对象 + * @return + */ + public static DimIdBean getDimIdBean(Date date) { + DimIdBean dimIdBean = new DimIdBean(); + dimIdBean.setDateId(getDateDimId(date)); + dimIdBean.setMonthId(getMonthDimId(date)); + dimIdBean.setWeekId(getWeekDimId(date)); + dimIdBean.setQuarterId(getQuarterDimId(date)); + dimIdBean.setYearId(getYearDimId(date)); + return dimIdBean; + } + + public static void main(String[] args) { + DimIdBean dimIdBean = getDimIdBean(DateUtils.stringToDate("2020-06-14",DateUtils.DATE_PATTERN)); + System.out.println(dimIdBean); + } + + @Data + public static class DimIdBean { + private String dateId; + private String monthId; + private String quarterId; + private String yearId; + private String weekId; + + public DimIdBean() { + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java new file mode 100644 index 0000000000..48a1b9a08c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -0,0 +1,34 @@ +package com.epmet.util; + +public interface ModuleConstant { + + /** + * 注册用户标识 + * */ + String REG_OR_PARTI_FLAG_REG = "reg"; + + /** + * 参与用户标识 + * */ + String REG_OR_PARTI_FLAG_PARTI = "parti"; + + /** + * 机关级别-社区 + * */ + String AGENCY_LEVEL_COMMUNITY = "community"; + + /** + * 维度: 下级机关 + * */ + String DIM_SUB_AGENCY = "agency"; + + /** + * 维度: 直属网格 + * */ + String DIM_BELONGING_GRID = "grid"; + + /** + * 统计机器人 + * */ + String CREATED_BY_STATISTICAL_ROBOT = "STATISTICAL_ROBOT"; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..ad6caadfa5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -0,0 +1,165 @@ +server: + port: @server.port@ + servlet: + context-path: /data/stats + +spring: + main: + allow-bean-definition-overriding: true + application: + name: data-statistical-server + #环境 dev|test|prod + profiles: + active: dev + 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 + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.stats.url@ + username: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ + 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 + #指定共享配置,且支持动态刷新 + # ext-config: + # - data-id: datasource.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + # - data-id: common.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + + # 数据迁移工具flyway + flyway: + enabled: false + locations: classpath:db/migration + url: @datasource.druid.stats.url@ + user: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ + baseline-on-migrate: true + baseline-version: 0 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: INPUT + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +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 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dynamic: + datasource: + govOrg: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.org.url@ + username: @datasource.druid.org.username@ + password: @datasource.druid.org.password@ + govIssue: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.issue.url@ + username: @datasource.druid.issue.username@ + password: @datasource.druid.issue.password@ + govProject: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.project.url@ + username: @datasource.druid.project.username@ + password: @datasource.druid.project.password@ + govVoice: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.voice.url@ + username: @datasource.druid.voice.username@ + password: @datasource.druid.voice.password@ + operCrm: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.crm.url@ + username: @datasource.druid.crm.username@ + password: @datasource.druid.crm.password@ + resiGroup: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.group.url@ + username: @datasource.druid.group.username@ + password: @datasource.druid.group.password@ + epmetuser: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.user.url@ + username: @datasource.druid.user.username@ + password: @datasource.druid.user.password@ + +thread: + # 线程池配置 + threadPool: + corePoolSize: @thread.pool.core-pool-size@ + maxPoolSize: @thread.pool.max-pool-size@ + queueCapacity: @thread.pool.queue-capacity@ + keepAlive: @thread.pool.keep-alive@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql new file mode 100644 index 0000000000..9f1554015e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql @@ -0,0 +1 @@ +ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql new file mode 100644 index 0000000000..25b7b1e955 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql @@ -0,0 +1,975 @@ +/*================================ 宣传能力 ======================================*/ + +/* + Navicat Premium Data Transfer + + Source Server : 亿联 + Source Server Type : MySQL + Source Server Version : 50728 + Source Host : 192.168.1.130:3306 + Source Schema : epmet_data_statistical + + Target Server Type : MySQL + Target Server Version : 50728 + File Encoding : 65001 + + Date: 22/06/2020 16:40:46 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for fact_article_published_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_article_published_agency_daily`; +CREATE TABLE `fact_article_published_agency_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '今日发布文章数', + `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【机关】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_article_published_department_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_article_published_department_daily`; +CREATE TABLE `fact_article_published_department_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布文章单位所属机关ID 发布文章单位所属机关ID', + `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '今日发布文章数', + `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【部门】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_article_published_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_article_published_grid_daily`; +CREATE TABLE `fact_article_published_grid_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布单位所属机关ID 发布单位所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '今日发布文章数', + `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【网格】日统计表' ROW_FORMAT = Dynamic; +-- ---------------------------- +-- Table structure for fact_tag_used_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_agency_daily`; +CREATE TABLE `fact_tag_used_agency_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_agency_monthly`; +CREATE TABLE `fact_tag_used_agency_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_agency_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_agency_quarterly`; +CREATE TABLE `fact_tag_used_agency_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_agency_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_agency_yearly`; +CREATE TABLE `fact_tag_used_agency_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_department_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_department_daily`; +CREATE TABLE `fact_tag_used_department_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID', + `DEPARTMENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_department_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_department_monthly`; +CREATE TABLE `fact_tag_used_department_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_department_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_department_quarterly`; +CREATE TABLE `fact_tag_used_department_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_department_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_department_yearly`; +CREATE TABLE `fact_tag_used_department_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_grid_daily`; +CREATE TABLE `fact_tag_used_grid_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_grid_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_grid_monthly`; +CREATE TABLE `fact_tag_used_grid_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_grid_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_grid_quarterly`; +CREATE TABLE `fact_tag_used_grid_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_used_grid_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_grid_yearly`; +CREATE TABLE `fact_tag_used_grid_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_viewed_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_agency_daily`; +CREATE TABLE `fact_tag_viewed_agency_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_viewed_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_agency_monthly`; +CREATE TABLE `fact_tag_viewed_agency_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_viewed_agency_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_agency_quarterly`; +CREATE TABLE `fact_tag_viewed_agency_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_viewed_agency_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_agency_yearly`; +CREATE TABLE `fact_tag_viewed_agency_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_viewed_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_grid_daily`; +CREATE TABLE `fact_tag_viewed_grid_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_viewed_grid_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_grid_monthly`; +CREATE TABLE `fact_tag_viewed_grid_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_viewed_grid_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_grid_quarterly`; +CREATE TABLE `fact_tag_viewed_grid_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_tag_viewed_grid_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_grid_yearly`; +CREATE TABLE `fact_tag_viewed_grid_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】年度统计表' ROW_FORMAT = Dynamic; + + +-- ---------------------------- +-- Table structure for fact_group_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS fact_group_agency_monthly;;/*SkipError*/ +CREATE TABLE `fact_group_agency_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '统计月份ID 关联月份dim表', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '统计季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '统计年份ID', + `GRID_TOTAL` int(11) DEFAULT NULL COMMENT '网格数 截至到月末的机关下网格数', + `GROUP_TOTAL` int(11) DEFAULT NULL COMMENT '小组数 截止到月末的新增数(该月内所有的新增数字之和)', + `GROUP_MEMBER_TOTAL` int(11) DEFAULT NULL COMMENT '机关下网格组内总人数 不去重', + `GROUP_MEMBER_AVG_COUNT` int(11) DEFAULT NULL COMMENT '小组平均人数 月末一天的平均数', + `GROUP_MEDIAN` int(11) DEFAULT NULL COMMENT '小组中位数 月末一天的中位数(人)', + `GROUP_INCR` int(11) DEFAULT NULL COMMENT '小组增量', + `GROUP_MEMBER_MAX_COUNT` int(11) DEFAULT NULL COMMENT '小组成员最大数', + `MAX_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '成员最多小组ID', + `GROUP_MEMBER_MIN_COUNT` int(11) DEFAULT NULL COMMENT '小组成员最小数', + `MIN_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '成员最少小组ID', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组-机关月统计数据'; + + + + + +-- ---------------------------- +-- Table structure for fact_group_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_group_grid_daily;;/*SkipError*/ +CREATE TABLE `fact_group_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dim表', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `GRID_TOTAL` int(11) DEFAULT '0' COMMENT '网格数 当前网格下的网格数', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '小组数', + `GROUP_MEMBER_TOTAL` int(11) DEFAULT '0' COMMENT '网格下所有组内总人数 不去重', + `GROUP_MEMBER_AVG_COUNT` int(11) DEFAULT '0' COMMENT '小组平均人数', + `GROUP_MEDIAN` int(11) DEFAULT '0' COMMENT '小组中位数 截至统计日期,小组人数依次由小到大排开取中位数', + `GROUP_INCR` int(11) DEFAULT '0' COMMENT '小组增量', + `GROUP_MEMBER_MAX_COUNT` int(11) DEFAULT NULL COMMENT '小组成员最大数', + `MAX_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '最多成员小组ID', + `GROUP_MEMBER_MIN_COUNT` int(11) DEFAULT NULL COMMENT '小组成员最小数', + `MIN_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '最少成员小组ID', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组-网格日统计数据'; + + + + +-- ---------------------------- +-- Table structure for fact_group_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_group_agency_daily;;/*SkipError*/ +CREATE TABLE `fact_group_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GRID_TOTAL` int(11) DEFAULT '0' COMMENT '网格总数 截至统计日期', + `GROUP_TOTAL_COUNT` int(11) DEFAULT '0' COMMENT '网格小组数(包含所有下级机关的网格小组) 截至统计日期', + `GROUP_MEMBER_TOTAL_COUNT` int(11) DEFAULT '0' COMMENT '机关下网格小组人数总计 不去重', + `GROUP_MEMBER_AVG_COUNT` int(11) DEFAULT '0' COMMENT '小组平均人数 截至统计日期', + `GROUP_MEDIAN` int(11) DEFAULT '0' COMMENT '小组中位数 截至统计日期,小组人数依次由小到大排开取中位数', + `GROUP_INCR` int(11) DEFAULT '0' COMMENT '当天小组增量', + `GROUP_MEMBER_MAX_COUNT` varchar(32) DEFAULT NULL COMMENT '小组最大成员数', + `MAX_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '最多成员小组ID', + `GROUP_MEMBER_MIN_COUNT` varchar(32) DEFAULT NULL COMMENT '小组最小成员数', + `MIN_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '最少成员小组ID', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组-机关日统计数据'; + + + + + +-- ---------------------------- +-- Table structure for fact_topic_status_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_status_agency_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_status_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dm表', + `PID` varchar(64) NOT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dm表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_STATUS_ID` varchar(32) NOT NULL COMMENT '话题状态ID 关联dim_topic_status表\n讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', + `TOPIC_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '话题数量 指定状态的话题数量', + `TOPIC_PROPORTION` decimal(4,2) NOT NULL COMMENT '话题状态百分比 指定状态话题数/话题总数\n总数在topic_total_agency_daily中', + `TOPIC_INCREMENT` int(11) NOT NULL DEFAULT '0' COMMENT '话题增量 单位时间内的状态话题的增加数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='状态话题-机关日统计数据表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_status_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_status_agency_monthly;;/*SkipError*/ +CREATE TABLE `fact_topic_status_agency_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dm表', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '统计月份 关联月度dm表', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID 关联季度dm表', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID 关联年度dm表', + `TOPIC_STATUS_ID` varchar(32) NOT NULL COMMENT '话题状态 讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', + `TOPIC_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '话题数量', + `TOPIC_PROPORTION` decimal(4,2) NOT NULL COMMENT '话题状态占比 月末一天 \n指定状态话题数/话题总数\n总数在topic_total_agency_daily中', + `TOPIC_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '话题增量 单位时间内的话题状态增加数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='状态话题-机关月统计数据表'; + + + + + +-- ---------------------------- +-- Table structure for fact_topic_status_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_status_grid_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_status_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID 关联网格dm表', + `DATE_ID` varchar(32) NOT NULL COMMENT '日期ID', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_STATUS_ID` varchar(32) DEFAULT NULL COMMENT '话题状态ID 讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '话题数量', + `TOPIC_PROPORTION` decimal(4,2) DEFAULT NULL COMMENT '话题状态占比 指定状态话题数/话题总数\n总数在topic_total_grid_daily中', + `TOPIC_INCREMENT` int(11) DEFAULT '0' COMMENT '话题增量', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='状态话题-网格日统计数据表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_total_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_total_agency_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_total_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dm表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `TOPIC_INCR` int(11) DEFAULT '0' COMMENT '话题增量', + `HIDDEN_TOTAL_COUNT` int(11) DEFAULT '0' COMMENT '屏蔽话题数', + `ISSUE_TOTAL_COUNT` int(11) DEFAULT '0' COMMENT '已转议题数', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题总数-机关日统计表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_total_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_total_grid_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_total_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dm表', + `WEEK_ID` varchar(32) DEFAULT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) DEFAULT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) DEFAULT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) DEFAULT NULL COMMENT '年ID', + `TOPIC_TOTAL` int(11) DEFAULT NULL COMMENT '话题总量', + `TOPIC_INCR` int(11) DEFAULT NULL COMMENT '话题增量', + `HIDDEN_TOTAL_COUNT` int(11) DEFAULT NULL COMMENT '屏蔽话题数量', + `ISSUE_TOTAL_COUNT` int(11) DEFAULT NULL COMMENT '已转议题数量', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL DEFAULT '0' COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL DEFAULT '0' COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题总数-网格日统计表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_issue_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_issue_agency_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_issue_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL DEFAULT '' COMMENT '客户Id', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '日期ID', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '已转议题数量', + `ISSUE_INCR` int(11) DEFAULT '0' COMMENT '已转议题当日增量', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转议题话题-机关日统计数据表'; + + + + + +-- ---------------------------- +-- Table structure for fact_topic_issue_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_issue_agency_monthly;;/*SkipError*/ +CREATE TABLE `fact_topic_issue_agency_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '已转议题总量', + `ISSUE_INCR` int(11) DEFAULT '0' COMMENT '已转议题增量', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转议题话题-机关月统计表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_issue_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_issue_grid_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_issue_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '日期ID', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `ISSUE_INCR` int(11) DEFAULT '0' COMMENT '新增转议题数', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '转议题总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`,`CUSTOMER_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转议题话题-网格日统计表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_issue_grid_monthly +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_issue_grid_monthly;;/*SkipError*/ +CREATE TABLE `fact_topic_issue_grid_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `ISSUE_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '已转议题增量', + `ISSUE_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '已转议题总量', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转议题话题-网格月统计表'; + + + + +-- ---------------------------- +-- Table structure for dim_topic_status +-- ---------------------------- +DROP TABLE IF EXISTS dim_topic_status;;/*SkipError*/ +CREATE TABLE dim_topic_status( + ID VARCHAR(32) NOT NULL COMMENT '唯一标识 话题状态ID"discussing"、"hidden"、"closed"' , + STATUS_DESC VARCHAR(32) NOT NULL COMMENT '状态描述 讨论中 已屏蔽 已关闭' , + DEL_FLAG VARCHAR(32) NOT NULL DEFAULT 0 COMMENT '删除标识' , + REVISION INT NOT NULL DEFAULT 0 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 dim_topic_status COMMENT '话题状态维度表';; + + + +SET FOREIGN_KEY_CHECKS = 1; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..148588bffb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -0,0 +1,163 @@ + + + + + + + + + + ${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-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerDao.xml new file mode 100644 index 0000000000..0aac258069 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml new file mode 100644 index 0000000000..968ca9d83d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml new file mode 100644 index 0000000000..3120f939d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml new file mode 100644 index 0000000000..6d3bc43ce3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml new file mode 100644 index 0000000000..6a5253e473 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml new file mode 100644 index 0000000000..3e22e1b5c3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml new file mode 100644 index 0000000000..7c20a18f4c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml new file mode 100644 index 0000000000..9f839a668e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml new file mode 100644 index 0000000000..fba7d93e3b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml @@ -0,0 +1,260 @@ + + + + + + + INSERT INTO dim_agency(id, agency_name, customer_id, pid, pids, all_parent_name, level, del_flag, revision, created_by, + created_time, updated_by, updated_time) + VALUE (#{id}, #{agencyName}, #{customerId}, #{pid}, #{pids}, #{allParentName}, #{level}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml new file mode 100644 index 0000000000..120be8603a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml @@ -0,0 +1,14 @@ + + + + + + INSERT INTO dim_customer(id, customer_name, del_flag, revision, created_by, created_time, updated_by, updated_time) + VALUES (#{id}, #{customerName}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml new file mode 100644 index 0000000000..ad531351b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + INSERT INTO dim_date + (ID, DATE_NAME, DAY_OF_WEEK, DAY_OF_WEEK_NAME, WEEK_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + (#{id}, #{dateName}, #{dayOfWeek}, #{dayOfWeekName}, #{weekId}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml new file mode 100644 index 0000000000..8941d496fd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml @@ -0,0 +1,22 @@ + + + + + + + INSERT INTO dim_department(id, department_name, agency_id, customer_id, del_flag, revision, created_by, created_time, + updated_by, updated_time) + VALUE (#{id}, #{departmentName}, #{agencyId}, #{customerId}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml new file mode 100644 index 0000000000..783230dc55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimMonthDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimMonthDao.xml new file mode 100644 index 0000000000..ffffa6903e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimMonthDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimQuarterDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimQuarterDao.xml new file mode 100644 index 0000000000..e9a609876a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimQuarterDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimTopicStatusDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimTopicStatusDao.xml new file mode 100644 index 0000000000..3c7aec1c8e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimTopicStatusDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimWeekDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimWeekDao.xml new file mode 100644 index 0000000000..04575603f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimWeekDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimYearDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimYearDao.xml new file mode 100755 index 0000000000..bfe7f01551 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimYearDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + INSERT INTO dim_year + (ID, YEAR_NAME, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + (#{id}, #{yearName}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml new file mode 100644 index 0000000000..eb6fc087bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + DELETE + FROM + fact_agency_project_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml new file mode 100644 index 0000000000..846b2c7a26 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_agency_project_monthly + WHERE + customer_id = #{customerId} + AND month_id = #{monthId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml new file mode 100644 index 0000000000..ea4debe1dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM fact_article_published_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml new file mode 100644 index 0000000000..abe5fafc0a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM fact_article_published_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml new file mode 100644 index 0000000000..b265d0b0c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM fact_article_published_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml new file mode 100644 index 0000000000..3f386bf7ba --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + DELETE + FROM + fact_grid_project_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml new file mode 100644 index 0000000000..916ff301c8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml @@ -0,0 +1,14 @@ + + + + + + + DELETE + FROM + fact_grid_project_monthly + WHERE + customer_id = #{customerId} + AND month_id = #{monthId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml new file mode 100644 index 0000000000..d2ef1b2a30 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO fact_group_agency_daily ( + ID, CUSTOMER_ID, AGENCY_ID, PID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL_COUNT, GROUP_MEMBER_TOTAL_COUNT, + GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, + MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + ( + REPLACE(UUID(),'-',''), + #{agency.customerId}, + #{agency.agencyId}, + #{agency.pid}, + #{agency.dateId}, + #{agency.weekId}, + #{agency.monthId}, + #{agency.quarterId}, + #{agency.yearId}, + #{agency.gridTotal}, + #{agency.groupTotalCount}, + #{agency.groupMemberTotalCount}, + #{agency.groupMemberAvgCount}, + #{agency.groupMedian}, + #{agency.groupIncr}, + #{agency.groupMemberMaxCount}, + IFNULL(#{agency.maxMemberGroupId},NULL), + #{agency.groupMemberMinCount}, + IFNULL(#{agency.minMemberGroupId},NULL), + #{agency.delFlag}, + #{agency.revision}, + #{agency.createdBy}, + NOW(), + #{agency.updatedBy}, + NOW() + ) + + + + + + + + + + + + DELETE + FROM + fact_group_agency_daily + WHERE + date_id = #{dateId} + AND customer_id = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml new file mode 100644 index 0000000000..cb0187485f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO fact_group_agency_monthly + (ID, CUSTOMER_ID, AGENCY_ID, PID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, + GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, + GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, + UPDATED_BY, UPDATED_TIME) + VALUES + + ( + REPLACE(UUID(),'-',''), + #{agency.customerId}, + #{agency.agencyId}, + #{agency.pid}, + #{agency.monthId}, + #{agency.quarterId}, + #{agency.yearId}, + #{agency.gridTotal}, + #{agency.groupTotal}, + #{agency.groupMemberTotal}, + #{agency.groupMemberAvgCount}, + #{agency.groupMedian}, + #{agency.groupIncr}, + #{agency.groupMemberMaxCount}, + #{agency.maxMemberGroupId}, + #{agency.groupMemberMinCount}, + #{agency.minMemberGroupId}, + #{agency.delFlag}, + #{agency.revision}, + #{agency.createdBy}, + NOW(), + #{agency.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_group_agency_monthly + WHERE + month_id = #{monthId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml new file mode 100644 index 0000000000..8c8ab22e50 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO fact_group_grid_daily (ID, CUSTOMER_ID, AGENCY_ID, GRID_ID, DATE_ID, WEEK_ID, MONTH_ID, YEAR_ID, QUARTER_ID, GRID_TOTAL, + GROUP_TOTAL, GROUP_MEMBER_TOTAL, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, + GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + + ( + REPLACE(UUID(),'-',''), + #{grid.customerId}, + #{grid.agencyId}, + #{grid.gridId}, + #{grid.dateId}, + #{grid.weekId}, + #{grid.monthId}, + #{grid.yearId}, + #{grid.quarterId}, + #{grid.gridTotal}, + #{grid.groupTotal}, + #{grid.groupMemberTotal}, + #{grid.groupMemberAvgCount}, + #{grid.groupMedian}, + #{grid.groupIncr}, + #{grid.groupMemberMaxCount}, + #{grid.maxMemberGroupId}, + #{grid.groupMemberMinCount}, + #{grid.minMemberGroupId}, + #{grid.delFlag}, + #{grid.revision}, + #{grid.createdBy}, + NOW(), + #{grid.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_group_grid_daily + WHERE + date_id = #{dateId} + AND customer_id = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml new file mode 100644 index 0000000000..20262ed8d4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM fact_issue_agency_daily WHERE CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml new file mode 100644 index 0000000000..430abbd36c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM fact_issue_agency_monthly WHERE CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml new file mode 100644 index 0000000000..998f24e343 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM fact_issue_grid_daily WHERE CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml new file mode 100644 index 0000000000..cbcc5b4276 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + fact_issue_grid_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml new file mode 100644 index 0000000000..b99b5e409b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml @@ -0,0 +1,33 @@ + + + + + + + DELETE FROM fact_tag_used_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..05d22a1a38 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + DELETE FROM fact_tag_used_agency_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..ccd42622a4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml @@ -0,0 +1,9 @@ + + + + + + + DELETE FROM fact_tag_used_agency_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml new file mode 100644 index 0000000000..b3851f7b5a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml @@ -0,0 +1,9 @@ + + + + + + + DELETE FROM fact_tag_used_agency_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml new file mode 100644 index 0000000000..8e8fb7e9b3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml @@ -0,0 +1,34 @@ + + + + + + + DELETE FROM fact_tag_used_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml new file mode 100644 index 0000000000..af8efb5266 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + DELETE FROM fact_tag_used_department_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml new file mode 100644 index 0000000000..fab6a6b6f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml @@ -0,0 +1,10 @@ + + + + + + + + DELETE FROM fact_tag_used_department_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml new file mode 100644 index 0000000000..e17b6fdf3d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml @@ -0,0 +1,9 @@ + + + + + + + DELETE FROM fact_tag_used_department_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml new file mode 100644 index 0000000000..1970dc22a7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml @@ -0,0 +1,30 @@ + + + + + + DELETE FROM fact_tag_used_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml new file mode 100644 index 0000000000..67974a20e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml @@ -0,0 +1,56 @@ + + + + + + + + + + DELETE FROM fact_tag_used_grid_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml new file mode 100644 index 0000000000..dc35b17d52 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml @@ -0,0 +1,11 @@ + + + + + + + DELETE FROM fact_tag_used_grid_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml new file mode 100644 index 0000000000..e2501f4f3d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml @@ -0,0 +1,10 @@ + + + + + + DELETE FROM fact_tag_used_grid_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml new file mode 100644 index 0000000000..f8c7a55728 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml @@ -0,0 +1,33 @@ + + + + + + + DELETE FROM fact_tag_viewed_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..85e33ec0ac --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml @@ -0,0 +1,54 @@ + + + + + + + DELETE FROM fact_tag_viewed_agency_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..83c09a954d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml @@ -0,0 +1,10 @@ + + + + + + DELETE FROM fact_tag_viewed_agency_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml new file mode 100644 index 0000000000..25b2d6a11c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml @@ -0,0 +1,11 @@ + + + + + + + DELETE FROM fact_tag_viewed_agency_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml new file mode 100644 index 0000000000..3fa886f434 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml @@ -0,0 +1,32 @@ + + + + + + + + DELETE FROM fact_tag_viewed_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml new file mode 100644 index 0000000000..8bde85f5a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml @@ -0,0 +1,53 @@ + + + + + + + DELETE FROM fact_tag_viewed_grid_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml new file mode 100644 index 0000000000..8d2908737e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml @@ -0,0 +1,9 @@ + + + + + + + DELETE FROM fact_tag_viewed_grid_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml new file mode 100644 index 0000000000..30276d91ac --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml @@ -0,0 +1,9 @@ + + + + + + + DELETE FROM fact_tag_viewed_grid_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/LastExecRecordDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/LastExecRecordDao.xml new file mode 100755 index 0000000000..2ae86b2d8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/LastExecRecordDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + UPDATE last_exec_record SET EXEC_TIME = #{date} WHERE SUBJECT = #{subject} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml new file mode 100644 index 0000000000..796804c0c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml @@ -0,0 +1,84 @@ + + + + + + + INSERT INTO fact_topic_issue_agency_daily + ( + ID, + + PID, + + AGENCY_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.pid}, + + #{item.agencyId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml new file mode 100644 index 0000000000..1d85661ddd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml @@ -0,0 +1,78 @@ + + + + + + + INSERT INTO fact_topic_issue_agency_monthly + ( + ID, + + PID, + + AGENCY_ID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.pid}, + + #{item.agencyId}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml new file mode 100644 index 0000000000..d509a646bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml @@ -0,0 +1,87 @@ + + + + + + + INSERT INTO fact_topic_issue_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml new file mode 100644 index 0000000000..e9232f4a24 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml @@ -0,0 +1,77 @@ + + + + + + + INSERT INTO fact_topic_issue_grid_monthly + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml new file mode 100644 index 0000000000..f8f4a16a84 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml @@ -0,0 +1,95 @@ + + + + + + + INSERT INTO fact_topic_status_agency_daily + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCREMENT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml new file mode 100644 index 0000000000..721ba53791 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml @@ -0,0 +1,86 @@ + + + + + + + INSERT INTO fact_topic_status_agency_monthly + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncr}, + + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml new file mode 100644 index 0000000000..b60c3bffaf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_status_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCREMENT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml new file mode 100644 index 0000000000..d12e0d8c11 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_total_agency_daily + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_TOTAL, + + TOPIC_INCR, + + HIDDEN_TOTAL_COUNT, + + ISSUE_TOTAL_COUNT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicTotal}, + + #{item.topicIncr}, + + #{item.hiddenTotalCount}, + + #{item.issueTotalCount}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_total_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml new file mode 100644 index 0000000000..537a46cebb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_total_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_TOTAL, + + TOPIC_INCR, + + HIDDEN_TOTAL_COUNT, + + ISSUE_TOTAL_COUNT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicTotal}, + + #{item.topicIncr}, + + #{item.hiddenTotalCount}, + + #{item.issueTotalCount}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_total_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml new file mode 100644 index 0000000000..b41b6f89dd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml @@ -0,0 +1,106 @@ + + + + + + + INSERT INTO fact_participation_user_agency_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml new file mode 100644 index 0000000000..7215527ed6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml @@ -0,0 +1,105 @@ + + + + + + + INSERT INTO fact_participation_user_agency_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml new file mode 100644 index 0000000000..575cea1844 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -0,0 +1,111 @@ + + + + + + + INSERT INTO fact_participation_user_grid_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + DATE_ID, + + WEEK_ID, + + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml new file mode 100644 index 0000000000..cfe17cd854 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml @@ -0,0 +1,109 @@ + + + + + + + INSERT INTO fact_participation_user_grid_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml new file mode 100644 index 0000000000..185a97da77 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml @@ -0,0 +1,106 @@ + + + + + + + INSERT INTO fact_reg_user_agency_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml new file mode 100644 index 0000000000..aa8548ff1c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml @@ -0,0 +1,105 @@ + + + + + + + INSERT INTO fact_reg_user_agency_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml new file mode 100644 index 0000000000..f8d85b7ab9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml @@ -0,0 +1,109 @@ + + + + + + + INSERT INTO fact_reg_user_grid_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml new file mode 100644 index 0000000000..f5f66265fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -0,0 +1,110 @@ + + + + + + + INSERT INTO fact_reg_user_grid_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 0000000000..819674dbbf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml new file mode 100644 index 0000000000..1b6f925c97 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml new file mode 100644 index 0000000000..0ecf25fb1b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleOperateRecordDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleOperateRecordDao.xml new file mode 100644 index 0000000000..3f2966b179 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleOperateRecordDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml new file mode 100644 index 0000000000..154d617001 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml new file mode 100644 index 0000000000..a6a733f6ac --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml new file mode 100644 index 0000000000..c5019d41f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/TestTx.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/TestTx.java new file mode 100644 index 0000000000..df60de5072 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/TestTx.java @@ -0,0 +1,23 @@ +package com.epmet.stats.test; + +import com.epmet.DataStatsApplication; +import com.epmet.service.StatsDemoService; +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; + +@RunWith(value = SpringRunner.class) +@SpringBootTest(classes = {DataStatsApplication.class}) +public class TestTx { + + @Autowired + private StatsDemoService statsDemoService; + + @Test + public void testTx() { + statsDemoService.testTx(); + } + +} diff --git a/epmet-module/data-statistical/pom.xml b/epmet-module/data-statistical/pom.xml new file mode 100644 index 0000000000..7bcd9e9fa6 --- /dev/null +++ b/epmet-module/data-statistical/pom.xml @@ -0,0 +1,20 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + data-statistical + pom + + data-statistical-client + data-statistical-server + + + + \ No newline at end of file diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml index 652cbd6dbb..9024c1891f 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml @@ -184,6 +184,8 @@ false + + false @@ -211,6 +213,8 @@ false + + true diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml index 1a8c58dbdf..d0f69c2502 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml @@ -30,6 +30,16 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + cloud: nacos: discovery: diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java new file mode 100644 index 0000000000..be5117fbf1 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -0,0 +1,31 @@ +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.EpmetCommonServiceOpenFeignClientFallback; +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 10:28 + */ +@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) +public interface EpmetCommonServiceOpenFeignClient { + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @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-common-service/common-service-server/deploy/docker-compose-test.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml index d9fd979690..9051b2a482 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/common-service-server:0.3.3 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/common-service-server:0.3.4 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index bc29c873e9..14a786091e 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -114,6 +114,8 @@ false + + false @@ -144,6 +146,8 @@ false + + true diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index 15b337db7c..146d5758dd 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -30,6 +30,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -104,3 +113,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file 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-job/epmet-job-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml index 6fa78a1a12..e20714082d 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-job-server: container_name: epmet-job-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:0.3.7 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:0.3.11 ports: - "8084:8084" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml index d1d0332917..69e741e250 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-job-server: container_name: epmet-job-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-job-server:0.3.6 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-job-server:0.3.7 ports: - "8084:8084" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index e3a8a161c1..6301d4acec 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.7 + 0.3.11 com.epmet epmet-job @@ -28,6 +28,11 @@ epmet-commons-mybatis 2.0.0 + + com.epmet + data-statistical-client + 2.0.0 + org.springframework.boot spring-boot-starter-web @@ -123,6 +128,8 @@ false + + false @@ -153,6 +160,8 @@ false + + true diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimInitService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimInitService.java new file mode 100644 index 0000000000..6d3f493620 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimInitService.java @@ -0,0 +1,9 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +public interface DimInitService { + + Result initAllDims(); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsGroupService.java new file mode 100644 index 0000000000..db3ed102d1 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -0,0 +1,32 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:12 + */ +public interface StatsGroupService { + + /** + * @Description 统计 “网格小组”, dim:【网格-日】 + * @param + * @author zxc + */ + Result groupGridDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-日】 + * @param + * @author zxc + */ + Result groupAgencyDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-月】 + * @param + * @author zxc + */ + Result groupAgencyMonthly(); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java new file mode 100644 index 0000000000..23590743e6 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:38 + */ +public interface StatsIssueService { + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/23 14:39 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + Result agencyGridIssueStats(); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java new file mode 100644 index 0000000000..473f8c798b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -0,0 +1,23 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Description 数据统计-项目-机关、网格日月统计任务接口 + * @Author sun + */ +public interface StatsProjectService { + + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + Result agencyProjectStats(); + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + Result gridProjectStats(); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPublicityTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPublicityTaskService.java new file mode 100644 index 0000000000..cdc8a32f46 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPublicityTaskService.java @@ -0,0 +1,72 @@ +package com.epmet.service; + + +import com.epmet.commons.tools.utils.Result; + +/** + * desc: 数据-宣传能力-数据统计 + * + * @return: + * @date: 2020/6/22 10:24 + * @author: jianjun liu + */ +public interface StatsPublicityTaskService { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result articleSummaryDailyStatsjob(); + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagUsedDailyStatsjob(); + + /** + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagUsedMonthlyStatsjob(); + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagUsedQuarterlyStatsjob(); + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagViewedDailyStatsjob(); + + /** + * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagViewedMonthlyStatsjob(); + + /** + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagViewedQuarterlyStatsjob(); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimInitServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimInitServiceImpl.java new file mode 100644 index 0000000000..38bdc54135 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimInitServiceImpl.java @@ -0,0 +1,19 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.DimInitService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class DimInitServiceImpl implements DimInitService { + + @Autowired + private DataStatisticalOpenFeignClient statsFeignClient; + + @Override + public Result initAllDims() { + return statsFeignClient.initAllDims(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java new file mode 100644 index 0000000000..4aec7898dd --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -0,0 +1,33 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsGroupService; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:13 + */ +@Service +public class StatsGroupServiceImpl implements StatsGroupService { + + @Autowired + private DataStatisticalOpenFeignClient statsPublicityFeignClient; + + @Override + public Result groupGridDaily() { + return statsPublicityFeignClient.groupGridDaily(); + } + + @Override + public Result groupAgencyDaily() { + return statsPublicityFeignClient.groupAgencyDaily(); + } + + @Override + public Result groupAgencyMonthly() { + return statsPublicityFeignClient.groupAgencyMonthly(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java new file mode 100644 index 0000000000..a6415241cf --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -0,0 +1,23 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:40 + */ +@Service +public class StatsIssueServiceImpl implements StatsIssueService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public Result agencyGridIssueStats() { + return dataStatisticalOpenFeignClient.agencyGridIssueStats(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java new file mode 100644 index 0000000000..0fb06aa23c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -0,0 +1,36 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Description 数据统计-项目-机关、网格日月统计任务接口 + * @Author sun + */ +@Service +public class StatsProjectServiceImpl implements StatsProjectService { + + @Autowired + private DataStatisticalOpenFeignClient statsPublicityFeignClient; + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @Override + public Result agencyProjectStats() { + return statsPublicityFeignClient.agencyProjectStats(); + } + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @Override + public Result gridProjectStats() { + return statsPublicityFeignClient.gridProjectStats(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java new file mode 100644 index 0000000000..40368b169b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java @@ -0,0 +1,94 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * desc:数据统计 任务服务类 + */ +@Service +public class StatsPublicityTaskServiceImpl implements StatsPublicityTaskService { + @Autowired + private DataStatisticalOpenFeignClient dataStatsOpenFeignClient; + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result articleSummaryDailyStatsjob() { + return dataStatsOpenFeignClient.articleSummaryDailyStatsjob(); + } + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedDailyStatsjob() { + return dataStatsOpenFeignClient.tagUsedDailyStatsjob(); + } + + /** + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedMonthlyStatsjob() { + return dataStatsOpenFeignClient.tagUsedMonthlyStatsjob(); + } + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedQuarterlyStatsjob() { + return dataStatsOpenFeignClient.tagUsedQuarterlyStatsjob(); + } + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedDailyStatsjob() { + return dataStatsOpenFeignClient.tagViewedDailyStatsjob(); + } + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedMonthlyStatsjob() { + return dataStatsOpenFeignClient.tagViewedMonthlyStatsjob(); + } + + /** + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedQuarterlyStatsjob() { + return dataStatsOpenFeignClient.tagViewedQuarterlyStatsjob(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimInitTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimInitTask.java new file mode 100644 index 0000000000..1fa78dd52c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimInitTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.DimInitService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:36 + */ +@Slf4j +@Component("dimInitTask") +public class DimInitTask implements ITask { + + @Autowired + private DimInitService dimInitService; + + @Override + public void run(String params) { + log.debug("DimInitTask定时任务正在执行,参数为:{}", params); + Result result = dimInitService.initAllDims(); + if (result.success()){ + log.debug("DimInitTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("DimInitTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityArticleSummaryDailyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityArticleSummaryDailyStatsTask.java new file mode 100644 index 0000000000..658850ba45 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityArticleSummaryDailyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:文章总数 日统计定时任务 + */ +@Component("publicityArticleSummaryDailyStatsTask") +public class PublicityArticleSummaryDailyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityArticleSummaryDailyStatsTask定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.articleSummaryDailyStatsjob(); + if (result.success()) { + logger.debug("publicityArticleSummaryDailyStatsTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityArticleSummaryDailyStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java new file mode 100644 index 0000000000..ef5b147ac8 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被使用次数 日统计定时任务 + */ +@Component("publicityTagUsedDailyStatsTask") +public class PublicityTagUsedDailyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagUsedDailyStatsjob定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagUsedDailyStatsjob(); + if (result.success()) { + logger.debug("publicityTagUsedDailyStatsjob定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagUsedDailyStatsjob定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java new file mode 100644 index 0000000000..c0a7862b90 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被使用次数 【月、季、年】统计定时任务 + */ +@Component("publicityTagUsedMonthlyStatsTask") +public class PublicityTagUsedMonthlyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagUsedMonthlyStatsjob(); + if (result.success()) { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedQuarterlyAndYearlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedQuarterlyAndYearlyStatsTask.java new file mode 100644 index 0000000000..a9a816139c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedQuarterlyAndYearlyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被使用次数 【月、季、年】统计定时任务 + */ +@Component("publicityTagUsedQuarterlyAndYearlyStatsTask") +public class PublicityTagUsedQuarterlyAndYearlyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagUsedQuarterlyStatsjob(); + if (result.success()) { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedDailyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedDailyStatsTask.java new file mode 100644 index 0000000000..5484440742 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedDailyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被阅读次数 【日】统计定时任务 + */ +@Component("publicityTagViewedDailyStatsTask") +public class PublicityTagViewedDailyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagViewedDailyStatsTask定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagViewedDailyStatsjob(); + if (result.success()) { + logger.debug("publicityTagViewedDailyStatsTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagViewedDailyStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedMonthlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedMonthlyStatsTask.java new file mode 100644 index 0000000000..d68677fde3 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedMonthlyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被阅读次数 【月、季、年】统计定时任务 + */ +@Component("publicityTagViewedMonthlyStatsTask") +public class PublicityTagViewedMonthlyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagViewedMonthlyStatsjob(); + if (result.success()) { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java new file mode 100644 index 0000000000..cb03b1a6aa --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被阅读次数 【月、季、年】统计定时任务 + */ +@Component("publicityTagViewedQuarterlyAndYearlyhlyStatsTask") +public class PublicityTagViewedQuarterlyAndYearlyhlyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagUsedQuarterlyStatsjob(); + if (result.success()) { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java new file mode 100644 index 0000000000..695b4aae18 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java @@ -0,0 +1,34 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsGroupService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【机关-日】 + */ +@Component("statsGroupAgencyDailyTask") +public class StatsGroupAgencyDailyTask implements ITask { + + @Autowired + private StatsGroupService statsGroupService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + logger.debug("StatsGroupAgencyDailyTask定时任务正在执行,参数为:{}", params); + Result result = statsGroupService.groupAgencyDaily(); + if (result.success()){ + logger.debug("StatsGroupAgencyDailyTask定时任务正在执行定时任务执行成功"); + }else { + logger.debug("StatsGroupAgencyDailyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java new file mode 100644 index 0000000000..bcd59c4047 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java @@ -0,0 +1,34 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsGroupService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【机关-日】 + */ +@Component("statsGroupAgencyMonthlyTask") +public class StatsGroupAgencyMonthlyTask implements ITask { + + @Autowired + private StatsGroupService statsGroupService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + logger.debug("StatsGroupAgencyMonthlyTask定时任务正在执行,参数为:{}", params); + Result result = statsGroupService.groupAgencyMonthly(); + if (result.success()){ + logger.debug("StatsGroupAgencyMonthlyTask定时任务正在执行定时任务执行成功"); + }else { + logger.debug("StatsGroupAgencyMonthlyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java new file mode 100644 index 0000000000..780ba44f18 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java @@ -0,0 +1,35 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsGroupService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【网格-日】 + * + */ +@Component("statsGroupGridDailyTask") +public class StatsGroupGridDailyTask implements ITask { + + @Autowired + private StatsGroupService statsGroupService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + logger.debug("StatsGroupGridDailyTask定时任务正在执行,参数为:{}", params); + Result result = statsGroupService.groupGridDaily(); + if (result.success()){ + logger.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行成功"); + }else { + logger.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java new file mode 100644 index 0000000000..20448d11d2 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.logging.Log; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:36 + */ +@Slf4j +@Component("statsIssueTask") +public class StatsIssueTask implements ITask { + @Autowired + private StatsIssueService statsIssueService; + + @Override + public void run(String params) { + log.debug("StatsGroupGridDailyTask定时任务正在执行,参数为:{}", params); + Result result = statsIssueService.agencyGridIssueStats(); + if (result.success()){ + log.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java new file mode 100644 index 0000000000..fcb09dae46 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description 数据统计-项目-机关日月统计任务 + * @Author sun + */ +@Component("statsProjectAgencyTask") +public class StatsProjectAgencyTask implements ITask { + + @Autowired + private StatsProjectService statsProjectService; + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + log.debug("StatsProjectAgencyTask定时任务正在执行,参数为:{}", params); + Result result = statsProjectService.agencyProjectStats(); + if (result.success()){ + log.debug("StatsProjectAgencyTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsProjectAgencyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java new file mode 100644 index 0000000000..293aa82380 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java @@ -0,0 +1,35 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【网格-日】 + * + */ +@Component("statsProjectGridTask") +public class StatsProjectGridTask implements ITask { + + @Autowired + private StatsProjectService statsProjectService; + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + log.debug("StatsProjectGridTask定时任务正在执行,参数为:{}", params); + Result result = statsProjectService.gridProjectStats(); + if (result.success()){ + log.debug("StatsProjectGridTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsProjectGridTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index 2be4349624..e7ace5304a 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -30,6 +30,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-job/epmet-job-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java new file mode 100644 index 0000000000..3bfac0e8f7 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java @@ -0,0 +1,30 @@ +package com.epmet.constant; + +/** + * 短信模板编码常亮 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/23 21:30 + */ +public interface SmsTemplateConstant { + + /** + * 登录确认验证码 + */ + String LGOIN_CONFIRM="SMS_150731396"; + + /** + * 用户注册验证码 + */ + String USER_REGISTER="SMS_150731394"; + + /** + * 信息变更验证码 + */ + String CHANGE_INFO="SMS_150731392"; + + /** + * 修改密码验证码 + */ + String CHANGE_PASSWORD = "SMS_150731393"; +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/SysSmsDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/SysSmsDTO.java index 91eff10e8b..d698373e9f 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/SysSmsDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/SysSmsDTO.java @@ -54,5 +54,8 @@ public class SysSmsDTO implements Serializable { @ApiModelProperty(value = "参数列表") private String params; - + /** + * 短信模板编码 来源于SmsTemplateConstant + */ + private String aliyunTemplateCode; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendVerificationCodeFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendVerificationCodeFormDTO.java new file mode 100644 index 0000000000..97aaa8549b --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendVerificationCodeFormDTO.java @@ -0,0 +1,36 @@ +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 yinzuomei@elink-cn.com + * @date 2020/6/23 20:58 + */ +@Data +public class SendVerificationCodeFormDTO implements Serializable { + private static final long serialVersionUID = 8894395590639206399L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String mobile; + + /** + * 场景: + */ + @NotBlank(message = "短信模板编码不能为空", groups = {AddUserInternalGroup.class}) + private String aliyunTemplateCode; +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendVerificationCodeResultDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendVerificationCodeResultDTO.java new file mode 100644 index 0000000000..2442da7cb1 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendVerificationCodeResultDTO.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/23 21:37 + */ +@Data +public class SendVerificationCodeResultDTO implements Serializable { + /** + * 短信验证码 + */ + private String code; +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java new file mode 100644 index 0000000000..76ac6ca878 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -0,0 +1,69 @@ +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.SendVerificationCodeFormDTO; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; +import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +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:47 + */ +@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) +public interface EpmetMessageOpenFeignClient { + /** + * 发送短信 + * @return + */ + @PostMapping(value = "message/sms/send") + Result send(@RequestBody SysSmsDTO smsDTO); + + /** + * 发送短信验证码 + * @return + */ + @GetMapping(value = "message/sms/captcha/{mobile}") + Result sendSmsCaptcha(@PathVariable("mobile") String mobile); + + /** + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 插入未读消息 + * @Date 2020/4/7 15:36 + **/ + @PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveUserMessage(@RequestBody UserMessageFormDTO formDto); + + /** + * @param + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 发送短信验证码(区分场景) + * @Date 2020/6/23 20:56 + **/ + @PostMapping(value = "message/sms/sendVerificationCode", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result sendVerificationCode(@RequestBody SendVerificationCodeFormDTO formDTO); + + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 热心居民申请给网格长们发送消息 + **/ + @PostMapping(value = "message/usermessage/saveusermessagelist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveUserMessageList(List msgList); +} 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/MessageFeignClient.java deleted file mode 100644 index 355bdf2a34..0000000000 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/MessageFeignClient.java +++ /dev/null @@ -1,41 +0,0 @@ -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; -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 { - - /** - * 发送短信 - * @return - */ - @PostMapping(value = "message/sms/send") - Result send(@RequestBody SysSmsDTO smsDTO); - - /** - * 发送短信验证码 - * @return - */ - @GetMapping(value = "message/sms/captcha/{mobile}") - Result sendSmsCaptcha(@PathVariable("mobile") String mobile); - - /** - * @param formDto - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 插入未读消息 - * @Date 2020/4/7 15:36 - **/ - @PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result saveUserMessage(UserMessageFormDTO formDto); -} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java new file mode 100644 index 0000000000..3cc5a5c5eb --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java @@ -0,0 +1,48 @@ +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.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:48 + */ +@Component +public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeignClient { + + @Override + public Result send(SysSmsDTO smsDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "send", smsDTO); + } + + @Override + public Result sendSmsCaptcha(String mobile) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSmsCaptcha", mobile); + } + + @Override + public Result saveUserMessage(UserMessageFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto); + } + + @Override + public Result sendVerificationCode(SendVerificationCodeFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendVerificationCode", formDTO); + } + + @Override + public Result saveUserMessageList(List msgList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessageList", msgList); + } +} 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/MessageFeignClientFallback.java deleted file mode 100644 index cf105730e2..0000000000 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java +++ /dev/null @@ -1,33 +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.SysSmsDTO; -import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.feign.MessageFeignClient; -import org.springframework.stereotype.Component; - -/** - * 消息服务降级 - */ -@Component -public class MessageFeignClientFallback implements MessageFeignClient { - - - @Override - public Result send(SysSmsDTO smsDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "send", smsDTO); - } - - @Override - public Result sendSmsCaptcha(String mobile) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSmsCaptcha", mobile); - } - - @Override - public Result saveUserMessage(UserMessageFormDTO formDto) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto); - } - -} diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml index 0d5fb9ee44..c5e1c7579d 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-message-server:0.3.11 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-message-server:0.3.22 ports: - "8085:8085" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml index d4df5edbb2..104ba801e6 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-message-server:0.3.10 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-message-server:0.3.19 ports: - "8085:8085" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 090faba77d..cf6938d147 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.11 + 0.3.22 com.epmet epmet-message @@ -90,6 +90,12 @@ feign-httpclient 10.3.0 + + + org.flywaydb + flyway-core + + @@ -144,6 +150,8 @@ false + + false @@ -174,6 +182,8 @@ false + + true diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java index 008429520d..0a0f534a0a 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java @@ -9,7 +9,6 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -17,6 +16,8 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AliyunGroup; import com.epmet.commons.tools.validator.group.QcloudGroup; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.enums.PlatformEnum; import com.epmet.remote.ParamsRemoteService; import com.epmet.service.SysSmsService; @@ -31,7 +32,6 @@ import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import java.util.Arrays; -import java.util.HashMap; import java.util.Map; /** @@ -76,7 +76,6 @@ public class SmsController { @PostMapping("saveConfig") @ApiOperation("保存配置短信") -// @LogOperation("保存配置短信") public Result saveConfig(@RequestBody SmsConfig config){ //校验类型 ValidatorUtils.validateEntity(config); @@ -96,19 +95,17 @@ public class SmsController { @PostMapping("send") @ApiOperation("发送短信") -// @LogOperation("发送短信") @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机好号", paramType = "query", required = true, dataType="String"), @ApiImplicitParam(name = "params", value = "参数", paramType = "query", required = true, dataType="String") }) public Result send(@RequestBody SysSmsDTO sysSmsDTO){ - sysSmsService.send(sysSmsDTO.getMobile(), sysSmsDTO.getParams()); + sysSmsService.send(sysSmsDTO); return new Result(); } @DeleteMapping @ApiOperation("删除") -// @LogOperation("删除") public Result delete(@RequestBody Long[] ids){ sysSmsService.deleteBatchIds(Arrays.asList(ids)); @@ -121,7 +118,6 @@ public class SmsController { */ @GetMapping("captcha/{mobile}") @ApiOperation("发送短信验证码") - //@LogOperation("发送短信验证码") @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", paramType = "query", required = true, dataType="String") }) @@ -129,4 +125,18 @@ public class SmsController { Result result = sysSmsService.sendSmsCaptcha(mobile); return result; } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 发送短信验证码(区分场景) + * @Date 2020/6/23 21:05 + **/ + @PostMapping("sendVerificationCode") + public Result sendVerificationCode(@RequestBody SendVerificationCodeFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,SendVerificationCodeFormDTO.AddUserShowGroup.class,SendVerificationCodeFormDTO.AddUserInternalGroup.class); + SendVerificationCodeResultDTO resultDTO=sysSmsService.sendVerificationCode(formDTO); + return new Result().ok(resultDTO); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java index 79c7cddd1c..1e67125423 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java @@ -12,6 +12,8 @@ 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.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.entity.SysSmsEntity; import java.util.LinkedHashMap; @@ -28,10 +30,9 @@ public interface SysSmsService extends BaseService { /** * 发送短信 - * @param mobile 手机号 - * @param params 短信参数 + * @param sysSmsDTO :mobile 手机号 params短信参数 aliyunTemplateCode:短信模板 */ - void send(String mobile, String params); + void send(SysSmsDTO sysSmsDTO); /** * 保存短信发送记录 @@ -48,5 +49,14 @@ public interface SysSmsService extends BaseService { * @return */ Result sendSmsCaptcha(String mobile); + + /** + * @return java.util.HashMap + * @param formDTO + * @author yinzuomei + * @description 发送短信验证码(区分场景) + * @Date 2020/6/23 21:07 + **/ + SendVerificationCodeResultDTO sendVerificationCode(SendVerificationCodeFormDTO 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..2f8600641e 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 @@ -20,9 +20,11 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.SysSmsDao; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; 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 +36,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 +46,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) { @@ -65,10 +69,10 @@ public class SysSmsServiceImpl extends BaseServiceImpl } @Override - public void send(String mobile, String params) { + public void send(SysSmsDTO sysSmsDTO) { LinkedHashMap map; try { - map = JSON.parseObject(params, LinkedHashMap.class); + map = JSON.parseObject(sysSmsDTO.getParams(), LinkedHashMap.class); }catch (Exception e){ throw new RenException(ErrorCode.JSON_FORMAT_ERROR); } @@ -78,9 +82,12 @@ public class SysSmsServiceImpl extends BaseServiceImpl if(service == null){ throw new RenException(ModuleErrorCode.SMS_CONFIG); } - //发送短信 - service.sendSms(mobile, map); + if(StringUtils.isNotBlank(sysSmsDTO.getAliyunTemplateCode())){ + service.sendSmsByAliyunTemplateCode(sysSmsDTO.getMobile(), map,sysSmsDTO.getAliyunTemplateCode()); + }else{ + service.sendSms(sysSmsDTO.getMobile(), map); + } } @Override @@ -125,7 +132,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); @@ -139,4 +146,34 @@ public class SysSmsServiceImpl extends BaseServiceImpl } return new Result().error(EpmetErrorCode.MESSAGE_SMS_SEND_ERROR.getCode()); } + + @Override + public SendVerificationCodeResultDTO sendVerificationCode(SendVerificationCodeFormDTO formDTO) { + SendVerificationCodeResultDTO data = new SendVerificationCodeResultDTO(); + Integer code = (int) ((Math.random() * 9 + 1) * 100000); + String codeStr = String.valueOf(code); + HashMap map = new HashMap<>(); + map.put("code", codeStr); + + try { + String paramJson = new ObjectMapper().writeValueAsString(map); + + SysSmsDTO sysSmsDTO = new SysSmsDTO(); + sysSmsDTO.setMobile(formDTO.getMobile()); + sysSmsDTO.setParams(paramJson); + sysSmsDTO.setAliyunTemplateCode(formDTO.getAliyunTemplateCode()); + Result result = epmetMessageOpenFeignClient.send(sysSmsDTO); + if (result != null && result.success()) { + data.setCode(codeStr); + } else { + logger.error(String.format("短信验证码发送失败,手机号:%s。code:%d,msg:%s", formDTO.getMobile(), result.getCode(), result.getMsg())); + throw new RenException(EpmetErrorCode.MESSAGE_SMS_SEND_ERROR.getCode()); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(String.format("短信验证码发送失败,手机号:%s。errorMessage:%s", formDTO.getMobile(), e.getMessage())); + throw new RenException(EpmetErrorCode.MESSAGE_SMS_SEND_ERROR.getCode()); + } + return data; + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AbstractSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AbstractSmsService.java index a29130457b..e1a07530fb 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AbstractSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AbstractSmsService.java @@ -37,4 +37,17 @@ public abstract class AbstractSmsService { * @param template 短信模板 */ public abstract void sendSms(String mobile, LinkedHashMap params, String signName, String template); + + /** + * @return void + * @param mobile 手机号 + * @param params 参数 + * @param aliyunTemplateCode 短息模板编码 + * @author yinzuomei + * @description + * @Date 2020/6/23 21:27 + **/ + public abstract void sendSmsByAliyunTemplateCode(String mobile, + LinkedHashMap params, + String aliyunTemplateCode); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AliyunSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AliyunSmsService.java index 7c97eb11ad..9ec5c16cd5 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AliyunSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AliyunSmsService.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.enums.PlatformEnum; import com.epmet.exception.ModuleErrorCode; import com.epmet.service.SysSmsService; +import org.apache.commons.lang3.StringUtils; import java.util.LinkedHashMap; @@ -108,4 +109,13 @@ public class AliyunSmsService extends AbstractSmsService { throw new RenException(ModuleErrorCode.SEND_SMS_ERROR, response.getMessage()); } } + + @Override + public void sendSmsByAliyunTemplateCode(String mobile, LinkedHashMap params,String aliyunTemplateCode) { + if(StringUtils.isNotBlank(aliyunTemplateCode)){ + this.sendSms(mobile, params, config.getAliyunSignName(), aliyunTemplateCode); + return; + } + this.sendSms(mobile, params, config.getAliyunSignName(), config.getAliyunTemplateCode()); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/QcloudSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/QcloudSmsService.java index 7c16e641dd..a3e33d6557 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/QcloudSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/QcloudSmsService.java @@ -17,6 +17,7 @@ import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.enums.PlatformEnum; import com.epmet.exception.ModuleErrorCode; import com.epmet.service.SysSmsService; +import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -67,4 +68,13 @@ public class QcloudSmsService extends AbstractSmsService { throw new RenException(ModuleErrorCode.SEND_SMS_ERROR, result.errMsg); } } + + @Override + public void sendSmsByAliyunTemplateCode(String mobile, LinkedHashMap params,String aliyunTemplateCode) { + if(StringUtils.isNotBlank(aliyunTemplateCode)){ + this.sendSms(mobile, params, config.getAliyunSignName(), aliyunTemplateCode); + return; + } + this.sendSms(mobile, params, config.getAliyunSignName(), config.getAliyunTemplateCode()); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml index f44a4099e0..0f7b365814 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml @@ -53,6 +53,16 @@ spring: # - data-id: common.yaml # group: ${spring.cloud.nacos.config.group} # refresh: true + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + management: endpoints: web: @@ -104,3 +114,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.1__DDL.sql b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.1__DDL.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.1__DDL.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml index 00b4f88d91..874b7de0d0 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-dev.yml @@ -3,7 +3,7 @@ services: epmet-oss-server: container_name: epmet-oss-server-dev # image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/epmet-oss-server:0.3.2 - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-oss-server:0.3.13 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-oss-server:0.3.21 ports: - "8083:8083" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml index 4d80088a97..9e206b3053 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml @@ -3,7 +3,7 @@ services: epmet-oss-server: container_name: epmet-oss-server-test # image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-test/epmet-oss-server:0.3.2 - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-oss-server:0.3.12 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-oss-server:0.3.21 ports: - "8083:8083" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index c8699e1f6b..0131376b35 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.13 + 0.3.21 com.epmet epmet-oss @@ -146,6 +146,8 @@ false + + false @@ -176,6 +178,8 @@ false + + true 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..4367e4e62e 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 @@ -29,6 +29,7 @@ import com.epmet.utils.ModuleConstant; import com.google.gson.Gson; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FilenameUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; @@ -37,7 +38,6 @@ import org.springframework.web.multipart.MultipartFile; import springfox.documentation.annotations.ApiIgnore; import java.util.Arrays; -import java.util.Date; import java.util.Map; /** @@ -48,6 +48,7 @@ import java.util.Map; @RestController @RequestMapping("file") @Api(tags="文件上传") +@Slf4j public class OssController { @Autowired private OssService ossService; @@ -186,4 +187,26 @@ 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()) && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType()) + && !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) ) { + log.error("uploadArticleImg file type:{} is not support 2 upload",file.getContentType() == null? null: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/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java index 7d8c2f3393..efa289bd61 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -21,4 +21,9 @@ public interface ModuleConstant extends Constant { * 云存储配置KEY */ String CLOUD_STORAGE_CONFIG_KEY = "CLOUD_STORAGE_CONFIG_KEY"; + + /** + * jpg文件类型 + */ + String FILE_CONTENT_TYPE_JPG = "image/jpg"; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index eb5ed56fda..390608e0f4 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -35,6 +35,15 @@ spring: max-file-size: 1024MB max-request-size: 1024MB enabled: true + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -115,3 +124,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigOpeDefaultScopesFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigOpeDefaultScopesFormDTO.java new file mode 100644 index 0000000000..86dad3a7a3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigOpeDefaultScopesFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 权限配置-操作默认范围form dto + */ +@Data +public class AccessConfigOpeDefaultScopesFormDTO { + + public interface ListOpeDefaultScopesGroup {} + public interface SaveOpeDefaultScopesGroup {} + + @NotBlank(message = "角色Key不能为空", groups = { ListOpeDefaultScopesGroup.class, SaveOpeDefaultScopesGroup.class }) + private String roleKey; + + @NotBlank(message = "操作Key不能为空", groups = { ListOpeDefaultScopesGroup.class, SaveOpeDefaultScopesGroup.class }) + private String operationKey; + + private List scopeKeys; +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigRoleDefaultOpesFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigRoleDefaultOpesFormDTO.java new file mode 100644 index 0000000000..cb6f196403 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/AccessConfigRoleDefaultOpesFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +/** + * 角色默认操作权限列表from DTO + */ +@Data +public class AccessConfigRoleDefaultOpesFormDTO { + + @NotBlank(message = "角色Key不能为空") + private String roleKey; + + private List operationKeys; +} 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 4a63754bd7..4901eca2bb 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,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import java.util.Set; @Data public class GetSQLFilterFormDTO { @@ -21,8 +22,8 @@ public class GetSQLFilterFormDTO { private String tableAlias; - private String gridId; + private Set gridIds; - private String departmentId; + private Set departmentIds; } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ListOpePermsFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ListOpePermsFormDTO.java index af13b14a3c..a7b1b2a7df 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ListOpePermsFormDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ListOpePermsFormDTO.java @@ -11,4 +11,8 @@ public class ListOpePermsFormDTO { private String staffId; @NotBlank(message = "当前单位不能为空") private String currAgencyId; + + private String currGridId; + + private String currDeptId; } diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/AccessConfigOpeDefaultScopesResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/AccessConfigOpeDefaultScopesResultDTO.java new file mode 100644 index 0000000000..53023bd459 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/AccessConfigOpeDefaultScopesResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * 权限配置-操作的默认范围result dto + */ +@Data +public class AccessConfigOpeDefaultScopesResultDTO { + private String scopeKey; + private String scopeName; + private String scopeIndex; + private String operationKey; + private String roleKey; + private Boolean assigned; +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java new file mode 100644 index 0000000000..2a14ada3fd --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.security.dto.GovTokenDto; +import lombok.Data; + +import java.util.List; +import java.util.Set; + +@Data +public class LoginUserDetailsResultDTO { + + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; + + /** + * PC端:web、微信小程序:wxmp + */ + private String client; + + /** + * 用户ID + */ + private String userId; + + /** + * 角色列表 + */ + //private Set roleIdList; + private List roleList; + + /** + * 部门id列表 + */ + private Set deptIdList; + + /** + * 当前登录的组织id(顶级) + */ + private String agencyId; + + /** + * 组织ID + */ + private String orgIdPath; + + /** + * 网格ID列表 + */ + private Set gridIdList; + + /** + * 当前工作人员进入的客户id + */ + private String customerId; + + +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserInfoResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserInfoResultDTO.java deleted file mode 100644 index 440e5eb307..0000000000 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/LoginUserInfoResultDTO.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.util.Set; - -@Data -public class LoginUserInfoResultDTO { - - /** - * 用户ID - */ - private String userId; - - /** - * 权限列表 - */ - private Set permissions; - - /** - * 角色列表 - */ - private Set roleIdList; - - /** - * 部门id列表 - */ - private Set deptIdList; - - /** - * 组织ID - */ - private String orgIdPath; - - /** - * 网格ID - */ - private String gridId; - - /** - * 网格ID列表 - */ - private Set gridIdList; - -} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OperationScopeDefaultResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OperationScopeDefaultResultDTO.java new file mode 100644 index 0000000000..4c1f593712 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OperationScopeDefaultResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class OperationScopeDefaultResultDTO { + + private String roleKey; + + /** + * 操作key + */ + private String operationKey; + + /** + * 范围key + */ + private String scopeKey; + +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationDefaultResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationDefaultResultDTO.java index a757844fe3..6961dad6ca 100755 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationDefaultResultDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/RoleOperationDefaultResultDTO.java @@ -18,7 +18,6 @@ package com.epmet.dto.result; import java.io.Serializable; -import java.util.Date; import lombok.Data; @@ -48,4 +47,14 @@ public class RoleOperationDefaultResultDTO implements Serializable { */ private String operationKey; + /** + * 操作名称 + */ + private String operationName; + + /** + * 是否已经具有该操作权限 + */ + private Boolean assigned; + } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/feign/GovAccessFeignClient.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java similarity index 77% rename from epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/feign/GovAccessFeignClient.java rename to epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java index b30419dd56..b4ca57f24b 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -1,13 +1,14 @@ -package com.epmet.dto.feign; +package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.feign.fallback.GovAccessFeignClientFallBack; import com.epmet.dto.form.InitDefaultOperationsFormDTO; +import com.epmet.feign.fallback.GovAccessFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +//@FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallBack.class, url = "http://localhost:8099") @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallBack.class) public interface GovAccessFeignClient { diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/feign/fallback/GovAccessFeignClientFallBack.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java similarity index 87% rename from epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/feign/fallback/GovAccessFeignClientFallBack.java rename to epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java index d75b4c8946..ba938ec2a8 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/feign/fallback/GovAccessFeignClientFallBack.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallBack.java @@ -1,10 +1,10 @@ -package com.epmet.dto.feign.fallback; +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.feign.GovAccessFeignClient; import com.epmet.dto.form.InitDefaultOperationsFormDTO; +import com.epmet.feign.GovAccessFeignClient; import org.springframework.stereotype.Component; /** diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml index 98fcc5b789..e037bc1878 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.23 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.34 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml index 7c859753e6..fa2fe5a092 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-access-server:0.3.22 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-access-server:0.3.34 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index dc31ec04ae..a70f4f33f0 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.23 + 0.3.34 gov-access com.epmet diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java index 49374b9084..ec11eaa26f 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessConfigController.java @@ -2,12 +2,13 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.AccessConfigOpesFormDTO; -import com.epmet.dto.form.AccessConfigOptionsFormDTO; -import com.epmet.dto.form.AccessConfigSaveConfigDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AccessConfigOpeDefaultScopesResultDTO; import com.epmet.dto.result.AccessConfigOpesResultDTO; import com.epmet.dto.result.AccessConfigOptionsResultDTO; +import com.epmet.dto.result.RoleOperationDefaultResultDTO; import com.epmet.service.AccessConfigService; +import oracle.jdbc.proxy.annotation.Post; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -22,7 +23,18 @@ public class AccessConfigController { private AccessConfigService accessConfigService; /** - * 列出角色的操作列表(及该操作的scope范围) + * 根据roleKey查询角色默认操作列表(包括assigned字段,标识该角色是否已经具有该操作权限) + * @param roleKey + * @return + */ + @PostMapping("roledefaultops/{roleKey}") + public Result listRoleDefaultOps(@PathVariable("roleKey") String roleKey) { + List defaultOps = accessConfigService.listRoleDefaultOpsByRoleKey(roleKey); + return new Result().ok(defaultOps); + } + + /** + * 根据角色ID列出角色的操作列表(及该操作的scope范围) * @param roleId * @return */ @@ -68,4 +80,40 @@ public class AccessConfigController { return new Result(); } + /** + * 保存角色默认操作权限列表 + * @param form + * @return + */ + @PostMapping("roledefaultopes/save") + public Result saveRoleDefaultOperations(@RequestBody AccessConfigRoleDefaultOpesFormDTO form) { + ValidatorUtils.validateEntity(form); + accessConfigService.saveRoleDefaultOperations(form.getRoleKey(), form.getOperationKeys()); + return new Result(); + } + + /** + * 查询操作的默认范围列表 + * @param form + * @return + */ + @PostMapping("opedefaultscopes/list") + public Result listOpeDefaultScopes(@RequestBody AccessConfigOpeDefaultScopesFormDTO form) { + ValidatorUtils.validateEntity(form, AccessConfigOpeDefaultScopesFormDTO.ListOpeDefaultScopesGroup.class); + List scopes = accessConfigService.listOpeDefaultScopes4Role(form.getRoleKey(), form.getOperationKey()); + return new Result().ok(scopes); + } + + /** + * 保存操作的默认范围配置 + * @param form + * @return + */ + @PostMapping("opedefaultscopes/save") + public Result saveOpeDefaultScopes(@RequestBody AccessConfigOpeDefaultScopesFormDTO form) { + ValidatorUtils.validateEntity(form, AccessConfigOpeDefaultScopesFormDTO.SaveOpeDefaultScopesGroup.class); + accessConfigService.saveOpeDefaultScopes(form.getRoleKey(), form.getOperationKey(), form.getScopeKeys()); + return new Result(); + } + } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java index 8a68bec452..dad8f7e095 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/AccessController.java @@ -1,17 +1,12 @@ package com.epmet.controller; -import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; -import com.epmet.dto.result.LoginUserInfoResultDTO; -import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.service.AccessService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import javax.validation.constraints.NotBlank; -import java.util.List; import java.util.Set; /** @@ -27,67 +22,6 @@ public class AccessController { @Autowired private AccessService accessService; - /** - * 更新工作人员权限缓存(前端查询权限时候gov-mine会调用此处) - * @param staffPermCacheFormDTO - * @return - */ - @PostMapping("updatepermissioncache") - public Result updatePermissionCache(@RequestBody StaffPermCacheFormDTO staffPermCacheFormDTO) { - ValidatorUtils.validateEntity(staffPermCacheFormDTO, StaffPermCacheFormDTO.UpdatePermissionCache.class); - String staffId = staffPermCacheFormDTO.getStaffId(); - String app = staffPermCacheFormDTO.getApp(); - String client = staffPermCacheFormDTO.getClient(); - Set permissions = staffPermCacheFormDTO.getPermissions(); - Set roleIdList = staffPermCacheFormDTO.getRoleIdList(); - String orgId = staffPermCacheFormDTO.getOrgIdPath(); - String gridId = staffPermCacheFormDTO.getGridId(); - accessService.updatePermissionCache(staffId, app, client, permissions, roleIdList, orgId, gridId); - return new Result(); - } - - /** - * 从缓存中查询用户信息(DataFilterAspect中用到) - * @return - */ - @PostMapping("loginuserinfo") - public Result getLoginUserInfo(@RequestBody StaffPermCacheFormDTO dto) { - ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); - GovTokenDto govTokenDto = accessService.getUserDetails(dto.getApp(), dto.getClient(), dto.getStaffId()); - LoginUserInfoResultDTO resultDTO = null; - if (govTokenDto != null) { - resultDTO = new LoginUserInfoResultDTO(); - resultDTO.setRoleIdList(govTokenDto.getRoleIdList()); - //resultDTO.setGridId(govTokenDto.getGridId()); - resultDTO.setOrgIdPath(govTokenDto.getOrgIdPath()); - resultDTO.setGridIdList(govTokenDto.getGridIdList()); - resultDTO.setDeptIdList(govTokenDto.getDeptIdList()); - resultDTO.setUserId(govTokenDto.getUserId()); - } - return new Result().ok(resultDTO); - } - - /** - * 查询角色的操作key对应操作范围列表(缓存) - * @return - */ - @PostMapping("operationscopes") - public Result> getOperationScopesByRoleId(@RequestBody OperationScopeFormDTO operationScopeFormDTO) { - ValidatorUtils.validateEntity(operationScopeFormDTO, OperationScopeFormDTO.ListOperationScopeGroup.class); - Set scopes = accessService.listOperationScopesByRoleId(operationScopeFormDTO.getRoleId(), operationScopeFormDTO.getOperationKey()); - return new Result>().ok(scopes); - } - - /** - * 查询角色所有operation及其范围(缓存) - * @return - */ - @PostMapping("roleallopesandscopes/{roleId}") - public Result> listRoleAllOperationScopesByRoleId(@PathVariable("roleId") String roleId) { - List scopes = accessService.listAllRoleOperationScopesByRoleId(roleId); - return new Result>().ok(scopes); - } - /** * 用户是否具有指定功能权限 * @return diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDefaultDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDefaultDao.java new file mode 100755 index 0000000000..2c9a049e83 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/OperationScopeDefaultDao.java @@ -0,0 +1,64 @@ +/** + * 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.AccessConfigOpeDefaultScopesResultDTO; +import com.epmet.dto.result.OperationScopeDefaultResultDTO; +import com.epmet.entity.OperationScopeDefaultEntity; +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-17 + */ +@Mapper +public interface OperationScopeDefaultDao extends BaseDao { + List listAllValid(); + + /** + * 根据角色key和操作key查询默认操作权限列表 + * @param roleKey + * @return + */ + List listDefaultOpeScopes(@Param("roleKey") String roleKey); + + /** + * 查询操作的默认范围 + * @param roleKey + * @param operationKey + * @return + */ + List listOpeDefaultScopes4Config( + @Param("roleKey") String roleKey, + @Param("operationKey") String operationKey); + + List listOpeDefaultScopesByRoleAndOpeKey( + @Param("roleKey") String roleKey, + @Param("operationKey") String operationKey); + + int delete( + @Param("roleKey") String roleKey, + @Param("operationKey") String operationKey, + @Param("scopeKey") String scopeKey); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDefaultDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDefaultDao.java index 820c23bba6..19ccbf901e 100755 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDefaultDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/RoleOperationDefaultDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.AccessConfigOpeDefaultScopesResultDTO; import com.epmet.dto.result.RoleOperationDefaultResultDTO; import com.epmet.entity.RoleOperationDefaultEntity; import org.apache.ibatis.annotations.Mapper; @@ -47,4 +48,10 @@ public interface RoleOperationDefaultDao extends BaseDao listByRoleKey(@Param("roleKey") String roleKey); + + List listRoleDefaultOpsByRoleKey(@Param("roleKey") String roleKey); + + int deleteByRoleKeyAndOpeKey( + @Param("roleKey") String roleKey, + @Param("operationKey") String operationKey); } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/OperationScopeDefaultEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/OperationScopeDefaultEntity.java new file mode 100755 index 0000000000..6ec89eb12b --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/OperationScopeDefaultEntity.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.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-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("operation_scope_default") +public class OperationScopeDefaultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String roleKey; + + /** + * 操作key + */ + private String operationKey; + + /** + * 范围key + */ + private String scopeKey; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationDefaultEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationDefaultEntity.java index b19c7e08e0..8ea82b13b9 100755 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationDefaultEntity.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/RoleOperationDefaultEntity.java @@ -18,12 +18,13 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper=false) +@TableName("role_operation_default") public class RoleOperationDefaultEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java index e6dfec5878..3fc28b675f 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessConfigService.java @@ -1,7 +1,10 @@ package com.epmet.service; +import com.epmet.dto.form.AccessConfigRoleDefaultOpesFormDTO; +import com.epmet.dto.result.AccessConfigOpeDefaultScopesResultDTO; import com.epmet.dto.result.AccessConfigOpesResultDTO; import com.epmet.dto.result.AccessConfigOptionsResultDTO; +import com.epmet.dto.result.RoleOperationDefaultResultDTO; import java.util.List; import java.util.Set; @@ -14,4 +17,12 @@ public interface AccessConfigService { AccessConfigOptionsResultDTO listScopeOptionsForAccessConfig(String roleId, String operationKey); void saveConfig(String roleId, String operationKey, Set scopeKeys); + + List listRoleDefaultOpsByRoleKey(String roleKey); + + void saveRoleDefaultOperations(String roleKey, List operationKeys); + + List listOpeDefaultScopes4Role(String roleKey, String operationKey); + + void saveOpeDefaultScopes(String roleKey, String operationKey, List scopeKeys); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java index 831126f6bf..7b365fa21b 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/AccessService.java @@ -1,34 +1,19 @@ package com.epmet.service; -import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.dto.form.GetSQLFilterFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import java.util.List; -import java.util.Map; import java.util.Set; public interface AccessService { - /** - * 更新权限缓存 - * @param staffId - * @param permissions - */ - void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, String orgIdPath, String gridId); - - /** - * 查询用户当前权限列表 - * @return - */ - GovTokenDto getUserDetails(String app, String client, String staffId); /** - * 查询角色的操作key对应操作范围列表 - * @param roleId - * @param operationKey + * 查询登陆用户登陆信息 * @return */ - Set listOperationScopesByRoleId(String roleId, String operationKey); + LoginUserDetailsResultDTO getLoginUserDetails(String app, String client, String staffId); /** * 查询角色所有operation及其范围(缓存) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java index 78594a96fd..7b635cedf0 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/AccessConfigServiceImpl.java @@ -4,6 +4,8 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.dao.*; import com.epmet.dto.result.*; +import com.epmet.entity.OperationScopeDefaultEntity; +import com.epmet.entity.RoleOperationDefaultEntity; import com.epmet.entity.RoleOperationEntity; import com.epmet.entity.RoleScopeEntity; import com.epmet.redis.RoleOpeScopeRedis; @@ -30,9 +32,15 @@ public class AccessConfigServiceImpl implements AccessConfigService { @Autowired private RoleOperationDao roleOperationDao; + @Autowired + private RoleOperationDefaultDao roleOperationDefaultDao; + @Autowired private RoleScopeDao roleScopeDao; + @Autowired + private OperationScopeDefaultDao operationScopeDefaultDao; + @Override public List listOpesByRole(String roleId) { return roleOperationDao.listOpesForAccessConfig(roleId); @@ -118,4 +126,74 @@ public class AccessConfigServiceImpl implements AccessConfigService { // 清空redis缓存 roleOpeScopeRedis.delRoleAllOpeScopes(roleId); } + + @Override + public List listRoleDefaultOpsByRoleKey(String roleKey) { + return roleOperationDefaultDao.listRoleDefaultOpsByRoleKey(roleKey); + } + + /** + * + * @param roleKey + * @param operationKeys + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void saveRoleDefaultOperations(String roleKey, List operationKeys) { + + List opesExists = roleOperationDefaultDao.listByRoleKey(roleKey); + Set opeKeysExists = opesExists.stream().map(ope -> ope.getOperationKey()).collect(Collectors.toSet()); + + // 过滤出删掉的 + Set deletedOpes = opeKeysExists.stream().filter(oke -> !operationKeys.contains(oke)).collect(Collectors.toSet()); + // 过滤出新增的 + Set newOpes = operationKeys.stream().filter(okn -> !opeKeysExists.contains(okn)).collect(Collectors.toSet()); + + for (String deletedOpe : deletedOpes) { + roleOperationDefaultDao.deleteByRoleKeyAndOpeKey(roleKey, deletedOpe); + } + + for (String newOpe : newOpes) { + RoleOperationDefaultEntity entity = new RoleOperationDefaultEntity(); + entity.setRoleKey(roleKey); + entity.setOperationKey(newOpe); + roleOperationDefaultDao.insert(entity); + } + } + + /** + * 查询默认的 + * @param roleKey + * @param operationKey + * @return + */ + @Override + public List listOpeDefaultScopes4Role(String roleKey, String operationKey) { + return operationScopeDefaultDao.listOpeDefaultScopes4Config(roleKey, operationKey); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void saveOpeDefaultScopes(String roleKey, String operationKey, List submitScopeKeys) { + List exists = operationScopeDefaultDao.listOpeDefaultScopesByRoleAndOpeKey(roleKey, operationKey); + + Set existsScopeKeys = exists.stream().map(ope -> ope.getScopeKey()).collect(Collectors.toSet()); + + // 删掉的 + Set deleteds = existsScopeKeys.stream().filter(esk -> !submitScopeKeys.contains(esk)).collect(Collectors.toSet()); + // 新增的 + Set addeds = submitScopeKeys.stream().filter(ssk -> !existsScopeKeys.contains(ssk)).collect(Collectors.toSet()); + + for (String scopeKey : deleteds) { + operationScopeDefaultDao.delete(roleKey, operationKey, scopeKey); + } + + for (String scopeKey : addeds) { + OperationScopeDefaultEntity entity = new OperationScopeDefaultEntity(); + entity.setOperationKey(operationKey); + entity.setRoleKey(roleKey); + entity.setScopeKey(scopeKey); + operationScopeDefaultDao.insert(entity); + } + } } 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 8c7e448f64..25afa314fa 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 @@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil; import com.epmet.bean.OpeScopeFilterResultBean; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; @@ -16,6 +15,7 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.GetSQLFilterFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.RoleOpeScopeResultDTO; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; @@ -64,55 +64,9 @@ public class AccessServiceImpl implements AccessService { public static final String ORG_RELATION_SUP = "sup"; public static final String ORG_PATH_SEPARATOR = ":"; - /** - * 更新权限缓存 - * @param staffId - * @param permissions - */ @Override - public void updatePermissionCache(String staffId, String app, String client, Set permissions, Set roleIdList, - String orgIdPath, String gridId) { - GovTokenDto govTokenDto = cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); - if (govTokenDto == null) { - logger.warn("更新[{}]用户缓存:Redis中不存在该用户TokenDto缓存信息", staffId); - return ; - } - // 将权限,角色列表,和当前组织ID存入TokenDto - govTokenDto.setPermissions(permissions); - govTokenDto.setRoleIdList(roleIdList); - govTokenDto.setOrgIdPath(orgIdPath); - govTokenDto.setGridId(gridId); - - // 将新的TokenDto更新到redis中 - long expire = cpUserDetailRedis.getExpire(app, client, staffId); - cpUserDetailRedis.set(govTokenDto, expire); - logger.warn("更新[{}]用户缓存成功。", staffId); - } - - @Override - public GovTokenDto getUserDetails(String app, String client, String staffId) { - return cpUserDetailRedis.get(app, client, staffId, GovTokenDto.class); - } - - /** - * 查询角色的操作key对应操作范围列表 - * @param roleId - * @param operationKey - * @return - */ - public Set listOperationScopesByRoleId(String roleId, String operationKey) { - Set roleOpeScopes = roleOpeScopeRedis.getRoleOpeScopes(roleId, operationKey); - if (roleOpeScopes != null) { - return roleOpeScopes; - } - Set scopes = operationScopeDao.listOperationScopesByRoleId(roleId, operationKey); - try { - roleOpeScopeRedis.setRoleOpeScopes(roleId, operationKey, scopes); - } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error("GovAccess:查询角色的操作范围:缓存范围出错:{}", errorStackTrace); - } - return scopes; + public LoginUserDetailsResultDTO getLoginUserDetails(String app, String client, String staffId) { + return cpUserDetailRedis.get(app, client, staffId, LoginUserDetailsResultDTO.class); } @Override @@ -132,19 +86,19 @@ public class AccessServiceImpl implements AccessService { return true; } - GovTokenDto userDetails = getUserDetails(app, client, userId); + LoginUserDetailsResultDTO userDetails = getLoginUserDetails(app, client, userId); if (userDetails == null) { return false; } - Set roleIdList = userDetails.getRoleIdList(); - if (CollectionUtils.isEmpty(roleIdList)) { + List roleList = userDetails.getRoleList(); + if (CollectionUtils.isEmpty(roleList)) { return false; } final Set operationKeys = new HashSet<>(); - roleIdList.stream().forEach(roleId -> { - List opeAndScopes = listAllRoleOperationScopesByRoleId(roleId); + roleList.stream().forEach(role -> { + List opeAndScopes = listAllRoleOperationScopesByRoleId(role.getId()); operationKeys.addAll(opeAndScopes.stream().map(opeAndScope -> opeAndScope.getOperationKey()).collect(Collectors.toSet())); }); @@ -157,7 +111,7 @@ public class AccessServiceImpl implements AccessService { @Override public String getSqlFilterSegment(GetSQLFilterFormDTO form) { hasConditions.set(false); - GovTokenDto userDetails = getUserDetails(form.getApp(), form.getClient(), form.getUserId()); + LoginUserDetailsResultDTO userDetails = getLoginUserDetails(form.getApp(), form.getClient(), form.getUserId()); if (userDetails == null) { logger.error("查询SQL过滤脚本:没有找到用户的登陆信息:app: {}, client: {}, userId:{}", form.getApp(), form.getClient(), form.getUserId()); throw new RenException(EpmetErrorCode.ERR10006.getCode()); @@ -165,12 +119,12 @@ public class AccessServiceImpl implements AccessService { StringBuilder sb = new StringBuilder(); - if (CollectionUtils.isEmpty(userDetails.getRoleIdList())) { + if (CollectionUtils.isEmpty(userDetails.getRoleList())) { //logger.warn("用户{}没有配置任何角色,无法执行{}操作", form.getUserId(), form.getOperationKey()); throw new RenException(String.format("用户%s没有配置任何角色,无法执行%s操作", form.getUserId(), form.getOperationKey())); } - OpeScopeFilterResultBean effectiveOpeScopes = getEffectiveOpeScopes(userDetails.getRoleIdList(), form.getOperationKey()); + OpeScopeFilterResultBean effectiveOpeScopes = getEffectiveOpeScopes(userDetails.getRoleList(), form.getOperationKey()); if (effectiveOpeScopes.isAllScopes()) { return sb.toString(); } @@ -185,7 +139,7 @@ public class AccessServiceImpl implements AccessService { // 生成开关范围的sql过滤器 if (!CollectionUtil.isEmpty(switchScopes)) { - genSwitchScopeSqlFilter(switchScopes, sb, form.getTableAlias(), userDetails.getUserId(), form.getGridId(), form.getDepartmentId()); + genSwitchScopeSqlFilter(switchScopes, sb, form.getTableAlias(), userDetails.getUserId(), form.getGridIds(), form.getDepartmentIds()); } return sb.toString(); @@ -199,29 +153,33 @@ public class AccessServiceImpl implements AccessService { StringBuilder sb, String tableAlias, String userId, - String gridId, - String departmentId) { + Set gridIds, + Set departmentIds) { if (switchScopes.contains(OperationScopeConstant.SCOPE_I_CREATED)) { genICreatedSql(sb, userId, tableAlias); } if (switchScopes.contains(OperationScopeConstant.SCOPE_IN_GRID)) { - if (StringUtils.isBlank(gridId)) { - String error = String.format("DataFilter:拼接SQL语句出错:需要in grid权限,但是代码中没有获取到,GridId:%s", gridId); + if (gridIds == null) { + String error = String.format("DataFilter:拼接SQL语句出错:需要in grid权限,但是代码中没有获取到gridIds"); logger.error(error); throw new RenException(error); } - genInGrid(sb, gridId, tableAlias); + if (gridIds.size() != 0) { + genInGrid(sb, gridIds, tableAlias); + } } if (switchScopes.contains(OperationScopeConstant.SCOPE_IN_DEPARTMENT)) { - if (StringUtils.isBlank(departmentId)) { - String error = String.format("DataFilter:拼接SQL语句出错:需要in department权限,但是代码中没有获取到, departmentId:%s", departmentId); + if (departmentIds == null) { + String error = String.format("DataFilter:拼接SQL语句出错:需要in department权限,但是代码中没有获取到, departmentIds"); logger.error(error); throw new RenException(error); } - genDepartmentFilterSql(sb, departmentId, tableAlias); + if (departmentIds.size() != 0) { + genDepartmentFilterSql(sb, departmentIds, tableAlias); + } } } @@ -245,18 +203,40 @@ public class AccessServiceImpl implements AccessService { * @param sb * @param tableAlias */ - private void genInGrid(StringBuilder sb, String gridId, String tableAlias) { + private void genInGrid(StringBuilder sb, Set gridIds, String tableAlias) { if (hasConditions.get()) { // 之前没有条件 sb.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("' "); + // 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 "); + } + } + + int lastOrIndex = sb.lastIndexOf("OR"); + sb.replace(lastOrIndex, lastOrIndex + "OR".length(), "" ); + + hasConditions.set(true); + } + + /** + * sql语句拼接FALSE + * @param sb + */ + private void genFalseCondition(StringBuilder sb) { + if (hasConditions.get()) { + // 之前没有条件 + sb.append(" OR "); } + + sb.append(" FALSE "); + hasConditions.set(true); } @@ -265,29 +245,36 @@ public class AccessServiceImpl implements AccessService { * * @param sb */ - private void genDepartmentFilterSql(StringBuilder sb, String deptId, String tableAlias) { + private void genDepartmentFilterSql(StringBuilder sb, Set deptIds, String tableAlias) { //Result> deptListResult = govOrgFeignClient.getDepartmentListByStaffId(staffId); if (hasConditions.get()) { // 之前没有条件 sb.append(" OR "); } - if (StringUtils.isBlank(tableAlias)) { - sb.append(" DEPARTMENT_ID = '").append(deptId).append("' "); - } else { - sb.append(" ").append(tableAlias).append(".DEPARTMENT_ID ='").append(deptId).append("' "); + + 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 "); + } } + + int lastOrIndex = sb.lastIndexOf("OR"); + sb.replace(lastOrIndex, lastOrIndex + "OR".length(), "" ); + hasConditions.set(true); } /** * 计算有效操作范围 */ - public OpeScopeFilterResultBean getEffectiveOpeScopes(Set roleIds, String reqiurePermission) { + public OpeScopeFilterResultBean getEffectiveOpeScopes(List roles, String reqiurePermission) { // 根据角色列表查询操作范围列表 Set opeAndScopesOfThisOperation = new HashSet<>(); - roleIds.forEach(roleId -> { - List opes = listAllRoleOperationScopesByRoleId(roleId); + roles.forEach(role -> { + List opes = listAllRoleOperationScopesByRoleId(role.getId()); if (!CollectionUtils.isEmpty(opes)) { opes.forEach(ope -> { if (reqiurePermission.equals(ope.getOperationKey())) { @@ -453,7 +440,7 @@ public class AccessServiceImpl implements AccessService { @Override public Set listOperationPermissions(String staffId, String currAgencyId) { - GovTokenDto userDetails = getUserDetails(loginUserUtil.getLoginUserApp(), loginUserUtil.getLoginUserClient(), loginUserUtil.getLoginUserId()); + LoginUserDetailsResultDTO userDetails = getLoginUserDetails(loginUserUtil.getLoginUserApp(), loginUserUtil.getLoginUserClient(), loginUserUtil.getLoginUserId()); if (userDetails == null) { throw new RenException(EpmetErrorCode.ERR10006.getCode(), EpmetErrorCode.ERR10006.getMsg()); } @@ -488,7 +475,7 @@ public class AccessServiceImpl implements AccessService { // 获取机关单位中的角色 // 目前一个人只在一个单位下,所以不动态查询,如果后面需要一个人在多个单位,再改这里 //List roleDTOS = queryGovStaffRoles(staffId, belongAgency.getId()); - Set roleIdList = userDetails.getRoleIdList(); + List roleList = userDetails.getRoleList(); // 当前组织和所属组织的orgId路径,以及他们的上下级关系 String belongOrgIdPath = getOrgIdPath(belongAgency); @@ -497,9 +484,9 @@ public class AccessServiceImpl implements AccessService { Set filtedOps = new HashSet<>(); - if (!CollectionUtils.isEmpty(roleIdList)) { - roleIdList.forEach(roleId -> { - List opeAndScopeDTO = listAllRoleOperationScopesByRoleId(roleId); + if (!CollectionUtils.isEmpty(roleList)) { + roleList.forEach(role -> { + List opeAndScopeDTO = listAllRoleOperationScopesByRoleId(role.getId()); filtedOps.addAll(filterOpesByScope(currOrgRelation, opeAndScopeDTO)); }); } @@ -578,8 +565,7 @@ public class AccessServiceImpl implements AccessService { } if (!opeScope.getSeries().equals(OperationScopeConstant.SERIES_ORG_LEVEL)) { - // 如果不是org_level系列权限,跳过。(如果一个操作没有分配org_level系列权限,那么无法根据所在机构判断是否具有该功能权限) - // 此时不会给前台返回此功能权限。即要求所有操作必须分配至少一个org_level系列权限(如果实在不需要,可以分配成org_all)。 + opeKeys.add(opeScope.getOperationKey()); continue; } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java index a1320faf7b..28943e74b8 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/RoleOperationServiceImpl.java @@ -23,13 +23,18 @@ 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.OperationScopeDefaultDao; import com.epmet.dao.RoleOperationDao; import com.epmet.dao.RoleOperationDefaultDao; +import com.epmet.dao.RoleScopeDao; import com.epmet.dto.RoleOperationDTO; import com.epmet.dto.form.InitDefaultOperationsFormDTO; +import com.epmet.dto.result.OperationScopeDefaultResultDTO; import com.epmet.dto.result.RoleOperationDefaultResultDTO; import com.epmet.dto.result.RoleOperationResultDTO; +import com.epmet.entity.OperationScopeDefaultEntity; import com.epmet.entity.RoleOperationEntity; +import com.epmet.entity.RoleScopeEntity; import com.epmet.service.RoleOperationService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -37,9 +42,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 角色能进行那些操作 @@ -56,6 +59,12 @@ public class RoleOperationServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -116,7 +125,6 @@ public class RoleOperationServiceImpl extends BaseServiceImpl roles) { - //roleOperationDefaultDao.listAllValid(); for (InitDefaultOperationsFormDTO.InitDefaultOpesRoleDTO role : roles) { String roleId = role.getRoleId(); String roleKey = role.getRoleKey(); @@ -124,6 +132,7 @@ public class RoleOperationServiceImpl extends BaseServiceImpl operations) { + HashMap> opeScopeMap = listDefaultOpeScopesMap(roleKey); + for (RoleOperationDefaultResultDTO operation : operations) { + // 该角色,该操作的操作范围列表 + Set scopeKeys4ThisOpe = opeScopeMap.get(operation.getOperationKey()); + if (!CollectionUtils.isEmpty(scopeKeys4ThisOpe)) { + for (String scopeKey : scopeKeys4ThisOpe) { + RoleScopeEntity roleScopeEntity = new RoleScopeEntity(); + roleScopeEntity.setOperationKey(operation.getOperationKey()); + roleScopeEntity.setRoleId(roleId); + roleScopeEntity.setScopeKey(scopeKey); + roleScopeDao.insert(roleScopeEntity); + } + } + } + } + + private HashMap> listDefaultOpeScopesMap(String roleKey) { + List defaultScopes = operationScopeDefaultDao.listDefaultOpeScopes(roleKey); + return convertScopeDefaultDto2Map(defaultScopes); + } + + /** + * 将默认范围entity转换为map + * @param entities + * @return + */ + private HashMap> convertScopeDefaultEntity2Map(List entities) { + HashMap> map = new HashMap<>(); + for (OperationScopeDefaultEntity entity : entities) { + Set scopes = map.get(entity.getOperationKey()); + if (scopes == null) { + scopes = new HashSet<>(); + map.put(entity.getOperationKey(), scopes); + } + scopes.add(entity.getScopeKey()); + } + return map; + } + + /** + * 将默认范围dto转换为map + * @param dtos + * @return + */ + private HashMap> convertScopeDefaultDto2Map(List dtos) { + HashMap> map = new HashMap<>(); + for (OperationScopeDefaultResultDTO dto : dtos) { + Set scopes = map.get(dto.getOperationKey()); + if (scopes == null) { + scopes = new HashSet<>(); + map.put(dto.getOperationKey(), scopes); + } + scopes.add(dto.getScopeKey()); + } + return map; + } + } \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml index f1159f2892..9aaa3e9556 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml @@ -59,6 +59,7 @@ spring: user: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ baseline-on-migrate: true + baseline-version: 0 management: @@ -112,3 +113,9 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.1__init.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.1__init.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.1__init.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V2__DemoSql.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V2__DemoSql.sql deleted file mode 100644 index ecd68455d3..0000000000 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V2__DemoSql.sql +++ /dev/null @@ -1,4 +0,0 @@ --- CREATE TABLE epmet_gov_access.device_t ( --- device_id bigint(11) primary KEY auto_increment, --- device_name varchar(20) NOT NULL --- ) \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/epmet_gov_access.sql deleted file mode 100644 index 9f2eec699a..0000000000 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/epmet_gov_access.sql +++ /dev/null @@ -1,119 +0,0 @@ -/* - Date: 22/04/2020 12:13:38 -*/ - --- SET NAMES utf8mb4; --- #SET FOREIGN_KEY_CHECKS = 0; - -CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; - --- DROP TABLE IF EXISTS `permission_scope`; -CREATE TABLE `operation_scope` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id', - `SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围key', - `SCOPE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围名称', - `SCOPE_INDEX` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围序号', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', - `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', - `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限范围表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for resource_ope --- ---------------------------- --- DROP TABLE IF EXISTS `operation`; -CREATE TABLE `operation` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `OPERATION_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `BRIEF` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作简介', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, - `REVISION` int(10) NULL DEFAULT NULL, - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `CREATED_TIME` datetime(0) NULL DEFAULT NULL, - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作类型表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for role_operation --- ---------------------------- --- DROP TABLE IF EXISTS `role_operation`; -CREATE TABLE `role_operation` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', - `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作key', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', - `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', - `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能进行那些操作' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for role_scope --- ---------------------------- --- DROP TABLE IF EXISTS `role_scope`; -CREATE TABLE `role_scope` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', - `OPERATION_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作Key', - `SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围Key', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', - `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', - `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能操作哪些范围' ROW_FORMAT = Dynamic; - --- SET FOREIGN_KEY_CHECKS = 1; - --- 2020.04.29 wxz -CREATE TABLE `access_setting` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', - `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色ID', - `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作key', - `SETTING_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置KEY', - `SETTING_VALUE` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置值', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, - `REVISION` int(10) NULL DEFAULT NULL, - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `CREATED_TIME` datetime(0) NULL DEFAULT NULL, - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`ID`) USING BTREE, - UNIQUE INDEX `uni_access_setting_role_key_opt`(`ROLE_ID`, `OPERATION_KEY`, `SETTING_KEY`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限配置' ROW_FORMAT = Dynamic; - - -CREATE TABLE `access_setting_options` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', - `SETTING_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置KEY', - `SETTING_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置name', - `BRIEF` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '简介', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, - `REVISION` int(10) NULL DEFAULT NULL, - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `CREATED_TIME` datetime(0) NULL DEFAULT NULL, - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`ID`) USING BTREE, - UNIQUE INDEX `uni_access_setting_opts`(`SETTING_KEY`) USING BTREE COMMENT '配置KEY不能重复' -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限配置选项' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of access_setting_options --- ---------------------------- -INSERT INTO `access_setting_options` VALUES ('1', 'I_CREATED', '我发起的', '我发起的条件过滤。ON为开启,OFF为关闭', 0, 0, NULL, NULL, NULL, NULL); -INSERT INTO `access_setting_options` VALUES ('2', 'I_PART', '我参与的', '我参与的条件过滤', 0, 0, NULL, NULL, NULL, NULL); -INSERT INTO `access_setting_options` VALUES ('3', 'IN_GRID', '网格内', '网格内', 0, 0, NULL, NULL, NULL, NULL); -INSERT INTO `access_setting_options` VALUES ('4', 'IN_DEPARTMENT', '部门内', '部门内', 0, 0, NULL, NULL, NULL, NULL); diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml index c1772b7c54..0591776c96 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml @@ -32,6 +32,16 @@ + + + + SELECT * + FROM operation_scope_default WHERE DEL_FLAG=0 + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml index dfd74bfea0..98cd9f675b 100755 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml @@ -15,6 +15,11 @@ + + + DELETE FROM role_operation_default WHERE ROLE_KEY = #{roleKey} AND OPERATION_KEY = #{operationKey} + + - + \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-client/pom.xml b/epmet-module/gov-grid/gov-grid-client/pom.xml index 297cb07121..5c477c501f 100644 --- a/epmet-module/gov-grid/gov-grid-client/pom.xml +++ b/epmet-module/gov-grid/gov-grid-client/pom.xml @@ -19,6 +19,12 @@ org.projectlombok lombok + + com.epmet + epmet-commons-tools + 2.0.0 + compile + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/DeletePartyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/DeletePartyMemberFormDTO.java new file mode 100644 index 0000000000..bcce3cb4bd --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/DeletePartyMemberFormDTO.java @@ -0,0 +1,31 @@ +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/18 18:05 + */ +@Data +public class DeletePartyMemberFormDTO implements Serializable { + private static final long serialVersionUID = 2325963253025239121L; + + public interface AddUserInternalGroup {} + /** + * 党员id + */ + @NotBlank(message = "党员id不能为空",groups = {PartyMemberIdFormDTO.AddUserInternalGroup.class}) + private String partyMemberId; + + /** + * 党支部id + */ + @NotBlank(message = "党支部id不能为空",groups = {PartyMemberIdFormDTO.AddUserInternalGroup.class}) + private String partyBranchId; + +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchAddFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchAddFormDTO.java new file mode 100644 index 0000000000..3de9a6f231 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchAddFormDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 添加党支部入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 12:35 + */ +@Data +public class PartyBranchAddFormDTO implements Serializable { + private static final long serialVersionUID = -8102877381223078842L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = {AddUserInternalGroup.class}) + private String gridId; + + /** + * 党支部名称 + */ + @NotBlank(message = "请输入支部名称", groups = {AddUserShowGroup.class}) + @Length(max = 20, message = "支部名称不能超过20个字", groups = AddUserShowGroup.class) + private String partyBranchName; + + /** + * 党支部概要信息 + */ + @Length(max = 500, message = "支部概要信息不能超过500个字", groups = AddUserShowGroup.class) + private String profile; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchEditFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchEditFormDTO.java new file mode 100644 index 0000000000..d4f03416a6 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchEditFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 修改党支部信息入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 14:00 + */ +@Data +public class PartyBranchEditFormDTO implements Serializable { + private static final long serialVersionUID = -6739109166420798965L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "党支部id不能为空", groups = {AddUserInternalGroup.class}) + private String partyBranchId; + /** + * 党支部名称 + */ + @NotBlank(message = "请输入支部名称", groups = {AddUserShowGroup.class}) + @Length(max = 20, message = "支部名称不能超过20个字", groups = AddUserShowGroup.class) + private String partyBranchName; + + /** + * 党支部概要信息 + */ + @NotBlank(message = "请输入支部概要信息", groups = {AddUserShowGroup.class}) + @Length(max = 500, message = "支部概要信息不能超过500个字", groups = AddUserShowGroup.class) + private String profile; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchIdFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchIdFormDTO.java new file mode 100644 index 0000000000..1849a8481b --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchIdFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党支部id + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 17:02 + */ +@Data +public class PartyBranchIdFormDTO implements Serializable { + private static final long serialVersionUID = 5321430865413383354L; + public interface AddUserInternalGroup { + } + /** + * 党支部id + */ + @NotBlank(message = "党支部id不能为空",groups = {AddUserInternalGroup.class}) + private String partyBranchId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchListFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchListFormDTO.java new file mode 100644 index 0000000000..5f1c8681e4 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 3、党支部列表查询入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 16:11 + */ +@Data +public class PartyBranchListFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {PartyBranchListFormDTO.AddUserInternalGroup.class}) + private String customerId; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = {PartyBranchListFormDTO.AddUserInternalGroup.class}) + private String gridId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyMemberIdFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyMemberIdFormDTO.java new file mode 100644 index 0000000000..1e69866bbf --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyMemberIdFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党员id + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 14:48 + */ +@Data +public class PartyMemberIdFormDTO implements Serializable { + private static final long serialVersionUID = 3088195909670495675L; + + public interface AddUserInternalGroup {} + /** + * 党员id + */ + @NotBlank(message = "党员id不能为空",groups = {AddUserInternalGroup.class}) + private String partyMemberId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/SaveOrUpdateParyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/SaveOrUpdateParyMemberFormDTO.java new file mode 100644 index 0000000000..3414805602 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/SaveOrUpdateParyMemberFormDTO.java @@ -0,0 +1,42 @@ +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; + +/** + * 新增、修改党员入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 22:15 + */ +@Data +public class SaveOrUpdateParyMemberFormDTO implements Serializable { + private static final long serialVersionUID = -6896349967046364830L; + + public interface UpdatePatyMemberGroup { + } + + public interface SavePatyMemberGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "党支部id不能为空", groups = {SavePatyMemberGroup.class}) + private String partyBranchId; + + @NotBlank(message = "姓名不能为空", groups = {AddUserShowGroup.class}) + private String name; + + @NotBlank(message = "身份证不能为空", groups = {AddUserShowGroup.class}) + private String idCard; + + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) + private String mobile; + + @NotBlank(message = "党员id不能为空", groups = {UpdatePatyMemberGroup.class}) + private String partyMemberId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchAddResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchAddResultDTO.java new file mode 100644 index 0000000000..a959eb8e1a --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchAddResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 添加党支部返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 12:45 + */ +@Data +public class PartyBranchAddResultDTO implements Serializable { + private static final long serialVersionUID = 5610858988982913682L; + /** + * 党支部id + */ + private String partyBranchId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchInfoResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchInfoResultDTO.java new file mode 100644 index 0000000000..df3b4bc492 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchInfoResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党支部详情信息返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 21:45 + */ +@Data +public class PartyBranchInfoResultDTO implements Serializable { + private static final long serialVersionUID = 1184531127569286576L; + + /** + * 党支部id + */ + private String partyBranchId; + + /** + * 党支部名称 + */ + private String partyBranchName; + + /** + * 党支部概要 + */ + private String profile; + + /** + * 党支部所属网格名称 + */ + private String gridName; + + /** + * 党支部所属网格id + */ + private String gridId; + + public PartyBranchInfoResultDTO(){ + this.partyBranchId=""; + this.partyBranchName=""; + this.profile=""; + this.gridName=""; + } +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchListResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchListResultDTO.java new file mode 100644 index 0000000000..8057699458 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchListResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 3、党支部列表查询返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 16:13 + */ +@Data +public class PartyBranchListResultDTO implements Serializable { + private static final long serialVersionUID = 8342529186641647970L; + /** + * 支部id + */ + private String partyBranchId; + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 党员总数 + */ + private Integer totalPartyMember; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberIdResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberIdResultDTO.java new file mode 100644 index 0000000000..09f2e6b1a9 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberIdResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员id:添加党员后返参、修改党员后返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 22:13 + */ +@Data +public class PartyMemberIdResultDTO implements Serializable { + private static final long serialVersionUID = 7467454908831748131L; + private String partyMemberId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoDetailResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoDetailResultDTO.java new file mode 100644 index 0000000000..b64a8b5462 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoDetailResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员信息详情返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 15:19 + */ +@Data +public class PartyMemberInfoDetailResultDTO implements Serializable { + private static final long serialVersionUID = -4887670791276512339L; + /** + * 党员id + */ + private String partyMemberId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 1男2女0未知 + */ + private String gender; + + /** + * true已激活,false未激活 + */ + private Boolean status; + + /** + * 返回:账号于2019年10月31日在海泊桥社区-第一网格激活 + */ + private String activeDesc; + + /** + * 党支部名称(机关-网格-支部名) + */ + private String partyBranchName; + + /** + * 党支部id + */ + private String partyBranchId; + + public PartyMemberInfoDetailResultDTO(){ + this.partyMemberId=""; + this.name=""; + this.idCard=""; + this.mobile=""; + this.gender=""; + this.status=Boolean.FALSE; + this.activeDesc=""; + this.partyBranchName=""; + this.partyBranchId=""; + } +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoResultDTO.java new file mode 100644 index 0000000000..7f812531c5 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员列表返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 10:04 + */ +@Data +public class PartyMemberInfoResultDTO implements Serializable { + private static final long serialVersionUID = 627412197353847930L; + /** + * 党员id + */ + private String partyMemberId; + + /** + * 姓名 + */ + private String name; + + /** + * 性别1男2女0未知 + */ + private String gender; +} diff --git a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml index 53010fcf3d..1cd20945f9 100644 --- a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-grid-server: container_name: gov-grid-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-grid-server:0.3.27 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-grid-server:0.3.36 ports: - "8097:8097" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml index 0bd5497379..08aedd497f 100644 --- a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-grid-server: container_name: gov-grid-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-grid-server:0.3.26 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-grid-server:0.3.36 ports: - "8097:8097" network_mode: host # 使用现有网络 @@ -14,4 +14,4 @@ services: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 350M \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index cd40490909..4e0313a293 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.27 + 0.3.36 com.epmet gov-grid @@ -113,6 +113,8 @@ false + + false @@ -137,6 +139,8 @@ false + + true diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/PartyBranchManageController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/PartyBranchManageController.java new file mode 100644 index 0000000000..c74412719a --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/PartyBranchManageController.java @@ -0,0 +1,179 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.service.PartyBranchManageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 基层治理-支部管理 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 12:25 + */ +@RestController +@RequestMapping("partybranch") +public class PartyBranchManageController { + @Autowired + private PartyBranchManageService partyBranchManageService; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 添加党支部 + * @Date 2020/6/17 12:47 + **/ + @PostMapping("add") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_BRANCH_ADD) + public Result addPartyBranch(@RequestBody PartyBranchAddFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartyBranchAddFormDTO.AddUserShowGroup.class, PartyBranchAddFormDTO.AddUserInternalGroup.class); + PartyBranchAddResultDTO partyBranchAddResultDTO = partyBranchManageService.addPartyBranch(formDTO); + return new Result().ok(partyBranchAddResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 修改党支部信息 + * @Date 2020/6/17 15:31 + **/ + @PostMapping("edit") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_BRANCH_EDIT) + public Result editPartyBranch(@RequestBody PartyBranchEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartyBranchEditFormDTO.AddUserShowGroup.class, PartyBranchEditFormDTO.AddUserInternalGroup.class); + partyBranchManageService.editPartyBranch(formDTO); + PartyBranchAddResultDTO partyBranchAddResultDTO = new PartyBranchAddResultDTO(); + partyBranchAddResultDTO.setPartyBranchId(formDTO.getPartyBranchId()); + return new Result().ok(partyBranchAddResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 党支部列表查询 + * @Date 2020/6/17 16:15 + **/ + @PostMapping("list") + public Result> listPartyBranch(@RequestBody PartyBranchListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartyBranchListFormDTO.AddUserInternalGroup.class); + return new Result>().ok(partyBranchManageService.listPartyBranch(formDTO)); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 删除党支部 + * @Date 2020/6/17 18:23 + **/ + @PostMapping("delete") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_BRANCH_DELETE) + public Result deleteBranch(@RequestBody PartyBranchIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + partyBranchManageService.deleteBranch(formDTO.getPartyBranchId()); + return new Result(); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 5、党支部详情信息查询 + * @Date 2020/6/17 21:49 + **/ + @PostMapping("info") + public Result queryPartyBranchInfo(@RequestBody PartyBranchIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,PartyBranchIdFormDTO.AddUserInternalGroup.class); + PartyBranchInfoResultDTO partyBranchInfoResultDTO = partyBranchManageService.queryPartyBranchInfo(formDTO.getPartyBranchId()); + return new Result().ok(partyBranchInfoResultDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 6、党员列表查询 + * @Date 2020/6/18 0:17 + **/ + @PostMapping("/partymember/list") + public Result> listPartyMember(@RequestBody PartyBranchIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,PartyBranchIdFormDTO.AddUserInternalGroup.class); + List list=partyBranchManageService.listPartyMember(formDTO.getPartyBranchId()); + return new Result>().ok(list); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 7、添加党员 + * @Date 2020/6/17 22:25 + **/ + @PostMapping("/partymember/add") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_MEMBER_ADD) + public Result addPartyMember(@RequestBody SaveOrUpdateParyMemberFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SaveOrUpdateParyMemberFormDTO.AddUserShowGroup.class + , SaveOrUpdateParyMemberFormDTO.SavePatyMemberGroup.class); + PartyMemberIdResultDTO partyMemberIdResultDTO = new PartyMemberIdResultDTO(); + partyMemberIdResultDTO.setPartyMemberId(partyBranchManageService.addPartyMember(formDTO)); + return new Result().ok(partyMemberIdResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 8、编辑党员 + * @Date 2020/6/17 23:29 + **/ + @PostMapping("/partymember/edit") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_MEMBER_EDIT) + public Result editPartyMember(@RequestBody SaveOrUpdateParyMemberFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SaveOrUpdateParyMemberFormDTO.AddUserShowGroup.class + , SaveOrUpdateParyMemberFormDTO.UpdatePatyMemberGroup.class); + PartyMemberIdResultDTO partyMemberIdResultDTO = new PartyMemberIdResultDTO(); + partyMemberIdResultDTO.setPartyMemberId(partyBranchManageService.editPartyMember(formDTO)); + return new Result().ok(partyMemberIdResultDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 10、党员详情 + * @Date 2020/6/18 15:25 + **/ + @PostMapping("/partymember/detail") + public Result queryPartyMemberDetail(@RequestBody PartyMemberIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PartyMemberIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(partyBranchManageService.queryPartyMemberDetail(formDTO.getPartyMemberId())); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param deletePartyMemberFormDTO + * @author yinzuomei + * @description 删除党员 + * @Date 2020/6/18 17:51 + **/ + @PostMapping("partymember/delete") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_MEMBER_DELETE) + public Result deletePartyMember(@RequestBody DeletePartyMemberFormDTO deletePartyMemberFormDTO){ + ValidatorUtils.validateEntity(deletePartyMemberFormDTO, DeletePartyMemberFormDTO.AddUserInternalGroup.class); + partyBranchManageService.deletePartyMember(deletePartyMemberFormDTO); + return new Result(); + } +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/PartyBranchManageService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/PartyBranchManageService.java new file mode 100644 index 0000000000..e87a4dad57 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/PartyBranchManageService.java @@ -0,0 +1,104 @@ +package com.epmet.service; + +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; + +import java.util.List; + +/** + * 基层治理-支部管理 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 12:47 + */ +public interface PartyBranchManageService { + /** + * @param formDTO + * @return com.epmet.dto.result.PartyBranchAddResultDTO + * @author yinzuomei + * @description 添加党支部 + * @Date 2020/6/17 13:24 + **/ + PartyBranchAddResultDTO addPartyBranch(PartyBranchAddFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.dto.result.PartyBranchAddResultDTO + * @author yinzuomei + * @description 修改党支部信息 + * @Date 2020/6/17 14:30 + **/ + void editPartyBranch(PartyBranchEditFormDTO formDTO); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 党支部列表查询 + * @Date 2020/6/17 16:15 + **/ + List listPartyBranch(PartyBranchListFormDTO formDTO); + + /** + * @return void + * @param partyBranchId + * @author yinzuomei + * @description 删除党支部 + * @Date 2020/6/17 17:04 + **/ + void deleteBranch(String partyBranchId); + + /** + * @return com.epmet.dto.result.PartyBranchInfoResultDTO + * @param partyBranchId + * @author yinzuomei + * @description 5、党支部详情信息查询 + * @Date 2020/6/17 21:49 + **/ + PartyBranchInfoResultDTO queryPartyBranchInfo(String partyBranchId); + + /** + * @return java.util.List + * @param partyBranchId + * @author yinzuomei + * @description 党员列表查询 + * @Date 2020/6/18 10:06 + **/ + List listPartyMember(String partyBranchId); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 7、添加党员 + * @Date 2020/6/17 22:26 + **/ + String addPartyMember(SaveOrUpdateParyMemberFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 8、编辑党员 + * @Date 2020/6/17 23:29 + **/ + String editPartyMember(SaveOrUpdateParyMemberFormDTO formDTO); + + /** + * @param partyMemberId + * @return com.epmet.dto.result.PartyMemberInfoDetailResultDTO + * @author yinzuomei + * @description 10、党员详情:根据党员id查询党员详情 + * @Date 2020/6/18 15:25 + **/ + PartyMemberInfoDetailResultDTO queryPartyMemberDetail(String partyMemberId); + + /** + * @return void + * @param deletePartyMemberFormDTO + * @author yinzuomei + * @description 删除党员 + * @Date 2020/6/18 17:51 + **/ + void deletePartyMember(DeletePartyMemberFormDTO deletePartyMemberFormDTO); +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java new file mode 100644 index 0000000000..0cf320e03f --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java @@ -0,0 +1,219 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import com.epmet.service.PartyBranchManageService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 基层治理-支部管理 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 13:23 + */ +@Service +public class PartyBranchManageServiceImpl implements PartyBranchManageService { + private Logger logger = LogManager.getLogger(PartyBranchManageServiceImpl.class); + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient; + + @Override + public PartyBranchAddResultDTO addPartyBranch(PartyBranchAddFormDTO formDTO) { + CustomerPartyBranchDTO customerPartyBranchDTO = ConvertUtils.sourceToTarget(formDTO, CustomerPartyBranchDTO.class); + customerPartyBranchDTO.setTotalPartyMember(0); + PartyBranchAddResultDTO partyBranchAddResultDTO = new PartyBranchAddResultDTO(); + Result result = govOrgOpenFeignClient.savePartyBranch(customerPartyBranchDTO); + if (result.success()) { + partyBranchAddResultDTO.setPartyBranchId(result.getData()); + } else { + logger.error("添加党支部错误,调用gov-org-server接口返回失败"); + } + return partyBranchAddResultDTO; + } + + @Override + public void editPartyBranch(PartyBranchEditFormDTO formDTO) { + CustomerPartyBranchDTO customerPartyBranchDTO = ConvertUtils.sourceToTarget(formDTO, CustomerPartyBranchDTO.class); + customerPartyBranchDTO.setId(formDTO.getPartyBranchId()); + Result result = govOrgOpenFeignClient.updatePartyBranch(customerPartyBranchDTO); + if (result.success()) { + logger.info("修改党支部信息成功"); + } + } + + @Override + public List listPartyBranch(PartyBranchListFormDTO formDTO) { + ListPartyBranchFormDTO listPartyBranchFormDTO = ConvertUtils.sourceToTarget(formDTO, ListPartyBranchFormDTO.class); + Result> result = govOrgOpenFeignClient.listPartyBranch(listPartyBranchFormDTO); + List resultList=result.getData(); + if (result.success()) { + List list = ConvertUtils.sourceToTarget(resultList, PartyBranchListResultDTO.class); + return list; + } else { + logger.error(String.format("党支部列表查询失败入参:"), JSON.toJSONString(formDTO)); + } + return new ArrayList<>(); + } + + @Override + public void deleteBranch(String partyBranchId) { + Result customerPartyBranchDTOResult = govOrgOpenFeignClient.getPartyBranchById(partyBranchId); + if (!customerPartyBranchDTOResult.success()||null==customerPartyBranchDTOResult.getData()) { + logger.error(String.format("查询党支部信息失败入参:partyBranchId=%s",partyBranchId)); + return; + }else{ + if (null != customerPartyBranchDTOResult.getData() && customerPartyBranchDTOResult.getData().getTotalPartyMember() > 0) { + throw new RenException(EpmetErrorCode.CANNOT_DELETE_PARTY_BRANCH.getCode()); + } + } + Result delteResult=govOrgOpenFeignClient.deletePartyBranchById(partyBranchId); + if(!delteResult.success()){ + logger.error(String.format("删除党支部失败入参:partyBranchId=%s",partyBranchId)); + } + } + + @Override + public PartyBranchInfoResultDTO queryPartyBranchInfo(String partyBranchId) { + PartyBranchInfoResultDTO partyBranchInfo = new PartyBranchInfoResultDTO(); + Result customerPartyBranchDTOResult = govOrgOpenFeignClient.getPartyBranchById(partyBranchId); + if (!customerPartyBranchDTOResult.success() || null == customerPartyBranchDTOResult.getData()) { + logger.error(String.format("党支部详情信息查询异常,partyBranchId=%s", partyBranchId)); + return partyBranchInfo; + } + partyBranchInfo.setPartyBranchId(partyBranchId); + partyBranchInfo.setPartyBranchName(customerPartyBranchDTOResult.getData().getPartyBranchName()); + partyBranchInfo.setProfile(customerPartyBranchDTOResult.getData().getProfile()); + partyBranchInfo.setGridId(customerPartyBranchDTOResult.getData().getGridId()); + Result gridInfoResult = govOrgOpenFeignClient.queryGridInfo(customerPartyBranchDTOResult.getData().getGridId()); + if (gridInfoResult.success() && null != gridInfoResult.getData() && StringUtils.isNotBlank(gridInfoResult.getData().getParentAgencyName())) { + partyBranchInfo.setGridName(String.format("%s-%s", gridInfoResult.getData().getParentAgencyName(), gridInfoResult.getData().getGridName())); + } else { + logger.error(String.format("查询网格基本信息失败,gridId=%s", customerPartyBranchDTOResult.getData().getGridId())); + } + return partyBranchInfo; + } + + @Override + public List listPartyMember(String partyBranchId) { + Result> result = resiPartyMemberOpenFeignClient.listPartyMemberBaseInfo(partyBranchId); + if (result.success()) { + List list = ConvertUtils.sourceToTarget(result.getData(), PartyMemberInfoResultDTO.class); + return list; + } + logger.error("党员列表查询失败"); + return new ArrayList<>(); + } + + @Override + public String addPartyMember(SaveOrUpdateParyMemberFormDTO formDTO) { + //1、查询党支部信息 + Result customerPartyBranchResult = govOrgOpenFeignClient.getPartyBranchById(formDTO.getPartyBranchId()); + if (!customerPartyBranchResult.success() || null == customerPartyBranchResult.getData()) { + throw new RenException("党支部信息获取失败"); + } + //2、构造党员入参 + CustomerPartyBranchDTO customerPartyBranch = customerPartyBranchResult.getData(); + PartyMemberBaseInfoAddFormDTO partyMemberBaseInfoAddFormDTO = this.getPartyMemberBaseInfoAddFormDTO(formDTO, customerPartyBranch); + Result result = resiPartyMemberOpenFeignClient.addPartyMemberBaseInfo(partyMemberBaseInfoAddFormDTO); + //3、党支部总人数+1 + if (result.success() && StringUtils.isNotBlank(result.getData())) { + //党支部总人数+1 + customerPartyBranch.setTotalPartyMember(customerPartyBranch.getTotalPartyMember() + 1); + Result updatePartyBranchResult = govOrgOpenFeignClient.updatePartyBranch(customerPartyBranch); + if (updatePartyBranchResult.success()) { + logger.info(String.format("党支部(%s)总人数+1", formDTO.getPartyBranchId())); + } + } else { + logger.error("添加党员异常"); + throw new RenException(result.getCode()); + } + return result.getData(); + } + + @Override + public String editPartyMember(SaveOrUpdateParyMemberFormDTO formDTO) { + PartymemberBaseInfoDTO partymemberBaseInfoDTO = new PartymemberBaseInfoDTO(); + partymemberBaseInfoDTO.setIdCard(formDTO.getIdCard().trim()); + partymemberBaseInfoDTO.setName(formDTO.getName().trim()); + partymemberBaseInfoDTO.setMobile(formDTO.getMobile().trim()); + partymemberBaseInfoDTO.setId(formDTO.getPartyMemberId()); + Result updateResult = resiPartyMemberOpenFeignClient.update(partymemberBaseInfoDTO); + if (updateResult.success() && StringUtils.isNotBlank(updateResult.getData())) { + logger.info("修改党员信息成功"); + return updateResult.getData(); + }else{ + logger.error("修改党员信息失败"); + throw new RenException(updateResult.getCode()); + } + } + + @Override + public PartyMemberInfoDetailResultDTO queryPartyMemberDetail(String partyMemberId) { + PartyMemberInfoDetailResultDTO partyMemberInfoDetailResultDTO=new PartyMemberInfoDetailResultDTO(); + Result partyMemberResult=resiPartyMemberOpenFeignClient.queryPartyMemberBaseInfoById(partyMemberId); + if(partyMemberResult.success()&&null!=partyMemberResult.getData()){ + partyMemberInfoDetailResultDTO=ConvertUtils.sourceToTarget(partyMemberResult.getData(),PartyMemberInfoDetailResultDTO.class); + Result partyBranchDTOResult=govOrgOpenFeignClient.getPartyBranchById(partyMemberResult.getData().getPartyBranchId()); + if(partyBranchDTOResult.success()){ + String agencyName=partyBranchDTOResult.getData().getAgencyName(); + String gridName=partyBranchDTOResult.getData().getGridName(); + String branchName=partyBranchDTOResult.getData().getPartyBranchName(); + partyMemberInfoDetailResultDTO.setPartyBranchName(String.format("%s-%s-%s",agencyName,gridName,branchName)); + return partyMemberInfoDetailResultDTO; + }else{ + logger.error("党员详情查询异常"); + } + } + return partyMemberInfoDetailResultDTO ; + } + + @Override + public void deletePartyMember(DeletePartyMemberFormDTO deletePartyMemberFormDTO) { + DelPartyMemberBaseInfoFormDTO formDTO = ConvertUtils.sourceToTarget(deletePartyMemberFormDTO, DelPartyMemberBaseInfoFormDTO.class); + Result result = resiPartyMemberOpenFeignClient.deltePartyMemberBaseInfo(formDTO); + if (!result.success()) { + throw new RenException(result.getCode()); + } + //党支部总人数-1 + Result decrResult = govOrgOpenFeignClient.decrPartyBranchMember(deletePartyMemberFormDTO.getPartyBranchId()); + if (decrResult.success()) { + logger.info("删除党员成功,党支部总人数已-1"); + } + } + + private PartyMemberBaseInfoAddFormDTO getPartyMemberBaseInfoAddFormDTO(SaveOrUpdateParyMemberFormDTO formDTO, + CustomerPartyBranchDTO customerPartyBranchDTO) { + PartyMemberBaseInfoAddFormDTO partyMemberBaseInfoAddFormDTO=new PartyMemberBaseInfoAddFormDTO(); + partyMemberBaseInfoAddFormDTO.setBranchId(formDTO.getPartyBranchId()); + partyMemberBaseInfoAddFormDTO.setIdCard(formDTO.getIdCard().trim()); + partyMemberBaseInfoAddFormDTO.setMobile(formDTO.getMobile().trim()); + partyMemberBaseInfoAddFormDTO.setName(formDTO.getName().trim()); + + partyMemberBaseInfoAddFormDTO.setBranch(customerPartyBranchDTO.getPartyBranchName()); + partyMemberBaseInfoAddFormDTO.setOrganization(customerPartyBranchDTO.getAgencyName()); + partyMemberBaseInfoAddFormDTO.setCustomerId(customerPartyBranchDTO.getCustomerId()); + return partyMemberBaseInfoAddFormDTO; + } +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml index 1df1097460..c56eefd656 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml @@ -38,6 +38,7 @@ spring: namespace: @nacos.config.namespace@ group: @nacos.config.group@ file-extension: yaml + management: endpoints: web: @@ -69,3 +70,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/gov-grid/gov-grid-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file 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-issue/gov-issue-server/deploy/docker-compose-dev.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml index ed86c62a51..06fc27b887 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.40 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.42 ports: - "8101:8101" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml index 5bde427f69..56d3dd745b 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-issue-server:0.3.40 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-issue-server:0.3.43 ports: - "8101:8101" network_mode: host # 使用现有网络 @@ -14,4 +14,4 @@ services: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 350M \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index d61947a24c..2dd11868f2 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.40 + 0.3.43 gov-issue com.epmet @@ -145,6 +145,8 @@ false + + false @@ -175,6 +177,8 @@ false + + true diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java index 2ae91874d3..268ddfbf88 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java @@ -23,14 +23,12 @@ import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.IssueConstant; import com.epmet.dto.IssueDTO; -import com.epmet.dto.IssueVoteStatisticalDTO; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.VoteRedisFormDTO; -import com.epmet.entity.IssueVoteStatisticalEntity; import com.epmet.feign.ResiGroupFeignClient; import com.epmet.service.IssueService; import com.epmet.service.IssueVoteDetailService; -import com.epmet.service.IssueVoteStatisticalService; +import com.epmet.utils.ModuleConstants; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,9 +53,6 @@ public class IssueVoteDetailRedis { @Autowired private RedisUtils redisUtils; - @Autowired - private IssueVoteStatisticalService issueVoteStatisticalService; - @Autowired private ResiGroupFeignClient resiGroupFeignClient; @@ -166,7 +161,7 @@ public class IssueVoteDetailRedis { } }else{ //如果没有该议题,终止所有操作 - logger.warn(String.format("找不到指定Id的议题,Id:【%s】",issueId)); + logger.warn(String.format(ModuleConstants.ISSUE_NOT_FOUND_EXCEPTION_TEMPLATE,issueId)); return null; } @@ -208,7 +203,7 @@ public class IssueVoteDetailRedis { set(voteCache); return voteCache; }else{ - logger.warn(String.format("找不到指定Id的议题,Id:【%s】",issueId)); + logger.warn(String.format(ModuleConstants.ISSUE_NOT_FOUND_EXCEPTION_TEMPLATE,issueId)); return null; } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index 4bb9611e45..320138bfc5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -302,7 +302,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl> entry : summaryMap.entrySet()) { IssueVoteStatisticalDTO obj = new IssueVoteStatisticalDTO(); - obj.setCreatedBy("system"); + obj.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM); obj.setIssueId(entry.getKey()); List v = entry.getValue(); if (v.size() > NumConstant.ONE) { @@ -338,7 +338,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl v = entry.getValue(); for(IssueDTO issue : v){ - //TODO 待删除 - Integer a = issueVoteDetailService.getVotingCount(issue.getId(),IssueConstant.SUPPORT); - //TODO 待删除 - Integer b = issueVoteDetailService.getVotingCount(issue.getId(),IssueConstant.OPPOSE); IssueVoteStatisticalDTO vote = new IssueVoteStatisticalDTO(); vote.setIssueId(issue.getId()); @@ -479,31 +475,22 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl - 0.3.25 + 0.3.29 com.epmet gov-mine diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java index d3ea928230..fadab52ce9 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovAccessFeignClient.java @@ -2,19 +2,12 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.OperationScopeDTO; import com.epmet.dto.form.ListOpePermsFormDTO; -import com.epmet.dto.form.OperationScopeFormDTO; -import com.epmet.dto.form.StaffPermCacheFormDTO; -import com.epmet.dto.result.RoleOpeScopeResultDTO; -import com.epmet.dto.result.RoleOperationResultDTO; import com.epmet.feign.fallback.GovAccessFeignClientFallback; 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; import java.util.Set; /** @@ -25,37 +18,6 @@ import java.util.Set; @FeignClient(name = ServiceConstant.GOV_ACCESS_SERVER, fallback = GovAccessFeignClientFallback.class) public interface GovAccessFeignClient { - /** - * 根据角色ID查询角色权限列表 - * @param roleId - * @return - */ - @PostMapping("/gov/access/role/operations/{roleId}") - Result> listOperationsByRoleId(@PathVariable("roleId") String roleId); - - /** - * 刷新用户权限缓存 - * @param staffPermCacheFormDTO - * @return - */ - @PostMapping("/gov/access/access/updatepermissioncache") - Result updatePermissionCache(@RequestBody StaffPermCacheFormDTO staffPermCacheFormDTO); - - /** - * 查询角色的操作key对应操作范围列表 - * @param operationScopeFormDTO - * @return - */ - @PostMapping("/gov/access/access/operationscopes") - Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO); - - /** - * 查询角色所有operation及其范围(缓存) - * @return - */ - @PostMapping("/gov/access/access/roleallopesandscopes/{roleId}") - Result> listRoleAllOperationScopesByRoleId(@PathVariable("roleId") String roleId); - /** * 列出觉得的功能权限列表 * @return diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java index 36ed3ae74f..1f9b0aaa2e 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovAccessFeignClientFallback.java @@ -3,17 +3,9 @@ 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.OperationScopeDTO; import com.epmet.dto.form.ListOpePermsFormDTO; -import com.epmet.dto.form.OperationScopeFormDTO; -import com.epmet.dto.form.StaffPermCacheFormDTO; -import com.epmet.dto.result.RoleOpeScopeResultDTO; -import com.epmet.dto.result.RoleOperationResultDTO; import com.epmet.feign.GovAccessFeignClient; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; import java.util.Set; /** @@ -23,31 +15,6 @@ import java.util.Set; @Component public class GovAccessFeignClientFallback implements GovAccessFeignClient { - @Override - public Result> listOperationsByRoleId(String roleId) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listOperationsByRoleId"); - } - - /** - * 刷新用户权限缓存 - * @param staffPermCacheFormDTO - * @return - */ - @Override - public Result updatePermissionCache(@RequestBody StaffPermCacheFormDTO staffPermCacheFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "updatePermissionCache"); - } - - @Override - public Result> getOperationScopesByRoleId(OperationScopeFormDTO operationScopeFormDTO) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "getOperationScopesByRoleId", operationScopeFormDTO); - } - - @Override - public Result> listRoleAllOperationScopesByRoleId(String roleId) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listRoleAllOperationScopesByRoleId", roleId); - } - @Override public Result> listOperationPermissions(ListOpePermsFormDTO listOpePermsFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ACCESS_SERVER, "listOperationPermissions", listOpePermsFormDTO); diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java index 5f7926415b..d53204f039 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/AccessServiceImpl.java @@ -27,6 +27,7 @@ public class AccessServiceImpl implements AccessService { ListOpePermsFormDTO listOpePermsFormDTO = new ListOpePermsFormDTO(); listOpePermsFormDTO.setStaffId(staffId); listOpePermsFormDTO.setCurrAgencyId(currAgencyId); + listOpePermsFormDTO.setCurrGridId(currGridId); Result> result = govAccessFeignClient.listOperationPermissions(listOpePermsFormDTO); if (!result.success()) { logger.error("调用GovAccess服务查询功能权限列表失败,StaffId:{},错误信息:{}", staffId, result.getMsg()); 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/CustomerPartyBranchDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerPartyBranchDTO.java new file mode 100644 index 0000000000..c396f90605 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerPartyBranchDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class CustomerPartyBranchDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 概要 + */ + private String profile; + + /** + * 党支部所属网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 党员总数 + */ + private Integer totalPartyMember; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属机关id + */ + private String agencyId; + + /** + * 网格所属机关名字 + */ + private String agencyName; +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListPartyBranchFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListPartyBranchFormDTO.java new file mode 100644 index 0000000000..ede50112e5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListPartyBranchFormDTO.java @@ -0,0 +1,29 @@ +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/17 16:27 + */ +@Data +public class ListPartyBranchFormDTO implements Serializable { + private static final long serialVersionUID = -5693132528876149747L; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空") + private String gridId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateTagFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateTagFormDTO.java new file mode 100644 index 0000000000..d2000b366f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateTagFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/4 15:12 + */ +@Data +public class UpdateTagFormDTO implements Serializable { + + private static final long serialVersionUID = 1686362744399106982L; + + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount = 1; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateTagUseCountsFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateTagUseCountsFormDTO.java new file mode 100644 index 0000000000..be0e75573e --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateTagUseCountsFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/4 15:12 + */ +@Data +public class UpdateTagUseCountsFormDTO implements Serializable { + + private static final long serialVersionUID = 1686362744399106982L; + + /** + * 标签id + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; +} 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/ArticleAgencyGridListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleAgencyGridListResultDTO.java new file mode 100644 index 0000000000..dd84877e56 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ArticleAgencyGridListResultDTO.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.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + * 党建声音-可选发布范围、可下线网格列表-接口返参 + * + * @author sun + */ +@Data +public class ArticleAgencyGridListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 树结构对象 + */ + private ArticleGridResultDTO agencyGridList; + +} \ 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/GridInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java index fff7b43caf..83bf82bfbf 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java @@ -77,5 +77,15 @@ public class GridInfoResultDTO implements Serializable { * 省级组织名称 */ private String proviceName; + + /** + * 网格所属机关id + */ + private String parentAgencyId; + + /** + * 网格所属机关名称 + */ + private String parentAgencyName; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java index 8a5249c6ae..3c96aa6df6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java @@ -21,9 +21,15 @@ public class LatestCustomerResultDTO implements Serializable { */ private String customerName; /** - * 用户所属组织id(任意一条) + * 用户所属组织id */ private String agencyId; + + /** + * 用户所属组织名称 + */ + private String agencyName; + /** * 工作人员头像 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ListPartyBranchResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ListPartyBranchResultDTO.java new file mode 100644 index 0000000000..b5d7e6cbce --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ListPartyBranchResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党支部列表查询返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 16:30 + */ +@Data +public class ListPartyBranchResultDTO implements Serializable { + private static final long serialVersionUID = 2306892144298853581L; + /** + * 支部id + */ + private String partyBranchId; + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 党员总数 + */ + private Integer totalPartyMember; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java index f19eb67cea..241f2eb44f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java @@ -40,4 +40,14 @@ public class MineResultDTO implements Serializable { * 角色 */ private List roleList; + + /** + * 我所属的机关id + */ + private String agencyId; + + /** + * 我所属的机关名称 + */ + private String myAgencyName; } 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 new file mode 100644 index 0000000000..99bccaa484 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -0,0 +1,134 @@ +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.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; +import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 本服务对外开放的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); + + /** + * @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); + + /** + * @param customerPartyBranchDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 添加党支部 + * @Date 2020/6/17 13:36 + **/ + @PostMapping(value = "gov/org/customerpartybranch/save", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result savePartyBranch(@RequestBody CustomerPartyBranchDTO customerPartyBranchDTO); + + /** + * @param customerPartyBranchDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 修改党支部信息 + * @Date 2020/6/17 15:31 + **/ + @PutMapping(value = "gov/org/customerpartybranch/update", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result updatePartyBranch(@RequestBody CustomerPartyBranchDTO customerPartyBranchDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 根据客户id、网格id查询党支部列表 + * @Date 2020/6/17 16:28 + **/ + @PostMapping(value = "gov/org/customerpartybranch/listpartybranch", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> listPartyBranch(@RequestBody ListPartyBranchFormDTO formDTO); + + /** + * @param partyBranchId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 根据党支部id,查询党支部信息 + * @Date 2020/6/17 18:01 + **/ + @GetMapping(value = "gov/org/customerpartybranch/get/{id}") + Result getPartyBranchById(@PathVariable("id") String partyBranchId); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param partyBranchId + * @author yinzuomei + * @description 根据党支部id,删除党支部(存在党员的不允许删除) + * @Date 2020/6/17 18:08 + **/ + @GetMapping(value = "gov/org/customerpartybranch/delete/{id}") + Result deletePartyBranchById(@PathVariable("id") String partyBranchId); + + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 23:16 + **/ + @GetMapping("/gov/org/customergrid/getGridInfo/{gridId}") + Result queryGridInfo(@PathVariable("gridId") String gridId); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param partyBranchId + * @author yinzuomei + * @description 党支部宗人数-1 + * @Date 2020/6/18 18:28 + **/ + @GetMapping(value = "gov/org/customerpartybranch/decrPartyBranchMember/{partyBranchId}") + Result decrPartyBranchMember(@PathVariable("partyBranchId") String partyBranchId); +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java new file mode 100644 index 0000000000..bcc224dd86 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -0,0 +1,80 @@ +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.CustomerAgencyDTO; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.dto.result.PublishAgencyListResultDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 本服务对外开放的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); + } + + @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); + } + + @Override + public Result savePartyBranch(CustomerPartyBranchDTO customerPartyBranchDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "save", customerPartyBranchDTO); + } + + @Override + public Result updatePartyBranch(CustomerPartyBranchDTO customerPartyBranchDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "update", customerPartyBranchDTO); + } + + @Override + public Result> listPartyBranch(ListPartyBranchFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "listpartybranch", formDTO); + } + + @Override + public Result getPartyBranchById(String partyBranchId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "get", partyBranchId); + } + + @Override + public Result deletePartyBranchById(String partyBranchId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "deleteById", partyBranchId); + } + + @Override + public Result queryGridInfo(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo",gridId); + } + + @Override + public Result decrPartyBranchMember(String partyBranchId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "decrPartyBranchMember",partyBranchId); + } +} diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml index 3b6850d1e3..03baf78da2 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.58 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.69 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml index 098f3f694a..777d8bafbb 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.57 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.69 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index b012a0a9d2..bab4db384b 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.58 + 0.3.69 com.epmet gov-org @@ -140,6 +140,8 @@ false + + false @@ -170,6 +172,9 @@ false + + + true 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/controller/CustomerPartyBranchController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java new file mode 100644 index 0000000000..04ebd8e0a0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java @@ -0,0 +1,132 @@ +/** + * 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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +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.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.excel.CustomerPartyBranchExcel; +import com.epmet.service.CustomerPartyBranchService; +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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@RestController +@RequestMapping("customerpartybranch") +public class CustomerPartyBranchController { + + @Autowired + private CustomerPartyBranchService customerPartyBranchService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerPartyBranchService.page(params); + return new Result>().ok(page); + } + + @GetMapping("get/{id}") + public Result get(@PathVariable("id") String id){ + CustomerPartyBranchDTO data = customerPartyBranchService.get(id); + return new Result().ok(data); + } + + @PostMapping("save") + public Result save(@RequestBody CustomerPartyBranchDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return new Result().ok(customerPartyBranchService.save(dto)); + } + + @PutMapping("update") + public Result update(@RequestBody CustomerPartyBranchDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerPartyBranchService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerPartyBranchService.delete(ids); + return new Result(); + } + + @GetMapping("delete/{id}") + public Result deleteById(@PathVariable("id") String id){ + CustomerPartyBranchDTO data = customerPartyBranchService.get(id); + if(null!=data&&data.getTotalPartyMember()>0){ + throw new RenException(EpmetErrorCode.CANNOT_DELETE_PARTY_BRANCH.getCode()); + } + customerPartyBranchService.deleteById(id); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerPartyBranchService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerPartyBranchExcel.class); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 党支部列表查询,供gov-grid服务调用 + * @Date 2020/6/17 16:33 + **/ + @PostMapping("listpartybranch") + public Result> listpartybranch(@RequestBody ListPartyBranchFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerPartyBranchService.listpartybranch(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param partyBranchId + * @author yinzuomei + * @description 党支部人数-1 + * @Date 2020/6/18 18:31 + **/ + @GetMapping("decrPartyBranchMember/{partyBranchId}") + public Result decrPartyBranchMember(@PathVariable("partyBranchId") String partyBranchId){ + customerPartyBranchService.decrPartyBranchMember(partyBranchId); + return new Result(); + } +} \ 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/CustomerPartyBranchDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerPartyBranchDao.java new file mode 100644 index 0000000000..007af50fde --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerPartyBranchDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.entity.CustomerPartyBranchEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface CustomerPartyBranchDao extends BaseDao { + //根据客户id、网格id查询党支部列表 + List selectListPartyBranchResultDTO(ListPartyBranchFormDTO formDTO); + + //党支部人数-1 + int decrPartyBranchMember(String partyBranchId); +} \ 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/entity/CustomerPartyBranchEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerPartyBranchEntity.java new file mode 100644 index 0000000000..98610e75f7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerPartyBranchEntity.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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_party_branch") +public class CustomerPartyBranchEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 概要 + */ + private String profile; + + /** + * 党支部所属网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 党员总数 + */ + private Integer totalPartyMember; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerPartyBranchExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerPartyBranchExcel.java new file mode 100644 index 0000000000..7766ed1260 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerPartyBranchExcel.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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class CustomerPartyBranchExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "支部名称") + private String partyBranchName; + + @Excel(name = "概要") + private String profile; + + @Excel(name = "党支部所属网格id") + private String gridId; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "党员总数") + private Integer totalPartymember; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java index 0c2ed5e9aa..80cc342c73 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerAgencyRedis.java @@ -42,6 +42,11 @@ public class CustomerAgencyRedis { } + public void delete(String agencyId) { + String key = RedisKeys.getAgencyByIdKey(agencyId); + redisUtils.delete(key); + } + public void set(String agencyId, CustomerAgencyDTO value){ String key = RedisKeys.getAgencyByIdKey(agencyId); Map map = BeanUtil.beanToMap(value, false, true); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java new file mode 100644 index 0000000000..e5d8d70e5e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Component +public class CustomerPartyBranchRedis { + @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-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/CustomerPartyBranchService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java new file mode 100644 index 0000000000..e373bcb0f1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.entity.CustomerPartyBranchEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface CustomerPartyBranchService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerPartyBranchDTO + * @author generator + * @date 2020-06-17 + */ + CustomerPartyBranchDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + String save(CustomerPartyBranchDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(CustomerPartyBranchDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 党支部列表查询,供gov-grid服务调用 + * @Date 2020/6/17 16:33 + **/ + List listpartybranch(ListPartyBranchFormDTO formDTO); + + /** + * @return void + * @param partyBranchId + * @author yinzuomei + * @description 党支部人数-1 + * @Date 2020/6/18 18:31 + **/ + void decrPartyBranchMember(String partyBranchId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 37439b5275..498aa11b62 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -151,6 +151,9 @@ public class AgencyServiceImpl implements AgencyService { log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); } + + //5.redis缓存 + customerAgencyRedis.delete(formDTO.getAgencyId()); return result; } 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..23b07f5b93 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,7 @@ 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.OperCrmFeignClient; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; @@ -75,6 +76,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -628,4 +631,184 @@ 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()); + //当前机关信息 + returnDTO.setAgencyId(agencyEntity.getId()); + returnDTO.setAgencyName(agencyEntity.getOrganizationName()); + returnDTO.setPid(agencyEntity.getPid()); + returnDTO.setPids(agencyEntity.getPids()); + returnDTO.setAllParentName(agencyEntity.getAllParentName()); + if (party) { + //4.1:查询当前机关的网格列表以及所有下级机关的网格列表 + //当前机关下网格列表 + List gridList = customerGridDao.selectAgencyGridList(agencyEntity.getId()); + returnDTO.setGridList(gridList); + //递归查询当前组织的下级组织以及每个下级组织对应的网格列表 + //根组织pids为空 + List subAgencyGridList = getGridList(("".equals(agencyEntity.getPids())?"":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 || 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/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index bcc4ecf11c..00436e9b59 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -27,7 +27,6 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerGridConstant; import com.epmet.dao.CustomerAgencyDao; @@ -452,6 +451,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.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.CustomerPartyBranchDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.entity.CustomerPartyBranchEntity; +import com.epmet.redis.CustomerPartyBranchRedis; +import com.epmet.service.CustomerAgencyService; +import com.epmet.service.CustomerGridService; +import com.epmet.service.CustomerPartyBranchService; +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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class CustomerPartyBranchServiceImpl extends BaseServiceImpl implements CustomerPartyBranchService { + + @Autowired + private CustomerPartyBranchRedis customerPartyBranchRedis; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private CustomerAgencyService customerAgencyService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerPartyBranchDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerPartyBranchDTO.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 CustomerPartyBranchDTO get(String id) { + CustomerPartyBranchEntity entity = baseDao.selectById(id); + CustomerPartyBranchDTO customerPartyBranchDTO=ConvertUtils.sourceToTarget(entity, CustomerPartyBranchDTO.class); + if(null!=customerPartyBranchDTO){ + CustomerGridDTO customerGridDTO=customerGridService.get(entity.getGridId()); + if(null!=customerGridDTO){ + customerPartyBranchDTO.setGridName(customerGridDTO.getGridName()); + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(customerGridDTO.getPid()); + if(null!=customerAgencyDTO){ + customerPartyBranchDTO.setAgencyId(customerAgencyDTO.getId()); + customerPartyBranchDTO.setAgencyName(customerAgencyDTO.getOrganizationName()); + } + } + } + return customerPartyBranchDTO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String save(CustomerPartyBranchDTO dto) { + CustomerPartyBranchEntity entity = ConvertUtils.sourceToTarget(dto, CustomerPartyBranchEntity.class); + insert(entity); + return entity.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerPartyBranchDTO dto) { + CustomerPartyBranchEntity entity = ConvertUtils.sourceToTarget(dto, CustomerPartyBranchEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listpartybranch(ListPartyBranchFormDTO formDTO) { + return baseDao.selectListPartyBranchResultDTO(formDTO); + } + + @Override + public void decrPartyBranchMember(String partyBranchId) { + baseDao.decrPartyBranchMember(partyBranchId); + } + +} \ 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..ba90138f12 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; @@ -131,6 +131,11 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl + + \ 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/CustomerPartyBranchDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerPartyBranchDao.xml new file mode 100644 index 0000000000..e9e1f1d17b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerPartyBranchDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE customer_party_branch + SET TOTAL_PARTY_MEMBER = TOTAL_PARTY_MEMBER - 1 + WHERE + id = #{partyBranchId} + AND DEL_FLAG = '0' + + \ 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/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index d932cd9d9a..48cd31c6f1 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.23 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.27 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml index fbd2484274..16ec28dfbb 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-project-server:0.3.23 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-project-server:0.3.28 ports: - "8102:8102" network_mode: host # 使用现有网络 @@ -14,4 +14,4 @@ services: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 350M \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 71bae60b6a..382580cd85 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.23 + 0.3.28 gov-project com.epmet @@ -145,6 +145,8 @@ false + + false @@ -175,6 +177,8 @@ false + + true 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-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index ae86146eac..d6aeb50289 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -27,6 +27,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -93,3 +102,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db.migration/epmet_gov_project.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/epmet_gov_project.sql similarity index 100% rename from epmet-module/gov-project/gov-project-server/src/main/resources/db.migration/epmet_gov_project.sql rename to epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/epmet_gov_project.sql diff --git a/epmet-module/gov-voice/gov-voice-client/pom.xml b/epmet-module/gov-voice/gov-voice-client/pom.xml new file mode 100644 index 0000000000..76d0961176 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/pom.xml @@ -0,0 +1,41 @@ + + + + gov-voice + com.epmet + 2.0.0 + + 4.0.0 + + gov-voice-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + com.epmet + resi-partymember-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + \ No newline at end of file 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/AddArticleTagsFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddArticleTagsFormDTO.java new file mode 100644 index 0000000000..da5f4c1504 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddArticleTagsFormDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/6/5 17:36 + */ +@Data +public class AddArticleTagsFormDTO implements Serializable { + + private static final long serialVersionUID = -6009661699565102279L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; +} 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..6d4b81cc2a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftAttrFromDTO.java @@ -0,0 +1,88 @@ +/** + * 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.NotEmpty; +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数组 + */ + @NotEmpty(message = "发布范围不能为空") + private List gridIdList; + + /** + * 发布单位Id 类型不同 id含义不同 + */ + @NotBlank(message = "发布单位不能为空") + 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..7df78525c0 --- /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 org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +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 = -5699594328218833256L; + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + @NotBlank(message = "请输入标题") + @Length(max = 50, message = "标题最长为50个字") + private String title; + + /** + * 内容列表 + */ + @NotEmpty(message = "至少添加一个段落") + @Valid + private List contentList; + + @Data + public static class DraftContentDTO { + public DraftContentDTO() { + } + + /** + * 内容Id + */ + private String draftContentId; + /** + * 内容 + */ + @Length(max = 1000, message = "每段文字最长为1000个字") + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + } +} \ 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/InitTagFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/InitTagFormDTO.java new file mode 100644 index 0000000000..c8517f896d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/InitTagFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * desc:初始化/重新加载标签数据到数据库 + */ +@Data +public class InitTagFormDTO implements Serializable { + private static final long serialVersionUID = -4982447946629101341L; + /** + * 客户列表 list,非必填,如果不填则初始化或重新加载所有客户 + */ + private List customerIdList; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/InitTagsFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/InitTagsFormDTO.java new file mode 100644 index 0000000000..ded8bc1f43 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/InitTagsFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/6/8 14:39 + */ +@Data +public class InitTagsFormDTO implements Serializable { + + private static final long serialVersionUID = 5507978729190322412L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount = 0; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "default"; + + /** + * 更新人 + */ + private String updatedBy = "default"; +} 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/PublishArticleFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishArticleFormDTO.java new file mode 100644 index 0000000000..4aff23c34e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishArticleFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端-发布文章参数 + */ +@Data +public class PublishArticleFormDTO implements Serializable { + + private static final long serialVersionUID = -1659776209159063672L; + /** + * 要发布的草稿Id + */ + private String draftId; + +} 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/form/UpdateGridTagsFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateGridTagsFormDTO.java new file mode 100644 index 0000000000..aac40d8a43 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/UpdateGridTagsFormDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/5 10:20 + */ +@Data +public class UpdateGridTagsFormDTO implements Serializable { + + private static final long serialVersionUID = 2876626163349728237L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount = 1; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + +} 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/DraftContentSaveResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentSaveResultDTO.java new file mode 100644 index 0000000000..dadde8373d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentSaveResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 政府端:保存文章内容 返回结果 + */ +@Data +public class DraftContentSaveResultDTO implements Serializable { + public DraftContentSaveResultDTO() { + super(); + } + public DraftContentSaveResultDTO(String draftId) { + this.draftId = draftId; + } + + /** + *草稿Id + */ + private String draftId; +} 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..5ca995d10e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleDetailResultDTO.java @@ -0,0 +1,81 @@ +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/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; + + /** + * 标签字符串-已废弃,不会返给前端 + */ + @JsonIgnore + private String tags; + + /** + * 文章关联标签集合 + */ + private String[] tagNameList; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 草稿Id,重新编辑时使用 + */ + private String draftId; + + /** + * 内容列表 + */ + private List articleContentList; + + /** + * true是我发布的,false不是我发布的 + */ + private Boolean isMePublished; +} 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..c566028269 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @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; + /** + * 文章标签串 + */ + @JsonIgnore + private String tags; + /** + * 文章标签列表 + */ + private List tagNameList; + /** + * 概要内容 + */ + 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/dto/result/UpdateCustomerTagCacheDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/UpdateCustomerTagCacheDTO.java new file mode 100644 index 0000000000..03407c7493 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/UpdateCustomerTagCacheDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/5 9:54 + */ +@Data +public class UpdateCustomerTagCacheDTO implements Serializable { + + private static final long serialVersionUID = -5544311005334312224L; + + /** + * 客户id + */ + private String customerId; + + /** + * 标签信息集合 + */ + private List tagsInfo; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/UpdateGridTagCacheDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/UpdateGridTagCacheDTO.java new file mode 100644 index 0000000000..8e1a8beb95 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/UpdateGridTagCacheDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/5 10:49 + */ +@Data +public class UpdateGridTagCacheDTO implements Serializable { + + private static final long serialVersionUID = 367220409651119904L; + + /** + * 网格id + */ + private String gridId; + + /** + * 标签集合 + * tagId、tagName + */ + private List tagsInfo; +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/UpdateTagUseCountsResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/UpdateTagUseCountsResultDTO.java new file mode 100644 index 0000000000..fba5e29854 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/UpdateTagUseCountsResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/4 17:20 + */ +@Data +public class UpdateTagUseCountsResultDTO implements Serializable { + + private static final long serialVersionUID = -6331586672885417576L; + + public UpdateTagUseCountsResultDTO() { + super(); + } + + public UpdateTagUseCountsResultDTO(String tagId, String tagName) { + this.tagId = tagId; + this.tagName = tagName; + } + + /** + * 标签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/Dockerfile b/epmet-module/gov-voice/gov-voice-server/Dockerfile new file mode 100644 index 0000000000..915e6100bc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8105 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/README.md b/epmet-module/gov-voice/gov-voice-server/README.md new file mode 100644 index 0000000000..0d08501df5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/README.md @@ -0,0 +1,6 @@ +## epmet-cloud + +客户(网格)标签如果redis中需要重新加载数据到redis +执行以下命令: +参数:customerIdList 数组 非必填;不填则刷新全部客户 +curl -H "Content-Type:application/json" -X POST --data '{"customerIdList": ["客户ID"]}' http://localhost:8105/gov/voice/tag/inittag diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..c716cc0239 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + gov-voice-server: + container_name: gov-voice-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.57 + ports: + - "8105:8105" + 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: 250M \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..464e41c8e3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + gov-voice-server: + container_name: gov-voice-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.57 + ports: + - "8105:8105" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 350M \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml new file mode 100644 index 0000000000..91548839b7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -0,0 +1,176 @@ + + + 4.0.0 + 0.3.57 + + gov-voice + com.epmet + 2.0.0 + + + gov-voice-server + jar + + + + com.epmet + 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 + 2.0.0 + + + com.epmet + epmet-message-client + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + 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 + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + com.epmet + gov-org-client + 2.0.0 + compile + + + + + ${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 + + + 8105 + dev + + + + + + epmet_gov_voice_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + false + https://epmet-dev.elinkservice.cn/epmetscan/api + + + + test + + + 8105 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + https://epmet-dev.elinkservice.cn/epmetscan/api + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java new file mode 100644 index 0000000000..db1073c8e8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/GovVoiceApplication.java @@ -0,0 +1,22 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableAsync; + +/** + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +@EnableAsync +public class GovVoiceApplication { + public static void main(String[] args) { + SpringApplication.run(GovVoiceApplication.class, args); + } +} 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/config/ModuleConfigImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..c34e594e11 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "govvoice"; + } +} 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..f90304f477 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java @@ -0,0 +1,59 @@ +/** + * 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_ALL_ARTICLE_MSG = "%s-%s下线文章【%s】"; + /** + * 下线文章操作记录表文案-部分下线 + */ + String OFF_LINE_ARTICLE_MSG = "%s-%s下线部分网格文章【%s】,下线网格:%s"; + + /** + * 发布文章操作记录表文案 + */ + String PUBLISH_ARTICLE_MSG = "%s-%s发布文章【%s】"; + /** + * 查询文章基本信息失败 + */ + String SELECT_ARTICLE_EXCEPTION = "获取文章信息失败"; + /** + * 操作权限异常-自己发表的文章只有自己才能下线 + */ + String SHIRO_EXCEPTION = "当前人员不是文章发布者,不能下线文章"; +} 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..6ee205ec7d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java @@ -0,0 +1,79 @@ +/** + * 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"; + + /** + * 审核失败:auditfail + */ + String AUDITFAIL = "auditfail"; + + //是否置顶 + /** + * 置顶:1 + */ + Integer TOP = 1; + + /** + * 不置顶:0 + */ + Integer UN_TOP = 0; + /** + * 组织 + */ + String AGENCY = "agency"; + /** + * 部门 + */ + String DEPARTMENT = "department"; + /** + * 网格 + */ + String GRID = "grid"; + /** + * 内容类型-图片 + */ + String IMG = "img"; + /** + * 内容类型-文字 + */ + String TEXT = "text"; + + /** + * 草稿预览内容大小长度 + */ + Integer PREVIEW_CONTENT_MAX_LENGTH = 50; + + /** + * 草稿预览内容超过50 添加... + */ + String PREVIEW_CONTENT_MORE = "..."; +} 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..f2de457976 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/TagConstant.java @@ -0,0 +1,55 @@ +/** + * 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】 + * 完整key:GRID_TAG_KEY:客户ID + *//* + String GOV_TAG_KEY = "epmet:tags:customer:rankingTag:"; + + *//** + * 客户维度(政府端) 关联标签 key的前缀 【set】 + * 完整key:GRID_TAG_KEY:标签ID + *//* + String GOV_RETAG_KEY = "epmet:tags:customer:relationTag:"; + + *//** + * 网格热度标签(居民端) key的前缀 【zset】 + * 完整key:GRID_TAG_KEY:网格ID + *//* + String GRID_TAG_KEY = "epmet:tags:grid:rankingTag:"; + + *//** + * 网格关联标签(居民端) key的前缀 【set】 + * 完整key:GRID_RETAG_KEY:网格ID:标签ID + *//* + String GRID_RETAG_KEY ="epmet:tags:grid:relationTag:"; + + *//** + * 冒号 + *//* + String COLON = ":";*/ + + String BEGIN_UPDATE = "开始更新标签缓存... ..."; + String SUCCESS_UPDATE = "更新标签缓存成功... ..."; + String FAILURE_UPDATE = "更新标签缓存失败... ..."; + + String SELECT_GRIDIDLIST_FAILURE = "查询gridId集合数量为0"; + + + +} 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..b22716bc16 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -0,0 +1,359 @@ +/** + * 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.scan.result.SyncScanResult; +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.commons.tools.validator.group.DefaultGroup; +import com.epmet.constant.DraftConstant; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.service.ArticleOperateRecordService; +import com.epmet.service.ArticleService; +import com.epmet.service.DraftService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Slf4j +@RestController +@RequestMapping("article") +public class ArticleController { + + @Autowired + private ArticleService articleService; + @Autowired + private ArticleOperateRecordService articleOperateRecordService; + @Autowired + private DraftService draftService; + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @PostMapping("agencygridlist") + public Result agencyGridList(@LoginUser TokenDto tokenDTO) { + ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); + agencyGridList.setAgencyGridList(articleService.agencyGridList(tokenDTO)); + return new Result().ok(agencyGridList); + } + + /** + * desc:政府端-点击返回按钮时,点击保存草稿 无需校验参数 + * @param fromDTO + * @throws Exception + */ + @PostMapping("savedraft") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result savedraft(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { + DraftContentSaveResultDTO draftDTO = articleService.saveDraft(tokenDto, fromDTO); + return new Result().ok(draftDTO); + } + + /** + * desc:保存或修改草稿内容 + * @param fromDTO + * @throws Exception + */ + @PostMapping("savecontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { + DraftContentSaveResultDTO resultDTO = articleService.saveOrUpdateContent(tokenDto, fromDTO, true); + return new Result().ok(resultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei@elink-cn.com + * @description 政府端:查询文章操作记录 + * @date 2020/6/2 16:50 + **/ + @PostMapping("oprationlist") + 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") + 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") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE) + 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 + */ + @PostMapping("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); + return new Result().ok(isSuccess); + } + + /** + * desc:预览保存草稿属性 + * @param fromDTO + * @throws Exception + */ + @PostMapping("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 formDTO + * @throws Exception + */ + @PostMapping("publish") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { + Boolean isSuccess = articleService.publish(tokenDto, formDTO.getDraftId()); + if (isSuccess) { + scanContent(tokenDto, formDTO.getDraftId()); + } + return new Result().ok(isSuccess); + } + + @Async + public void scanContent(TokenDto tokenDto,String draftId){ + try { + SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId); + if (syncScanResult == null) { + log.error("scanContent draftId:{} return result null", draftId); + } + + if (syncScanResult.isAllPass()) { + articleService.scanAllPassPublishArticle(tokenDto, draftId, syncScanResult); + } else { + articleService.updateAuditStatusFailById(draftId, syncScanResult); + } + } catch (Exception e) { + articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); + log.error("scanContent exception draftId:{} return result null", e); + } + } + + + /** + * 已发布文章列表 + * @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); + List list = articleService.publishedArticleList(tokenDto, formDTO).getList(); + return new Result>().ok(list); + } + + + /** + * 已下线文章列表 + * @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); + List list = articleService.offlineList(tokenDto, formDTO).getList(); + return new Result >().ok(list); + } + /** + * @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); + ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); + agencyGridList.setAgencyGridList(articleService.publishGridList(formDTO)); + return new Result().ok(agencyGridList); + } + + + /** + * @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/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java new file mode 100644 index 0000000000..2a9837723f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -0,0 +1,73 @@ +/** + * 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.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftListFormDTO; +import com.epmet.dto.result.DraftListResultDTO; +import com.epmet.service.DraftService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 草稿表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@RestController +@RequestMapping("draft") +public class DraftController { + + @Autowired + private DraftService draftService; + + /** + * @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, @RequestBody DraftListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(draftService.draftList(tokenDto, formDTO).getList()); + } +} \ 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..bd2603685b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/TagController.java @@ -0,0 +1,84 @@ +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.CorrelationTagListFormDTO; +import com.epmet.dto.form.InitTagFormDTO; +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)); + } + + /** + * desc:初始化/重新加载 db标签到redis + * @param formDto + * @return + */ + @PostMapping("inittag") + public Result initTag(@RequestBody InitTagFormDTO formDto){ + return new Result().ok(tagService.initTag(formDto)); + } + +} 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..39109fbc0b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.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.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 + * @param tagIdList + * @return java.util.List + */ + @DataFilter(tableAliases = "a", gridIdsArgName = "gridList") + List selectArticleListForAgency(@Param("customerId") String customerId, @Param("tagIdList") List tagIdList, Set gridList); + + /** + * 已发布列表---网格工作人员 + * @author zhaoqifeng + * @date 2020/6/5 16:35 + * @param customerId + * @param tagIdList + * @param gridList + * @return java.util.List + */ + List selectArticleListForGrid(@Param("customerId") String customerId, + @Param("tagIdList") List tagIdList, + @Param("gridList")Set gridList); + + /** + * 已下线文章列表 + * @author zhaoqifeng + * @date 2020/6/3 15:16 + * @param gridList + * @return java.util.List + */ + @DataFilter(tableAliases = "a", gridIdsArgName = "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); + + /** + * @Description 根据draftId获取文章id + * @param draftId + * @author zxc + */ + String getArticleIdByDraftId(@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/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..9fe5fa1614 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java @@ -0,0 +1,50 @@ +/** + * 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.ArticlePublishRangeEntity; +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 ArticlePublishRangeDao extends BaseDao { + + /** + * @param rangeEntity + * @return + * @Author sun + * @Description 根据文章Id查询发布范围数据 + **/ + List selectByArticleId(ArticlePublishRangeEntity rangeEntity); + + /** + * desc:获取网格发布的文章 用于初始化数据库标签数据到redis + * @param customerIdList + * @return + */ + List selectInitData(@Param("customerIdList") List customerIdList); +} \ 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..e6a006e166 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleTagsDao.java @@ -0,0 +1,50 @@ +/** + * 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.form.AddArticleTagsFormDTO; +import com.epmet.entity.ArticleTagsEntity; +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 ArticleTagsDao extends BaseDao { + + /** + * @Description 插入文章标签 + * @param addArticleTags + * @author zxc + */ + void addArticleTags(@Param("addArticleTags")List addArticleTags); + + /** + * desc:获取文章标签数据 用于初始化到redis + * @param customerIdList + * @return + */ + List selectInitData(@Param("customerIdList")List customerIdList); +} \ 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..12d5888c86 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftContentDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +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); + + /** + * desc:查询需要审核的内容 + * @param draftId + * @return + */ + List selectScanContentByDraftId(String draftId); + + int updateAuditStatusById(@Param("id")String id, @Param("auditStatus")String auditStatus); + + /** + * desc:根据草稿Id 物理删除内容 + * @param draftId + * @return + */ + int deleteByDraftId(@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/DraftCoverDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java new file mode 100644 index 0000000000..961d786545 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftCoverDao.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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; + +/** + * 草稿封面表 + * + * @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 + **/ + DraftCoverEntity selectByDraftId(@Param("draftId")String draftId,@Param("auditStatus")String auditStatus); + + /** + * @Description 通过草稿Id 获取未删除的草稿封面id及地址 + * @param draftId + * @return DraftCoverDTO + * @author wangc + * @date 2020.06.05 10:28 + **/ + DraftCoverDTO selectCoverIdAndUrlByDraftId(@Param("draftId")String draftId); + + int updateAuditStatusById(@Param("id")String id, @Param("auditStatus")String auditStatus); + + /** + * desc:物理删除封面 + * @param draftId + * @return + */ + int deleteByDraftId(@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/DraftDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java new file mode 100644 index 0000000000..4e6c151df4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.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.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); + + int deleteDraft(String draftId); + + int updateAuditStatusById(@Param("draftId") String draftId, @Param("statusFlag") String statusFlag); +} \ 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..c738d8631f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftPublishRangeDao.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +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); + + /** + * @Description 根据草稿id查询发布范围id集合 + * @param draftId + * @author zxc + */ + List selectGridIdByDraftId(@Param("draftId")String draftId); + + /** + * desc:物理删除发布范围 + * @param draftId + * @return + */ + int deleteByDraftId(@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..edcc5ec3b5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.InitTagsFormDTO; +import com.epmet.dto.form.UpdateTagFormDTO; +import com.epmet.entity.TagCustomerEntity; +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 TagCustomerDao extends BaseDao { + + /** + * @Description 校验此标签数据库是否存在 ? 不存在insert : 存在update useCount+1 ; 返回id + * @param formDTO + * @author zxc + */ + void upsertTagCount(UpdateTagFormDTO formDTO); + + /** + * @Description 初始化默认标签 + * @param tags + * @author zxc + */ + void initTags(@Param("tags") List tags); + + /** + * desc:获取需要初始化的客户标签 + * @param customerIdList + * @return + */ + List selectInitData(@Param("customerIdList") List customerIdList); +} \ 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..2c9ad87528 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagDefaultDao.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.entity.TagDefaultEntity; +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 TagDefaultDao extends BaseDao { + + /** + * @Description 获取默认标签 + * @param + * @author zxc + */ + List selectDefaultTags(); + +} \ 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..26c393f3ce --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagGridDao.java @@ -0,0 +1,50 @@ +/** + * 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.form.UpdateGridTagsFormDTO; +import com.epmet.entity.TagGridEntity; +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 TagGridDao extends BaseDao { + + /** + * @Description 更新网格下的标签,标签存在?使用次数+1:插入新数据 + * @param gridTags + * @author zxc + */ + void updateGridTag(@Param("gridTags") List gridTags,@Param("userId")String userId); + + /** + * desc:获取网格初始化数据 用于加载数据库数据到redis + * @param customerIdList + * @return + */ + List selectInitData(@Param("customerIdList") List customerIdList); +} \ 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..ff89979fb8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleOperateRecordEntity.java @@ -0,0 +1,75 @@ +/** + * 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; + + /** + * 网格ID,下线文章时,多个以英文:隔开 + */ + private String gridIds; + + /** + * 执行人 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/TagRedis.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java new file mode 100644 index 0000000000..c8657af1a5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/redis/TagRedis.java @@ -0,0 +1,310 @@ +/** + * 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.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +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.epmet.dto.result.UpdateTagUseCountsResultDTO; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ZSetOperations; +import org.springframework.stereotype.Component; + +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Component +public class TagRedis { + @Autowired + private RedisUtils redisUtils; + @Autowired + private RedisTemplate redisTemplate; + + private Long zAdd(String key,Set> value) { + return redisTemplate.opsForZSet().add(key,value); + } + + /** + * desc:添加或修改客户标签排行 + * @param customerId + * @param value + * @return + */ + public Long zAddCustomerTag(String customerId,Set> value){ + return this.zAdd(RedisKeys.getCustomerTagKey(customerId),value); + } + + /** + * desc:添加或修改网格标签排行 + * @param gridId + * @param value + * @return + */ + public Long zAddGridTag(String gridId,Set> value){ + return this.zAdd(RedisKeys.getGridTagKey(gridId),value); + } + + /** + * @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 = RedisKeys.getCustomerReTagKey(customerId,tagId); + keys.add(tagId); + } + String key = RedisKeys.getCustomerReTagKey(customerId,tagIdList.get(0)); + objects = redisUtils.intersect(key, keys); + }else { + // 查询关联标签数量 等于1条时 + String key = RedisKeys.getCustomerReTagKey(customerId,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)); + } +// resultList = JSONObject.parseArray(objects.toString(), CorrelationTagListResultDTO.class); + //级联标签排序 + //1.取出 zset 中的有序标签,根据级联标签,筛选有序标签 + List resultEquals = new ArrayList<>(); + if (resultList.size() > NumConstant.ZERO) { + long start = 0; + long end = -1; + String customerKey = RedisKeys.getCustomerTagKey(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 = RedisKeys.getCustomerTagKey(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)); + } +// List tagInfoResultDTOS = JSONObject.parseArray(objects.toString(), TagInfoResultDTO.class); + return result; + } + + /** + * @Description 获取标签(居民端) + * @param key == gridId + * @author zxc + */ + public List zGridRevRange(String key){ + long start = 0; + long end = -1; + String tagKey = RedisKeys.getGridTagKey(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 = RedisKeys.getGridReTagKey(gridId,tagId); + keys.add(tagId); + } + String key = RedisKeys.getGridReTagKey(gridId,tagIdList.get(0)); + objects = redisUtils.intersect(key, keys); + }else { + //当级联标签为一条时 + String key = RedisKeys.getGridReTagKey(gridId,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 gridTagKey =RedisKeys.getGridTagKey(formDto.getGridId()); + + Set> typedTuples = redisUtils.zReverseRangeWithScores(gridTagKey, 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; + } + + /** + * @Description 更新标签使用次数 + * @param key + * @param formDTO + * @author zxc + */ + public Double updateTagUseCounts(String key, Object formDTO){ + return redisUtils.zIncrementScore(key, formDTO, NumConstant.ONE); + } + + /** + * @Description 初始化缓存标签 + * @param key + * @param list + * @author zxc + */ + public void initCacheTags(String key, List list){ + redisTemplate.executePipelined(new RedisCallback() { + @Override + public List doInRedis(RedisConnection connection) throws DataAccessException { + for (Object o : list) { + connection.zIncrBy( + redisTemplate.getKeySerializer().serialize(key), + NumConstant.ZERO, + redisTemplate.getValueSerializer().serialize(o)); + } + return null; + } + }); + } + + /** + * @Description set 更新标签级联 + * @param key + * @param value + * @author zxc + */ + public void updateMoreTag(String key, Set value) { + try { + log.info(TagConstant.BEGIN_UPDATE); + redisTemplate.executePipelined((RedisCallback>) connection -> { + for (UpdateTagUseCountsResultDTO tag : value) { + connection.sAdd(redisTemplate.getKeySerializer().serialize(key),redisTemplate.getValueSerializer().serialize(tag)); + } + return null; + }); + log.info(TagConstant.SUCCESS_UPDATE); + }catch (Exception e){ + log.info(TagConstant.FAILURE_UPDATE); + throw new RenException(TagConstant.FAILURE_UPDATE); + } + } + + + +} \ 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..4a5424c8af --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -0,0 +1,209 @@ +/** + * 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.scan.result.SyncScanResult; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.ArticleEntity; + +import java.util.List; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface ArticleService extends BaseService { + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + ArticleGridResultDTO agencyGridList(TokenDto tokenDTO); + + /** + * desc:保存或修改文章内容 + * + * @param tokenDto + * @param fromDTO + * @param required + * @return + */ + DraftContentSaveResultDTO saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO, boolean required); + + /** + * 政府端:(已发布、已下线)文章详情 + * + * @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); + + /** + * desc:执行审核返回执行结果 + * @param tokenDto + * @param draftId + * @return + */ + SyncScanResult scanContent(TokenDto tokenDto, String draftId); + + /** + * desc:审核通过后 发表文章 + * @param tokenDto + * @param draftId + * @param syncScanResult + */ + void scanAllPassPublishArticle(TokenDto tokenDto, String draftId, SyncScanResult syncScanResult); + + /** + * desc:修改审核状态为失败 + * @param draftId + * @param syncScanResult + */ + void updateAuditStatusFailById(String draftId, SyncScanResult syncScanResult); + + /** + * desc:政府端点击返回时,点击保存草稿 + * @param tokenDto + * @param fromDTO + * @return + */ + DraftContentSaveResultDTO saveDraft(TokenDto tokenDto, DraftContentFromDTO fromDTO); + + /** + * desc:政府端点审核结果处理异常后 修改草稿审核状态 + * @param draftId + * @param statusFlag + * @return + */ + void updateDraftPublishStatus(String draftId,String statusFlag); +} \ 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..3ecb3c49c1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.dto.result.UpdateTagUseCountsResultDTO; +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); + + /** + * @Description 查询标签信息 + * @param tagName + * @author zxc + */ + UpdateTagUseCountsResultDTO checkTagInfo(String tagName,String customerId,String userId); +} \ 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..c4e3e85f49 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagService.java @@ -0,0 +1,50 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.CorrelationTagListFormDTO; +import com.epmet.dto.form.InitTagFormDTO; +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); + + /** + * desc:初始化/重新加载 客户标签到redis,用于数据库与redis数据同步的 + * @param formDto + * @return + */ + Boolean initTag(InitTagFormDTO 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..d09b4f9aee --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleContentServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.ArticleContentDao; +import com.epmet.dto.ArticleContentDTO; +import com.epmet.entity.ArticleContentEntity; +import com.epmet.service.ArticleContentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleContentServiceImpl extends BaseServiceImpl implements ArticleContentService { + + @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..d7eb79d76c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleCoverServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.ArticleCoverDao; +import com.epmet.dto.ArticleCoverDTO; +import com.epmet.entity.ArticleCoverEntity; +import com.epmet.service.ArticleCoverService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleCoverServiceImpl extends BaseServiceImpl implements ArticleCoverService { + + @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..18f57d5bea --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleOperateRecordServiceImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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.service.ArticleOperateRecordService; +import org.apache.commons.lang3.StringUtils; +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 { + + @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..173e80ce7f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticlePublishRangeServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.ArticlePublishRangeDao; +import com.epmet.dto.ArticlePublishRangeDTO; +import com.epmet.entity.ArticlePublishRangeEntity; +import com.epmet.service.ArticlePublishRangeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { + + @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..2e3d296122 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -0,0 +1,1305 @@ +/** + * 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.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +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.utils.ScanContentUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.*; +import com.epmet.dao.*; +import com.epmet.dto.ArticleVisitRecordDTO; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.DraftCoverDTO; +import com.epmet.dto.DraftDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.redis.TagRedis; +import com.epmet.service.*; +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.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +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 GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private DraftDao draftDao; + @Autowired + private DraftContentService draftContentService; + @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; + @Autowired + private DraftService draftService; + @Autowired + private TagCustomerService tagCustomerService; + @Autowired + private TagRedis tagRedis; + @Autowired + private TagGridDao tagGridDao; + @Autowired + private ArticleDao articleDao; + @Autowired + private ArticleTagsDao articleTagsDao; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + + private static final String AGENCY = "agency"; + private static final String GRID = "grid"; + + + @Autowired + private ArticleVisitRecordService articleVisitRecordService; + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @Override + public ArticleGridResultDTO agencyGridList(TokenDto tokenDTO) { + Result result = govOrgOpenFeignClient.getAgencyGridList(tokenDTO.getUserId()); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + return result.getData(); + } + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位 + **/ + @Override + public PublishAgencyListResultDTO publishAgencyList(TokenDto tokenDTO) { + Result result = govOrgOpenFeignClient.getPublishAgencyList(tokenDTO.getUserId()); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + return result.getData(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DraftContentSaveResultDTO saveOrUpdateContent(TokenDto tokenDto, DraftContentFromDTO fromDTO, boolean required) { + log.debug("saveOrUpdateContent param:{}", JSON.toJSONString(fromDTO)); + if (required) { + ValidatorUtils.validateEntity(fromDTO); + } + + DraftEntity draftEntity = null; + List draftContentList = null; + if (StringUtils.isNotBlank(fromDTO.getDraftId())) { + draftEntity = this.checkDraftStatus(fromDTO.getDraftId()); + draftEntity.setTitle(StringUtils.isBlank(fromDTO.getTitle()) ? "" : fromDTO.getTitle()); + buildPreviewContent(fromDTO, draftEntity); + 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(), ModuleConstant.GET_USER_DETAIL_ERROR); + } + draftEntity = new DraftEntity(); + draftEntity.setTitle(fromDTO.getTitle()); + draftEntity.setCustomerId(tokenDto.getCustomerId()); + draftEntity.setIsTop(DraftConstant.UN_TOP); + draftEntity.setStatusFlag(DraftConstant.UNPUBLISH); + String[] orgIdPath = loginUserDetails.getData().getOrgIdPath().split(":"); + String agencyId = orgIdPath[orgIdPath.length - 1]; + draftEntity.setOrgId(agencyId); + draftEntity.setOrgIdPath(loginUserDetails.getData().getOrgIdPath()); + draftEntity.setGridId(""); + draftEntity.setDepartmentId(loginUserDetails.getData().getCustomerId()); + draftEntity.setDelFlag(NumConstant.ZERO_STR); + buildPreviewContent(fromDTO, draftEntity); + draftDao.insert(draftEntity); + } + + String draftId = draftEntity.getId(); + fromDTO.setDraftId(draftId); + draftContentList = buildDraftContent(tokenDto, fromDTO); + //物理删除 草稿内容 + draftContentDao.deleteByDraftId(fromDTO.getDraftId()); + if (!CollectionUtils.isEmpty(draftContentList)) { + draftContentService.insertBatch(draftContentList); + } + return new DraftContentSaveResultDTO(draftId); + } + + private void buildPreviewContent(DraftContentFromDTO fromDTO, DraftEntity draftEntity) { + if (CollectionUtils.isEmpty(fromDTO.getContentList())) { + draftEntity.setPreviewContent(""); + return; + } + String content = ""; + for (int i = 0; i < fromDTO.getContentList().size(); i++) { + if (DraftConstant.TEXT.equals(fromDTO.getContentList().get(i).getContentType())) { + content = fromDTO.getContentList().get(i).getContent(); + if (content.length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) { + content = content.substring(NumConstant.ZERO, DraftConstant.PREVIEW_CONTENT_MAX_LENGTH).concat(DraftConstant.PREVIEW_CONTENT_MORE); + } + break; + } + } + draftEntity.setPreviewContent(content); + } + + @Override + public GovArticleDetailResultDTO queryGovArticleDetail(String articleId) { + GovArticleDetailResultDTO articleDetail = baseDao.queryGovArticleDetail(articleId); + if (null != articleDetail) { + List articleContentList = baseDao.queryGovArticleContent(articleId); + if (null != articleContentList && articleContentList.size() > 0) { + articleDetail.setArticleContentList(articleContentList); + } else { + articleDetail.setArticleContentList(new ArrayList<>()); + } + if (StringUtils.isNoneBlank(articleDetail.getTags())) { + String[] tagNames = articleDetail.getTags().split("\\|"); + articleDetail.setTagNameList(tagNames); + } else { + articleDetail.setTagNameList(new String[0]); + } + ArticleEntity articleEntity = this.baseDao.selectById(articleId); + log.info(String.format("当前文章id%s,发布人id%s,当前用户id%s", articleId, articleEntity.getCreatedBy(), loginUserUtil.getLoginUserId())); + if (articleEntity.getCreatedBy().equals(loginUserUtil.getLoginUserId())) { + articleDetail.setIsMePublished(true); + } else { + articleDetail.setIsMePublished(false); + } + } + return articleDetail; + } + + @Override + public Boolean saveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + log.debug("saveDraftAttr param:{}", JSON.toJSONString(fromDTO)); + + DraftEntity draftEntity = checkDraftStatus(fromDTO.getDraftId()); + + //构建标签 + draftEntity.setTags(null); + 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()); + + //发布单位 + draftEntity.setPublisherName(fromDTO.getPublisherName()); + draftEntity.setPublisherId(fromDTO.getPublisher()); + draftEntity.setPublisherType(fromDTO.getPublisherType()); + + //TODO ? 如果为机关 不设置? + if (DraftConstant.GRID.equals(fromDTO.getPublisherType())) { + draftEntity.setGridId(fromDTO.getPublisher()); + } + + if (StringUtils.isNotBlank(fromDTO.getPublishDate())) { + 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(ModuleConstant.DRAFT_ID_IS_NOT_EXIST); + } + if (NumConstant.ONE_STR.equals(draftEntity.getDelFlag())) { + log.warn("saveDraftAttr draftId:{} have deleted", draftId); + throw new RenException(ModuleConstant.DRAFT_STATUS_IS_DEL); + } + //只有未发布的和审核失败的才能修改 + if (DraftConstant.AUDITING.equals(draftEntity.getStatusFlag()) || DraftConstant.PUBLISHED.equals(draftEntity.getStatusFlag())) { + log.warn("saveDraftAttr draftId:{} publishStatus have published", draftId); + throw new RenException(ModuleConstant.DRAFT_STATUS_IS_NOT_ALLOW_MODIFY); + } + return draftEntity; + } + + @Override + public Boolean previewSaveDraftAttr(TokenDto tokenDto, DraftAttrFromDTO fromDTO) { + log.debug("previewSaveDraftAttr param:{}",JSON.toJSONString(fromDTO)); + //校验参数 + ValidatorUtils.validateEntity(fromDTO); + if (DraftConstant.TOP.equals(fromDTO.getIsTop()) && StringUtils.isBlank(fromDTO.getCoverImg())) { + log.warn("saveOrUpdateAttr isTop=1 but coverImg is blank"); + throw new RenException(ModuleConstant.DRAFT_CONTENT_IS_NULL); + } + if (StringUtils.isBlank(fromDTO.getPublisherName()) || StringUtils.isBlank(fromDTO.getPublisherType())) { + throw new RenException(ModuleConstant.DRAFT_PUBLISHER_IS_NULL); + } + if (fromDTO.getIsTop() == null || fromDTO.getIsTop() > 1 || fromDTO.getIsTop() < 0) { + throw new RenException(ModuleConstant.DRAFT_IS_TOP_ERROR); + } + + if (!DraftConstant.AGENCY.equals(fromDTO.getPublisherType()) && !DraftConstant.DEPARTMENT.equals(fromDTO.getPublisherType()) + && !DraftConstant.GRID.equals(fromDTO.getPublisherType())) { + throw new RenException(ModuleConstant.DRAFT_PUBLISHER_TYPE_ERROR); + } + 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(ModuleConstant.DRAFT_ID_IS_NULL); + } + 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) { + //物理删除 + draftCoverDao.deleteByDraftId(draftEntity.getId()); + if (coverEntity != null) { + draftCoverDao.insert(coverEntity); + } + //物理删除 + draftPublishRangeDao.deleteByDraftId(draftEntity.getId()); + 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(ModuleConstant.GET_USER_CAN_SELECT_GRID_ERROR); + } + buildName(tokenDto, agencyGridNameList, publishRangeEntityList, fromDTO, articleGridResultDTO); + buildAgencyGridNames(tokenDto, agencyGridNameList, publishRangeEntityList, fromDTO, articleGridResultDTO); + draftEntity.setPublishRangeDesc(StringUtils.join(agencyGridNameList, StrConstant.COMMA_ZH)); + 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.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); + }); + } + } + + + 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(StrConstant.HYPHEN).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.setDelFlag(NumConstant.ZERO_STR); + draftPublishRangeEntity.setPids(articleGridResultDTO.getPids()); + draftPublishRangeEntity.setAllParentName(articleGridResultDTO.getAllParentName()); + draftPublishRangeEntity.setAgencyId(articleGridResultDTO.getAgencyId()); + + publishRangeEntityList.add(draftPublishRangeEntity); + } + }); + } + } + + /** + * desc:构建 内容对象 + * + * @param tokenDto + * @param fromDTO + * @return + */ + private List buildDraftContent(TokenDto tokenDto, DraftContentFromDTO fromDTO) { + List contentList = fromDTO.getContentList(); + if (CollectionUtils.isEmpty(contentList)) { + return null; + } + List newContentList = new ArrayList<>(); + + + for (int i = NumConstant.ZERO; 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 + NumConstant.ONE); + //默认为空 + entity.setAuditStatus(""); + newContentList.add(entity); + } + return newContentList; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-下线文章 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void offLineArticle(OffLineArticleFormDTO formDTO) { + //0:查询文章表数据,判断当前操作人是否是当初发表文章的人(谁发布的文章水才能下线) + ArticleEntity articleEntity = baseDao.selectById(formDTO.getArticleId()); + if (null == articleEntity) { + throw new RenException(ArticleConstant.SELECT_ARTICLE_EXCEPTION); + } + if (!formDTO.getStaffId().equals(articleEntity.getCreatedBy())) { + throw new RenException(ArticleConstant.SHIRO_EXCEPTION); + } + + //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 (CollectionUtils.isEmpty(publishedList)) { + entity.setStatusFlag(ArticleConstant.OFFLINE); + entity.setOffLineTime(date); + rangeEntityList.forEach(range -> { + publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? StrConstant.COMMA_ZH : ""); + publishRangeDesc.append(range.getAgencyGridName()); + }); + } else { + publishedList.forEach(pub -> { + publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? StrConstant.COMMA_ZH : ""); + publishRangeDesc.append(pub.getAgencyGridName()); + }); + } + entity.setPublishRangeDesc(publishRangeDesc.toString()); + baseDao.updateById(entity); + + //4:文章操作记录表新增数据 + //4.1:调用epmet-user服务,查询工作人员信息 + CustomerStaffDTO staffDTO = getCustomerStaff(formDTO.getStaffId()); + //4.2:新增操作表数据 + ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity(); + recordEntity.setCustomerId(articleEntity.getCustomerId()); + recordEntity.setArticleId(formDTO.getArticleId()); + recordEntity.setOpUser(articleEntity.getPublisherName() + StrConstant.HYPHEN + staffDTO.getRealName()); + //下线文案,分为全部下线和部分下线 + String content = ""; + StringBuffer offLineGridId = new StringBuffer(); + if (null == publishedList || publishedList.size() < NumConstant.ONE) { + content = String.format(ArticleConstant.OFF_LINE_ALL_ARTICLE_MSG, articleEntity.getPublisherName(), staffDTO.getRealName(), articleEntity.getTitle()); + } else { + StringBuffer offLineRangeDesc = new StringBuffer(); + offLineList.forEach(off -> { + offLineRangeDesc.append(offLineRangeDesc.length() > NumConstant.ZERO ? StrConstant.COMMA_ZH : ""); + offLineRangeDesc.append(off.getAgencyGridName()); + }); + content = String.format(ArticleConstant.OFF_LINE_ARTICLE_MSG, articleEntity.getPublisherName(), staffDTO.getRealName(), articleEntity.getTitle(), offLineRangeDesc); + } + offLineList.forEach(off -> { + offLineGridId.append(StrConstant.COLON).append(off.getGridId()); + }); + recordEntity.setGridIds(offLineGridId.toString().replaceFirst(StrConstant.COLON,"")); + recordEntity.setContent(content); + recordEntity.setOpType(ArticleConstant.OFFLINE); + recordEntity.setOpTime(date); + articleOperateRecordService.insert(recordEntity); + } + + private CustomerStaffDTO getCustomerStaff(String userId) { + Result resultStaff = epmetUserOpenFeignClient.getCustomerStaff(userId); + if (!resultStaff.success() || null == resultStaff.getData()) { + throw new RenException(ArticleConstant.SELECT_STAFF_EXCEPTION); + } + return resultStaff.getData(); + } + + @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)) { + Set gridList = new HashSet<>(); + resultList = baseDao.selectArticleListForAgency(tokenDto.getCustomerId(), formDTO.getTagIdList(), gridList); + } else { + Set gridList = new HashSet<>(); + if (null != userInfo.getGridIdList()) { + gridList = userInfo.getGridIdList(); + } + resultList = baseDao.selectArticleListForAgency(tokenDto.getCustomerId(), formDTO.getTagIdList(), gridList); + } + resultList.forEach(result -> { + String tags = result.getTags(); + List tagList = new ArrayList<>(); + tagList = Arrays.asList(tags.split("[|]")); + result.setTagNameList(tagList); + }); + 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()); + + 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())) { + staffLevel = AGENCY; + break; + } else if (RoleKeyConstants.ROLE_KEY_GRID_PARTY_DIRECTOR.equals(role.getRoleKey())){ + staffLevel = GRID; + } + } + List resultList = new ArrayList<>(); + if (GRID.equals(staffLevel)) { + Set gridList = new HashSet<>(); + if (null != userInfo.getGridIdList()) { + gridList = userInfo.getGridIdList(); + } + resultList = baseDao.selectOfflineList(gridList); + } else { + Set gridList = new HashSet<>(); + resultList = baseDao.selectOfflineList(gridList); + } + PageInfo pageInfo = new PageInfo<>(resultList); + return new PageData<>(resultList, pageInfo.getTotal()); + } + + /** + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @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()); + } + + /** + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @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()); + } + + /** + * @param articlePageFormDTO + * @return List + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @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().substring(resultDTOResult.getData().getOrgIdPath().lastIndexOf(":") + NumConstant.ONE); + //存放树的每一个节点对象,用于将同一节点下的网格列表合并(主键:agencyId 值:节点对象) + Map map = new HashMap<>(); + //3:循环可下线网格列表,根据pids组织每一个树节点对象信息 + for (ArticlePublishRangeEntity range : rangeEntityList) { + //当前网格的所有机关id + String gridPids = range.getPids() + ":" + range.getAgencyId(); + //当前网格的所有机关名称 + String gridAgencyNames = range.getAllParentName() + StrConstant.HYPHEN + range.getAgencyGridName().substring(NumConstant.ZERO, range.getAgencyGridName().lastIndexOf(StrConstant.HYPHEN)); + String[] pids = gridPids.split(":"); + String[] names = gridAgencyNames.split(StrConstant.HYPHEN); + //倒序遍历 + 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(StrConstant.HYPHEN) + 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(StrConstant.HYPHEN) + 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; + } + + /** + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @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; + } + + /** + * @param draft + * @return String 返回新发布文章的Id + * @Description 草稿发布文章 + * @author wangc + * @date 2020.06.05 09:10 + **/ + + public ArticleEntity publishDraftToArticle(DraftEntity draft) { + //1.查找草稿内容 + + if (null != draft) { + //2.查找草稿内容、封面、发布范围 + String draftId = draft.getId(); + //直接查询改草稿的 封面及内容 + List draftContents = draftContentDao.selectByDraftId(draftId, null); + DraftCoverEntity draftCover = draftCoverDao.selectByDraftId(draftId, null); + List draftPublishRange = draftPublishRangeDao.selectByDraftId(draftId); + + //3.生成文章以及相关记录 + ArticleEntity article = ConvertUtils.sourceToTarget(draft, ArticleEntity.class); + article.setId(null); + article.setDraftId(draftId); + article.setStatusFlag(DraftConstant.PUBLISHED); + baseDao.insert(article); + if (null != draftContents && draftContents.size() > NumConstant.ZERO) { + draftContents.forEach(content -> { + content.setOrderNum(content.getOrderNum()); + 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 -> { + range.setPublishStatus(DraftConstant.PUBLISHED); + ArticlePublishRangeEntity rangeToInsert = ConvertUtils.sourceToTarget(range, ArticlePublishRangeEntity.class); + rangeToInsert.setArticleId(article.getId()); + rangeToInsert.setId(null); + articlePublishRangeDao.insert(rangeToInsert); + draftPublishRangeDao.updateById(range); + }); + if (null != draftCover) { + ArticleCoverEntity coverToInsert = ConvertUtils.sourceToTarget(draftCover, ArticleCoverEntity.class); + coverToInsert.setArticleId(article.getId()); + coverToInsert.setId(null); + articleCoverDao.insert(coverToInsert); + } + } + + //4.3:新增操作表数据 + CustomerStaffDTO staffDTO = getCustomerStaff(loginUserUtil.getLoginUserId()); + ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity(); + recordEntity.setCustomerId(article.getCustomerId()); + recordEntity.setArticleId(article.getId()); + recordEntity.setOpUser(article.getPublisherName() + StrConstant.HYPHEN + staffDTO.getRealName()); + recordEntity.setContent(String.format(ArticleConstant.PUBLISH_ARTICLE_MSG, article.getPublisherName(), staffDTO.getRealName(), article.getTitle())); + recordEntity.setOpType(ArticleConstant.OFFLINE); + recordEntity.setOpTime(new Date()); + articleOperateRecordService.insert(recordEntity); + + return article; + } + + throw new RenException(String.format(ModuleConstant.SPECIFIED_DRAFT_NOT_FOUNT_EXCEPTION_TEMPLATE, draft.getId())); + } + + @Override + public SyncScanResult scanContent(TokenDto tokenDto, String draftId) { + DraftEntity draftEntity = draftDao.selectById(draftId); + boolean isOk = true; + if (draftEntity == null) { + log.error("scanContent draftId:{} is not exist", draftId); + isOk = false; + } + if (!DraftConstant.AUDITING.equals(draftEntity.getStatusFlag())) { + log.error("scanContent draftId:{} statusFlag:{} is not support 2 modify", draftId, draftEntity.getStatusFlag()); + isOk = false; + } + + if (!NumConstant.ZERO_STR.equals(draftEntity.getDelFlag())) { + log.error("scanContent draftId:{} delFlag:{} is not support 2 modify", draftId, draftEntity.getDelFlag()); + isOk = false; + } + + if (!isOk) { + this.sendMsg(draftEntity.getCustomerId(), draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle())); + this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); + return null; + } + SyncScanResult result = null; + try { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + DraftCoverDTO draftCoverDTO = draftCoverDao.selectCoverIdAndUrlByDraftId(draftId); + if (draftCoverDTO != null) { + ImgTaskDTO taskDTO = new ImgTaskDTO(); + taskDTO.setDataId(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE).concat(draftCoverDTO.getId())); + taskDTO.setUrl(draftCoverDTO.getImgUrl()); + imgScanParamDTO.getTasks().add(taskDTO); + } + List contentDTOList = draftContentDao.selectScanContentByDraftId(draftId); + if (!CollectionUtils.isEmpty(contentDTOList)) { + contentDTOList.forEach(content -> { + String contentType = content.getContentType(); + if (DraftConstant.TEXT.equals(contentType)) { + TextTaskDTO textTaskDTO = new TextTaskDTO(); + textTaskDTO.setDataId(content.getId()); + textTaskDTO.setContent(content.getContent()); + textScanParamDTO.getTasks().add(textTaskDTO); + } else if (DraftConstant.IMG.equals(contentType)) { + ImgTaskDTO taskDTO = new ImgTaskDTO(); + taskDTO.setDataId(content.getId()); + taskDTO.setUrl(content.getContent()); + imgScanParamDTO.getTasks().add(taskDTO); + } + }); + } + Result imgSyncScanResult = null; + Result textSyncScanResult = null; + + if (!CollectionUtils.isEmpty(imgScanParamDTO.getTasks())) { + log.info("scanContent imgScanParamDTO:{}", JSON.toJSONString(imgScanParamDTO)); + imgSyncScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + log.info("scanContent imgSyncScanResult:{}", JSON.toJSONString(imgSyncScanResult)); + if (!imgSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),imgSyncScanResult.getMsg()); + } + } + if (!CollectionUtils.isEmpty(textScanParamDTO.getTasks())) { + log.info("scanContent textScanParamDTO:{}", JSON.toJSONString(textScanParamDTO)); + textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + log.info("scanContent textSyncScanResult:{}", JSON.toJSONString(textSyncScanResult)); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),textSyncScanResult.getMsg()); + } + } + + + result = new SyncScanResult(); + if (imgSyncScanResult != null) { + SyncScanResult imgSyncScanResultData = imgSyncScanResult.getData(); + if (imgSyncScanResult.success()) { + result.setAllPass(imgSyncScanResultData.isAllPass()); + result.getSuccessDataIds().addAll(imgSyncScanResultData.getSuccessDataIds()); + result.getFailDataIds().addAll(imgSyncScanResultData.getFailDataIds()); + } + } + if (textSyncScanResult != null) { + SyncScanResult textSyncScanResultData = textSyncScanResult.getData(); + if (textSyncScanResult.success()) { + result.setAllPass(result.isAllPass() ? textSyncScanResultData.isAllPass() : false); + result.getSuccessDataIds().addAll(textSyncScanResultData.getSuccessDataIds()); + result.getFailDataIds().addAll(textSyncScanResultData.getFailDataIds()); + } + } + } catch (Exception e) { + log.error("scanContent exception", e); + this.sendMsg(draftEntity.getCustomerId(), draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle())); + this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); + } + log.debug("scanContent result:{}", JSON.toJSONString(result)); + return result; + } + + @Override + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) + public void scanAllPassPublishArticle(TokenDto tokenDto, String draftId, SyncScanResult syncScanResult) { + + DraftEntity draft = draftDao.selectById(draftId); + if (draft == null) { + log.error("scanAllPassPublishArticle draftId:{} is not exist in db", draftId); + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + try { + //审核通过 + this.updateAuditStatusFailById(draftId, syncScanResult); + ArticleEntity articleEntity = this.publishDraftToArticle(draft); + UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId); + if (updateCustomerTagCacheDTO == null) { + return; + } + List updateGridTagCacheDTOS = this.updateGridTag(tokenDto, draftId, updateCustomerTagCacheDTO); + this.addArticleTags(updateCustomerTagCacheDTO, draftId, tokenDto, articleEntity.getCreatedTime()); + + //更新redis + try { + this.updateCacheCustomerTag(updateCustomerTagCacheDTO); + this.updateCacheGridTag(updateGridTagCacheDTOS); + } catch (Exception e) { + log.error("scanAllPassPublishArticle update redis exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } catch (Exception e) { + log.error("scanAllPassPublishArticle update db exception", e); + this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateAuditStatusFailById(String draftId, SyncScanResult syncScanResult) { + DraftEntity draft = draftDao.selectById(draftId); + if (draft == null) { + log.error("updateAuditStatusFailById draftId:{} is not exist in db", draftId); + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + if (syncScanResult.isAllPass()) { + this.updateDraftPublishStatus(draftId, DraftConstant.PUBLISHED); + } else { + this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); + } + + boolean coverFail = false, contentFail = false; + try { + List failDataIds = syncScanResult.getFailDataIds(); + for (String id : failDataIds) { + if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) { + draftCoverDao.updateAuditStatusById(id.replace(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE), ""), ModuleConstant.AUDIT_STATUS_FAIL); + coverFail = true; + } else { + draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL); + contentFail = true; + } + } + List successDataIds = syncScanResult.getSuccessDataIds(); + successDataIds.forEach(id -> { + if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) { + draftCoverDao.updateAuditStatusById(id.replace(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE), ""), ModuleConstant.AUDIT_STATUS_PASS); + } else { + draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_PASS); + } + }); + if (coverFail || contentFail) { + String auditMsg = ""; + if (coverFail && contentFail) { + auditMsg = ModuleConstant.DRAFT_CONTENT_AND_COVER; + } else if (contentFail) { + auditMsg = ModuleConstant.DRAFT_CONTENT; + } else if (coverFail) { + auditMsg = ModuleConstant.DRAFT_COVER; + ; + } + this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_AUDIT_CONTENT, draft.getTitle(), auditMsg)); + } + } catch (Exception e) { + log.error("scanAllPassPublishArticle update db exception", e); + this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draft.getTitle())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public DraftContentSaveResultDTO saveDraft(TokenDto tokenDto, DraftContentFromDTO fromDTO) { + return this.saveOrUpdateContent(tokenDto, fromDTO, false); + } + + public Result sendMsg(String customerId, String title, String content) { + UserMessageFormDTO formDTO = new UserMessageFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setGridId(""); + formDTO.setUserId(loginUserUtil.getLoginUserId()); + formDTO.setApp(AppClientConstant.APP_GOV); + formDTO.setTitle(String.format(ModuleConstant.MSG_TITLE, title)); + formDTO.setMessageContent(content); + formDTO.setReadFlag(ReadFlagConstant.UN_READ); + return epmetMessageOpenFeignClient.saveUserMessage(formDTO); + } + + @Override + public void updateDraftPublishStatus(String draftId, String statusFlag) { + draftDao.updateAuditStatusById(draftId, statusFlag); + } + + + /** + * @param draftId + * @Description 更新DB的标签使用次数 政府端 + * @author zxc + */ + public UpdateCustomerTagCacheDTO updateCustomerTag(TokenDto tokenDto, String draftId) { + //获取草稿基本信息 + DraftDTO draft = draftService.get(draftId); + String tags = draft.getTags(); + String customerId = draft.getCustomerId(); + String userId = tokenDto.getUserId(); + UpdateCustomerTagCacheDTO result = null; + if (StringUtils.isNotBlank(tags)) { + result = new UpdateCustomerTagCacheDTO(); + List tagsList = Arrays.asList(tags.split("\\|")); + List tagsInfo = new ArrayList<>(); + //政府端的 标签使用次数 DB + tagsList.forEach(tag -> { + UpdateTagUseCountsResultDTO updateTagUseCount = tagCustomerService.checkTagInfo(tag, customerId, userId); + tagsInfo.add(updateTagUseCount); + }); + result.setCustomerId(customerId); + result.setTagsInfo(tagsInfo); + } + + + return result; + } + + /** + * @param formDto + * @Description 更新redis 标签使用数量 和 标签级联 政府端 + * @author zxc + */ + public void updateCacheCustomerTag(UpdateCustomerTagCacheDTO formDto) { + List tagsInfo = formDto.getTagsInfo(); + String customerId = formDto.getCustomerId(); + //更新缓存标签使用数量 + tagsInfo.forEach(resultDTO -> { + String customerKey = RedisKeys.getCustomerTagKey(customerId); + tagRedis.updateTagUseCounts(customerKey, resultDTO); + }); + //政府端更新redis的级联标签(set) + List tagsInfoCopy = new ArrayList<>(); + for (int i = 0; i < tagsInfo.size(); i++) { + tagsInfoCopy.addAll(tagsInfo); + String key = RedisKeys.getCustomerReTagKey(customerId, tagsInfo.get(i).getTagId()); + tagsInfoCopy.remove(tagsInfo.get(i)); + Set setTag = new HashSet<>(tagsInfoCopy); + tagRedis.updateMoreTag(key, setTag); + tagsInfoCopy.clear(); + } + } + + /** + * @param draftId + * @param formDto + * @Description 更新数据库 网格下的标签使用数量 居民端 + * @author zxc + */ + public List updateGridTag(TokenDto tokenDto, String draftId, UpdateCustomerTagCacheDTO formDto) { + //获取草稿基本信息 + DraftDTO draft = draftService.get(draftId); + String customerId = draft.getCustomerId(); + List tagsInfo = formDto.getTagsInfo(); + String userId = tokenDto.getUserId(); + //根据草稿id查询发布范围id集合 + List gridIds = draftPublishRangeDao.selectGridIdByDraftId(draftId); + if (gridIds.size() == NumConstant.ZERO) { + throw new RenException(TagConstant.SELECT_GRIDIDLIST_FAILURE); + } + List gridTags = new ArrayList<>(); + List gridTagCache = new ArrayList<>(); + gridIds.forEach(gridId -> { + UpdateGridTagCacheDTO cache = new UpdateGridTagCacheDTO(); + cache.setGridId(gridId); + cache.setTagsInfo(tagsInfo); + gridTagCache.add(cache); + tagsInfo.forEach(resultDTO -> { + UpdateGridTagsFormDTO tag = new UpdateGridTagsFormDTO(); + BeanUtils.copyProperties(resultDTO, tag); + tag.setCreatedBy(userId); + tag.setUpdatedBy(userId); + tag.setCustomerId(customerId); + tag.setGridId(gridId); + gridTags.add(tag); + }); + }); + tagGridDao.updateGridTag(gridTags, userId); + return gridTagCache; + } + + /** + * @param gridTagCache + * @Description 更新redis 网格下的 标签使用数量 和 级联标签 居民端 + * @author zxc + */ + public void updateCacheGridTag(List gridTagCache) { + //更新 网格下 标签使用数量 + List gridTagCacheCopy = new ArrayList<>(); + gridTagCache.forEach(cacheDTO -> { + String gridId = cacheDTO.getGridId(); + String key = RedisKeys.getGridTagKey(gridId); + List tagsInfo = cacheDTO.getTagsInfo(); + tagsInfo.forEach(resultDTO -> { + tagRedis.updateTagUseCounts(key, resultDTO); + }); + //级联 + for (int i = 0; i < tagsInfo.size(); i++) { + gridTagCacheCopy.addAll(tagsInfo); + String moreKey = RedisKeys.getGridReTagKey(gridId, tagsInfo.get(i).getTagId()); + gridTagCacheCopy.remove(tagsInfo.get(i)); + Set setTag = new HashSet<>(gridTagCacheCopy); + tagRedis.updateMoreTag(moreKey, setTag); + gridTagCacheCopy.clear(); + } + }); + } + + /** + * @param formDto + * @param createdTime + * @Description 给文章挂标签 article_tags,创建时间与文章保持一致 + * @author zxc + */ + public void addArticleTags(UpdateCustomerTagCacheDTO formDto, String draftId, TokenDto tokenDto, Date createdTime) { + List addArticleTags = new ArrayList<>(); + List tagsInfo = formDto.getTagsInfo(); + DraftDTO draft = draftService.get(draftId); + String customerId = draft.getCustomerId(); + String userId = tokenDto.getUserId(); + String articleId = articleDao.getArticleIdByDraftId(draftId); + tagsInfo.forEach(resultDTO -> { + AddArticleTagsFormDTO addArticleTag = new AddArticleTagsFormDTO(); + addArticleTag.setCreatedBy(userId); + addArticleTag.setUpdatedBy(userId); + addArticleTag.setCustomerId(customerId); + addArticleTag.setArticleId(articleId); + BeanUtils.copyProperties(resultDTO, addArticleTag); + addArticleTag.setCreatedTime(createdTime); + addArticleTags.add(addArticleTag); + }); + articleTagsDao.addArticleTags(addArticleTags); + } +} \ 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..7b4935e1f8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleTagsServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.ArticleTagsDao; +import com.epmet.dto.ArticleTagsDTO; +import com.epmet.entity.ArticleTagsEntity; +import com.epmet.service.ArticleTagsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleTagsServiceImpl extends BaseServiceImpl implements ArticleTagsService { + + @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..8b4ce81966 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleVisitRecordServiceImpl.java @@ -0,0 +1,108 @@ +/** + * 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.ArticleVisitRecordDao; +import com.epmet.dto.ArticleVisitRecordDTO; +import com.epmet.entity.ArticleVisitRecordEntity; +import com.epmet.service.ArticleVisitRecordService; +import com.epmet.utils.ModuleConstant; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class ArticleVisitRecordServiceImpl extends BaseServiceImpl implements ArticleVisitRecordService { + + @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..34a7c2ef33 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftContentServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.DraftContentDao; +import com.epmet.dto.DraftContentDTO; +import com.epmet.entity.DraftContentEntity; +import com.epmet.service.DraftContentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftContentServiceImpl extends BaseServiceImpl implements DraftContentService { + + @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..b8915a5070 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftCoverServiceImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.DraftCoverDao; +import com.epmet.dto.DraftCoverDTO; +import com.epmet.entity.DraftCoverEntity; +import com.epmet.service.DraftCoverService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿封面表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftCoverServiceImpl extends BaseServiceImpl implements DraftCoverService { + @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..6bcd541903 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftPublishRangeServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.DraftPublishRangeDao; +import com.epmet.dto.DraftPublishRangeDTO; +import com.epmet.entity.DraftPublishRangeEntity; +import com.epmet.service.DraftPublishRangeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 草稿发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class DraftPublishRangeServiceImpl extends BaseServiceImpl implements DraftPublishRangeService { + + @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..319a1e4506 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -0,0 +1,186 @@ +/** + * 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.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.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 DraftServiceImpl extends BaseServiceImpl implements DraftService { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @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); + baseDao.deleteDraft(draftDTO.getId()); + } + + @Override + public DraftContentResultDTO queryDraftContent(DraftDetailFormDTO formDTO) { + DraftContentResultDTO draftContentResultDTO = baseDao.selectDraftContent(formDTO.getDraftId()); + /*for(DraftContentDetailDTO contentDetailDTO:draftContentResultDTO.getContentList()){ + if(StringUtils.isBlank(contentDetailDTO.getAuditReason())){ + contentDetailDTO.setAuditReason(""); + } + if(StringUtils.isBlank(contentDetailDTO.getAuditStatus())){ + contentDetailDTO.setAuditStatus(""); + } + }*/ + 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.isNotBlank(draftAttrResultDTO.getTags())) { + String[] tagNames = draftAttrResultDTO.getTags().split("\\|"); + draftAttrResultDTO.setTagNameList(tagNames); + }else{ + draftAttrResultDTO.setTagNameList(new String[0]); + } + } 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()); + if (null != articleContentList && articleContentList.size() > 0) { + draftDetailResultDTO.setArticleContentList(articleContentList); + } else { + draftDetailResultDTO.setArticleContentList(new ArrayList<>()); + } + if (StringUtils.isNotBlank(draftDetailResultDTO.getTags())) { + String[] tagNames = draftDetailResultDTO.getTags().split("\\|"); + draftDetailResultDTO.setTagNameList(tagNames); + }else{ + draftDetailResultDTO.setTagNameList(new String[0]); + } + } + 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..58ece05108 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java @@ -0,0 +1,124 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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.TagCustomerDao; +import com.epmet.dto.TagCustomerDTO; +import com.epmet.dto.form.UpdateTagFormDTO; +import com.epmet.dto.result.UpdateTagUseCountsResultDTO; +import com.epmet.entity.TagCustomerEntity; +import com.epmet.service.TagCustomerService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagCustomerServiceImpl extends BaseServiceImpl implements TagCustomerService { + + @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)); + } + + + /** + * @Description 校验此标签数据库是否存在 ? 不存在insert : 存在update useCount+1 ; 返回id + * @param tagName + * @param customerId + * @param userId + * @author zxc + */ + @Override + @Transactional(rollbackFor = Exception.class) + public UpdateTagUseCountsResultDTO checkTagInfo(String tagName,String customerId,String userId) { + UpdateTagFormDTO formDTO = new UpdateTagFormDTO(); + formDTO.setCreatedBy(userId); + formDTO.setCustomerId(customerId); + formDTO.setUpdatedBy(userId); + formDTO.setTagName(tagName); + baseDao.upsertTagCount(formDTO); + UpdateTagUseCountsResultDTO resultDTO = new UpdateTagUseCountsResultDTO(); + resultDTO.setTagId(formDTO.getId()); + resultDTO.setTagName(tagName); + return resultDTO; + } + +} \ 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..aff0c83817 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagDefaultServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.TagDefaultDao; +import com.epmet.dto.TagDefaultDTO; +import com.epmet.entity.TagDefaultEntity; +import com.epmet.service.TagDefaultService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 默认标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagDefaultServiceImpl extends BaseServiceImpl implements TagDefaultService { + + @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..e47f01392f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagGridServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.TagGridDao; +import com.epmet.dto.TagGridDTO; +import com.epmet.entity.TagGridEntity; +import com.epmet.service.TagGridService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +public class TagGridServiceImpl extends BaseServiceImpl implements TagGridService { + + @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..e1fb6b092c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagServiceImpl.java @@ -0,0 +1,251 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dao.*; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CorrelationTagListResultDTO; +import com.epmet.dto.result.TagInfoResultDTO; +import com.epmet.dto.result.UpdateTagUseCountsResultDTO; +import com.epmet.entity.ArticlePublishRangeEntity; +import com.epmet.entity.ArticleTagsEntity; +import com.epmet.entity.TagCustomerEntity; +import com.epmet.entity.TagGridEntity; +import com.epmet.redis.TagRedis; +import com.epmet.service.TagService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.DefaultTypedTuple; +import org.springframework.data.redis.core.ZSetOperations; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class TagServiceImpl implements TagService { + + @Autowired + private TagRedis tagRedis; + @Autowired + private ArticleDao articleDao; + @Autowired + private TagDefaultDao tagDefaultDao; + @Autowired + private TagCustomerDao tagCustomerDao; + @Autowired + private ArticleTagsDao articleTagsDao; + @Autowired + private TagGridDao tagGridDao; + @Autowired + private ArticlePublishRangeDao articlePublishRangeDao; + + /** + * @Description 已发布列表页的标签——政府端 + * @param tokenDto + * @author zxc + */ + @Override + @Transactional(rollbackFor = Exception.class) + public List tagList(TokenDto tokenDto) { + String customerId = tokenDto.getCustomerId(); + List resultDtos = tagRedis.zRevRange(customerId); + if (resultDtos.size() == NumConstant.ZERO){ + resultDtos = this.initTags(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 customerId + * @author zxc + */ + public List initTags(String customerId){ + List tags = new ArrayList<>(); + List initCacheTags = new ArrayList<>(); + List tagNames = tagDefaultDao.selectDefaultTags(); + tagNames.forEach(tagName -> { + InitTagsFormDTO tagInfo = new InitTagsFormDTO(); + UpdateTagUseCountsResultDTO initTag = new UpdateTagUseCountsResultDTO(); + UUID uuid = UUID.randomUUID(); + String replaceUuid = uuid.toString().replace(StrConstant.HYPHEN, ""); + tagInfo.setId(replaceUuid); + initTag.setTagId(replaceUuid); + tagInfo.setTagName(tagName); + initTag.setTagName(tagName); + tagInfo.setCustomerId(customerId); + tags.add(tagInfo); + initCacheTags.add(initTag); + }); + tagCustomerDao.initTags(tags); + String key = RedisKeys.getCustomerTagKey(customerId); + tagRedis.initCacheTags(key,initCacheTags); + return tagRedis.zRevRange(customerId); + } + + /** + * @Description 已发布列表页-获取关联标签——政府端 + * @param tokenDto + * @param formDto + * @author zxc + */ + @Override + public List correlationTagList(TokenDto tokenDto, CorrelationTagListFormDTO formDto) { + if (formDto.getTagIdList().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + String customerId = tokenDto.getCustomerId(); + return tagRedis.get(customerId,formDto); + } + + /** + * @Description 标签级联查询——居民端 + * @param formDto + * @author zxc + */ + @Override + public List tagCascadeList(TagCascadeListFormDTO formDto) { + if (formDto.getTagIdList().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return tagRedis.getResiTag(formDto); + } + + @Override + public Boolean initTag(InitTagFormDTO formDto) { + List customerTagList = tagCustomerDao.selectInitData(formDto.getCustomerIdList()); + if (CollectionUtils.isEmpty(customerTagList)) { + throw new RenException("客户标签数为空"); + } + + Map>> customerTag = new HashMap<>(); + customerTagList.stream().forEach(tag -> { + buildZset(customerTag, tag.getCustomerId(), tag.getId(), tag.getTagName(), tag.getUseCount()); + }); + + if (customerTag.size() > 0) { + customerTag.forEach((customerId, tagSet) -> tagRedis.zAddCustomerTag(customerId, tagSet)); + } + //key customerId:tagId + Map> reCustomerTagMap = new HashMap<>(); + List articleTagList = articleTagsDao.selectInitData(formDto.getCustomerIdList()); + Map> articleReTagMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(articleTagList)) { + articleReTagMap = articleTagList.stream().collect(Collectors.groupingBy(ArticleTagsEntity::getArticleId)); + articleReTagMap.forEach((articleId, articleReTagList) -> { + buildReTag(reCustomerTagMap, articleReTagList); + }); + } + if (reCustomerTagMap.size() > 0) { + reCustomerTagMap.forEach((customerAndTagId, tagSet) -> { + String[] customerIdAndTagIdArr = customerAndTagId.split(StrConstant.COLON); + tagRedis.updateMoreTag(RedisKeys.getCustomerReTagKey(customerIdAndTagIdArr[0], customerIdAndTagIdArr[1]), tagSet); + }); + } + + + //初始化 网格级标签 + List gridTagList = tagGridDao.selectInitData(formDto.getCustomerIdList()); + if (CollectionUtils.isEmpty(gridTagList)) { + throw new RenException("网格标签数为空"); + } + customerTag.clear(); + gridTagList.stream().forEach(tag -> buildZset(customerTag, tag.getGridId(), tag.getTagId(), tag.getTagName(), tag.getUseCount())); + if (customerTag.size() > 0) { + customerTag.forEach((gridId, tagSet) -> tagRedis.zAddGridTag(gridId, tagSet)); + } + + //获取网格发布的文章 按网格排序 + List publishRangeTagList = articlePublishRangeDao.selectInitData(formDto.getCustomerIdList()); + if (CollectionUtils.isEmpty(publishRangeTagList)){ + log.error("publishRangeTagList return empty"); + return false; + } + //网格关联标签结果 key:gridId:tagId + Map> resultMap = new HashMap<>(); + Map> gridArticleListMap = publishRangeTagList.stream().collect(Collectors.groupingBy(ArticlePublishRangeEntity::getGridId)); + for (Map.Entry> entry : gridArticleListMap.entrySet()) { + String gridId = entry.getKey(); + List articleIdList = entry.getValue(); + for (ArticlePublishRangeEntity publishRange : articleIdList) { + List articleTagsEntities = articleReTagMap.get(publishRange.getArticleId()); + if (CollectionUtils.isEmpty(articleTagsEntities)){ + //该文章没有标签 + continue; + } + buildGridReTag(resultMap,gridId,articleTagsEntities); + } + } + if (resultMap.size() > 0) { + resultMap.forEach((gridIdAndTagId, tagSet) -> { + String[] gridIdAndTagIdArr = gridIdAndTagId.split(StrConstant.COLON); + tagRedis.updateMoreTag(RedisKeys.getGridReTagKey(gridIdAndTagIdArr[0],gridIdAndTagIdArr[1]), tagSet); + }); + } + return true; + } + + private void buildReTag(Map> reCustomerTagMap, List articleReTagList) { + articleReTagList.forEach(articleTag -> { + + String key = articleTag.getCustomerId().concat(StrConstant.COLON).concat(articleTag.getTagId()); + Set reTagSet = reCustomerTagMap.get(key); + if (reTagSet == null) { + reTagSet = new HashSet<>(); + reCustomerTagMap.put(key, reTagSet); + } + Set newReTagSet = articleReTagList.stream().filter(o -> !o.getTagId().equals(articleTag.getTagId())) + .map(tag -> new UpdateTagUseCountsResultDTO(tag.getTagId(), tag.getTagName())).collect(Collectors.toSet()); + reTagSet.addAll(newReTagSet); + }); + } + + private void buildGridReTag(Map> resultMap,String gridId, List articleReTagList) { + articleReTagList.forEach(articleTag -> { + String key = gridId.concat(StrConstant.COLON).concat(articleTag.getTagId()); + Set reTagSet = resultMap.get(key); + if (reTagSet == null) { + reTagSet = new HashSet<>(); + resultMap.put(key, reTagSet); + } + Set newReTagSet = articleReTagList.stream().filter(o -> !o.getTagId().equals(articleTag.getTagId())) + .map(tag -> new UpdateTagUseCountsResultDTO(tag.getTagId(), tag.getTagName())).collect(Collectors.toSet()); + reTagSet.addAll(newReTagSet); + }); + } + + private void buildZset(Map>> customerTag, String customerId, String id, String tagName, Integer useCount) { + Set> typedTupleSet = customerTag.get(customerId); + if (typedTupleSet == null) { + typedTupleSet = new HashSet<>(); + customerTag.put(customerId, typedTupleSet); + } + UpdateTagUseCountsResultDTO initTag = new UpdateTagUseCountsResultDTO(); + initTag.setTagId(id); + initTag.setTagName(tagName); + ZSetOperations.TypedTuple typedTuple1 = new DefaultTypedTuple<>(initTag, Double.valueOf(useCount)); + typedTupleSet.add(typedTuple1); + } +} \ 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..900eb94622 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,129 @@ +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_DRAFT_ID = "DRAFT_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】"; + + /** + * 内容审核 封面图片前缀,用于标识这个Id是封面图片 + * */ + String SCAN_COVER_PREFIX = "cover_"; + + /** + * 文章站内消息标题 + * */ + String MSG_TITLE = "您有一条文章【%s】的消息"; + + /** + * 文章未审核通过 消息内容模版 + * */ + String MSG_AUDIT_CONTENT = "您好,您发布的【%s】文章%s审核未通过,请重新编辑后发布,谢谢。"; + + /** + * 文章发布失败 内部错误导致 + * */ + String MSG_ARTICLE_PUBLISH_ERROR = "您好,你发布的【%s】文章由于网络错误未发布成功,请重新发布,谢谢。"; + + /** + * 草稿Id不存在 + * */ + String DRAFT_ID_IS_NOT_EXIST = "草稿ID不存在"; + + /** + * 草稿已删除 + * */ + String DRAFT_STATUS_IS_DEL = "草稿已删除"; + + + String GET_USER_DETAIL_ERROR = "获取用户详情失败"; + + String GET_USER_CAN_SELECT_GRID_ERROR = "获取用户可选网格失败"; + + String DRAFT_STATUS_IS_NOT_ALLOW_MODIFY = "草稿状态不允许修改"; + + String DRAFT_PUBLISHER_IS_NULL = "发布单位不能为空"; + + String DRAFT_PUBLISHER_TYPE_ERROR = "发布单位类型不合法"; + + String DRAFT_PUBLISH_RANGE_IS_NULL = "发布范围不能为空"; + + String DRAFT_PUBLISH_DATE_IS_NULL = "发布时间不能为空"; + + String DRAFT_ID_IS_NULL = "草稿ID不能为空"; + + String DRAFT_CONTENT_AND_COVER = "内容和封面"; + + String DRAFT_CONTENT = "内容"; + + String DRAFT_COVER = "封面"; + + String DRAFT_CONTENT_IS_NULL = "文章封面不能为空"; + + String DRAFT_IS_TOP_ERROR = "是否置顶参数不合法"; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..8504cb2d5a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml @@ -0,0 +1,117 @@ +server: + port: @server.port@ + servlet: + context-path: /gov/voice + +spring: + main: + allow-bean-definition-overriding: true + application: + name: gov-voice-server + #环境 dev|test|prod + profiles: + active: dev + 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 + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + 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 + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +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 + +openapi: + scan: + server: + url: @openapi.scan.server.url@ + method: + imgSyncScan: /imgSyncScan + textSyncScan: /textSyncScan + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/epmet_gov_voice.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/epmet_gov_voice.sql new file mode 100644 index 0000000000..dceb9fca9b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/epmet_gov_voice.sql @@ -0,0 +1,285 @@ +/* + Date: 2/06/2020 16:13:38 +*/ + +-- SET NAMES utf8mb4; +-- #SET FOREIGN_KEY_CHECKS = 0; + +CREATE DATABASE `epmet_gov_voice` 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 = '客户标签表 客户标签表'; + +INSERT INTO `epmet_gov_voice`.`tag_default`(`ID`, `TAG_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (REPLACE(UUID(),'-',''), '发现榜样', 0, 0, 'default', NOW(), 'default', NOW()); +INSERT INTO `epmet_gov_voice`.`tag_default`(`ID`, `TAG_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (REPLACE(UUID(),'-',''), '党建动态', 0, 0, 'default', NOW(), 'default', NOW()); +INSERT INTO `epmet_gov_voice`.`tag_default`(`ID`, `TAG_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (REPLACE(UUID(),'-',''), '通知公告', 0, 0, 'default', NOW(), 'default', NOW()); +INSERT INTO `epmet_gov_voice`.`tag_default`(`ID`, `TAG_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (REPLACE(UUID(),'-',''), '生活服务', 0, 0, 'default', NOW(), 'default', NOW()); +INSERT INTO `epmet_gov_voice`.`tag_default`(`ID`, `TAG_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES (REPLACE(UUID(),'-',''), '党建要闻', 0, 0, 'default', NOW(), 'default', NOW()); + +ALTER TABLE tag_customer ADD UNIQUE UNX_TAG_NAME(CUSTOMER_ID,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' , + GRID_IDS VARCHAR(1024) 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/main/resources/logback-spring.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..e9ef5d3b60 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/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-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..f4d41ffa88 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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..c58c230891 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + \ 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..92c4fb67f6 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleTagsDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/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..906a248e3c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + UPDATE DRAFT_CONTENT SET AUDIT_STATUS = #{auditStatus,jdbcType=VARCHAR} WHERE ID = #{id,jdbcType=VARCHAR} + + + DELETE FROM draft_content WHERE DRAFT_ID = #{draftId,jdbcType=VARCHAR} + + + \ 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..ffd2aa3488 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftCoverDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + UPDATE DRAFT_COVER SET AUDIT_STATUS = #{auditStatus,jdbcType=VARCHAR} WHERE ID = #{id,jdbcType=VARCHAR} + + + DELETE FROM DRAFT_COVER WHERE DRAFT_ID = #{draftId,jdbcType=VARCHAR} + + + \ 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..e97eb759b1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update draft set DEL_FLAG='1' where id=#{draftId} + + + update draft set STATUS_FLAG =#{statusFlag,jdbcType=VARCHAR} where id=#{draftId,jdbcType=VARCHAR} + + \ 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..bece861541 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftPublishRangeDao.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + DELETE FROM draft_publish_range WHERE DRAFT_ID = #{draftId,jdbcType=VARCHAR} + + + \ 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..12da65d434 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml @@ -0,0 +1,57 @@ + + + + + + + + select id from tag_customer where tag_name = #{tagName} AND CUSTOMER_ID = #{customerId} + + INSERT INTO tag_customer ( ID, CUSTOMER_ID, TAG_NAME, USE_COUNT, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + (REPLACE ( UUID(), '-', '' ), + #{customerId}, + #{tagName}, + #{useCount}, + #{delFlag}, + #{revision}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW()) + ON DUPLICATE KEY UPDATE USE_COUNT = ( USE_COUNT + 1 ), + UPDATED_TIME = NOW(), + UPDATED_BY = #{updatedBy} + + + + + INSERT INTO tag_customer ( ID, CUSTOMER_ID, TAG_NAME, USE_COUNT, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + #{tag.id},#{tag.customerId}, #{tag.tagName}, #{tag.useCount}, #{tag.delFlag}, #{tag.revision}, #{tag.createdBy}, NOW(), #{tag.updatedBy}, NOW() + ) + + ON DUPLICATE KEY UPDATE + UPDATED_TIME = NOW() + + + + \ 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..d54d427024 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagDefaultDao.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ 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..c4b54c4dfa --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagGridDao.xml @@ -0,0 +1,39 @@ + + + + + + + + INSERT INTO tag_grid ( ID, CUSTOMER_ID, GRID_ID, TAG_ID, TAG_NAME, USE_COUNT, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( REPLACE ( UUID(), '-', '' ),#{tag.customerId}, #{tag.gridId}, #{tag.tagId}, #{tag.tagName}, #{ + tag.useCount}, #{tag.delFlag}, + #{tag.revision}, #{tag.createdBy}, NOW(),#{tag.updatedBy}, NOW()) + + ON DUPLICATE KEY UPDATE + USE_COUNT = ( USE_COUNT + 1 ), + UPDATED_TIME = NOW(), + UPDATED_BY = #{userId} + + + + \ No newline at end of file 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..a0d19d9423 --- /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.dto.result.DraftContentSaveResultDTO; +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"); + list.add(contentDTO); + } + draftContentFromDTO.setContentList(list); + DraftContentSaveResultDTO s = articleService.saveOrUpdateContent(tokenDto, draftContentFromDTO, false); + 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/gov-voice/pom.xml b/epmet-module/gov-voice/pom.xml new file mode 100644 index 0000000000..98eac595f9 --- /dev/null +++ b/epmet-module/gov-voice/pom.xml @@ -0,0 +1,20 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + gov-voice + pom + + gov-voice-client + gov-voice-server + + + + \ No newline at end of file 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-access/oper-access-server/deploy/docker-compose-test.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-test.yml index 6c7b7622ed..794d79cd3c 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-test.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-access-server:0.3.13 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-access-server:0.3.14 ports: - "8093:8093" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index 17cde411fb..47fb663873 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-server/pom.xml @@ -120,6 +120,8 @@ false + + false @@ -150,6 +152,8 @@ false + + true diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml index 9852c40609..b57b255fe6 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml @@ -30,6 +30,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -104,3 +113,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file 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-crm/oper-crm-server/deploy/docker-compose-dev.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml index 2eb7fd87ca..78040ff47a 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.21 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.23 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml index 304cecd418..0f3eee60dc 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.21 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-crm-server:0.3.23 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 1cef22e230..85a2c6877e 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.21 + 0.3.23 com.epmet oper-crm @@ -135,6 +135,8 @@ false + + false @@ -165,6 +167,8 @@ false + + true diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 1942525951..d67b500d59 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; -//, url = "localhost:8087" +//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class, url = "localhost:8087") @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class) public interface EpmetUserFeignClient { diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java index b3c13859b7..b59a5c7a20 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java @@ -2,22 +2,12 @@ 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.dto.CustomerHomeDTO; -import com.epmet.dto.form.AddAgencyFormDTO; -import com.epmet.dto.form.AddRootAgencyFormDTO; -import com.epmet.dto.form.StaffSubmitFromDTO; -import com.epmet.dto.result.AddAgencyResultDTO; -import com.epmet.feign.fallback.GovOrgFeignClientFallBack; import com.epmet.feign.fallback.OperCustomizeFeignClientFallBack; 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; -import java.util.Map; - //@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeFeignClientFallBack.class, url = "localhost:8089") @FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeFeignClientFallBack.class) public interface OperCustomizeFeignClient { diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml index 74241043ea..c434e9de81 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml @@ -30,6 +30,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -110,3 +119,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file 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/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 1fb2472591..be0e6cd245 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.20 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.22 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml index c378f3aa33..31783a2227 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-customize-server:0.3.20 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-customize-server:0.3.22 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 2a176086d6..1c299a382e 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.20 + 0.3.22 com.epmet oper-customize @@ -118,6 +118,8 @@ false + + false @@ -148,6 +150,8 @@ false + + true diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml index d64cf2db02..f65f7d24eb 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml @@ -30,6 +30,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -104,3 +113,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/customer_foot_bar.sql similarity index 100% rename from epmet-module/oper-customize/oper-customize-server/src/main/resources/db.migration/customer_foot_bar.sql rename to epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/customer_foot_bar.sql diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index 7cb7d3e138..aa37ab3129 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -35,6 +35,10 @@ gov-project epmet-common-service resi-home - + gov-voice + resi-voice + data-statistical + data-report + diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java index 85c76cc827..fd2b239ea8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.group.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -12,48 +13,56 @@ import java.io.Serializable; */ @Data public class ApplyCreateGroupFormDTO implements Serializable { - private static final long serialVersionUID = 1570620480398949075L; - - /** - * 当前登录用户id由TokenDto赋值 - */ - @NotBlank(message="当前用户id不能为空") - private String userId; - - /** - * 头像地址 - */ - @NotBlank(message = "头像地址不能为空") - private String groupHeadPhoto; - - /** - * 小组名称 - */ - @NotBlank(message = "小组名称不能为空") - private String groupName; - - /** - * 群介绍 - */ - @NotBlank(message = "群介绍不能为空") - private String groupIntroduction; - - /** - * 当前网格所属客户id - */ - @NotBlank(message = "当前网格所属客户id不能为空") - private String customerId; - - /** - * 当前网格id - */ - @NotBlank(message = "当前网格id不能为空") - private String gridId; - - /** - * 当前登录用户来源从token中获取 - */ - @NotBlank(message="app不能为空") - private String app; + private static final long serialVersionUID = 1570620480398949075L; + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 当前登录用户id由TokenDto赋值 + */ + @NotBlank(message = "当前用户id不能为空") + private String userId; + + /** + * 头像地址 + */ + @NotBlank(message = "头像地址不能为空", groups = {AddUserShowGroup.class}) + private String groupHeadPhoto; + + /** + * 小组名称 + */ + @NotBlank(message = "小组名称不能为空", groups = {AddUserShowGroup.class}) + private String groupName; + + /** + * 群介绍 + */ + @NotBlank(message = "群介绍不能为空", groups = {AddUserShowGroup.class}) + private String groupIntroduction; + + /** + * 当前网格所属客户id + */ + @NotBlank(message = "当前网格所属客户id不能为空") + private String customerId; + + /** + * 当前网格id + */ + @NotBlank(message = "当前网格id不能为空") + private String gridId; + + /** + * 当前登录用户来源从token中获取 + */ + @NotBlank(message = "app不能为空") + private String app; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/ApplyJoinGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/ApplyJoinGroupFormDTO.java index 03860e1bf4..a5e795f26f 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/ApplyJoinGroupFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/ApplyJoinGroupFormDTO.java @@ -1,5 +1,7 @@ package com.epmet.resi.group.dto.member.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.resi.group.dto.group.form.ApplyCreateGroupFormDTO; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,7 +15,13 @@ import java.io.Serializable; @Data public class ApplyJoinGroupFormDTO implements Serializable { private static final long serialVersionUID = -1611110663584570521L; - + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } /** * 当前登录用户id由TokenDto赋值 */ @@ -29,7 +37,7 @@ public class ApplyJoinGroupFormDTO implements Serializable { /** * 入群理由 */ - @NotBlank(message="入组理由不能为空") + @NotBlank(message="入组理由不能为空", groups = {ApplyJoinGroupFormDTO.AddUserShowGroup.class}) private String operateDes; private String app; diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/DisagreeApplyFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/DisagreeApplyFormDTO.java index 610397be20..4adcb3082d 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/DisagreeApplyFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/DisagreeApplyFormDTO.java @@ -1,5 +1,7 @@ package com.epmet.resi.group.dto.member.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.resi.group.dto.group.form.ApplyCreateGroupFormDTO; import lombok.Data; import javax.validation.constraints.NegativeOrZero; @@ -14,7 +16,13 @@ import java.io.Serializable; @Data public class DisagreeApplyFormDTO implements Serializable { private static final long serialVersionUID = 7490311907300741995L; - + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } /** * 申请单id */ @@ -30,6 +38,6 @@ public class DisagreeApplyFormDTO implements Serializable { /** * 拒绝理由 */ - @NotBlank(message = "拒绝理由必填") + @NotBlank(message = "拒绝理由必填", groups = {DisagreeApplyFormDTO.AddUserShowGroup.class}) private String operateDesc; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicClosingMsgResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicClosingMsgResultDTO.java new file mode 100644 index 0000000000..ab8262e70c --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicClosingMsgResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 关闭话题详情相关信息 + * @ClassName ResiTopicClosingMsgResultDTO + * @Auth wangc + * @Date 2020-06-01 17:44 + */ +@Data +public class ResiTopicClosingMsgResultDTO implements Serializable { + private static final long serialVersionUID = 3959914139163088792L; + + /** + * 关闭人(目前只有组长可以关闭话题) + * */ + private String closeUserName; + + /** + * 关闭时间 + * */ + private Long closeDateTime; + + /** + * 关闭理由 + * */ + private String closeReason; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java index 4ac316638c..988d319ad8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java @@ -65,4 +65,9 @@ public class ResiTopicIncludeIssueDetailResultDTO implements Serializable { * 议题Id,当shiftIssueFlag为false时返回"" * */ private String issueId; + + /** + * 关闭详情 如果没有关闭 对象里的字符串属性为String + * */ + private ResiTopicClosingMsgResultDTO closeDetail; } 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/deploy/docker-compose-dev.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml index aced345d78..34276d79e5 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.50 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.53 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml index a867e7a8ae..17f948b4d1 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-group-server:0.3.50 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-group-server:0.3.53 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 4a95c08678..60ef52d595 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.50 + 0.3.53 com.epmet resi-group @@ -148,6 +148,8 @@ false + + false @@ -178,6 +180,7 @@ false + true 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-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 718fe179a5..4e3c3578b2 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.modules.topic.service.impl; + import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -29,7 +30,6 @@ import com.epmet.commons.tools.security.dto.TokenDto; 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.dto.CustomerGridDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CommonDataFilterResultDTO; @@ -79,7 +79,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.management.monitor.MonitorSettingException; + import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -523,15 +523,39 @@ public class ResiTopicServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); + queryWrapper.eq(ModuleConstant.FILED_TOPIC_ID,topicDetail.getId()); + queryWrapper.eq(ModuleConstant.FIELD_OPERATION_TYPE,ModuleConstant.TOPIC_STATUS_CLOSED); + queryWrapper.orderByDesc(FieldConstant.CREATED_TIME); + List records = + resiTopicOperationDao.selectList(queryWrapper); + if(null != records && records.size() > NumConstant.ZERO){ + closeDetail.setCloseReason(records.get(0).getOperationReason()); + closeDetail.setCloseDateTime(records.get(0).getCreatedTime().getTime()/NumConstant.ONE_THOUSAND); + ResiGroupMemberInfoRedisDTO closedBy = + resiGroupMemberRedis.get(group.getId(),records.get(0).getCreatedBy()); + if(null != closedBy){ + closeDetail.setCloseUserName(closedBy.getUserShowName()); + } + } + } + resultDTO.setCloseDetail(closeDetail); return new Result().ok(resultDTO); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java index 8fd8c6954f..2d1bcc545f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java @@ -267,6 +267,11 @@ public interface ModuleConstant extends Constant { * */ String TOPIC_OPERATION_TYPE_SHIFT_ISSUE = "shift_issue"; + /** + * 话题状态: 已关闭 + * */ + String TOPIC_STATUS_CLOSED = "closed"; + /** * 空字符串 * */ @@ -317,4 +322,8 @@ public interface ModuleConstant extends Constant { String NO_GROUP_CACHE_LOG_TEMPLATE = "没有相应的组缓存信息,组Id:【%s】"; String UPDATE_GROUP_CACHE_SUCCESSFULLY_LOG_TEMPLATE = "更新组缓存信息成功,组Id:【%s】"; + + String FILED_TOPIC_ID = "TOPIC_ID"; + + String FIELD_OPERATION_TYPE = "OPERATION_TYPE"; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index 5b182f44a1..98f0d3e7bd 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -30,6 +30,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -104,3 +113,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index e316a46efd..119db46b30 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -285,17 +285,18 @@ FROM resi_group_member rgm WHERE - rgm.del_flag = 0 - AND rgm.resi_group_id = ALL ( + EXISTS ( SELECT rg.id FROM resi_group rg WHERE rg.del_flag = 0 + AND rgm.resi_group_id = rg.id AND rg.grid_id = #{gridId} - AND rgm.resi_group_id = rg.id ) - AND rgm.customer_user_id = #{userId} + ) + AND rgm.CUSTOMER_USER_ID = #{userId} + AND rgm.del_flag = 0 diff --git a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-dev.yml b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-dev.yml index 43e10fe613..a68d7baaba 100644 --- a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-guide-server: container_name: resi-guide-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-guide-server:0.3.13 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-guide-server:0.3.15 ports: - "8091:8091" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml index 24b07e115e..56c95bd4ca 100644 --- a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-guide-server: container_name: resi-guide-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-guide-server:0.3.13 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-guide-server:0.3.15 ports: - "8091:8091" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index 749832426e..d5ef75fe0d 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.13 + 0.3.15 com.epmet resi-guide @@ -135,6 +135,8 @@ false + + false @@ -165,6 +167,8 @@ false + + true diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml index 2ff1d86886..1108340bce 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml @@ -30,6 +30,16 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + cloud: nacos: discovery: @@ -104,3 +114,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/resi-guide/resi-guide-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml index 07c68ac5f0..cffa5d8eaf 100644 --- a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-hall-server: container_name: resi-hall-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-hall-server:0.3.17 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-hall-server:0.3.20 ports: - "8100:8100" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-test.yml b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-test.yml index e0154f1dce..a8141f384f 100644 --- a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-hall-server: container_name: resi-hall-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-hall-server:0.3.16 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-hall-server:0.3.20 ports: - "8100:8100" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-hall/resi-hall-server/pom.xml b/epmet-module/resi-hall/resi-hall-server/pom.xml index b90f959c4c..b83cc8aad1 100644 --- a/epmet-module/resi-hall/resi-hall-server/pom.xml +++ b/epmet-module/resi-hall/resi-hall-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.17 + 0.3.20 resi-hall com.epmet @@ -99,6 +99,8 @@ false + + false @@ -123,6 +125,8 @@ false + + true diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml index 3552110780..00e752f20a 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml @@ -38,6 +38,7 @@ spring: namespace: @nacos.config.namespace@ group: @nacos.config.group@ file-extension: yaml + management: endpoints: web: diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/resi-hall/resi-hall-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-dev.yml b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-dev.yml index 725c5139c3..2fe51f377a 100644 --- a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-home-server: container_name: resi-home-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-home-server:0.3.12 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-home-server:0.3.15 ports: - "8104:8104" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-test.yml b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-test.yml index 348d43f3e1..8f631d979e 100644 --- a/epmet-module/resi-home/resi-home-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-home/resi-home-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-home-server: container_name: resi-home-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-home-server:0.3.11 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-home-server:0.3.15 ports: - "8104:8104" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index cb97219777..21068f4c76 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.12 + 0.3.15 resi-home @@ -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/aspect/RequestLogAspect.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/resi-home/resi-home-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-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-mine/resi-mine-server/deploy/docker-compose-dev.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml index 9c9dab989a..a3fce63894 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.23 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.25 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml index c593f6708d..8e0c634709 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-mine-server:0.3.22 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-mine-server:0.3.25 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 267b2b5dc5..59b99753bd 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.23 + 0.3.25 com.epmet resi-mine @@ -17,11 +17,11 @@ epmet-commons-tools 2.0.0 - + org.springframework.boot spring-boot-starter-web @@ -117,13 +117,6 @@ 8094 dev - - - - - - epmet_resi_guide_user - EpmEt-db-UsEr 0 192.168.1.130 @@ -147,13 +140,6 @@ 8094 test - - - - - - epmet - elink@833066 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml index f602718744..ad3ec82fe3 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml @@ -23,13 +23,6 @@ spring: port: @spring.redis.port@ password: @spring.redis.password@ timeout: 30s - datasource: - druid: - #MySQL - driver-class-name: com.mysql.cj.jdbc.Driver - url: @spring.datasource.druid.url@ - username: @spring.datasource.druid.username@ - password: @spring.datasource.druid.password@ cloud: nacos: discovery: diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartyBranchMembersDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartyBranchMembersDTO.java new file mode 100644 index 0000000000..946e0ea1fa --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartyBranchMembersDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.partymember.dto.partymember; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党支部党员关系表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class PartyBranchMembersDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 党支部id,customer_party_branch.id + */ + private String branchId; + + /** + * 党员库表主键,partymember_base_info.id + */ + private String partymemberBaseInfoId; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberAuthRecordDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberAuthRecordDTO.java new file mode 100644 index 0000000000..9c3f0334e6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberAuthRecordDTO.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.resi.partymember.dto.partymember; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党员认证记录表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class PartymemberAuthRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * partymember_base_info.id + */ + private String partymemberBaseInfoId; + + /** + * 认证居民id + */ + private String userId; + + /** + * 认证时间(和partymember_info表时间一致) + */ + private Date authTime; + + /** + * 认证网格id + */ + private String gridId; + + /** + * 认证客户id + */ + private String customerId; + + /** + * 认证的描述:账户于2020年10月30号在海泊桥社区-第一网格激活 + */ + private String authDesc; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/DelPartyMemberBaseInfoFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/DelPartyMemberBaseInfoFormDTO.java new file mode 100644 index 0000000000..eac10a7bbf --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/DelPartyMemberBaseInfoFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 删除党员入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 18:09 + */ +@Data +public class DelPartyMemberBaseInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 2735219691600150687L; + public interface AddUserInternalGroup {} + + /** + * 党员id + */ + @NotBlank(message = "党员id不能为空",groups = {DelPartyMemberBaseInfoFormDTO.AddUserInternalGroup.class}) + private String partyMemberId; + + /** + * 党支部id + */ + @NotBlank(message = "党支部id不能为空",groups = {DelPartyMemberBaseInfoFormDTO.AddUserInternalGroup.class}) + private String partyBranchId; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberBaseInfoAddFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberBaseInfoAddFormDTO.java new file mode 100644 index 0000000000..0ed42ab876 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberBaseInfoAddFormDTO.java @@ -0,0 +1,64 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 添加党员入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 22:42 + */ +@Data +public class PartyMemberBaseInfoAddFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 客户Id (customer.id) + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 党支部id + */ + @NotBlank(message = "党支部id不能为空", groups = {AddUserInternalGroup.class}) + private String branchId; + + /** + * 姓名 + */ + @NotBlank(message = "姓名不能为空", groups = {AddUserShowGroup.class}) + private String name; + + /** + * 身份证号 + */ + @NotBlank(message = "身份证号不能为空", groups = {AddUserShowGroup.class}) + private String idCard; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) + private String mobile; + + /** + * 所在党组织(网格直属机关的名字) + */ + @NotBlank(message = "党组织不能为空", groups = {AddUserShowGroup.class}) + private String organization; + + /** + * 所在党支部 + */ + @NotBlank(message = "党支部名称不能为空", groups = {AddUserShowGroup.class}) + private String branch; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberBaseInfoDetailResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberBaseInfoDetailResultDTO.java new file mode 100644 index 0000000000..8bf05dbcb8 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberBaseInfoDetailResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员详情返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 15:31 + */ +@Data +public class PartyMemberBaseInfoDetailResultDTO implements Serializable { + private static final long serialVersionUID = -1416472090639851835L; + + /** + * 党员id + */ + private String partyMemberId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 1男2女0未知 + */ + private String gender; + + /** + * true已激活,false未激活 + */ + private Boolean status; + + /** + * 返回:账号于2019年10月31日在海泊桥社区-第一网格激活 + */ + private String activeDesc; + + /** + * 党支部id + */ + private String partyBranchId; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartymemberBaseInfoResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartymemberBaseInfoResultDTO.java new file mode 100644 index 0000000000..0dd6a85a7d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartymemberBaseInfoResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 10:15 + */ +@Data +public class PartymemberBaseInfoResultDTO implements Serializable { + private static final long serialVersionUID = 8406798885012269801L; + + /** + * 党员id + */ + private String partyMemberId; + + /** + * 党员姓名 + */ + private String name; + + /** + * 性别 + */ + private String gender; +} 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..5785bf4489 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -0,0 +1,76 @@ +package com.epmet.resi.partymember.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO; +import com.epmet.resi.partymember.feign.fallback.ResiPartyMemberOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:12 + */ +//@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartyMemberOpenFeignClientFallback.class,url = "http://localhost:8096") +@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartyMemberOpenFeignClientFallback.class) +public interface ResiPartyMemberOpenFeignClient { + + /** + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 更新党员库信息 + * @Date 2020/6/17 23:36 + **/ + @PutMapping(value = "/resi/partymember/partymemberbaseinfo", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result update(@RequestBody PartymemberBaseInfoDTO dto); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 添加党员 + * @Date 2020/6/17 23:00 + **/ + @PostMapping(value = "/resi/partymember/partymemberbaseinfo/addPartyMemberBaseInfo", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result addPartyMemberBaseInfo(@RequestBody PartyMemberBaseInfoAddFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param partyBranchId + * @author yinzuomei + * @description 根据党支部id,查询党员列表 + * @Date 2020/6/18 10:12 + **/ + @GetMapping(value = "/resi/partymember/partymemberbaseinfo/listPartyMemberBaseInfo/{partyBranchId}") + Result> listPartyMemberBaseInfo(@PathVariable("partyBranchId") String partyBranchId); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param partyMemberId 党员库id主键 + * @author yinzuomei + * @description 根据党员id查询党员信息 + * @Date 2020/6/18 15:30 + **/ + @GetMapping(value = "/resi/partymember/partymemberbaseinfo/queryPartyMemberBaseInfoById/{partyMemberId}") + Result queryPartyMemberBaseInfoById(@PathVariable("partyMemberId") String partyMemberId); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 删除党员 + * @Date 2020/6/18 17:57 + **/ + @PostMapping(value = "/resi/partymember/partymemberbaseinfo/delete", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result deltePartyMemberBaseInfo(@RequestBody DelPartyMemberBaseInfoFormDTO formDTO); +} 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..058af67dfa --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -0,0 +1,49 @@ +package com.epmet.resi.partymember.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.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:14 + */ +@Component +public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOpenFeignClient { + + @Override + public Result update(PartymemberBaseInfoDTO partymemberBaseInfoDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "update", partymemberBaseInfoDTO); + } + + @Override + public Result addPartyMemberBaseInfo(PartyMemberBaseInfoAddFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "addPartyMemberBaseInfo", formDTO); + } + + @Override + public Result> listPartyMemberBaseInfo(String partyBranchId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "listPartyMemberBaseInfo", partyBranchId); + } + + @Override + public Result queryPartyMemberBaseInfoById(String partyMemberId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryPartyMemberBaseInfoById", partyMemberId); + } + + @Override + public Result deltePartyMemberBaseInfo(DelPartyMemberBaseInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "deltePartyMemberBaseInfo", formDTO); + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml index aee72d5645..b59f1fb9b1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.42 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.53 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml index 7e62625841..344f01b1f1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.51 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index aca8ce68fa..383b4a14fe 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.42 + 0.3.53 com.epmet resi-partymember @@ -147,6 +147,8 @@ false + + false @@ -177,6 +179,8 @@ false + + true diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java index bb0795b43b..ab366fd058 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java @@ -135,4 +135,9 @@ public interface PartyMemberConstant { * 已读 */ String READ = "read"; + + /** + * 党员详情界面:账号于2020年10月31日在海泊桥社区-第一网格激活 + */ + String AUTH_DESC="账户于%s年%s月%s日在%s激活"; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyBranchMembersController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyBranchMembersController.java new file mode 100644 index 0000000000..9fc1a5c0ff --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartyBranchMembersController.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.modules.partymember.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.modules.partymember.excel.PartyBranchMembersExcel; +import com.epmet.modules.partymember.service.PartyBranchMembersService; +import com.epmet.resi.partymember.dto.partymember.PartyBranchMembersDTO; +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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@RestController +@RequestMapping("partybranchmembers") +public class PartyBranchMembersController { + + @Autowired + private PartyBranchMembersService partyBranchMembersService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = partyBranchMembersService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PartyBranchMembersDTO data = partyBranchMembersService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PartyBranchMembersDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + partyBranchMembersService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PartyBranchMembersDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + partyBranchMembersService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + partyBranchMembersService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = partyBranchMembersService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PartyBranchMembersExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberAuthRecordController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberAuthRecordController.java new file mode 100644 index 0000000000..295a615e48 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberAuthRecordController.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.modules.partymember.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.modules.partymember.excel.PartymemberAuthRecordExcel; +import com.epmet.modules.partymember.service.PartymemberAuthRecordService; +import com.epmet.resi.partymember.dto.partymember.PartymemberAuthRecordDTO; +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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@RestController +@RequestMapping("partymemberauthrecord") +public class PartymemberAuthRecordController { + + @Autowired + private PartymemberAuthRecordService partymemberAuthRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = partymemberAuthRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PartymemberAuthRecordDTO data = partymemberAuthRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PartymemberAuthRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + partymemberAuthRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PartymemberAuthRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + partymemberAuthRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + partymemberAuthRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = partymemberAuthRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PartymemberAuthRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java index 438594f0b3..f5fd7ec421 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberBaseInfoController.java @@ -28,15 +28,18 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.modules.partymember.excel.PartymemberBaseInfoExcel; import com.epmet.modules.partymember.service.PartymemberBaseInfoService; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.util.List; import java.util.Map; @@ -75,11 +78,11 @@ public class PartymemberBaseInfoController { } @PutMapping - public Result update(@RequestBody PartymemberBaseInfoDTO dto){ + public Result update(@RequestBody PartymemberBaseInfoDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); partymemberBaseInfoService.update(dto); - return new Result(); + return new Result().ok(dto.getId()); } @DeleteMapping @@ -121,4 +124,56 @@ public class PartymemberBaseInfoController { ValidatorUtils.validateEntity(formDTO); return partymemberBaseInfoService.audited(formDTO); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 添加党员 + * @Date 2020/6/17 22:47 + **/ + @PostMapping("addPartyMemberBaseInfo") + public Result addPartyMemberBaseInfo(@RequestBody PartyMemberBaseInfoAddFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + String partyMemberId=partymemberBaseInfoService.addPartyMemberBaseInfo(formDTO); + return new Result().ok(partyMemberId); + } + + /** + * @param partyBranchId + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 根据党支部id, 查询党员列表 + * @Date 2020/6/18 10:18 + **/ + @GetMapping("listPartyMemberBaseInfo/{partyBranchId}") + public Result> listPartyMemberBaseInfo(@PathVariable("partyBranchId") String partyBranchId) { + return new Result>().ok(partymemberBaseInfoService.listPartyMemberBaseInfo(partyBranchId)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param partyMemberId + * @author yinzuomei + * @description 根据党员库id,查询党员信息 + * @Date 2020/6/18 17:15 + **/ + @GetMapping("queryPartyMemberBaseInfoById/{partyMemberId}") + public Result queryPartyMemberBaseInfoById(@PathVariable("partyMemberId") String partyMemberId){ + return new Result().ok(partymemberBaseInfoService.queryPartyMemberBaseInfoById(partyMemberId)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 删除党员 + * @Date 2020/6/18 17:45 + **/ + @PostMapping("delete") + public Result deltePartyMemberBaseInfo(@RequestBody DelPartyMemberBaseInfoFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,DelPartyMemberBaseInfoFormDTO.AddUserInternalGroup.class); + partymemberBaseInfoService.deltePartyMemberBaseInfo(formDTO); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartyBranchMembersDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartyBranchMembersDao.java new file mode 100644 index 0000000000..c70979e411 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartyBranchMembersDao.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partymember.entity.PartyBranchMembersEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 党支部党员关系表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface PartyBranchMembersDao extends BaseDao { + int deletePartyBranchMember(@Param("partyBranchId") String partyBranchId, + @Param("partyMemberId") String partyMemberId, + @Param("userId") String userId); +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberAuthRecordDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberAuthRecordDao.java new file mode 100644 index 0000000000..5957ee1fb0 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberAuthRecordDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partymember.entity.PartymemberAuthRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 党员认证记录表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface PartymemberAuthRecordDao extends BaseDao { + + /** + * @return com.epmet.modules.partymember.entity.PartymemberAuthRecordEntity + * @param partymemberBaseInfoId + * @author yinzuomei + * @description 根据党员库id,查询党员认证信息 + * @Date 2020/6/18 0:04 + **/ + List selectByPartyMemberBaseInfoId(String partymemberBaseInfoId); +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java index 6c614045fb..3b756089a9 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberBaseInfoDao.java @@ -22,9 +22,11 @@ import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -78,4 +80,31 @@ public interface PartymemberBaseInfoDao extends BaseDao selectListReviewedParyMember(ReviewedParyMemberFormDTO formDTO); + + /** + * @return com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity + * @param idCard + * @author yinzuomei + * @description 根据身份证号查询党员库 + * @Date 2020/6/17 23:49 + **/ + List selectByIdCard(@Param("idCard") String idCard,@Param("id")String id); + + /** + * @return java.util.List + * @param partyBranchId + * @author yinzuomei + * @description 根据党支部id,查询党员列表 + * @Date 2020/6/18 11:05 + **/ + List selectListPartyMemberBaseInfo(String partyBranchId); + + /** + * @return com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO + * @param partyMemberId + * @author yinzuomei + * @description 根据党员库id,查询党员信息 + * @Date 2020/6/18 17:24 + **/ + PartyMemberBaseInfoDetailResultDTO queryPartyMemberBaseInfoById(String partyMemberId); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartyBranchMembersEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartyBranchMembersEntity.java new file mode 100644 index 0000000000..4ab74c40bc --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartyBranchMembersEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("party_branch_members") +public class PartyBranchMembersEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 党支部id,customer_party_branch.id + */ + private String branchId; + + /** + * 党员库表主键,partymember_base_info.id + */ + private String partymemberBaseInfoId; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartymemberAuthRecordEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartymemberAuthRecordEntity.java new file mode 100644 index 0000000000..8639d00ea1 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/PartymemberAuthRecordEntity.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.modules.partymember.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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("partymember_auth_record") +public class PartymemberAuthRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * partymember_base_info.id + */ + private String partymemberBaseInfoId; + + /** + * 认证居民id + */ + private String userId; + + /** + * 认证时间(和partymember_info表时间一致) + */ + private Date authTime; + + /** + * 认证网格id + */ + private String gridId; + + /** + * 认证客户id + */ + private String customerId; + + /** + * 认证的描述:账户于2020年10月30号在海泊桥社区-第一网格激活 + */ + private String authDesc; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/PartyBranchMembersExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/PartyBranchMembersExcel.java new file mode 100644 index 0000000000..5a5eec75c8 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/PartyBranchMembersExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党支部党员关系表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class PartyBranchMembersExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "党支部id,customer_party_branch.id") + private String branchId; + + @Excel(name = "党员库表主键,partymember_base_info.id") + private String partymemberBaseInfoId; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/PartymemberAuthRecordExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/PartymemberAuthRecordExcel.java new file mode 100644 index 0000000000..d75dc1d6e7 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/PartymemberAuthRecordExcel.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.modules.partymember.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党员认证记录表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class PartymemberAuthRecordExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "partymember_base_info.id") + private String partymemberBaseInfoId; + + @Excel(name = "认证居民id") + private String userId; + + @Excel(name = "认证时间(和partymember_info表时间一致)") + private Date authTime; + + @Excel(name = "认证网格id") + private String gridId; + + @Excel(name = "认证客户id") + private String customerId; + + @Excel(name = "认证的描述:账户于2020年10月30号在海泊桥社区-第一网格激活") + private String authDesc; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/PartyBranchMembersRedis.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/PartyBranchMembersRedis.java new file mode 100644 index 0000000000..b437b564a2 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/PartyBranchMembersRedis.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.modules.partymember.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党支部党员关系表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Component +public class PartyBranchMembersRedis { + @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/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/PartymemberAuthRecordRedis.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/PartymemberAuthRecordRedis.java new file mode 100644 index 0000000000..53193bdd59 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/PartymemberAuthRecordRedis.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.modules.partymember.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党员认证记录表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Component +public class PartymemberAuthRecordRedis { + @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/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyBranchMembersService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyBranchMembersService.java new file mode 100644 index 0000000000..348102f417 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyBranchMembersService.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.modules.partymember.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.partymember.entity.PartyBranchMembersEntity; +import com.epmet.resi.partymember.dto.partymember.PartyBranchMembersDTO; + +import java.util.List; +import java.util.Map; + +/** + * 党支部党员关系表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface PartyBranchMembersService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PartyBranchMembersDTO + * @author generator + * @date 2020-06-17 + */ + PartyBranchMembersDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(PartyBranchMembersDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(PartyBranchMembersDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberAuthRecordService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberAuthRecordService.java new file mode 100644 index 0000000000..1087dc909b --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberAuthRecordService.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.modules.partymember.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.partymember.entity.PartymemberAuthRecordEntity; +import com.epmet.modules.partymember.entity.PartymemberInfoEntity; +import com.epmet.resi.partymember.dto.partymember.PartymemberAuthRecordDTO; + +import java.util.List; +import java.util.Map; + +/** + * 党员认证记录表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface PartymemberAuthRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PartymemberAuthRecordDTO + * @author generator + * @date 2020-06-17 + */ + PartymemberAuthRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(PartymemberAuthRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(PartymemberAuthRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); + + /** + * @return void + * @param partyMemberInfoEntity + * @param partymemberBaseInfoId + * @author yinzuomei + * @description 自动匹配、人工审核是党员,记录居民-党员库关系 + * @Date 2020/6/19 13:06 + **/ + void insert(PartymemberInfoEntity partyMemberInfoEntity, String partymemberBaseInfoId); +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java index e317427c92..b25f8e06b0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberBaseInfoService.java @@ -24,8 +24,12 @@ import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; @@ -125,4 +129,40 @@ public interface PartymemberBaseInfoService extends BaseService> audited(ReviewedParyMemberFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 添加党员 + * @Date 2020/6/17 22:50 + **/ + String addPartyMemberBaseInfo(PartyMemberBaseInfoAddFormDTO formDTO); + + /** + * @return java.util.List + * @param partyBranchId + * @author yinzuomei + * @description 根据党支部id,查询党员列表 + * @Date 2020/6/18 10:17 + **/ + List listPartyMemberBaseInfo(String partyBranchId); + + /** + * @return com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO + * @param partyMemberId + * @author yinzuomei + * @description 根据党员库id,查询党员信息 + * @Date 2020/6/18 17:15 + **/ + PartyMemberBaseInfoDetailResultDTO queryPartyMemberBaseInfoById(String partyMemberId); + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 删除党员 + * @Date 2020/6/18 17:35 + **/ + void deltePartyMemberBaseInfo(DelPartyMemberBaseInfoFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyBranchMembersServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyBranchMembersServiceImpl.java new file mode 100644 index 0000000000..9297c47fbc --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyBranchMembersServiceImpl.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.modules.partymember.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.modules.partymember.dao.PartyBranchMembersDao; +import com.epmet.modules.partymember.entity.PartyBranchMembersEntity; +import com.epmet.modules.partymember.redis.PartyBranchMembersRedis; +import com.epmet.modules.partymember.service.PartyBranchMembersService; +import com.epmet.resi.partymember.dto.partymember.PartyBranchMembersDTO; +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 yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class PartyBranchMembersServiceImpl extends BaseServiceImpl implements PartyBranchMembersService { + + @Autowired + private PartyBranchMembersRedis partyBranchMembersRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PartyBranchMembersDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PartyBranchMembersDTO.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 PartyBranchMembersDTO get(String id) { + PartyBranchMembersEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PartyBranchMembersDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PartyBranchMembersDTO dto) { + PartyBranchMembersEntity entity = ConvertUtils.sourceToTarget(dto, PartyBranchMembersEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PartyBranchMembersDTO dto) { + PartyBranchMembersEntity entity = ConvertUtils.sourceToTarget(dto, PartyBranchMembersEntity.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/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index c4c661debf..61d8f0a5f4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -10,26 +10,20 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; import com.epmet.constant.PartyMemberMessageConstant; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.StaffRoleFormDTO; -import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; -import com.epmet.dto.result.AgencyAndStaffsResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.GridInfoResultDTO; -import com.epmet.dto.result.UserResiInfoResultDTO; -import com.epmet.modules.feign.EpmetMessageFeignClient; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.feign.ResiGroupFeignClient; import com.epmet.modules.partymember.entity.*; import com.epmet.modules.partymember.redis.PartymemberInfoRedis; import com.epmet.modules.partymember.service.*; -import com.epmet.modules.warmhearted.constant.ResiWarmUserMessageConstant; import com.epmet.modules.warmhearted.constant.ResiWarmheartedConstant; import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant; import com.epmet.redis.ResiPartyMemberRedis; @@ -50,6 +44,8 @@ import com.epmet.resi.partymember.dto.partymember.result.AutoFailedDetailResultD import com.epmet.resi.partymember.dto.partymember.result.RejectedDetailResultDTO; import lombok.extern.slf4j.Slf4j; 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; @@ -57,7 +53,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Map; /** * 党员认证 @@ -68,7 +63,7 @@ import java.util.Map; @Service @Slf4j public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService { - + private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private EpmetUserFeignClient epmetUserFeignClient; @Autowired @@ -86,13 +81,16 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService @Autowired private PartymemberRegisterRelationService partymemberRegisterRelationService; @Autowired - private EpmetMessageFeignClient messageFeignClient; + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Autowired private GovOrgFeignClient govOrgFeignClient; @Autowired private ResiPartyMemberRedis resiPartyMemberRedis; @Autowired private ResiGroupFeignClient resiGroupFeignClient; + @Autowired + private PartymemberAuthRecordService partymemberAuthRecordService; + @Override @Transactional(rollbackFor = Exception.class) public Result init(PartyMemberInitFromDTO fromDto) { @@ -148,17 +146,21 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService if (null != partyMemberInfoResult) { return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode()); } - //TODO 方便测试屏蔽短信验证码 - /*//生成短信验证码 - Map message = (Map) messageFeignClient.sendSmsCaptcha(fromDTO.getMobile()).getData(); - if (null == message) { + //生成短信验证码 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(fromDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.USER_REGISTER); + Result sendVerificationCodeResult = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if(!sendVerificationCodeResult.success()|| + null==sendVerificationCodeResult.getData() + || StringUtils.isBlank(sendVerificationCodeResult.getData().getCode())){ return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); } //删除旧验证码 partyMemberInfoRedis.deleteUserMobileCodeByPattern(fromDTO.getUserId(), fromDTO.getMobile()); //将验证码存入Redis - partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), message.get("code"));*/ + partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), sendVerificationCodeResult.getData().getCode()); //将访问记录更新到热心居民申请行为记录表 saveOrUpdateVisit(fromDTO.getVisitId(), null, PartyMemberConstant.OPERATE_OPERATE_SMS_CODE); @@ -182,7 +184,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); }*/ - //获取党员基本信息 + //获取党员基本信息(匹配) PartymemberConfirmAutoDTO confirmAutoDTO = partymemberBaseInfoService.getPartyMemberBaseInfo(partyMemberInfoDTO); @@ -212,6 +214,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService partyMemberInfoEntity.setConfirmResult(PartyMemberConstant.AUTO_CONFIRM_SUCCESS); if (partyMemberInfoEntity.getId().isEmpty()) { partymemberInfoService.insert(partyMemberInfoEntity); + //记录当前居民与党员库关系,保存认证信息 + logger.info(String.format("党员认证自动匹配成功,保存partymember_auth_record,userId=%s,党员库id=%s",partyMemberInfoEntity.getUserId(),confirmAutoDTO.getPatryMemberBaseInfoId())); + partymemberAuthRecordService.insert(partyMemberInfoEntity,confirmAutoDTO.getPatryMemberBaseInfoId()); } else { partymemberInfoService.updateById(partyMemberInfoEntity); } @@ -256,7 +261,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberConfirmAutoEntity.class)); } } - + // //判断是否已注册居民,如果没有则注册居民 isResiRegister(partyMemberInfoDTO); @@ -301,7 +306,6 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberInfoEntity partyMemberInfoEntity = partymemberInfoService.selectById(fromDTO.getPartyMemberId()); partyMemberInfoEntity.setId(manualEntity.getPartymemberInfoId()); partyMemberInfoEntity.setConfirmResult(fromDTO.getPartyMemberFlag()); - partymemberInfoService.updateById(partyMemberInfoEntity); manualEntity.setAuditStatus(fromDTO.getPartyMemberFlag()); @@ -326,6 +330,12 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService identityParam.setUserId(partyMemberInfoEntity.getUserId()); identityParam.setPartyFlag(NumConstant.ONE_STR); resiGroupFeignClient.updateWhenAuditedResiRole(identityParam); + //如果是自动匹配失败的,人工审核他是党员,需要记录党员库-居民的认证关系 + PartymemberConfirmAutoDTO partymemberConfirmAutoDTO=partymemberConfirmAutoService.get(fromDTO.getAutoId()); + if(partymemberConfirmAutoDTO!=null){ + logger.info(String.format("自动匹配失败,人工审核是党员,保存partymember_auth_record,userId=%s,党员库id=%s",partyMemberInfoEntity.getUserId(),partymemberConfirmAutoDTO.getPatryMemberBaseInfoId())); + partymemberAuthRecordService.insert(partyMemberInfoEntity,partymemberConfirmAutoDTO.getPatryMemberBaseInfoId()); + } } else { auditMessageToResi(partyMemberInfoEntity, PartyMemberMessageConstant.AUDIT_REJECT_MSG); } @@ -608,7 +618,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService userMessageFormDTO.setMessageContent(messageContent); userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); //保存消息 - return messageFeignClient.saveUserMessage(userMessageFormDTO); + return epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO); } /** @@ -663,7 +673,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService }); }); if (msgList.size() > NumConstant.ZERO) { - result = messageFeignClient.saveUserMessageList(msgList); + result = epmetMessageOpenFeignClient.saveUserMessageList(msgList); } return result; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberAuthRecordServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberAuthRecordServiceImpl.java new file mode 100644 index 0000000000..0252d78942 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberAuthRecordServiceImpl.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.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.commons.tools.utils.Result; +import com.epmet.constant.PartyMemberConstant; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.modules.partymember.dao.PartymemberAuthRecordDao; +import com.epmet.modules.partymember.entity.PartymemberAuthRecordEntity; +import com.epmet.modules.partymember.entity.PartymemberInfoEntity; +import com.epmet.modules.partymember.redis.PartymemberAuthRecordRedis; +import com.epmet.modules.partymember.service.PartymemberAuthRecordService; +import com.epmet.resi.partymember.dto.partymember.PartymemberAuthRecordDTO; +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.Calendar; +import java.util.List; +import java.util.Map; + +/** + * 党员认证记录表 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class PartymemberAuthRecordServiceImpl extends BaseServiceImpl implements PartymemberAuthRecordService { + private static final Logger logger = LoggerFactory.getLogger(PartymemberAuthRecordServiceImpl.class); + @Autowired + private PartymemberAuthRecordRedis partymemberAuthRecordRedis; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PartymemberAuthRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PartymemberAuthRecordDTO.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 PartymemberAuthRecordDTO get(String id) { + PartymemberAuthRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PartymemberAuthRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PartymemberAuthRecordDTO dto) { + PartymemberAuthRecordEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberAuthRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PartymemberAuthRecordDTO dto) { + PartymemberAuthRecordEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberAuthRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void insert(PartymemberInfoEntity partyMemberInfoEntity, String partymemberBaseInfoId) { + PartymemberAuthRecordEntity partymemberAuthRecordEntity=new PartymemberAuthRecordEntity(); + partymemberAuthRecordEntity.setPartymemberBaseInfoId(partymemberBaseInfoId); + partymemberAuthRecordEntity.setUserId(partyMemberInfoEntity.getUserId()); + partymemberAuthRecordEntity.setAuthTime(partyMemberInfoEntity.getCreatedTime()); + partymemberAuthRecordEntity.setCustomerId(partyMemberInfoEntity.getCustomerId()); + partymemberAuthRecordEntity.setGridId(partyMemberInfoEntity.getGridId()); + //日历对象 + Calendar calendar = Calendar.getInstance(); + //设置当前日期 + calendar.setTime(partymemberAuthRecordEntity.getAuthTime()); + Result result=govOrgOpenFeignClient.queryGridInfo(partymemberAuthRecordEntity.getGridId()); + String gridName=""; + if(result.success()&&null!=result.getData()){ + gridName=String.format("%s-%s",result.getData().getParentAgencyName(),result.getData().getGridName()); + }else{ + logger.error("保存用户认证党员记录失败:查询网格名称失败"); + } + partymemberAuthRecordEntity.setAuthDesc(String.format(PartyMemberConstant.AUTH_DESC, + calendar.get(Calendar.YEAR), + calendar.get(Calendar.MONTH)+1, + calendar.get(Calendar.DATE), + gridName)); + baseDao.insert(partymemberAuthRecordEntity); + logger.info(String.format("保存用户认证党员记录成功:认证描述%s",partymemberAuthRecordEntity.getAuthDesc())); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java index f91dc23fe7..35e890d7b7 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java @@ -22,24 +22,38 @@ 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.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.IdCardNoValidatorUtils; +import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.PartyMemberConstant; import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; +import com.epmet.modules.partymember.dao.PartyBranchMembersDao; +import com.epmet.modules.partymember.dao.PartymemberAuthRecordDao; import com.epmet.modules.partymember.dao.PartymemberBaseInfoDao; +import com.epmet.modules.partymember.entity.PartymemberAuthRecordEntity; import com.epmet.modules.partymember.entity.PartymemberBaseInfoEntity; import com.epmet.modules.partymember.redis.PartymemberBaseInfoRedis; +import com.epmet.modules.partymember.service.PartyBranchMembersService; import com.epmet.modules.partymember.service.PartymemberBaseInfoService; +import com.epmet.resi.partymember.dto.partymember.PartyBranchMembersDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; import com.epmet.resi.partymember.dto.partymember.form.ReviewedParyMemberFormDTO; import com.epmet.resi.partymember.dto.partymember.form.UnderReviewParyMemberFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.ReviewedParyMemberResultDTO; import com.epmet.resi.partymember.dto.partymember.result.UnderReviewParyMemberResultDTO; import info.debatty.java.stringsimilarity.Levenshtein; @@ -68,6 +82,14 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl partymemberBaseInfoEntityList = baseDao.selectByIdCard(idCardNo, partymemberBaseInfoId); + if (null != partymemberBaseInfoEntityList&&partymemberBaseInfoEntityList.size()>0) { + throw new RenException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode()); + } + } + @Override @Transactional(rollbackFor = Exception.class) public void delete(String[] ids) { @@ -283,11 +330,12 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId()); String gridFullPath = ""; if (gridInfoResult.success() && null != gridInfoResult.getData()) { - gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), + /*gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName(), gridInfoResult.getData().getCommnuityName(), gridInfoResult.getData().getGridName()); gridFullPath = gridFullPath.replaceAll("null", "").trim(); - gridFullPath = gridFullPath.replaceAll("--", "-").trim(); + gridFullPath = gridFullPath.replaceAll("--", "-").trim();*/ + gridFullPath=String.format("%s-%s",gridInfoResult.getData().getParentAgencyName(),gridInfoResult.getData().getGridName()); } //查询居民认证信息,获取居民头像 List userIdList = new ArrayList<>(); @@ -326,11 +374,12 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl gridInfoResult = govOrgFeignClient.queryGridInfo(formDTO.getGridId()); String gridFullPath = ""; if (gridInfoResult.success() && null != gridInfoResult.getData()) { - gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(), + /*gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(), gridInfoResult.getData().getCommnuityName() == null?"":gridInfoResult.getData().getCommnuityName(), gridInfoResult.getData().getGridName() == null?"":gridInfoResult.getData().getGridName()); gridFullPath = gridFullPath.replaceAll("null", "").trim(); - gridFullPath = gridFullPath.replaceAll("--", "-").trim(); + gridFullPath = gridFullPath.replaceAll("--", "-").trim();*/ + gridFullPath=String.format("%s-%s",gridInfoResult.getData().getParentAgencyName(),gridInfoResult.getData().getGridName()); } //查询居民认证信息,获取居民头像 List userIdList = new ArrayList<>(); @@ -354,6 +403,68 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl>().ok(list); } + @Override + @Transactional(rollbackFor = Exception.class) + public String addPartyMemberBaseInfo(PartyMemberBaseInfoAddFormDTO formDTO) { + //校验数据 + this.checkPartymemberBaseInfoDTO(formDTO.getIdCard(),formDTO.getMobile(),null); + //插入党员库记录 + PartymemberBaseInfoEntity entity = ConvertUtils.sourceToTarget(formDTO, PartymemberBaseInfoEntity.class); + insert(entity); + //插入党支部-党员关系记录 + PartyBranchMembersDTO partyBranchMembersDTO=new PartyBranchMembersDTO(); + partyBranchMembersDTO.setBranchId(formDTO.getBranchId()); + partyBranchMembersDTO.setPartymemberBaseInfoId(entity.getId()); + partyBranchMembersService.save(partyBranchMembersDTO); + return entity.getId(); + } + + @Override + public List listPartyMemberBaseInfo(String partyBranchId) { + List resultDTOList=new ArrayList<>(); + if(StringUtils.isNotBlank(partyBranchId)){ + List entityList=baseDao.selectListPartyMemberBaseInfo(partyBranchId); + for(PartymemberBaseInfoEntity entity:entityList){ + PartymemberBaseInfoResultDTO partymemberBaseInfoResultDTO=new PartymemberBaseInfoResultDTO(); + partymemberBaseInfoResultDTO.setName(entity.getName()); + partymemberBaseInfoResultDTO.setPartyMemberId(entity.getId()); + partymemberBaseInfoResultDTO.setGender(IdCardNoValidatorUtils.getGender(entity.getIdCard())); + resultDTOList.add(partymemberBaseInfoResultDTO); + } + } + return resultDTOList; + } + + @Override + public PartyMemberBaseInfoDetailResultDTO queryPartyMemberBaseInfoById(String partyMemberId) { + PartyMemberBaseInfoDetailResultDTO partyMemberBaseInfoDetailResultDTO = baseDao.queryPartyMemberBaseInfoById(partyMemberId); + if (null != partyMemberBaseInfoDetailResultDTO) { + //性别 + partyMemberBaseInfoDetailResultDTO.setGender(IdCardNoValidatorUtils.getGender(partyMemberBaseInfoDetailResultDTO.getIdCard())); + List entityList = partymemberAuthRecordDao.selectByPartyMemberBaseInfoId(partyMemberId); + if (null != entityList&&entityList.size()>0) { + partyMemberBaseInfoDetailResultDTO.setStatus(Boolean.TRUE); + partyMemberBaseInfoDetailResultDTO.setActiveDesc(entityList.get(0).getAuthDesc()); + } else { + partyMemberBaseInfoDetailResultDTO.setStatus(Boolean.FALSE); + partyMemberBaseInfoDetailResultDTO.setActiveDesc(""); + } + } + return partyMemberBaseInfoDetailResultDTO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deltePartyMemberBaseInfo(DelPartyMemberBaseInfoFormDTO formDTO) { + List entityList = partymemberAuthRecordDao.selectByPartyMemberBaseInfoId(formDTO.getPartyMemberId()); + if (null != entityList&&entityList.size()>0) { + throw new RenException(EpmetErrorCode.CANNOT_DELETE_PARTY_MEMBER.getCode()); + } + this.deleteById(formDTO.getPartyMemberId()); + partyBranchMembersDao.deletePartyBranchMember(formDTO.getPartyBranchId(), + formDTO.getPartyMemberId(), + loginUserUtil.getLoginUserId()); + } /** * 生成返回结果 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 77a6eaa634..4803ebef14 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -29,7 +29,6 @@ import com.epmet.dto.form.CreatedTimeByUserIdFormDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; import com.epmet.dto.result.GridInfoResultDTO; -import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.partymember.dao.PartymemberInfoDao; @@ -159,10 +158,11 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl gridInfoResult = govOrgFeignClient.queryGridInfo(certifiedFormDTO.getGridId()); String gridFullPath = ""; if (gridInfoResult.success() && null != gridInfoResult.getData()) { - gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(), + /*gridFullPath = String.format("%s-%s-%s", gridInfoResult.getData().getStreetName() == null?"":gridInfoResult.getData().getStreetName(), gridInfoResult.getData().getCommnuityName() == null?"":gridInfoResult.getData().getCommnuityName(), gridInfoResult.getData().getGridName() == null?"":gridInfoResult.getData().getGridName()); - gridFullPath = gridFullPath.replaceAll("--", "").trim(); + gridFullPath = gridFullPath.replaceAll("--", "").trim();*/ + gridFullPath=String.format("%s-%s",gridInfoResult.getData().getParentAgencyName(),gridInfoResult.getData().getGridName()); } for (CertifiedResultDTO datum : listResult.getData()) { datum.setGridFullPath(gridFullPath); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml index 9e0c0fac96..9a2b17a333 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml @@ -30,6 +30,15 @@ spring: url: @spring.datasource.druid.url@ username: @spring.datasource.druid.username@ password: @spring.datasource.druid.password@ + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -104,3 +113,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartyBranchMembersDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartyBranchMembersDao.xml new file mode 100644 index 0000000000..63cc73d5f2 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartyBranchMembersDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + update party_branch_members + set DEL_FLAG='1',UPDATED_TIME=NOW(),UPDATED_BY=#{userId} + WHERE PARTYMEMBER_BASE_INFO_ID=#{partyMemberId} + AND BRANCH_ID=#{partyBranchId} + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberAuthRecordDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberAuthRecordDao.xml new file mode 100644 index 0000000000..7bb2065080 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberAuthRecordDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index 2cbad32ae0..1b2ea4f5ee 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml @@ -25,33 +25,54 @@ SELECT * FROM - partymember_base_info + partymember_base_info pbi WHERE - CUSTOMER_ID = #{customerId} - AND ID_CARD = #{idCard} - AND DEL_FLAG = 0 + pbi.CUSTOMER_ID = #{customerId} + AND pbi.ID_CARD = #{idCard} + AND pbi.DEL_FLAG = 0 + AND NOT EXISTS (SELECT + * + FROM + partymember_auth_record m + WHERE + pbi.id=m.PARTYMEMBER_BASE_INFO_ID + and m.del_flag='0') @@ -120,4 +141,46 @@ applyTime DESC LIMIT #{pageNo},#{pageSize} + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-voice/pom.xml b/epmet-module/resi-voice/pom.xml new file mode 100644 index 0000000000..caf0fa012c --- /dev/null +++ b/epmet-module/resi-voice/pom.xml @@ -0,0 +1,20 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + resi-voice + pom + + resi-voice-client + resi-voice-server + + + + \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-client/pom.xml b/epmet-module/resi-voice/resi-voice-client/pom.xml new file mode 100644 index 0000000000..ec6ad2107d --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-client/pom.xml @@ -0,0 +1,41 @@ + + + + resi-voice + com.epmet + 2.0.0 + + 4.0.0 + + resi-voice-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + com.epmet + resi-partymember-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + \ No newline at end of file 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/Dockerfile b/epmet-module/resi-voice/resi-voice-server/Dockerfile new file mode 100644 index 0000000000..ae49b60d2b --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8106 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..373c575fc9 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + resi-voice-server: + container_name: resi-voice-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/resi-voice-server:0.3.7 + ports: + - "8106:8106" + 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: 250M \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..d6183761f9 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + resi-voice-server: + container_name: resi-voice-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-voice-server:0.3.7 + ports: + - "8106:8106" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 400M \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-server/pom.xml b/epmet-module/resi-voice/resi-voice-server/pom.xml new file mode 100644 index 0000000000..c30d0bd72b --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/pom.xml @@ -0,0 +1,136 @@ + + + 4.0.0 + 0.3.7 + + resi-voice + com.epmet + 2.0.0 + + + resi-voice-server + jar + + + + com.epmet + resi-voice-client + 2.0.0 + + + com.epmet + gov-voice-client + 2.0.0 + + + com.epmet + epmet-commons-tools + 2.0.0 + + + 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 + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + + ${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 + + + 8106 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + + + test + + + 8106 + 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-module/resi-voice/resi-voice-server/src/main/java/com/epmet/ResiVoiceApplication.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/ResiVoiceApplication.java new file mode 100644 index 0000000000..27d6017d9a --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/ResiVoiceApplication.java @@ -0,0 +1,20 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class ResiVoiceApplication { + public static void main(String[] args) { + SpringApplication.run(ResiVoiceApplication.class, args); + } +} 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/config/ModuleConfigImpl.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..ad76e9c155 --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "resivoice"; + } +} 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..55ad32285d --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -0,0 +1,92 @@ +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.ArrayList; +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()){ + if(null == articles.getData() || articles.getData().size() <= NumConstant.ZERO){ + return new ArrayList<>(); + } + 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-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..e77e88368d --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml @@ -0,0 +1,67 @@ +server: + port: @server.port@ + servlet: + context-path: /resi/voice + +spring: + main: + allow-bean-definition-overriding: true + application: + name: resi-voice-server + #环境 dev|test|prod + profiles: + active: dev + 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 diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/resources/logback-spring.xml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..98bc0a986b --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/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/Dockerfile b/epmet-openapi/epmet-openapi-scan/Dockerfile new file mode 100644 index 0000000000..e619f718b9 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8107 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file 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..10c2835084 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-openapi-scan: + container_name: epmet-openapi-scan-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-scan:0.3.11 + 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..62b847b4d6 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-openapi-scan: + container_name: epmet-openapi-scan-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-openapi-scan:0.3.11 + 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..8a80b425df --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -0,0 +1,138 @@ + + + + 4.0.0 + 0.3.11 + epmet-openapi-scan + jar + + + epmet-openapi + com.epmet + 2.0.0 + + + + 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..38f55211d2 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/ScanApplication.java @@ -0,0 +1,30 @@ +/** + * 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; +import org.springframework.context.annotation.ComponentScan; + +/** + * 管理后台 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ + +@SpringBootApplication +@ComponentScan(basePackages = "com.epmet") +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/constant/SysConstant.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java new file mode 100644 index 0000000000..a23795e538 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java @@ -0,0 +1,18 @@ +package com.epmet.openapi.scan.common.constant; + +/** + * 系统常量 + * + * @author jianjun liu + * @date 2020-06-05 10:42 + **/ +public class SysConstant { + + public static final String UTF8 = "utf-8"; + + public static final Integer MAX_TEXT_TASKS = 100; + public static final Integer MAX_IMG_TASKS = 10; + + public static final String CODE = "code"; + public static final String DATA = "data"; +} 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..cfb8d77ac2 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/ImgSceneEnum.java @@ -0,0 +1,47 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * desc:图片检测场景 + * @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/common/enu/SuggestionEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SuggestionEnum.java new file mode 100644 index 0000000000..455b2975f4 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SuggestionEnum.java @@ -0,0 +1,48 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * desc:文本检测建议 + * @author jianjun liu + * @date 2020-06-04 21:39 + **/ +public enum SuggestionEnum { + PASS("pass", "正常"), + REVIEW("review", "需要人工审核"), + BLOCK("block", "文本违规"); + + private String code; + private String desc; + + SuggestionEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static List getImgSceneList() { + List result = new ArrayList<>(); + SuggestionEnum[] values = SuggestionEnum.values(); + for (SuggestionEnum 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/SysResponseEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SysResponseEnum.java new file mode 100644 index 0000000000..330cdb87e8 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SysResponseEnum.java @@ -0,0 +1,44 @@ +package com.epmet.openapi.scan.common.enu; + +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 21:39 + **/ +public enum SysResponseEnum { + /** + * + * 业务代码枚举类 + * + * 编码样式:【CCCBBOOXX】 + * 编码示例说明: + * CCC 中心编码&业务系统 (110-内容扫描服务中心服务) + * BB 业务类型(00-默认 ) + * OO 操作类型(00-默认) + * XX 具体编码(00-成功,01-失败,02-参数错误,10-异常 99-系统错误) + * + */ + /*通用枚举 */ + EXCEPTION(10001,"系统异常"), + + + /*审核内容 业务 01*/ + SCAN_TASK_LIST_PARAM_ERROR(110010001,"任务列表不能为空"), + SCAN_PARAM_ERROR(110010002,"参数格式不正确"), + ; + + private Integer code; + private String msg; + SysResponseEnum(Integer code, String msg){ + this.code = code; + this.msg = msg; + } + + public Integer getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/TextSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/TextSceneEnum.java new file mode 100644 index 0000000000..263d6e25ed --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/TextSceneEnum.java @@ -0,0 +1,46 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * desc:文本检测场景 + * @author jianjun liu + * @date 2020-06-04 21:39 + **/ +public enum TextSceneEnum { + ANTISPAM("antispam", "文本垃圾内容检测"); + + private String code; + private String desc; + + TextSceneEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static List getTextSceneList() { + List result = new ArrayList<>(); + TextSceneEnum[] values = TextSceneEnum.values(); + for (TextSceneEnum 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/exception/ExeCuteHttpException.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExeCuteHttpException.java new file mode 100644 index 0000000000..99daf84bae --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExeCuteHttpException.java @@ -0,0 +1,23 @@ +package com.epmet.openapi.scan.common.exception; + +import com.epmet.commons.tools.utils.MessageUtils; +import com.epmet.openapi.scan.common.enu.SysResponseEnum; + +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-05 10:31 + **/ +public class ExeCuteHttpException extends RuntimeException { + private int code; + private String msg; + + public ExeCuteHttpException(String msg) { + this(SysResponseEnum.EXCEPTION.getCode(), msg); + } + public ExeCuteHttpException(int code, String... params) { + this.code = code; + this.msg = MessageUtils.getMessage(code, params); + + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java new file mode 100644 index 0000000000..3904011b00 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.openapi.scan.common.redis; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class RedisKeys { + + /** + * 党群e事通redis前缀 + */ + private static String rootPrefix = "epmet:"; + + /** + * desc:白名单Key + * @return + */ + public static String getWhiteList () { + return rootPrefix.concat("openapi:scan:whitelist"); + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/HttpClientManager.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/HttpClientManager.java new file mode 100644 index 0000000000..7ca0302331 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/HttpClientManager.java @@ -0,0 +1,171 @@ +package com.epmet.openapi.scan.common.util; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpStatus; +import org.apache.http.NameValuePair; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.springframework.util.CollectionUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * desc: http 工具类 + * date: 2020/6/4 22:27 + * + * @author: jianjun liu + */ +@Slf4j +public class HttpClientManager { + private static int connectionTimeout = 3000;// 连接超时时间,毫秒 + private static int soTimeout = 10000;// 读取数据超时时间,毫秒 + /** + * HttpClient对象 + */ + private static CloseableHttpClient httpclient = HttpClients.custom().disableAutomaticRetries().build(); + + /*** 超时设置 ****/ + private static RequestConfig requestConfig = RequestConfig.custom() + .setSocketTimeout(soTimeout) + .setConnectTimeout(connectionTimeout) + .build();//设置请求和传输超时时间 + + public static HttpClientManager getInstance() { + return SingleClass.instance; + } + + private static class SingleClass { + private final static HttpClientManager instance = new HttpClientManager(); + } + + /** + * desc: 发送json post 请求 + * param: url,jsonStrParam + * return: Result + * date: 2019/2/21 9:12 + * + * @author: jianjun liu + */ + public Result sendPost(String url, Map paramsMap) { + + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + httppost.addHeader("Content-Type", "application/x-www-form-urlencoded charset=utf-8"); + + List list = new ArrayList(); + for (String key : paramsMap.keySet()) { + list.add(new BasicNameValuePair(key, String.valueOf(paramsMap.get(key)))); + } + UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, "utf-8"); + httppost.setEntity(urlEncodedFormEntity); + + return execute(httppost); + } catch (Exception e) { + e.printStackTrace(); + log.error("send exception", e); + return new Result().error(8000, e.getMessage()); + } + + } + + /** + * desc: 发送json post 请求 + * param: url,jsonStrParam + * return: Result + * date: 2019/2/21 9:12 + * + * @author: jianjun liu + */ + public Result sendPostByJSON(String url, String jsonStrParam) { + + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + httppost.addHeader("Content-Type", "application/json; charset=utf-8"); + if (StringUtils.isNotEmpty(jsonStrParam)) { + StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + httppost.setEntity(se); + } + return execute(httppost); + } catch (Exception e) { + e.printStackTrace(); + log.error("send exception", e); + return new Result().error(8000, e.getMessage()); + } + + } + + /** + * desc: 发送get请求 + * param:url, params + * return: Result + * date: 2019/2/21 9:16 + * + * @author: jianjun liu + */ + public Result sendGet(String url, Map params) { + + try { + URIBuilder builder = new URIBuilder(url); + if (!CollectionUtils.isEmpty(params)) { + Set set = params.keySet(); + for (String key : set) { + builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key))); + } + } + HttpGet httpGet = new HttpGet(builder.build()); + httpGet.setConfig(requestConfig); + return execute(httpGet); + } catch (Exception e) { + log.error("sendGet exception", e); + return new Result().error(8000, e.getMessage()); + } + } + + private Result execute(HttpRequestBase httpMethod) { + CloseableHttpResponse response = null; + try { + response = httpclient.execute(httpMethod); + log.debug("http send response:{}", JSON.toJSONString(response)); + if (response != null && response.getStatusLine() != null) { + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + String result = EntityUtils.toString(response.getEntity()); + return new Result().ok(result); + } else { + log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode()); + } + } + } catch (Exception e) { + log.error("execute exception", e); + } finally { + httpMethod.releaseConnection(); + try { + if (response != null) { + response.close(); + } + } catch (IOException e) { + } + } + return new Result().error(8000, "系统异常"); + } +} + + diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/IAcsClientUtil.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/IAcsClientUtil.java new file mode 100644 index 0000000000..c0c8362727 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/IAcsClientUtil.java @@ -0,0 +1,67 @@ +package com.epmet.openapi.scan.common.util; + +/** + * @author jianjun liu + * @date 2020-06-05 10:03 + **/ + +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.epmet.openapi.scan.common.enu.RegionIdEnum; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; + +@Slf4j +@Component +public class IAcsClientUtil { + private static String accessKeyId; + private static String secret; + private static String product = "Green"; + + private static String regionId; + private static String endpointName = ""; + + private static IClientProfile profile; + + + @PostConstruct + private void initProFile() { + profile = DefaultProfile.getProfile(regionId, accessKeyId, secret); + try { + DefaultProfile.addEndpoint(endpointName, regionId, product, RegionIdEnum.getDoMain(regionId)); + } catch (ClientException e) { + log.error("initProFile exception", e.getMessage()); + } + } + + + public static IAcsClient getIAcsClient() { + return new DefaultAcsClient(profile); + } + + @Value("${aliyun.green.accessKeyId}") + public void setAccessKeyId(String accessKeyId) { + IAcsClientUtil.accessKeyId = accessKeyId; + } + + @Value("${aliyun.green.accessKeySecret}") + public void setSecret(String secret) { + IAcsClientUtil.secret = secret; + } + + @Value("${aliyun.green.regionId}") + public void setRegionId(String regionId) { + IAcsClientUtil.regionId = regionId; + } + + @Value("${aliyun.green.regionId}") + public void setEndpointName(String endpointName) { + IAcsClientUtil.endpointName = endpointName; + } +} \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/MapUtil.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/MapUtil.java new file mode 100644 index 0000000000..e98dbfd7a2 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/MapUtil.java @@ -0,0 +1,55 @@ +package com.epmet.openapi.scan.common.util; + +import org.apache.commons.lang3.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author jianjun liu + * @date 2020-06-05 16:44 + **/ +public class MapUtil { + /** + * 将url参数转换成map + * + * @param param aa=11&bb=22&cc=33 + * @return + */ + public static Map getUrlParams(String param) { + Map map = new HashMap<>(0); + if (StringUtils.isBlank(param)) { + return map; + } + String[] params = param.split("&"); + for (int i = 0; i < params.length; i++) { + String[] p = params[i].split("="); + if (p.length == 2) { + map.put(p[0], p[1]); + } + } + return map; + } + + /** + * 将map转换成url + * + * @param map + * @return + */ + public static String getUrlParamsByMap(Map map) { + if (map == null) { + return ""; + } + StringBuffer sb = new StringBuffer(); + for (Map.Entry entry : map.entrySet()) { + sb.append(entry.getKey() + "=" + entry.getValue()); + sb.append("&"); + } + String s = sb.toString(); + if (s.endsWith("&")) { + s = StringUtils.substringBeforeLast(s, "&"); + } + return s; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java new file mode 100644 index 0000000000..c79906908d --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java @@ -0,0 +1,152 @@ +package com.epmet.openapi.scan.common.util; + +import org.apache.commons.codec.binary.Base64; +import org.bouncycastle.util.encoders.UrlBase64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.crypto.Cipher; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.security.KeyFactory; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.Signature; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; + +/** + * @author jianjun liu + * @date 2020-06-05 16:48 + **/ + +public class RSASignature { + private static final Logger LOGGER = LoggerFactory.getLogger(RSASignature.class); + public static final String KEY_ALGORITHM = "RSA"; + public static final String SIGNATURE_ALGORITHM = "SHA1WithRSA"; + public static final String ENCODING = "utf-8"; + public static final String X509 = "X.509"; + + /** + * 获取私钥 + * + * @param key + * @return + * @throws Exception + */ + public static PrivateKey getPrivateKey(String key) throws Exception { + byte[] keyBytes = Base64.decodeBase64(key.getBytes(ENCODING)); + PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + PrivateKey privateKey = keyFactory.generatePrivate(keySpec); + return privateKey; + } + + /** + * 获取公钥 + * + * @param key + * @return + * @throws Exception + */ + public static PublicKey getPublicKey(String key) throws Exception { + byte[] keyBytes = Base64.decodeBase64(key.getBytes(ENCODING)); + CertificateFactory certificateFactory = CertificateFactory.getInstance(X509); + InputStream in = new ByteArrayInputStream(keyBytes); + Certificate certificate = certificateFactory.generateCertificate(in); + PublicKey publicKey = certificate.getPublicKey(); + return publicKey; + } + + /** + * 使用公钥对明文进行加密,返回BASE64编码的字符串 + * + * @param publicKey + * @param plainText + * @return + */ + public static String encrypt(String publicKey, String plainText) { + try { + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + byte[] encodedKey = Base64.decodeBase64(publicKey.getBytes(ENCODING)); + PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.ENCRYPT_MODE, pubKey); + byte[] enBytes = cipher.doFinal(plainText.getBytes()); + return new String(Base64.encodeBase64(enBytes)); + } catch (Exception e) { + LOGGER.error("rsa encrypt exception: {}", e.getMessage(), e); + } + return null; + } + + /** + * 使用私钥对明文密文进行解密 + * + * @param privateKey + * @param enStr + * @return + */ + public static String decrypt(String privateKey, String enStr) { + try { + PrivateKey priKey = getPrivateKey(privateKey); + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.DECRYPT_MODE, priKey); + byte[] deBytes = cipher.doFinal(Base64.decodeBase64(enStr)); + return new String(deBytes); + } catch (Exception e) { + LOGGER.error("rsa decrypt exception: {}", e.getMessage(), e); + } + return null; + } + + /** + * RSA私钥签名 + * + * @param content 待签名数据 + * @param privateKey 私钥 + * @return 签名值 + */ + public static String signByPrivateKey(String content, String privateKey) { + try { + PrivateKey priKey = getPrivateKey(privateKey); + Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); + signature.initSign(priKey); + signature.update(content.getBytes(ENCODING)); + byte[] signed = signature.sign(); + return new String(UrlBase64.encode(signed), ENCODING); + } catch (Exception e) { + LOGGER.error("sign error, content: {}", content, e); + } + return null; + } + + /** + * 公钥验签 + * + * @param content + * @param sign + * @param publicKey + * @return + */ + public static boolean verifySignByPublicKey(String content, String sign, String publicKey) { + try { + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + byte[] encodedKey = Base64.decodeBase64(publicKey.getBytes(ENCODING)); + PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); + + Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); + signature.initVerify(pubKey); + signature.update(content.getBytes(ENCODING)); + + return signature.verify(UrlBase64.decode(sign.getBytes(ENCODING))); + + } catch (Exception e) { + LOGGER.error("verify sign error, content: {}, sign: {}", content, sign, e); + } + return false; + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/ModuleConfigImpl.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..68532b7819 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.openapi.scan.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "epmetscan"; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java new file mode 100644 index 0000000000..c955a7f555 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java @@ -0,0 +1,31 @@ +package com.epmet.openapi.scan.config; + +import com.epmet.openapi.scan.interceptor.ScanApiAuthInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-08 14:30 + **/ + + @Configuration + public class WebAppConfig implements WebMvcConfigurer{ + @Autowired + private ScanApiAuthInterceptor scanApiAuthInterceptor; + + // 多个拦截器组成一个拦截器链 + // addPathPatterns 用于添加拦截规则 + // excludePathPatterns 用户排除拦截 + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(scanApiAuthInterceptor)//添加拦截器 + .addPathPatterns("/**") //拦截所有请求 + .excludePathPatterns("/opback/**");//对应的不拦截的请求 + } + } + diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/BackDoorController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/BackDoorController.java new file mode 100644 index 0000000000..433ff1b06d --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/BackDoorController.java @@ -0,0 +1,32 @@ +package com.epmet.openapi.scan.controller; + +import com.alibaba.fastjson.JSON; +import com.epmet.openapi.scan.common.redis.RedisKeys; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Set; + +/** + * @author jianjun liu + * @date 2020-06-04 20:39 + **/ +@RestController +@RequestMapping("opback") +public class BackDoorController { + @Autowired + private RedisTemplate redisTemplate; + + @RequestMapping("addWhite") + public String addWhite(@RequestParam String ip) { + SetOperations setOperations = redisTemplate.opsForSet(); + String whiteList = RedisKeys.getWhiteList(); + Long add = setOperations.add(whiteList, ip); + Set members = setOperations.members(whiteList); + return "ip:" + ip + "添加" + (add > 0 ? "成功" : "失败") + ",当前所有列表:" + JSON.toJSONString(members); + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java new file mode 100644 index 0000000000..efaae3ddd5 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java @@ -0,0 +1,59 @@ +package com.epmet.openapi.scan.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.openapi.scan.service.impl.ScanService; +import com.epmet.openapi.scan.support.param.ImgScanParam; +import com.epmet.openapi.scan.support.param.TextScanParam; +import com.epmet.openapi.scan.support.result.ImgAsyncScanResult; +import com.epmet.openapi.scan.support.result.SyncScanResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-05 10:39 + **/ +@RestController +@RequestMapping("api") +public class ScanController { + + @Autowired + private ScanService scanService; + + + /** + * desc:图片同步检测接口 + * + * @param param + * @return + */ + @RequestMapping("imgSyncScan") + public Result ImgSyncScan(@RequestBody ImgScanParam param) { + ValidatorUtils.validateEntity(param); + Result scanResultResult = scanService.sendSyncImgScan(param); + return scanResultResult; + } + + /** + * desc:文本同步检测接口 + * + * @param param + * @return + */ + @RequestMapping("textSyncScan") + public Result textSyncScan(@RequestBody TextScanParam param) { + ValidatorUtils.validateEntity(param); + Result scanResultResult = scanService.sendTextScan(param); + return scanResultResult; + } + + //@RequestMapping("imgAsyncScan") + public Result ImgAsyncScan(@RequestBody ImgScanParam param) { + Result scanResultResult = scanService.sendASyncImgScan(param); + return scanResultResult; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java new file mode 100644 index 0000000000..6ce851a45e --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java @@ -0,0 +1,60 @@ +package com.epmet.openapi.scan.interceptor; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.utils.IpUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.openapi.scan.common.redis.RedisKeys; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * @author jianjun liu + * @date 2020-06-05 16:36 + **/ +@Component +public class ScanApiAuthInterceptor implements HandlerInterceptor { + private static final Logger log = LoggerFactory.getLogger(ScanApiAuthInterceptor.class); + @Autowired + private RedisTemplate redisTemplate; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + String ip = IpUtils.getIpAddr(request); + SetOperations setOperations = redisTemplate.opsForSet(); + if (!setOperations.isMember(RedisKeys.getWhiteList(), ip)) { + log.warn("preHandle ip:{} is not in whitelist", ip); + String result = JSON.toJSONString(new Result<>().error(EpmetErrorCode.ERR401.getCode(), EpmetErrorCode.ERR401.getMsg())); + responseJson(response, result); + return false; + } + return true; + } + + private void responseJson(HttpServletResponse response, String json) throws Exception { + PrintWriter writer = null; + response.setCharacterEncoding("UTF-8"); + response.setContentType("text/json; charset=utf-8"); + try { + writer = response.getWriter(); + writer.print(json); + } catch (IOException e) { + log.error(e.toString()); + } finally { + if (writer != null) { + writer.close(); + } + } + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java new file mode 100644 index 0000000000..6f1959a2f8 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java @@ -0,0 +1,37 @@ +package com.epmet.openapi.scan.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.openapi.scan.support.param.ImgScanParam; +import com.epmet.openapi.scan.support.param.TextScanParam; +import com.epmet.openapi.scan.support.result.ImgAsyncScanResult; +import com.epmet.openapi.scan.support.result.SyncScanResult; + +/** + * desc:内容扫描接口 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-05 13:12 + **/ +public interface ScanService { + /** + * desc:扫描文本内容 同步 + * @param textScanParam + * @return ImgAsyncScanResult + */ + public Result sendTextScan(TextScanParam textScanParam); + + + /** + * desc:扫描图片内容 同步 + * @param imgScanParam + * @return + */ + public Result sendSyncImgScan(ImgScanParam imgScanParam); + /** + * desc:扫描图片内容 异步 + * @param imgScanParam + * @return + */ + public Result sendASyncImgScan(ImgScanParam imgScanParam); +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java new file mode 100644 index 0000000000..709fc7aef4 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java @@ -0,0 +1,320 @@ +package com.epmet.openapi.scan.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.AcsRequest; +import com.aliyuncs.exceptions.ClientException; +import com.aliyuncs.exceptions.ServerException; +import com.aliyuncs.green.model.v20180509.ImageAsyncScanRequest; +import com.aliyuncs.green.model.v20180509.ImageSyncScanRequest; +import com.aliyuncs.green.model.v20180509.TextScanRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.epmet.commons.tools.utils.Result; +import com.epmet.openapi.scan.common.constant.SysConstant; +import com.epmet.openapi.scan.common.enu.ImgSceneEnum; +import com.epmet.openapi.scan.common.enu.SuggestionEnum; +import com.epmet.openapi.scan.common.enu.SysResponseEnum; +import com.epmet.openapi.scan.common.enu.TextSceneEnum; +import com.epmet.openapi.scan.common.exception.ExeCuteHttpException; +import com.epmet.openapi.scan.common.util.IAcsClientUtil; +import com.epmet.openapi.scan.support.param.ImgScanParam; +import com.epmet.openapi.scan.support.param.ImgTask; +import com.epmet.openapi.scan.support.param.TextScanParam; +import com.epmet.openapi.scan.support.param.TextTask; +import com.epmet.openapi.scan.support.result.ImgAsyncScanResult; +import com.epmet.openapi.scan.support.result.ScanTaskResult; +import com.epmet.openapi.scan.support.result.SceneDetailResult; +import com.epmet.openapi.scan.support.result.SyncScanResult; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.HttpStatus; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-05 13:16 + **/ +@Slf4j +@Service +public class ScanServiceImpl implements ScanService { + @Value("${aliyun.green.regionId}") + private String regionId; + @Value("${aliyun.green.bizType}") + private String bizType; + + @Override + public Result sendTextScan(TextScanParam textScanParam) { + + //默认参数 + // 鉴黄 暴恐涉政 + textScanParam.setScenes(TextSceneEnum.getTextSceneList()); + textScanParam.setBizType(bizType); + + List textTasks = textScanParam.getTasks(); + if (CollectionUtils.isEmpty(textTasks) || textTasks.size() > SysConstant.MAX_TEXT_TASKS) { + return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg()); + } + + TextScanRequest textScanRequest = new TextScanRequest(); + textScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + textScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + textScanRequest.setEncoding(SysConstant.UTF8); + textScanRequest.setRegionId(regionId); + + try { + textScanRequest.setHttpContent(JSON.toJSONString(textScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); + } catch (UnsupportedEncodingException e) { + log.error("sendTextScan exception", e.getMessage()); + } + + + /** + * 请务必设置超时时间 + */ + textScanRequest.setConnectTimeout(3000); + textScanRequest.setReadTimeout(6000); + try { + SyncScanResult textScanResult = executeSyncText(textScanRequest); + return new Result().ok(textScanResult); + } catch (Exception e) { + log.error("sendTextScan exception", e); + throw new ExeCuteHttpException(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + } + } + + @Override + public Result sendSyncImgScan(ImgScanParam imgScanParam) { + + ImageSyncScanRequest imageSyncScanRequest = new ImageSyncScanRequest(); + imageSyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + imageSyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + imageSyncScanRequest.setEncoding(SysConstant.UTF8); + imageSyncScanRequest.setRegionId(regionId); + + //默认参数 + // 鉴黄 暴恐涉政 + imgScanParam.setScenes(ImgSceneEnum.getImgSceneList()); + imgScanParam.setBizType(bizType); + + List imgTasks = imgScanParam.getTasks(); + if (CollectionUtils.isEmpty(imgTasks) || imgTasks.size() > SysConstant.MAX_IMG_TASKS) { + return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg()); + } + + try { + imageSyncScanRequest.setHttpContent(JSON.toJSONString(imgScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); + } catch (UnsupportedEncodingException e) { + log.error("sendSyncImgScan exception", e.getMessage()); + return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); + } + + /** + * 请务必设置超时时间 + */ + imageSyncScanRequest.setConnectTimeout(3000); + imageSyncScanRequest.setReadTimeout(6000); + + try { + SyncScanResult scanResult = executeSyncImg(imageSyncScanRequest); + return new Result().ok(scanResult); + } catch (Exception e) { + log.error("sendImgScan execute Exception", e); + return new Result().error(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + } + } + + @Override + public Result sendASyncImgScan(ImgScanParam imgScanParam) { + ImageAsyncScanRequest imageAsyncScanRequest = new ImageAsyncScanRequest(); + imageAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 + imageAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 + imageAsyncScanRequest.setEncoding(SysConstant.UTF8); + imageAsyncScanRequest.setRegionId(regionId); + + //默认参数 + // 鉴黄 暴恐涉政 + imgScanParam.setScenes(ImgSceneEnum.getImgSceneList()); + imgScanParam.setBizType(bizType); + + List imgTasks = imgScanParam.getTasks(); + if (CollectionUtils.isEmpty(imgTasks) || imgTasks.size() > SysConstant.MAX_IMG_TASKS) { + return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg()); + } + + try { + imageAsyncScanRequest.setHttpContent(JSON.toJSONString(imgScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); + } catch (UnsupportedEncodingException e) { + log.error("sendASyncImgScan exception", e.getMessage()); + return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); + } + + /** + * 请务必设置超时时间 + */ + imageAsyncScanRequest.setConnectTimeout(3000); + imageAsyncScanRequest.setReadTimeout(6000); + + try { + ImgAsyncScanResult scanResult = executeAsyncImg(imageAsyncScanRequest); + return new Result().ok(scanResult); + } catch (Exception e) { + log.error("sendImgScan execute Exception", e); + return new Result().error(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + } + } + + public SyncScanResult executeSyncText(AcsRequest textScanRequest) { + SyncScanResult result = new SyncScanResult(); + try { + HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(textScanRequest); + + if (httpResponse.isSuccess()) { + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), SysConstant.UTF8)); + //System.out.println(JSON.toJSONString(scrResponse, true)); + if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) { + //任务 列表 + List scanTaskResults = scrResponse.getJSONArray(SysConstant.DATA).toJavaList(ScanTaskResult.class); + for (ScanTaskResult taskResult : scanTaskResults) { + result.getDetails().add(taskResult); + //又根据场景不同 + if (HttpStatus.SC_OK == taskResult.getCode()) { + //如果是多个场景 则为对个 BaseScanResult + List sceneResults = taskResult.getResults(); + //是文本检测 目前就一种场景 + boolean isSuccess = true; + for (SceneDetailResult sceneResult : sceneResults) { + String suggestion = sceneResult.getSuggestion(); + if (SuggestionEnum.PASS.getCode().equals(suggestion)) { + isSuccess = false; + break; + } + } + if (isSuccess){ + result.getFailDataIds().add(taskResult.getDataId()); + } else { + result.getSuccessDataIds().add(taskResult.getDataId()); + } + } else { + result.getFailDataIds().add(taskResult.getDataId()); + log.warn("executeSyncText task process fail:code:{},msg:{}", taskResult.getCode(), taskResult.getMsg()); + throw new ExeCuteHttpException(" executeSyncTexttask process fail:code:" + taskResult.getCode() + ",msg:" + taskResult.getMsg()); + } + } + return result; + } else { + throw new ExeCuteHttpException("executeSyncText detect not success. code:" + scrResponse.getInteger(SysConstant.CODE)); + } + } else { + log.warn("executeSyncText response not success. status:" + httpResponse.getStatus()); + throw new ExeCuteHttpException("response not success. status:" + httpResponse.getStatus()); + } + + } catch (Exception e) { + log.warn("executeSyncImg exception", e); + throw new ExeCuteHttpException(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + } + } + + + /** + * desc:异步 检查图片 TODO 结果处理 + * + * @param request + * @return + */ + private ImgAsyncScanResult executeAsyncImg(AcsRequest request) { + ImgAsyncScanResult result = new ImgAsyncScanResult(); + try { + HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(request); + if (httpResponse.isSuccess()) { + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), SysConstant.UTF8)); + //System.out.println(JSON.toJSONString(scrResponse, true)); + if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) { + JSONArray taskResults = scrResponse.getJSONArray(SysConstant.DATA); + for (Object taskResult : taskResults) { + if (HttpStatus.SC_OK == ((JSONObject) taskResult).getInteger(SysConstant.CODE)) { + String taskId = ((JSONObject) taskResult).getString("taskId"); + // 将taskId 保存下来,间隔一段时间来轮询结果, 参照ImageAsyncScanResultsRequest + result.getSuccessTaskIds().add(taskId); + } else { + String taskId = ((JSONObject) taskResult).getString("taskId"); + result.getFailTaskIds().add(taskId); + log.warn("task process fail:{}", ((JSONObject) taskResult).getInteger(SysConstant.CODE)); + continue; + } + } + return result; + } else { + System.out.println("detect not success. code:" + scrResponse.getInteger(SysConstant.CODE)); + throw new ExeCuteHttpException("detect not success. code:" + scrResponse.getInteger(SysConstant.CODE)); + } + } else { + System.out.println("response not success. status:" + httpResponse.getStatus()); + throw new ExeCuteHttpException("response not success. status:" + httpResponse.getStatus()); + } + } catch (ServerException e) { + e.printStackTrace(); + } catch (ClientException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + private SyncScanResult executeSyncImg(AcsRequest request) { + SyncScanResult result = new SyncScanResult(); + try { + HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(request); + if (httpResponse.isSuccess()) { + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), SysConstant.UTF8)); + if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) { + JSONArray taskResults = scrResponse.getJSONArray(SysConstant.DATA); + List scanTaskResults = taskResults.toJavaList(ScanTaskResult.class); + for (ScanTaskResult taskResult : scanTaskResults) { + result.getDetails().add(taskResult); + if (HttpStatus.SC_OK != taskResult.getCode()) { + if (!result.getFailDataIds().contains(taskResult.getDataId())) { + result.getFailDataIds().add(taskResult.getDataId()); + } + continue; + } + //如果是多个场景 则为对个 BaseScanResult + List sceneResults = taskResult.getResults(); + + boolean isSuccess = true; + for (SceneDetailResult sceneResult : sceneResults) { + String suggestion = sceneResult.getSuggestion(); + if (SuggestionEnum.BLOCK.getCode().equals(suggestion)) { + isSuccess = false; + break; + } + } + if (isSuccess){ + result.getSuccessDataIds().add(taskResult.getDataId()); + }else{ + result.getFailDataIds().add(taskResult.getDataId()); + } + } + return result; + } else { + log.warn("executeSyncImg detect not success. code:", scrResponse.getInteger(SysConstant.CODE)); + throw new ExeCuteHttpException("detect not success. code:" + scrResponse.getInteger(SysConstant.CODE)); + } + } else { + log.warn("executeSyncImg response not success. status:" + httpResponse.getStatus()); + throw new ExeCuteHttpException("response not success. status:" + httpResponse.getStatus()); + } + } catch (Exception e) { + log.warn("executeSyncImg exception", e); + throw new ExeCuteHttpException(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + } + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgScanParam.java new file mode 100644 index 0000000000..82036797e3 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgScanParam.java @@ -0,0 +1,48 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * 审查参数 + * + * @author jianjun liu + * @date 2020-06-04 21:57 + **/ +@Data +public class ImgScanParam implements Serializable { + + private static final long serialVersionUID = 958801658335909745L; + /** + * 业务类型 + */ + private String bizType; + /** + * 场景 必填 + * + * @see com.epmet.openapi.scan.common.enu.ImgSceneEnum; + */ + private List scenes; + + /** + * 要检测的内容列表,必填 + * remark:一组任务列表中的taskId不能相同 + */ + @Valid + @NotEmpty(message = "任务列表不能为空") + 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/ImgTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java new file mode 100644 index 0000000000..2ec15a9593 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java @@ -0,0 +1,31 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 任务参数 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 22:13 + **/ +@Data +public class ImgTask implements Serializable { + + private static final long serialVersionUID = -747206284930578105L; + /** + * 要检测的数据id 非必填 + * + * */ + @NotNull(message = "dataId不能为空") + private String dataId; + + /** + * 图片url 必填 + */ + @NotNull(message = "图片URL不能为空") + private String url; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java new file mode 100644 index 0000000000..2b05d34e20 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java @@ -0,0 +1,48 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * 文本审查参数 + * + * @author jianjun liu + * @date 2020-06-05 11:17 + **/ +@Data +public class TextScanParam implements Serializable { + private static final long serialVersionUID = -3568903097975113166L; + + /** + * 业务类型 + */ + private String bizType; + /** + * 场景 必填 + * + * @see com.epmet.openapi.scan.common.enu.ImgSceneEnum; + */ + private List scenes; + + /** + * 要检测的内容列表,必填 + * remark:一组任务列表中的taskId不能相同 + */ + @Valid + @NotEmpty(message = "任务列表不能为空") + 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/TextTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java new file mode 100644 index 0000000000..aeb976506c --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java @@ -0,0 +1,28 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 任务参数 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-04 22:13 + **/ +@Data +public class TextTask implements Serializable { + + private static final long serialVersionUID = 6957195274696018630L; + /** + * 要检测的数据id 非必填 + * + * */ + private String dataId; + + /** + * 文本内容 必填 最多不能超过10000 + */ + private String content; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ImgAsyncScanResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ImgAsyncScanResult.java new file mode 100644 index 0000000000..d988cf7a88 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ImgAsyncScanResult.java @@ -0,0 +1,24 @@ +package com.epmet.openapi.scan.support.result; + +import lombok.Data; + +import java.util.List; + +/** + * 检测结果 + * + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-05 10:52 + **/ +@Data +public class ImgAsyncScanResult { + /** + * 执行成功的任务Id集合 + */ + private List successTaskIds; + /** + * 执行失败的任务Id集合 + */ + private List failTaskIds; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ScanTaskResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ScanTaskResult.java new file mode 100644 index 0000000000..d358a570fa --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/ScanTaskResult.java @@ -0,0 +1,28 @@ +package com.epmet.openapi.scan.support.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * desc:文本检测返回结果 + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-05 14:24 + **/ +@Data +public class ScanTaskResult implements Serializable { + + private static final long serialVersionUID = -7905091710384256911L; + private Integer code; + + + private String msg; + + + private String dataId; + + + private List results; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SceneDetailResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SceneDetailResult.java new file mode 100644 index 0000000000..4023153d10 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SceneDetailResult.java @@ -0,0 +1,31 @@ +package com.epmet.openapi.scan.support.result; + +import lombok.Data; + +/** + * desc:场景扫描结果 + * @author jianjun liu + * @date 2020-06-05 14:24 + **/ +@Data +public class SceneDetailResult { + /** + * 结果为该分类的概率 + */ + private Double rate; + + /** + * 建议用户执行的操作 + */ + private String suggestion; + + /** + * 场景 + */ + private String scene; + + /** + * 标签 + */ + private String label; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SyncScanResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SyncScanResult.java new file mode 100644 index 0000000000..c50589d7ce --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/SyncScanResult.java @@ -0,0 +1,46 @@ +package com.epmet.openapi.scan.support.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 检测结果 + * + * @author jianjun liu + * @date 2020-06-05 10:52 + **/ +@Data +public class SyncScanResult implements Serializable { + /** + * 执行成功的任务Id集合 + */ + private List successDataIds = new ArrayList<>(); + /** + * 执行失败的任务Id集合 + */ + private List failDataIds = new ArrayList<>(); + + /** + * desc:检测详情 + */ + private List details = new ArrayList<>(); + + /** + * 本地是否全部通过 + */ + private boolean isAllPass; + + public boolean isAllPass() { + if (failDataIds.isEmpty() && !successDataIds.isEmpty()) { + return true; + } + return isAllPass; + } + + public void setAllPass(boolean allPass) { + isAllPass = allPass; + } +} 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..6c9dba5543 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -0,0 +1,79 @@ +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: LTAI4G6Fv6uTzQbpsayATHq4 + accessKeySecret: QevMw1RYCwQUG3RSMPq1J6EAfmSblo + regionId: cn-shanghai + bizType: epmet_img_text + 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/main/resources/readme b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme new file mode 100644 index 0000000000..384fca6dfc --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme @@ -0,0 +1,7 @@ +#访问openApi 需要向redis中 添加白名单 +sadd epmet:openapi:scan:whitelist "客户端ip地址" +#eg: +sadd epmet:openapi:scan:whitelist "\"192.168.1.1\"" + +#del +srem 'epmet:openapi:scan:whitelist' "\"116.179.32.197\"" "\"27.219.156.47\"" \ No newline at end of file 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..9db62073f3 --- /dev/null +++ b/epmet-openapi/pom.xml @@ -0,0 +1,18 @@ + + + + epmet-cloud + com.epmet + 2.0.0 + + 4.0.0 + pom + + 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/LoginUserDetailsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java new file mode 100644 index 0000000000..7c1af89a00 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LoginUserDetailsFormDTO.java @@ -0,0 +1,10 @@ +package com.epmet.dto.form; + +import lombok.Data; + +@Data +public class LoginUserDetailsFormDTO { + private String app; + private String client; + private String userId; +} 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/form/UpdateCachedRolesFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateCachedRolesFormDTO.java new file mode 100644 index 0000000000..80559c4ec5 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateCachedRolesFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +@Data +public class UpdateCachedRolesFormDTO { + + @NotBlank(message = "客户ID不能为空") + private String staffId; + + @NotBlank(message = "机关ID不能为空") + private String orgId; + + private List roleIds; + +} 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/GovStaffRoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java index 51586242da..1708d17f32 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java @@ -34,6 +34,7 @@ public class GovStaffRoleResultDTO implements Serializable { private static final long serialVersionUID = 1L; + private String customerId; /** * 角色ID */ @@ -54,6 +55,8 @@ public class GovStaffRoleResultDTO implements Serializable { */ private String roleName; + private String orgType; + /** * 姓名 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java new file mode 100644 index 0000000000..1174f0fb34 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.security.dto.GovTokenDto; +import lombok.Data; + +import java.util.List; +import java.util.Set; + +@Data +public class LoginUserDetailsResultDTO { + + /** + * 政府端:gov、居民端:resi、运营端:oper + */ + private String app; + + /** + * PC端:web、微信小程序:wxmp + */ + private String client; + + /** + * 用户ID + */ + private String userId; + + /** + * 角色列表 + */ + //private Set roleIdList; + private List roleList; + + /** + * 部门id列表 + */ + private Set deptIdList; + + /** + * 当前登录用户所属的机关id + */ + private String agencyId; + + /** + * 组织ID + */ + private String orgIdPath; + + /** + * 网格ID列表 + */ + private Set gridIdList; + + /** + * 当前工作人员进入的客户id + */ + private String customerId; + + +} 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..c8c1848738 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -0,0 +1,75 @@ +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.EpmetUserOpenFeignClientFallback; +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; + +/** + * 本服务对外开放的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); + + /** + * @param formDTO + * @Description 根据userId获取customerId + * @author zxc + */ + @PostMapping("/epmetuser/user/getcustomeridbyuserid") + Result getCustomerIdByUserId(@RequestBody TagCustomerFormDTO formDTO); + +} 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..54c904449e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -0,0 +1,53 @@ +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.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); + } + + @Override + public Result getCustomerIdByUserId(TagCustomerFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerIdByUserId", formDTO); + } + +} diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 8a1d84ff15..4ed23e2498 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.53 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.61 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml index 60fcfed2e0..accb7bf5f3 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.53 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.60 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 37dfbcf945..d15335cac0 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.53 + 0.3.61 com.epmet epmet-user @@ -82,6 +82,12 @@ 2.0.0 compile + + com.epmet + epmet-message-client + 2.0.0 + compile + @@ -131,13 +137,15 @@ 6379 123456 - true + false 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b false + + false @@ -168,6 +176,8 @@ false + + true 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/GovStaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java new file mode 100644 index 0000000000..8b8ccd1048 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java @@ -0,0 +1,43 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.RoleDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.GovStaffRoleTemplateDTO; +import com.epmet.service.GovStaffRoleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RequestMapping("govstaffrole") +@RestController +public class GovStaffRoleController { + + @Autowired + private GovStaffRoleService govStaffRoleService; + + /** + * 根据客户ID查询该客户的角色列表 + * @param customerId + * @return + */ + @PostMapping("rolesbycustomer/{customerId}") + public Result listGovStaffRolesByCustomer(@PathVariable("customerId") String customerId) { + List roleEntities = govStaffRoleService.listRolesByCustomer(customerId); + return new Result().ok(roleEntities); + } + + /** + * 查询角色模板列表 + * @return + */ + @PostMapping("roletemplates") + public Result listGovStaffRoleTemplates() { + List roleTemplates = govStaffRoleService.listRoleTemplates(); + return new Result().ok(roleTemplates); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java index 9958251e8f..e7c82100a6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java @@ -49,19 +49,6 @@ public class RoleController { @Autowired private RoleService roleService; - /** - * 根据客户ID查询该客户的角色列表 - * @param customerId - * @return - */ - @PostMapping("rolesbycustomer/{customerId}") - public Result listRolesByCustomer(@PathVariable("customerId") String customerId) { - List roleEntities = roleService.listRolesByCustomer(customerId); - return new Result().ok(roleEntities); - } - - - @GetMapping("page") public Result> page(@RequestParam Map params){ PageData page = roleService.page(params); 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/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index d7f0f28dde..a02a38b24a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -10,11 +10,11 @@ import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.MyResiUserInfoResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.service.UserService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.PropertySource; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -111,4 +111,15 @@ public class UserController { return new Result().ok(userService.resiMyselfMsg(myResiUserInfoFormDTO)); } + /** + * 从缓存中查询已登录用户的基本信息以及角色等相关信息 + * @return + */ + @PostMapping("loginuserdetails") + public Result getLoginUserDetails(@RequestBody LoginUserDetailsFormDTO dto) { + ValidatorUtils.validateEntity(dto, StaffPermCacheFormDTO.GetStaffCurrPermissions.class); + LoginUserDetailsResultDTO govTokenDto = userService.getLoginUserDetails(dto.getApp(), dto.getClient(), dto.getUserId()); + return new Result().ok(govTokenDto); + } + } 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/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index 907bb84ea1..d7562fafad 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.entity.GovStaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -56,4 +57,6 @@ public interface GovStaffRoleDao extends BaseDao { * @return */ GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(@Param("customerId") String customerId, @Param("roleKey") String roleKey); + + List listRolesByCustomer(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java index d175c919b1..398406a8cf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java @@ -41,11 +41,4 @@ public interface RoleDao extends BaseDao { * @return RoleEntity */ RoleEntity selectRoleByKey(RoleEntity param); - - /** - * 通过客户ID查询客户的角色列表 - * @param customerId - * @return - */ - List listRolesByCustomer(@Param("customerId") String customerId); } \ 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/feign/AuthFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java new file mode 100644 index 0000000000..dd1ed9ec46 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java @@ -0,0 +1,23 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UpdateCachedRolesFormDTO; +import com.epmet.feign.fallback.AuthFeignClientCallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class, url = "localhost:8081") +//@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class) +public interface AuthFeignClient { + + /** + * 更新缓存的角色列表 + * @param form + * @return + */ + @PostMapping("/auth/gov/updatecachedroles") + Result updateCachedRoles(@RequestBody UpdateCachedRolesFormDTO form); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/AuthFeignClientCallback.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/AuthFeignClientCallback.java new file mode 100644 index 0000000000..af013a458b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/AuthFeignClientCallback.java @@ -0,0 +1,17 @@ +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.UpdateCachedRolesFormDTO; +import com.epmet.feign.AuthFeignClient; +import org.springframework.stereotype.Component; + +@Component +public class AuthFeignClientCallback implements AuthFeignClient { + + @Override + public Result updateCachedRoles(UpdateCachedRolesFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_AUTH_SERVER, "updateCachedRoles", form); + } +} 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/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index d7985c8758..25d6fe495b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.GovStaffRoleTemplateDTO; import com.epmet.entity.GovStaffRoleEntity; import java.util.List; @@ -120,4 +121,8 @@ public interface GovStaffRoleService extends BaseService { * @param roleKey */ GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(String customerId, String roleKey); + + List listRolesByCustomer(String customerId); + + List listRoleTemplates(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java index d758c6a64b..72e055c4b1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java @@ -99,6 +99,4 @@ public interface RoleService extends BaseService { * @return RoleDTO */ RoleDTO getRoleByKey(RoleDTO role); - - List listRolesByCustomer(String customerId); } \ 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/UserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java index a7bafa437e..1df8d94607 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java @@ -1,19 +1,16 @@ package com.epmet.service; 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.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CreatedTimeByUserIdResultDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.MyResiUserInfoResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.entity.UserEntity; -import java.util.List; -import java.util.Map; - /** * @Description * @IntefaceName UserService @@ -73,4 +70,10 @@ public interface UserService extends BaseService { * @date 2020.05.22 19:24 **/ MyResiUserInfoResultDTO resiMyselfMsg(MyResiUserInfoFormDTO myResiUserInfoFormDTO); + + /** + * 查询登陆用户信息 + * @return + */ + LoginUserDetailsResultDTO getLoginUserDetails(String app, String client, String staffId); } 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..48b2f5a45f 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 @@ -24,8 +24,10 @@ 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.ExceptionUtils; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerStaffConstant; import com.epmet.constant.UserConstant; @@ -39,6 +41,7 @@ import com.epmet.entity.CustomerStaffEntity; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.UserEntity; +import com.epmet.feign.AuthFeignClient; import com.epmet.redis.CustomerStaffRedis; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; @@ -52,10 +55,7 @@ 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; +import java.util.*; import java.util.stream.Collectors; /** @@ -78,6 +78,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -328,6 +332,23 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl listRolesByCustomer(String customerId) { + return govStaffRoleDao.listRolesByCustomer(customerId); + } + + @Override + public List listRoleTemplates() { + return govStaffRoleTemplateDao.listValidateRoles(); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index fd543a4d02..b2cba9216e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -216,11 +216,11 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl registerRecordWithDiffCustAndGrid = registerRecords.stream().filter(obj -> !customerId.equals(obj.getCustomerId()) && !gridId.equals(obj.getGridId())).findAny(); if(registerRecordWithDiffCustAndGrid.isPresent()){ - //如果存在不同客户不同网格的注册信息 + //如果存在不同客户不同网格的注册信息(当前用户已经在别的客户下的网格注册过) //注册用户 参与用户 registerRelationToSave.setFirstRegister(NumConstant.ZERO_STR); registerRelationToSave.setRegister(NumConstant.ONE_STR); @@ -246,10 +246,13 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl implem RoleEntity entity = baseDao.selectRoleByKey(ConvertUtils.sourceToTarget(role, RoleEntity.class)); return ConvertUtils.sourceToTarget(entity, RoleDTO.class); } - - - - @Override - public List listRolesByCustomer(String customerId) { - return baseDao.listRolesByCustomer(customerId); - } - } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index a38188f700..38a4924eef 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -31,7 +31,10 @@ import com.epmet.dao.GovStaffRoleTemplateDao; import com.epmet.dao.StaffRoleDao; 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.GovStaffRoleTemplateDTO; import com.epmet.dto.result.StaffRolesResultDTO; @@ -163,4 +166,18 @@ public class StaffRoleServiceImpl 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/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index d831b34e14..5901ddd950 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -26,19 +26,18 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserConstant; import com.epmet.constant.UserRoleConstant; import com.epmet.dao.UserResiInfoDao; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; -import com.epmet.dto.form.IssueInitiatorFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; -import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.form.VerificationCodeFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.IssueInitiatorResultDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.entity.UserResiInfoEntity; -import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.redis.UserResiInfoRedis; import com.epmet.service.RegisterRelationService; import com.epmet.service.UserResiInfoService; @@ -77,7 +76,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -202,25 +201,25 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl map = (Map) result.getData(); - if (null == map || null == map.get("code")) { + //3:调用短信服务 生成验证码发送短信 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(verificationCodeFormDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.USER_REGISTER); + Result result = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if(!result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getCode())){ return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); } //4:删除缓存中可能存在的旧验证码 userResiInfoRedis.deleteOldUserMobileCode(verificationCodeFormDTO.getUserId(), verificationCodeFormDTO.getMobile()); //5:将验证码存入redis - userResiInfoRedis.setUserResiMobileCode(verificationCodeFormDTO.getUserId(),verificationCodeFormDTO.getMobile(),map.get("code").toString());*/ - return result; + userResiInfoRedis.setUserResiMobileCode(verificationCodeFormDTO.getUserId(),verificationCodeFormDTO.getMobile(),result.getData().getCode()); + return new Result(); } @Override diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 3909ab2c2a..621259be47 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserConstant; import com.epmet.dao.UserDao; @@ -42,6 +43,8 @@ public class UserServiceImpl extends BaseServiceImpl implem private GovOrgFeignClient govOrgFeignClient; @Autowired private UserRoleDao userRoleDao; + @Autowired + private CpUserDetailRedis cpUserDetailRedis; private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class); @@ -174,4 +177,9 @@ public class UserServiceImpl extends BaseServiceImpl implem return null; } + + @Override + public LoginUserDetailsResultDTO getLoginUserDetails(String app, String client, String userId) { + return cpUserDetailRedis.get(app, client, userId, LoginUserDetailsResultDTO.class); + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 6674d13dfd..00a9025891 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -51,6 +51,15 @@ spring: wall: config: multi-statement-allow: true + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 cloud: nacos: discovery: @@ -118,3 +127,8 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ 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/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 5788da7ba8..aa495b89f5 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -49,4 +49,14 @@ AND ROLE_KEY = #{roleKey} AND DEL_FLAG = '0' + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml index 38e35cf8c3..2bc5147051 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml @@ -27,11 +27,4 @@ and ROLE_KEY = #{roleKey} and DEL_FLAG = 0 - - - \ 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/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java new file mode 100644 index 0000000000..06d674a4e3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java @@ -0,0 +1,25 @@ +package com.epmet.epmetuser.test; + +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.service.UserService; +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; + +@SpringBootTest +@RunWith(SpringRunner.class) +public class UserControllerTest { + + @Autowired + private UserService userService; + + @Test + public void getLoginUserDetails() { + LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, "4aaab913d9f11d90a2cb4dd21b075259"); + System.out.println(loginUserDetails); + } + +} 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