diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java new file mode 100644 index 0000000000..e096c6a65a --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java @@ -0,0 +1,39 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.GovWebLoginFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.service.GovWebService; +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; + +/** + * @Description PC工作端-登陆服务 + * @author sun + */ +@RestController +@RequestMapping("govweb") +public class GovWebController { + + @Autowired + private GovWebService govWebService; + + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端-工作人员登录 + **/ + @PostMapping("login") + public Result workLogin(@RequestBody GovWebLoginFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(govWebService.login(formDTO)); + } + + +} diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 924c1a4070..00770d82bb 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -2,13 +2,11 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.LoginFormDTO; -import com.epmet.dto.form.StaffOrgsFormDTO; -import com.epmet.dto.form.ThirdStaffOrgsFormDTO; -import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.ThirdLoginService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -91,4 +89,19 @@ public class ThirdLoginController { return new Result>().ok(staffOrgs); } + /** + * @param formDTO + * @return + * @author sun + * @description 单客户-获取微信用户手机号 + **/ + @PostMapping("getresiwxphone") + public Result getResiWxPhone(@RequestBody GetResiWxPhoneFormDTO formDTO) { + String phone = thirdLoginService.getResiWxPhone(formDTO); + if (StringUtils.isNotBlank(phone) && !"null".equals(phone)) { + return new Result().ok(phone); + } + return new Result().ok(""); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GetResiWxPhoneFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GetResiWxPhoneFormDTO.java new file mode 100644 index 0000000000..30e7d947d6 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GetResiWxPhoneFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 单客户-获取微信用户手机号 + * + * @author sun + */ +@Data +public class GetResiWxPhoneFormDTO implements Serializable { + private static final long serialVersionUID = 4381236451736209332L; + /** + * 小程序appId + */ + @NotBlank(message = "appId不能为空",groups = {AddUserInternalGroup.class}) + private String appId; + /** + * 微信code + */ + @NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class}) + private String wxCode; + /** + * 用户信息 + */ + @NotBlank(message = "encryptedData不能为空",groups = {AddUserInternalGroup.class}) + private String encryptedData; + /** + * 加密算法的初始向量 + */ + @NotBlank(message = "iv不能为空",groups = {AddUserInternalGroup.class}) + private String iv; + + public interface AddUserInternalGroup {} + +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWebLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWebLoginFormDTO.java new file mode 100644 index 0000000000..22c87a0aed --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWebLoginFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description PC工作端 手机号+密码登陆-接口入参 + * @Author sun + */ +@Data +public class GovWebLoginFormDTO extends LoginCommonFormDTO implements Serializable { + private static final long serialVersionUID = 7950477424010655108L; + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空",groups = {AddUserShowGroup.class}) + private String customerId; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空",groups = {AddUserShowGroup.class}) + private String phone; + + /** + * 密码 + */ + @NotBlank(message = "密码不能为空",groups = {AddUserShowGroup.class}) + private String password; + + /** + * 验证码 + */ + @NotBlank(message="验证码不能为空",groups = {AddUserShowGroup.class}) + private String captcha; + + /** + * 唯一标识 + */ + @NotBlank(message="唯一标识不能为空",groups = {AddUserInternalGroup.class}) + private String uuid; + +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java index 7339592d7a..aae374df94 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java @@ -19,7 +19,7 @@ public class LoginCommonFormDTO implements Serializable { /** * 政府端:gov、居民端:resi、运营端:oper */ - @NotBlank(message = "app不能为空(政府端:gov、居民端:resi、运营端:oper)",groups ={AddUserInternalGroup.class} ) + @NotBlank(message = "app不能为空(工作端:gov、居民端:resi、运营端:oper)",groups ={AddUserInternalGroup.class} ) private String app; /** diff --git a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 37312c17f6..44c7d9d3ab 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -7,6 +7,7 @@ import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.GovWebOperLoginResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; @@ -115,4 +116,14 @@ public interface EpmetUserFeignClient { */ @PostMapping("/epmetuser/staffrole/staffroles") Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + @PostMapping(value = "epmetuser/customerstaff/getstaffidandpwd", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getStaffIdAndPwd(@RequestBody GovWebOperLoginFormDTO formDTO); + } diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 88ed4e42de..59623a7dc7 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -8,6 +8,7 @@ import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.GovWebOperLoginResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.feign.EpmetUserFeignClient; @@ -68,4 +69,9 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRolesOfStaff", staffRoleFormDTO); } + @Override + public Result getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffIdAndPwd", formDTO); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/service/GovWebService.java b/epmet-auth/src/main/java/com/epmet/service/GovWebService.java new file mode 100644 index 0000000000..30f8d8ae4c --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/GovWebService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +import com.epmet.dto.form.GovWebLoginFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; + +/** + * @Description 第三方-居民端、政府端登陆服务 + * @author sun + */ +public interface GovWebService { + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端-工作人员登录 + **/ + UserTokenResultDTO login(GovWebLoginFormDTO formDTO); +} diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index b343bf5a22..3d9c60cc64 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.dto.form.GetResiWxPhoneFormDTO; import com.epmet.dto.form.LoginFormDTO; import com.epmet.dto.form.ThirdStaffOrgsFormDTO; import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO; @@ -53,4 +54,12 @@ public interface ThirdLoginService { * @description 单客户-手机号密码获取组织 **/ List getMyOrgByPassword(ThirdStaffOrgsFormDTO formDTO); + + /** + * @param formDTO + * @return + * @author sun + * @description 单客户-获取微信用户手机号 + **/ + String getResiWxPhone(GetResiWxPhoneFormDTO formDTO); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java new file mode 100644 index 0000000000..12162bfbd3 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -0,0 +1,124 @@ +package com.epmet.service.impl; + +import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.password.PasswordUtils; +import com.epmet.commons.tools.utils.CpUserDetailRedis; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.GovWebLoginFormDTO; +import com.epmet.dto.form.GovWebOperLoginFormDTO; +import com.epmet.dto.form.LoginByPassWordFormDTO; +import com.epmet.dto.form.PasswordLoginUserInfoFormDTO; +import com.epmet.dto.result.GovWebOperLoginResultDTO; +import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.jwt.JwtTokenProperties; +import com.epmet.jwt.JwtTokenUtils; +import com.epmet.service.CaptchaService; +import com.epmet.service.GovWebService; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author sun + * @Description 第三方-居民端、政府端登陆服务 + */ +@Slf4j +@Service +public class GovWebServiceImpl implements GovWebService { + + private static final Logger logger = LoggerFactory.getLogger(GovWebServiceImpl.class); + @Autowired + private CaptchaService captchaService; + @Autowired + private JwtTokenUtils jwtTokenUtils; + @Autowired + private JwtTokenProperties jwtTokenProperties; + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端-工作人员登录 + **/ + @Override + public UserTokenResultDTO login(GovWebLoginFormDTO formDTO) { + //1.参数校验 + if (!(LoginConstant.APP_GOV.equals(formDTO.getApp()) && LoginConstant.CLIENT_WEB.equals(formDTO.getClient()))) { + logger.error("当前接口只适用于PC工作端运营管理后台"); + throw new RenException("当前接口只适用于PC工作端运营管理后台"); + } + //2.验证码校验 + boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); + if (!flag) { + logger.error(String.format("用户%s登录,验证码输入错误,暂时放行", formDTO.getPhone())); + //暂时关闭验证码校验 TODO + //throw new RenException(EpmetErrorCode.ERR10019.getCode()); + } + //3.校验登陆账号是否存在 + //根据客户Id和手机号查询登陆用户信息(此处不需要判断登陆人是否是有效客户以及是否是客户的根管理员,前一接口获取登陆手机号对应客户列表已经判断了) + GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO(); + form.setCustomerId(formDTO.getCustomerId()); + form.setMobile(formDTO.getPhone()); + Result result = epmetUserFeignClient.getStaffIdAndPwd(form); + if (!result.success() || null == result.getData() || null == result.getData().getUserId()) { + logger.error("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在"); + throw new RenException(EpmetErrorCode.ERR10003.getCode()); + } + GovWebOperLoginResultDTO resultDTO = result.getData(); + + //4.密码是否正确 + //密码错误 + if (!PasswordUtils.matches(formDTO.getPassword(), resultDTO.getPassWord())) { + logger.error("登陆密码错误"); + throw new RenException(EpmetErrorCode.ERR10004.getCode()); + } + + //5.生成token存到redis并返回 + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(this.packagingUserToken(formDTO, resultDTO.getUserId())); + return userTokenResultDTO; + + } + + /** + * 生成PC工作端token + * @author sun + */ + private String packagingUserToken(GovWebLoginFormDTO formDTO, String userId) { + // 生成token + Map map = new HashMap<>(); + map.put("app", formDTO.getApp()); + map.put("client", formDTO.getClient()); + map.put("userId", userId); + String token = jwtTokenUtils.createToken(map); + logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]"); + int expire = jwtTokenProperties.getExpire(); + TokenDto tokenDto = new TokenDto(); + tokenDto.setApp(formDTO.getApp()); + tokenDto.setClient(formDTO.getClient()); + tokenDto.setUserId(userId); + tokenDto.setToken(token); + tokenDto.setUpdateTime(System.currentTimeMillis()); + tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + cpUserDetailRedis.set(tokenDto, expire); + logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); + return token; + } + + +} diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index a7980eebe1..9e50e6b796 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -1,6 +1,8 @@ package com.epmet.service.impl; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; +import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; +import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.epmet.common.token.constant.LoginConstant; @@ -549,4 +551,40 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { return userWechatDTO; } + /** + * @param formDTO + * @return + * @author sun + * @description 单客户-获取微信用户手机号 + * 【此接口只适配第三方客户,对于党群e事通客户还是走原接口】 + **/ + @Override + public String getResiWxPhone(GetResiWxPhoneFormDTO formDTO) { + String phone = ""; + try { + //1.根据wxcode获取sessionKey + WxLoginFormDTO resiLoginFormDTO = new WxLoginFormDTO(); + resiLoginFormDTO.setAppId(formDTO.getAppId()); + resiLoginFormDTO.setWxCode(formDTO.getWxCode()); + //此方法会校验appId是否授权,然后在判断客户是否存在,之后才是获取sessionKey,如果只想获取sessionKey需要写新接口 + UserWechatDTO userWechatDTO = this.getUserWeChat(resiLoginFormDTO); + if (null == userWechatDTO || null == userWechatDTO.getSessionKey()) { + logger.error(String.format("调用生成third服务wxcode获取sessionKey失败,对应appId->" + formDTO.getAppId())); + throw new RenException("获取本机号码失败"); + } + + //2.使用sessionKey解密获取手机号 + WxMaPhoneNumberInfo phoneNoInfo = WxMaPhoneNumberInfo.fromJson(WxMaCryptUtils.decrypt(userWechatDTO.getSessionKey(), + formDTO.getEncryptedData(), + formDTO.getIv())); + if (null != phoneNoInfo) { + phone = phoneNoInfo.getPurePhoneNumber(); + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("获取用户微信绑定的手机号接口异常%s", e.getMessage())); + } + return phone; + } + } diff --git a/epmet-commons/epmet-commons-dynamic-datasource/pom.xml b/epmet-commons/epmet-commons-dynamic-datasource/pom.xml index 07f98a0b56..efb328a391 100644 --- a/epmet-commons/epmet-commons-dynamic-datasource/pom.xml +++ b/epmet-commons/epmet-commons-dynamic-datasource/pom.xml @@ -19,6 +19,12 @@ 2.0.0 provided + + + org.springframework.boot + spring-boot-starter-web + provided + diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/aspect/DataSourceAspect.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/aspect/DataSourceAspect.java index 45113847c6..080bda7565 100644 --- a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/aspect/DataSourceAspect.java +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/aspect/DataSourceAspect.java @@ -9,8 +9,8 @@ package com.epmet.commons.dynamic.datasource.aspect; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.dynamic.datasource.bean.DataSourceParam; import com.epmet.commons.dynamic.datasource.config.DynamicContextHolder; +import com.epmet.commons.dynamic.datasource.util.HttpRequestDataSourceNameFetcher; import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; @@ -19,12 +19,12 @@ import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import java.lang.reflect.Method; -import java.lang.reflect.Parameter; /** * 多数据源,切面处理类 @@ -38,6 +38,9 @@ import java.lang.reflect.Parameter; public class DataSourceAspect { protected Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private HttpRequestDataSourceNameFetcher httpRequestDataSourceNameFetcher; + @Pointcut("@annotation(com.epmet.commons.dynamic.datasource.annotation.DataSource) " + "|| @within(com.epmet.commons.dynamic.datasource.annotation.DataSource)") public void dataSourcePointCut() { @@ -55,12 +58,14 @@ public class DataSourceAspect { if(targetDataSource != null || methodDataSource != null){ String value; if(methodDataSource != null){ - value = getDatasourceName(methodDataSource, signature.getMethod().getParameters(), point.getArgs()); + value = getDatasourceName(methodDataSource); }else { - value = getDatasourceName(targetDataSource, signature.getMethod().getParameters(), point.getArgs()); + value = getDatasourceName(targetDataSource); } - DynamicContextHolder.push(value); + if (StringUtils.isNotBlank(value)) { + DynamicContextHolder.push(value); + } logger.debug("set datasource is {}", value); } @@ -77,33 +82,16 @@ public class DataSourceAspect { * @param dataSource * @return */ - public String getDatasourceName(DataSource dataSource, Parameter[] methodParameters, Object[] methodArgValues) { + public String getDatasourceName(DataSource dataSource) { + String dataSourceName = null; if (dataSource.datasourceNameFromArg()) { - // 1.从参数中动态获取数据源名称 - String datasourceNameFromParam = getDatasourceNameFromArg(methodParameters, methodArgValues); - if (StringUtils.isNotBlank(datasourceNameFromParam)) { - // 如果有DatasourceParam类型的参数并且设置了datasourceName值,那么返回这个值,否则使用硬编码的 - return datasourceNameFromParam; - } + // 1.优先从http header中动态获取数据源名称 + dataSourceName = httpRequestDataSourceNameFetcher.fetchDataSourceName(); } - // 2.硬编码指定数据源名称 - return dataSource.value(); - } - - /** - * 从参数中取数据源名称 - * @param parameters - * @param argsObject - * @return - */ - public String getDatasourceNameFromArg(Parameter[] parameters, Object[] argsObject) { - for (int i = 0; i < parameters.length; i++) { - if (parameters[i].getType() == DataSourceParam.class) { - DataSourceParam param = (DataSourceParam) argsObject[i]; - return param.getDatasourceName(); - } + // 2.硬编码指定默认的数据源名称 + if (StringUtils.isBlank(dataSourceName)) { + dataSourceName = dataSource.value(); } - - return null; + return dataSourceName; } } diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java index 3fae7e003d..0a9d9adf91 100644 --- a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/config/DynamicDataSource.java @@ -8,6 +8,8 @@ package com.epmet.commons.dynamic.datasource.config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; /** @@ -18,9 +20,13 @@ import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; */ public class DynamicDataSource extends AbstractRoutingDataSource { + private Logger logger = LoggerFactory.getLogger(getClass()); + @Override protected Object determineCurrentLookupKey() { - return DynamicContextHolder.peek(); + String datasourceName = DynamicContextHolder.peek(); + logger.info("使用的数据源名称为:{}", datasourceName); + return datasourceName; } } diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/enums/DataSourceEnum.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/enums/DataSourceEnum.java new file mode 100644 index 0000000000..bca4441435 --- /dev/null +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/enums/DataSourceEnum.java @@ -0,0 +1,48 @@ +package com.epmet.commons.dynamic.datasource.enums; + +/** + * 服务-数据源flag-数据源名称对应关系 + */ +public enum DataSourceEnum { + + DATA_STATISTICAL_REAL("data-statistical-server", "real", "stats"), + DATA_STATISTICAL_FAKE("data-statistical-server", "fake", "statsDisplay"), + DATA_REPORT_REAL("data-report-server", "real", "stats"), + DATA_REPORT_FAKE("data-report-server", "fake", "statsDisplay"), + ; + + // 服务名 + private String serviceName; + // 数据源标记 + private String flag; + // 数据源,跟yml中的数据源名称保持一致 + private String dataSourceName; + + DataSourceEnum(String serviceName, String flag, String dataSourceName) { + this.serviceName = serviceName; + this.flag = flag; + this.dataSourceName = dataSourceName; + } + + public static DataSourceEnum getEnum(String serviceName, String flag) { + DataSourceEnum[] values = DataSourceEnum.values(); + for (DataSourceEnum value : values) { + if (value.serviceName.equals(serviceName) && value.flag.equals(flag)) { + return value; + } + } + return null; + } + + public String getServiceName() { + return serviceName; + } + + public String getFlag() { + return flag; + } + + public String getDataSourceName() { + return dataSourceName; + } +} diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/util/AbstractDataSourceNameFetcher.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/util/AbstractDataSourceNameFetcher.java new file mode 100644 index 0000000000..5069bd5958 --- /dev/null +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/util/AbstractDataSourceNameFetcher.java @@ -0,0 +1,13 @@ +package com.epmet.commons.dynamic.datasource.util; + +import com.epmet.commons.dynamic.datasource.enums.DataSourceEnum; + +public abstract class AbstractDataSourceNameFetcher { + + public abstract String fetchDataSourceName(); + + //protected String getDataSourceName(String dataType, String serviceName) { + // return DataSourceEnum.getEnum(serviceName, dataType) + //} + +} diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/util/HttpRequestDataSourceNameFetcher.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/util/HttpRequestDataSourceNameFetcher.java new file mode 100644 index 0000000000..df11b546bf --- /dev/null +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/util/HttpRequestDataSourceNameFetcher.java @@ -0,0 +1,44 @@ +package com.epmet.commons.dynamic.datasource.util; + +import com.epmet.commons.dynamic.datasource.enums.DataSourceEnum; +import com.epmet.commons.tools.exception.RenException; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +/** + * Http请求中获取数据源名称 + */ +@Component +public class HttpRequestDataSourceNameFetcher extends AbstractDataSourceNameFetcher { + + protected Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private Environment environment; + + @Override + public String fetchDataSourceName() { + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + javax.servlet.http.HttpServletRequest request = requestAttributes.getRequest(); + String dataType = request.getHeader("Data-Type"); + + logger.info("HttpRequestDataSourceNameFetcher获取到的DataType为:{}", dataType); + if (StringUtils.isBlank(dataType)) { + return null; + } + + String serviceName = environment.getProperty("spring.application.name"); + DataSourceEnum dataSourceEnum = DataSourceEnum.getEnum(serviceName, dataType); + if (dataSourceEnum == null) { + throw new RenException(String.format("根据前端传入的DataType[%s]无法找到对应的数据源。", dataType)); + } + logger.info("HttpRequestDataSourceNameFetcher根据DataType:[{}]获取到的DataSourceEnum为{}", dataType, dataSourceEnum.getDataSourceName()); + return dataSourceEnum.getDataSourceName(); + } +} diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java index b4cfd11c27..82ffd68882 100644 --- a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java @@ -37,6 +37,9 @@ public class ExternalAppRequestAuthAspect { public static final String ACCESS_TOKEN_HEADER_KEY = "AccessToken"; public static final String APP_ID_HEADER_KEY = "appId"; + public static final String APP_ID_TIMESTAMP_KEY = "ts"; + public static final String APP_ID_CUSTOMER_ID_KEY = "CustomerId"; + public static final String APP_ID_AUTY_TYPE_KEY = "AuthType"; @Autowired private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; @@ -52,6 +55,9 @@ public class ExternalAppRequestAuthAspect { HttpServletRequest request = getRequest(); String token = request.getHeader(ACCESS_TOKEN_HEADER_KEY); String appId = request.getHeader(APP_ID_HEADER_KEY); + String ts = request.getHeader(APP_ID_TIMESTAMP_KEY); + String customerId = request.getHeader(APP_ID_CUSTOMER_ID_KEY); + String authType = request.getHeader(APP_ID_AUTY_TYPE_KEY); if (StringUtils.isAnyBlank(token, appId)) { throw new RenException("请求头中的token和appId不能为空"); @@ -62,6 +68,11 @@ public class ExternalAppRequestAuthAspect { ExternalAppAuthFormDTO form = new ExternalAppAuthFormDTO(); form.setAppId(appId); form.setToken(token); + form.setAuthType(authType); + if (StringUtils.isNotBlank(ts)) { + // 将字符串转化为时间 + form.setTs(new Long(ts)); + } Result result = commonServiceOpenFeignClient.externalAppAuth(form); if (result == null) { throw new RenException("调用服务进行外部应用认证,返回null"); @@ -84,7 +95,7 @@ public class ExternalAppRequestAuthAspect { if (parameters[i].getType() == ExternalAppRequestParam.class) { ExternalAppRequestParam requestParam = (ExternalAppRequestParam) point.getArgs()[i]; requestParam.setAppId(appId); - requestParam.setCustomerId(authResult.getCustomerId()); + requestParam.setCustomerId(authResult.getCustomerId() == null ? customerId : authResult.getCustomerId()); } } } 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 92af86d3a9..0ac7dbf706 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 @@ -35,6 +35,10 @@ public interface NumConstant { int ONE_HUNDRED = 100; int ONE_THOUSAND = 1000; int MAX = 99999999; + int EIGHTY_EIGHT = 88; + + double ZERO_DOT_ZERO = 0.0; + long ZERO_L = 0L; long ONE_L = 1L; 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 d3d2b8ccd1..939378fc26 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 @@ -77,6 +77,8 @@ public enum EpmetErrorCode { CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"), NO_SET_GRID_COUNT(8406,"您还未设置创建网格数量上限,请联系管理员设置"), GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"), + EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"), + EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"), ALREADY_EVALUATE(8501,"您已评价"), ALREADY_VOTE(8502,"您已表态"), @@ -104,6 +106,7 @@ public enum EpmetErrorCode { OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"), OPER_EXTERNAL_CUSTOMER_NOT_EXISTS(8710, "该客户不存在"), OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"), + OPER_EXT_APP_SECRET_RESET_FAIL(8712, "秘钥更新失败"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpContextUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpContextUtils.java index 6a01fa6c0f..d27da23ab7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpContextUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpContextUtils.java @@ -61,8 +61,9 @@ public class HttpContextUtils { } //请求语言 - defaultLanguage = request.getHeader(HttpHeaders.ACCEPT_LANGUAGE); - + if(StringUtils.isNotBlank(request.getHeader(HttpHeaders.ACCEPT_LANGUAGE))){ + defaultLanguage = request.getHeader(HttpHeaders.ACCEPT_LANGUAGE); + } return defaultLanguage; } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/UniqueIdGenerator.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/UniqueIdGenerator.java new file mode 100644 index 0000000000..fcefbdf2ca --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/UniqueIdGenerator.java @@ -0,0 +1,81 @@ +package com.epmet.commons.tools.utils; + + +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; +import java.util.Random; +import java.util.concurrent.atomic.AtomicLong; + +/** + * 唯一ID生成器 + */ +public class UniqueIdGenerator { + + private static UniqueValue uniqueValue = new UniqueValue(); + private static String middle; + static { + String threadCode = StringUtils.right(String.valueOf(Math.abs(System.nanoTime()+"".hashCode())), 2); + middle = StringUtils.leftPad(threadCode, 2, "0"); + } + + /** + * 唯一时间值 + */ + private static class UniqueValue { + + private AtomicLong uniqueValue = new AtomicLong(0L); + private volatile String currentTime = DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT); + private volatile String lastTime = currentTime; + + /** + * 获取当前时间:yyyyMMddHHmmSS + * 如果到了下一秒,则唯一值从0开始 + * + * @return + */ + public String getCurrentTime() { + currentTime = DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT); + if (!currentTime.equals(lastTime)) { + lastTime = currentTime; + Random random = new Random(); + uniqueValue.set(Long.valueOf(random.nextInt(10))); + } + return currentTime; + } + + public String getCurrentValue() { + return StringUtils.leftPad(String.valueOf(uniqueValue.incrementAndGet()), 5, "0"); + } + } + + /** + * 生成一个24位唯一ID + * 15位时间+2位中间值(防止多服务冲突)+2个线程code+5位秒级递增值 + * + * @return + */ + public static String generate() { + StringBuilder builder = new StringBuilder(32); + builder.append(uniqueValue.getCurrentTime()) + .append(middle) + .append(getUniqueThreadCode()) + .append(uniqueValue.getCurrentValue()); + + return builder.toString(); + } + + public static String getUniqueThreadCode() { + String threadCode = StringUtils.left(String.valueOf(Thread.currentThread().hashCode()), 2); + return StringUtils.leftPad(threadCode, 2, "0"); + } + + public static void main(String[] args) throws InterruptedException { + + System.out.println(UniqueIdGenerator.uniqueValue.currentTime); + System.out.println(UniqueIdGenerator.middle); + System.out.println(UniqueIdGenerator.getUniqueThreadCode()); + System.out.println(uniqueValue.getCurrentValue()); + + } +} 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 43fbf6d0cb..7c74fa6763 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -135,7 +135,9 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory organizeData; + + /** + * 组织名称数组 + * */ + private List xAxis; + + /** + * 参与人数 + * */ + private List joinData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java new file mode 100644 index 0000000000..58a277322f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 3、支部建设情况|联建共建情况-折线图 返参DTO + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321981 + * @ClassName BranchBuildTrendResultDTO + * @Auth wangc + * @Date 2020-08-19 10:06 + */ +@Data +public class BranchBuildTrendResultDTO implements Serializable { + private static final long serialVersionUID = 2453727230656371207L; + + /** + * 分类数组 ["三会党课","主体党日","三述专题","志愿服务","党内关怀"] + * */ + private List legend; + + /** + * 横坐标,近12个月的结合 ["8月","9月"] + * */ + private List xAxis; + + private List seriesData; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java new file mode 100644 index 0000000000..65a6888047 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName BranchIssueDataResultDTO + * @Auth wangc + * @Date 2020-08-19 10:50 + */ +@Data +public class BranchIssueDataResultDTO implements Serializable { + private static final long serialVersionUID = 2417543749267496482L; + + private String issue; + + private String monthId; + + private Integer data; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java new file mode 100644 index 0000000000..f4a611cc10 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/18 10:52 上午 + */ +@Data +public class BranchResultDTO implements Serializable { + + private static final long serialVersionUID = -8001714892170166320L; + + /** + * 网格ID + */ + private String gridId = ""; + + /** + * 网格名称 + */ + private String gridName = ""; + + /** + * 党支部(网格)位置 + */ + private String partyMark = ""; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java new file mode 100644 index 0000000000..7d5f415547 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 3、支部建设情况|联建共建情况-折线图 返参中的系列数组 + * @ClassName BranchTrendSeriesDataResultDTO + * @Auth wangc + * @Date 2020-08-19 10:22 + */ +@Data +public class BranchTrendSeriesDataResultDTO implements Serializable { + private static final long serialVersionUID = -2288264050517402039L; + + /** + * 和legend集合值一致 + * */ + private String name; + + /** + * 对应每个月的数值 + * */ + private List data; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java new file mode 100644 index 0000000000..2bf8ffd3d6 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/18 14:18 + */ +@Data +public class CompartmentResultDTO implements Serializable { + + private static final long serialVersionUID = 7963177476365327829L; + + /** + * 当前所选组织 + */ + private String agencyId = ""; + + /** + * 当前所选组织名称 + */ + private String name = ""; + + /** + * 当前所选组织的坐标区域 + */ + private String areaMarks = ""; + + /** + * 机关级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + */ + @JsonIgnore + private String level; + + /** + * 子级用户分布 + */ + private List agencyDistribution = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java new file mode 100644 index 0000000000..e77c336fbe --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java @@ -0,0 +1,30 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 2:45 下午 + */ +@Data +public class ContactMassLineChartResult implements Serializable { + + private static final long serialVersionUID = 5668549816473850787L; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员建群数 + */ + private Integer groupTotal; + + /** + * 群成员数 + */ + private Integer userTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java new file mode 100644 index 0000000000..e57b0cc54f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/20 2:31 下午 + */ +@Data +public class ContactMassLineChartResultDTO implements Serializable { + + private static final long serialVersionUID = 192666933158635787L; + + /** + * 横坐标集合 + */ + private List xAxis; + + /** + * 党员建群数 + */ + private List groupData; + + /** + * 群成员数 + */ + private List groupMemberData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java new file mode 100644 index 0000000000..e89155d00c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 返参DTO + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 + * @ClassName DifficultProjectResultDTO + * @Auth wangc + * @Date 2020-08-20 13:43 + */ +@Data +public class DifficultProjectResultDTO implements Serializable { + private static final long serialVersionUID = -7338625142484943434L; + + private String projectId; + + private String title; + + /** + * 状态: 待处理: pending; 结案closed + * */ + private String status; + + private Integer totalHours; + + /** + * yyyy-MM-dd HH:mm + * */ + private String createDateTime; + + private String gridName; + + private String imgUrl; + + private String categoryName; + + private Integer handleDepts; + + private Integer handleCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java new file mode 100644 index 0000000000..a81f45fc05 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 1:48 下午 + */ +@Data +public class FineExampleResultDTO implements Serializable { + + private static final long serialVersionUID = -2754696449087950719L; + + /** + * 党员参与议事 + */ + private Integer issueTotal = 0; + + @JsonIgnore + private Double issueRatioA; + + /** + * 党员参与议事占比 + */ + private String issueRatio = "0.00%"; + + /** + * 党员发布话题总数 + */ + private Integer topicTotal = 0; + + @JsonIgnore + private Double topicRatioA; + + /** + * 党员发布话题占比 + */ + private String topicRatio = "0.00%"; + + /** + * 议题转项目 + */ + private Integer shiftProjectTotal = 0; + + @JsonIgnore + private Double shiftProjectRatioA; + + /** + * 议题转项目占比 + */ + private String shiftProjectRatio = "0.00%"; + + /** + * 解决项目 + */ + private Integer resolvedProjectTotal = 0; + + @JsonIgnore + private Double resolvedProjectRatioA; + + /** + * 解决项目占比 + */ + private String resolvedProjectRatio = "0.00%"; + + /** + * 党员发布议题数 + */ + private Integer publishIssueTotal = 0; + + @JsonIgnore + private Double publishIssueRatioA; + + /** + * 党员发布议题数占比 + */ + private String publishIssueRatio = "0.00%"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java new file mode 100644 index 0000000000..318b290840 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 治理能力榜单返参dto + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627 + * @ClassName GovernCapacityRankResultDTO + * @Auth wangc + * @Date 2020-08-20 17:30 + */ +@Data +public class GovernCapacityRankResultDTO implements Serializable { + private static final long serialVersionUID = -3891870459284304022L; + + /** + * 名称 + * */ + private String agencyName; + + /** + * 响应率 + * */ + private String responseRatio; + + /** + * 解决率 + * */ + private String resolvedRatio; + + /** + * 自治率 + * */ + private String governRatio; + + /** + * 满意率 + * */ + private String satisfactionRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java new file mode 100644 index 0000000000..dd2c09cd94 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 治理能力查询结果dto + * @ClassName GovernCapacityResultDTO + * @Auth wangc + * @Date 2020-08-20 17:24 + */ +@Data +public class GovernCapacityResultDTO implements Serializable { + private static final long serialVersionUID = -2834039644611050304L; + + /** + * 名称 + * */ + private String agencyName; + + /** + * 响应率 + * */ + private BigDecimal responseRatio; + + /** + * 解决率 + * */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + * */ + private BigDecimal governRatio; + + /** + * 满意率 + * */ + private BigDecimal satisfactionRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java new file mode 100644 index 0000000000..ebf0d9d276 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java @@ -0,0 +1,25 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 9:12 上午 + */ +@Data +public class MonthBarchartResult implements Serializable { + + private static final long serialVersionUID = 3777652772902180088L; + + private String monthId; + + private Double serviceAbility; + + private Double partyDevAbility; + + private Double governAbility; + + private Double indexTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java new file mode 100644 index 0000000000..479547a883 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/19 5:23 下午 + */ +@Data +public class MonthBarchartResultDTO implements Serializable { + + private static final long serialVersionUID = 561457498288576566L; + + /** + * 服务能力 + */ + private List serviceAbilityData; + + /** + * 党建能力 + */ + private List partyDevAbilityData; + + /** + * 治理能力 + */ + private List governAbilityData; + + /** + * 横坐标月份集合 + */ + private List xAxis; + + /** + * 总指数集合 + */ + private List totalIndexData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java new file mode 100644 index 0000000000..248f69d5ce --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 3:12 下午 + */ +@Data +public class MonthPieChartResultDTO implements Serializable { + + private static final long serialVersionUID = 8399158251970739021L; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; + + /** + * 党建能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 治理能力 + */ + private Double governAbility = 0.0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java new file mode 100644 index 0000000000..87a8d482c9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 党建引领-组织先进排行榜 查询结果dto + * @ClassName OrgRankDataResultDTO + * @Auth wangc + * @Date 2020-08-21 11:16 + */ +@Data +public class OrgRankDataResultDTO implements Serializable { + + private static final long serialVersionUID = -2980098512184391207L; + + /** + * 名称 XXXX社区党委 + * */ + private String name; + + /** + * 满意度 90.64% 返回字符串,前端直接显示 + * */ + private BigDecimal satisfactionRatio; + + /** + * 结案率 94.3% 返回字符串,前端直接显示 + * */ + private BigDecimal closedProjectRatio; + + /** + * 党员数 + * */ + private Integer partyMemberNum; + + /** + * 支部建设 GROUP_TOTAL + * */ + private Integer branchNum; + + /** + * 议题数 + * */ + private Integer issueNum; + + /** + * 项目数 + * */ + private Integer projectNum; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java new file mode 100644 index 0000000000..5ae10cb73e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 党员积分查询结果 dto 作为接口【5、先进排行榜单-先进党员排行】的返参对象 NEI地址: https://nei.netease.com/interface/detail/res/?pid=57068&id=321624 + * @ClassName PartyUserPointResultDTO + * @Auth wangc + * @Date 2020-08-21 14:18 + */ +@Data +public class PartyUserPointResultDTO implements Serializable { + private static final long serialVersionUID = -288523161283142460L; + + /** + * 用户Id + * */ + private String userId; + + /** + * 用户姓名 + * */ + private String name; + + /** + * 用户积分 + * */ + private Integer point; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java new file mode 100644 index 0000000000..6ae70d9a67 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.screen.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName PartymemberAgeDistributionResultDTO + * @Auth wangc + * @Date 2020-08-18 17:04 + */ +@Data +public class PartymemberAgeDistributionResultDTO implements Serializable { + private static final long serialVersionUID = -3477512511475784330L; + + /** + * 30岁以下 的党员 + * */ + private Integer under30Count = NumConstant.ZERO; + + /** + * 31-50岁 的党员 + * */ + private Integer between31And50Count = NumConstant.ZERO; + + /** + * 51-60岁 的党员 + * */ + private Integer between51And60Count = NumConstant.ZERO; + + /** + * 61岁以上 的党员 + * */ + private Integer above61Count = NumConstant.ZERO; + + /** + * 党员总数 + * */ + private Integer partyTotal = NumConstant.ZERO; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java new file mode 100644 index 0000000000..c5eec4d539 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description + * @ClassName PartymemberAgePercentResultDTO + * @Auth wangc + * @Date 2020-08-19 09:13 + */ +@Data +public class PartymemberAgePercentResultDTO implements Serializable { + private static final long serialVersionUID = 2228109850328978771L; + + /** + * 30岁以下 的党员占 注册党员总数的百分比 (返回数字,小数点后保留两位) + * */ + private BigDecimal under30Ratio; + + /** + * 31-50岁 的党员占 注册党员总数的百分比(返回数字,小数点后保留两位) + * */ + private BigDecimal between31And50Ratio; + + /** + * 51-60岁 的党员占 注册党员总数的百分比(返回数字,小数点后保留两位) + * */ + private BigDecimal between51And60Ratio; + + /** + * 61岁以上 的党员占 注册党员总数的百分比(返回数字,小数点后保留两位) + * */ + private BigDecimal above61; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java new file mode 100644 index 0000000000..eb8bc35184 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.screen.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 1、党员基本情况-饼状图概况 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321324 + * @ClassName PartymemberPercentResultDTO + * @Auth wangc + * @Date 2020-08-18 14:54 + */ +@Data +public class PartymemberPercentResultDTO implements Serializable { + private static final long serialVersionUID = -2864099044581782674L; + + /** + * 注册党员总数 + * */ + private Integer partyMemberTotal = NumConstant.ZERO; + + /** + * 注册党员占比 + * */ + private String percentInPlatForm; + + /** + * 注册用户总数 + * */ + private Integer platFormTotal = NumConstant.ZERO; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java new file mode 100644 index 0000000000..397b53287b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/18 11:06 上午 + */ +@Data +public class ParymemberDistributionResultDTO implements Serializable { + + private static final long serialVersionUID = 9180892033529262049L; + + /** + * 可能是gridId,可能是agencyId + */ + private String subId = ""; + + /** + * 中心点位 + */ + private String centerMark = ""; + + /** + * 党员总人数 + */ + private Integer totalNum = 0; + + /** + * 坐标区域 + */ + private String areaMarks = ""; + + /** + * 可以是网格的名称,可以是组织的名称 + */ + private String subName= ""; + + /** + * 组织:agency, 网格 : grid; + */ + private String type = ""; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java new file mode 100644 index 0000000000..18bc33df48 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/18 11:03 上午 + */ +@Data +public class ParymemberResultDTO implements Serializable { + + private static final long serialVersionUID = -7230556020628357047L; + + /** + * 当前所选组织 + */ + private String agencyId = ""; + + /** + * 当前所选组织名称 + */ + private String name = ""; + + /** + * 当前所选组织的坐标区域 + */ + private String areaMarks = ""; + + /** + * 机关级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + */ + @JsonIgnore + private String level; + + /** + * 子级用户分布 + */ + private List userDistribution = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java new file mode 100644 index 0000000000..234fe38034 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/19 4:37 下午 + */ +@Data +public class ProjectDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 2884179183725459493L; + + /** + * 项目内容 + */ + private String projectContent = ""; + + /** + * 当前状态 + */ + private String status = ""; + + /** + * 最后一次处理的部门 + */ + private String latestHandleDept = ""; + + /** + * 最后一次处理的时间yyyy-MM-dd HH:mm + */ + private String latestHandleTime = ""; + + /** + * 操作描述 + */ + private String operDesc = ""; + + /** + * 图片列表 + */ + private List imgList = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java new file mode 100644 index 0000000000..7a0a016b25 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 1:27 下午 + */ +@Data +public class ProjectResultDTO implements Serializable { + + private static final long serialVersionUID = 7130615407473171093L; + + /** + * 项目标题 + */ + private String projectTitle = ""; + + /** + * red, green,yellow + */ + private String color = ""; + + /** + * 项目id + */ + private String projectId = ""; + + /** + * 网格名称 + */ + private String orgName = ""; + + /** + * 经度 + */ + private Double longitude = 0.0; + + /** + * 纬度 + */ + private Double latitude = 0.0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java new file mode 100644 index 0000000000..45f4f801ce --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName PublicPartiChartResultDTO + * @Auth wangc + * @Date 2020-08-21 09:16 + */ +@Data +public class PublicPartiChartResultDTO implements Serializable { + private static final long serialVersionUID = 8366701017042226713L; + + /** + * 横坐标:近一年(不包含当前月) + * */ + private List xAxis; + + /** + * 组织次数 + * */ + private List organizeNumList; + + /** + * 参与人数 + * */ + private List joinUserNumList; + + /** + * 平均参与人次 + * */ + private List averageJoinNumList; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java new file mode 100644 index 0000000000..52a127fd77 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.screen.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 3、公众参与概况返参DTO + * @ClassName PublicPartiProfileResultDTO + * @Auth wangc + * @Date 2020-08-20 14:33 + */ +@Data +public class PublicPartiProfileResultDTO implements Serializable { + private static final long serialVersionUID = 2520835419152912027L; + + private Integer total = NumConstant.ZERO; + + private String monthIncr = ""; + + /** + * incr上升, decr下降 + * */ + private String monthTrend = ""; + + private Integer averageIssue = NumConstant.ZERO; + + /** + * 较上月百分比 + * */ + private String issueCompareLatestMonth = ""; + + /** + * 较上月趋势:incr上升,decr下降 + * */ + private String issueCompareLatestTrend = ""; + + /** + * 平均参与度 + * */ + private Integer averageJoin = NumConstant.ZERO; + + private String joinCompareLatestMonth = ""; + + private String joinCompareLatestTrend = ""; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java new file mode 100644 index 0000000000..b151901bdf --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 公众参与-排行榜 传参dto + * @ClassName PublicPartiRankResultDTO + * @Auth wangc + * @Date 2020-08-20 15:29 + */ +@Data +public class PublicPartiRankResultDTO implements Serializable { + private static final long serialVersionUID = -2958188980327497507L; + + private String name; + + private Integer regNum; + + private Integer joinNum; + + private Integer topicNum; + + private Integer issueNum; + + private Integer projectNum; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java new file mode 100644 index 0000000000..5b0d89f39f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 9:58 上午 + */ +@Data +public class SubAgencyIndexRankResultDTO implements Serializable { + + private static final long serialVersionUID = -2767000156092731932L; + + /** + * 名称(组织或者网格名称,部门名称) + */ + private String name = ""; + + /** + * 总指数 + */ + private Double totalIndex = 0.0; + + /** + * 党建能力 + */ + private Double governAbility = 0.0; + + /** + * 治理能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java new file mode 100644 index 0000000000..607891f5bf --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 1:46 下午 + */ +@Data +public class TopProfileResultDTO implements Serializable { + + private static final long serialVersionUID = -5081563117620857359L; + + /** + * 用户总数 + */ + private Integer userNum = 0; + + /** + * 党员总数 + */ + private Integer partyMemberNum = 0; + + /** + * 党群总数 + */ + private Integer groupNum = 0; + + /** + * 话题总数 + */ + private Integer topicNum = 0; + + /** + * 议题总数 + */ + private Integer issueNum = 0; + + /** + * 项目总数 + */ + private Integer projectNum = 0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java new file mode 100644 index 0000000000..b12a8f46f5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/18 2:00 下午 + */ +@Data +public class TreeResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 显示名称 + */ + private String label = ""; + + /** + * agencyId下拉框value + */ + private String value = ""; + + @JsonIgnore + private String pids; + + /** + * 子目录 + */ + private List children = new ArrayList<>(); + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java new file mode 100644 index 0000000000..15787f28ed --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/18 11:06 上午 + */ +@Data +public class UserDistributionResultDTO implements Serializable { + + private static final long serialVersionUID = -7679590088019724244L; + + /** + * 可能是gridId,可能是agencyId + */ + private String subId; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 用户总人数 + */ + private Integer totalNum; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 可以是网格的名称,可以是组织的名称 + */ + private String subName; + + /** + * 组织:agency, 网格 : grid; + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java new file mode 100644 index 0000000000..cf870c9b18 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 用户参与各项指标以及增长查询结果dto + * @ClassName UserJoinIndicatorGrowthRateResultDTO + * @Auth wangc + * @Date 2020-08-21 16:07 + */ +@Data +public class UserJoinIndicatorGrowthRateResultDTO implements Serializable { + private static final long serialVersionUID = -8830240350298414599L; + + private Integer total; + + private BigDecimal monthIncr; + + /** + * incr上升, decr下降 + * */ + private String monthTrend; + + private Integer averageIssue; + + /** + * 较上月百分比 + * */ + private BigDecimal issueCompareLatestMonth; + + /** + * 较上月趋势:incr上升,decr下降 + * */ + private String issueCompareLatestTrend; + + /** + * 平均参与度 + * */ + private Integer averageJoin; + + private BigDecimal joinCompareLatestMonth; + + private String joinCompareLatestTrend; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java new file mode 100644 index 0000000000..b35ce13c58 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.screen.dto.result; + + +import lombok.Data; +import java.io.Serializable; + + +/** + * @Description 阅读用户参与查询返参dto screen_user_join + * @ClassName UserJoinMonthlyResultDTO + * @Auth wangc + * @Date 2020-08-21 09:20 + */ +@Data +public class UserJoinMonthlyResultDTO implements Serializable { + private static final long serialVersionUID = 4078219053108425375L; + + private String monthId; + + private Integer organizeNum; + + private Integer joinUserNum; + + private Integer averageJoinNum; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java new file mode 100644 index 0000000000..43cc73e066 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; + +/** + * @Description + * @ClassName UserPointRankResultDTO + * @Auth wangc + * @Date 2020-08-20 10:46 + */ +@Data +public class UserPointRankResultDTO implements Serializable { + private static final long serialVersionUID = 2829557017489626022L; + + /** + * 横坐标:姓名 + * */ + private List nameData = new LinkedList<>(); + + /** + * 纵坐标:积分 + * */ + private List pointsData = new LinkedList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java new file mode 100644 index 0000000000..1f38d6886e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 用户积分DTO - 查询结果 + * @ClassName UserPointResultDTO + * @Auth wangc + * @Date 2020-08-20 10:50 + */ +@Data +public class UserPointResultDTO implements Serializable { + private static final long serialVersionUID = -5174248184514429116L; + + private String name; + + private Integer point; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java new file mode 100644 index 0000000000..179aa5bec2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/18 11:03 上午 + */ +@Data +public class UserResultDTO implements Serializable { + + private static final long serialVersionUID = -6633682494274511121L; + + /** + * 当前所选组织 + */ + private String agencyId = ""; + + /** + * 当前所选组织名称 + */ + private String name = ""; + + /** + * 当前所选组织的坐标区域 + */ + private String areaMarks = ""; + + /** + * 机关级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + */ + @JsonIgnore + private String level; + + /** + * 子级用户分布 + */ + private List userDistribution = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java new file mode 100644 index 0000000000..bc2d53edff --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java @@ -0,0 +1,35 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 3:16 下午 + */ +@Data +public class VolunteerServiceResult implements Serializable { + + private static final long serialVersionUID = 959536759114517195L; + + /** + * 月份ID + */ + private String monthId; + + /** + * 组织次数 + */ + private Integer organizeData; + + /** + * 参与次数 + */ + private Integer joinData; + + /** + * 平均参与人次 + */ + private Integer averageJoinUserData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java new file mode 100644 index 0000000000..18331f9ca7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/20 3:14 下午 + */ +@Data +public class VolunteerServiceResultDTO implements Serializable { + + private static final long serialVersionUID = -6227889392267793005L; + + /** + * x轴,返回近12个月,不包含当前月 + */ + private List xAxis; + + /** + * 组织次数 + */ + private List organizeData; + + /** + * 参与次数 + */ + private List joinData; + + /** + * 平均参与人次 + */ + private List averageJoinUserData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java new file mode 100644 index 0000000000..d05479d5d2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 2:45 下午 + */ +@Data +public class YearAverageIndexResultDTO implements Serializable { + + private static final long serialVersionUID = 6453379153616899440L; + + /** + * 年度平均指数 + */ + private Double yearAverageIndex = 0.0; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; + + /** + * 党建能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 治理能力 + */ + private Double governAbility = 0.0; +} 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 index 116fd812c5..92658e8199 100644 --- 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 @@ -2,7 +2,7 @@ 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.27 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.28 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index f6e8f593d5..2da81cdd0e 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.27 + 0.3.28 data-report-server @@ -67,6 +67,12 @@ epmet-commons-extapp-auth 2.0.0 + + + com.epmet + epmet-commons-dynamic-datasource + 2.0.0 + @@ -104,11 +110,18 @@ dev - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr 0 @@ -139,11 +152,11 @@ test - + - - epmet - elink@833066 + + epmet + elink@833066 0 @@ -174,11 +187,11 @@ prod - + - - epmet_data_statistical - EpmEt-db-UsEr + + epmet_data_statistical + EpmEt-db-UsEr 0 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/datareport/aspect/RequestLogAspect.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/aspect/RequestLogAspect.java index 7d4ff2d7d4..d57b2833e5 100644 --- 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/datareport/aspect/RequestLogAspect.java @@ -1,4 +1,4 @@ -package com.epmet.aspect; +package com.epmet.datareport.aspect; import com.epmet.commons.tools.aspect.BaseRequestLogAspect; import org.aspectj.lang.ProceedingJoinPoint; @@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletRequest; public class RequestLogAspect extends BaseRequestLogAspect { @Override - @Around(value = "execution(* com.epmet.controller.*.*Controller*.*(..)) ") + @Around(value = "execution(* com.epmet.datareport.controller.*.*Controller*.*(..)) ") public Object proceed(ProceedingJoinPoint point) throws Throwable { return super.proceed(point, 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/datareport/config/ModuleConfigImpl.java similarity index 92% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/ModuleConfigImpl.java index c52ec15b50..10a4cdd6d7 100644 --- 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/datareport/config/ModuleConfigImpl.java @@ -6,7 +6,7 @@ * 版权所有,侵权必究! */ -package com.epmet.config; +package com.epmet.datareport.config; import com.epmet.commons.tools.config.ModuleConfig; import org.springframework.stereotype.Service; 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/datareport/controller/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/.gitignore 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/datareport/controller/group/GroupController.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/group/GroupController.java index 88dd3bb376..1d269eddbd 100644 --- 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/datareport/controller/group/GroupController.java @@ -9,7 +9,7 @@ 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 com.epmet.datareport.service.group.GroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; 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/datareport/controller/issue/IssueController.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/issue/IssueController.java index c9fad20ce2..afc732802d 100644 --- 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/datareport/controller/issue/IssueController.java @@ -1,11 +1,11 @@ -package com.epmet.controller.issue; +package com.epmet.datareport.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 com.epmet.datareport.service.issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; 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/datareport/controller/project/ProjectController.java similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/project/ProjectController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java 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/datareport/controller/publicity/PublicityController.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/publicity/PublicityController.java index 8612d82002..f01540758c 100644 --- 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/datareport/controller/publicity/PublicityController.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.controller.publicity; +package com.epmet.datareport.controller.publicity; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.NumConstant; @@ -24,7 +24,7 @@ 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 com.epmet.datareport.service.publicity.PublicityService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java new file mode 100644 index 0000000000..d671c4cd05 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -0,0 +1,59 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +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.screen.dto.form.CompartmentFormDTO; +import com.epmet.screen.dto.result.CompartmentResultDTO; +import com.epmet.screen.dto.result.TreeResultDTO; +import com.epmet.datareport.service.screen.AgencyService; +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; + +/** + * 组织相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:15 + */ +@RestController +@RequestMapping("/screen/agency") +public class AgencyController { + + @Autowired + private AgencyService agencyService; + + /** + * @Description 1、组织机构树 + * @param + * @author zxc + * @date 2020/8/18 2:04 下午 + */ + @ExternalAppRequestAuth + @PostMapping("tree") + public Result tree(ExternalAppRequestParam externalAppRequestParam){ + return new Result().ok(agencyService.tree(externalAppRequestParam)); + } + + /** + * @Description 2、组织区域查询 + * @param compartmentFormDTO + * @author zxc + * @date 2020/8/18 2:33 下午 + */ + @ExternalAppRequestAuth + @PostMapping("compartment") + public Result compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){ + ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class); + return new Result().ok(agencyService.compartment(compartmentFormDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java new file mode 100644 index 0000000000..b0b7c1f7a8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -0,0 +1,95 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.screen.dto.form.*; +import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.screen.DistributionService; +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/8/18 10:14 + */ +@RestController +@RequestMapping("/screen/distribution") +public class DistributionController { + + @Autowired + private DistributionService distributionService; + + /** + * @Description 1、党支部 + * @param formDTO + * @author zxc + * @date 2020/8/18 10:59 上午 + */ + @ExternalAppRequestAuth + @PostMapping("branch") + public Result> branch(@RequestBody BranchFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class); + return new Result>().ok(distributionService.branch(formDTO)); + } + + /** + * @Description 2、用户分布 + * @param userFormDTO + * @author zxc + * @date 2020/8/18 11:10 上午 + */ + @ExternalAppRequestAuth + @PostMapping("user") + public Result user(@RequestBody UserFormDTO userFormDTO){ + ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class); + return new Result().ok(distributionService.user(userFormDTO)); + } + + /** + * @Description 3、党员分布 + * @param parymemberFormDTO + * @author zxc + * @date 2020/8/18 11:20 上午 + */ + @ExternalAppRequestAuth + @PostMapping("parymember") + public Result parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){ + ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class); + return new Result().ok(distributionService.parymember(parymemberFormDTO)); + } + + /** + * @Description 4、事件 + * @param projectFormDTO + * @author zxc + * @date 2020/8/19 1:29 下午 + */ + @ExternalAppRequestAuth + @PostMapping("project") + public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ + ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); + return new Result>().ok(distributionService.project(projectFormDTO)); + } + + /** + * @Description 5、top区概况 + * @param topProfileFormDTO + * @author zxc + * @date 2020/8/19 1:52 下午 + */ + @ExternalAppRequestAuth + @PostMapping("topprofile") + public Result topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ + ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); + return new Result().ok(distributionService.topProfile(topProfileFormDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java new file mode 100644 index 0000000000..325c4606c8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -0,0 +1,109 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.GrassRootsGovernService; +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.AgencyFormDTO; +import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.screen.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 yinzuomei@elink-cn.com + * @date 2020/8/18 10:12 + */ +@RestController +@RequestMapping("/screen/grassrootsgovern") +public class GrassRootsGovernController { + + @Autowired + private GrassRootsGovernService grassRootsGovernService; + + + + /** + * @Description 1、热心市民积分排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544 + * @param param + * @return + * @author wangc + * @date 2020.08.20 11:16 + **/ + @ExternalAppRequestAuth + @PostMapping("userpointrank") + public Result userPointRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result().ok(grassRootsGovernService.userPointRank(param)); + } + + /** + * @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 + * @param param + * @return + * @author wangc + * @date 2020.08.20 13:55 + **/ + @ExternalAppRequestAuth + @PostMapping("difficultprojects") + public Result> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){ + ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class); + return new Result>().ok(grassRootsGovernService.difficultProject(param)); + } + + /** + * @Description 3、公众参与概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321975 + * @param param + * @return + * @author wangc + * @date 2020.08.20 14:37 + **/ + @ExternalAppRequestAuth + @PostMapping("publicpartiprofile") + public Result publicPartiProfile(@RequestBody AgencyFormDTO param){ + ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result().ok(grassRootsGovernService.publicPartiProfile(param)); + } + + /** + * @Description 4、公众参与-排行榜 + * @NEI https://nei.netease.com/interface/detail/?pid=57068&id=321978 + * @param param + * @return + * @author wangc + * @date 2020.08.20 15:32 + **/ + @ExternalAppRequestAuth + @PostMapping("publicpartirank") + public Result> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result>().ok(grassRootsGovernService.publicPartiRank(param)); + } + + /** + * @Description 5、治理能力榜单 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627 + * @param param + * @return + * @author wangc + * @date 2020.08.20 17:46 + **/ + @ExternalAppRequestAuth + @PostMapping("governcapacityrank") + public Result> governCapacityRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result>().ok(grassRootsGovernService.governCapacityRank(param)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java new file mode 100644 index 0000000000..7c536869e9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -0,0 +1,93 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.GrassrootsPartyDevService; +import com.epmet.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.screen.dto.form.ParymemberFormDTO; +import com.epmet.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.screen.dto.result.PartymemberPercentResultDTO; +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; + +/** + * 基层党建相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:11 + */ +@RestController +@RequestMapping("/screen/grassrootspartydev") +public class GrassrootsPartyDevController { + + @Autowired + private GrassrootsPartyDevService grassrootsPartyDevService; + + /** + * @Description 党员基本情况-饼状图概况 + * @NEI https://nei.netease.com/interface/detail/?pid=57068&id=321324 + * @param param + * @return + * @author wangc + * @date 2020.08.18 16:59 + **/ + @ExternalAppRequestAuth + @PostMapping("basicinfo") + public Result baseInfo(@RequestBody ParymemberFormDTO param){ + ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); + return new Result().ok(grassrootsPartyDevService.partymemberBaseInfo(param)); + } + + /** + * @Description 2、党员基本情况-年龄分布 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 + * @param param + * @return + * @author wangc + * @date 2020.08.18 17:54 + **/ + @ExternalAppRequestAuth + @PostMapping("ageinfo") + public Result ageInfo(@RequestBody ParymemberFormDTO param){ + ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); + return new Result().ok(grassrootsPartyDevService.partymemberAgeDistribution(param)); + } + + /** + * @Description 3、支部建设情况|联建共建情况-折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321981 + * @param param + * @return BranchBuildTrendResultDTO + * @author wangc + * @date 2020.08.19 11:02 + **/ + @ExternalAppRequestAuth + @PostMapping("branchbuildtrend") + public Result branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){ + ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class); + return new Result().ok(grassrootsPartyDevService.branchBuildTrend(param)); + } + + /** + * @Description 4、支部建设情况|联建共建情况-排行 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321982 + * @param param + * @return + * @author wangc + * @date 2020.08.19 15:25 + **/ + @ExternalAppRequestAuth + @PostMapping("branchbuildrank") + public Result branchBuildRank(@RequestBody BranchBuildRankFormDTO param){ + ValidatorUtils.validateEntity(param, BranchBuildRankFormDTO.BranchBuildRankGroup.class); + return new Result().ok(grassrootsPartyDevService.branchBuildRank(param)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java new file mode 100644 index 0000000000..53b69591b4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -0,0 +1,89 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.IndexService; +import com.epmet.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +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/8/18 10:13 + */ +@RestController +@RequestMapping("/screen/index") +public class IndexController { + + @Autowired + private IndexService indexService; + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + @ExternalAppRequestAuth + @PostMapping("yearaverageindex") + public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ + ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); + return new Result().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO)); + } + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + @ExternalAppRequestAuth + @PostMapping("monthindexanalysis/piechart") + public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ + ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); + return new Result().ok(indexService.monthPieChart(monthPieChartFormDTO)); + } + + /** + * @Description 3、月度指数分析-柱状图 + * @param monthBarchartFormDTO + * @author zxc + * @date 2020/8/19 5:27 下午 + */ + @ExternalAppRequestAuth + @PostMapping("monthindexanalysis/barchart") + public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam){ + ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); + return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO,externalAppRequestParam)); + } + + /** + * @Description 4、下级部门指数排行 + * @param subAgencyIndexRankFormDTO + * @author zxc + * @date 2020/8/20 10:02 上午 + */ + @ExternalAppRequestAuth + @PostMapping("subagencyindexrank") + public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ + ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); + return new Result>().ok(indexService.subAgencyIndexRank(subAgencyIndexRankFormDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java new file mode 100644 index 0000000000..5478956a32 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -0,0 +1,99 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.PartyMemberLeadService; +import com.epmet.screen.dto.form.*; +import com.epmet.screen.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 yinzuomei@elink-cn.com + * @date 2020/8/18 10:10 + */ +@RestController +@RequestMapping("/screen/partymemberlead") +public class PartyMemberLeadController { + + @Autowired + private PartyMemberLeadService partyMemberLeadService; + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + @ExternalAppRequestAuth + @PostMapping("fineexample") + public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ + ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); + return new Result().ok(partyMemberLeadService.fineExample(fineExampleFormDTO)); + } + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + @ExternalAppRequestAuth + @PostMapping("contactmasslinechart") + public Result contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){ + ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class); + return new Result().ok(partyMemberLeadService.contactMassLineChart(contactMassLineChartFormDTO)); + } + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + @ExternalAppRequestAuth + @PostMapping("volunteerservice") + public Result volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){ + ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class); + return new Result().ok(partyMemberLeadService.volunteerService(volunteerServiceFormDTO)); + } + + /** + * @Description 4、先进排行榜单-先进支部排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321539 + * @param param + * @return + * @author wangc + * @date 2020.08.21 11:05 + **/ + @ExternalAppRequestAuth + @PostMapping("advancedbranchrank") + Result> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result>().ok(partyMemberLeadService.advancedBranchRank(param)); + } + + /** + * @Description 5、先进排行榜单-先进党员排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321624 + * @param param + * @return List + * @author wangc + * @date 2020.08.21 14:22 + **/ + @ExternalAppRequestAuth + @PostMapping("advancedpartymemberrank") + Result> advancedPartymemberRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result>().ok(partyMemberLeadService.advancedPartymemberRank(param)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java new file mode 100644 index 0000000000..8c508e5eda --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -0,0 +1,41 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.ScreenProjectService; +import com.epmet.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.screen.dto.result.ProjectDetailResultDTO; +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; + +/** + * 项目 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:16 + */ +@RestController +@RequestMapping("/screen/project") +public class ScreenProjectController { + + @Autowired + private ScreenProjectService screenProjectService; + + /** + * @Description 3、项目详情 + * @param projectDetailFormDTO + * @author zxc + * @date 2020/8/19 4:36 下午 + */ + @ExternalAppRequestAuth + @PostMapping("detail") + public Result projectDetail(@RequestBody ProjectDetailFormDTO projectDetailFormDTO){ + ValidatorUtils.validateEntity(projectDetailFormDTO, ProjectDetailFormDTO.ProjectDetail.class); + return new Result().ok(screenProjectService.projectDetail(projectDetailFormDTO)); + } + +} 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/datareport/controller/topic/TopicController.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/topic/TopicController.java index 233f31dc27..91edf636dd 100644 --- 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/datareport/controller/topic/TopicController.java @@ -1,10 +1,10 @@ -package com.epmet.controller.topic; +package com.epmet.datareport.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.datareport.service.topic.TopicService; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; import com.epmet.topic.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; 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/datareport/controller/user/UserAnalysisController.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/UserAnalysisController.java index cceebbef37..dda6b177cf 100644 --- 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/datareport/controller/user/UserAnalysisController.java @@ -1,4 +1,4 @@ -package com.epmet.controller.user; +package com.epmet.datareport.controller.user; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -7,7 +7,7 @@ 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.*; -import com.epmet.service.user.UserAnalysisService; +import com.epmet.datareport.service.user.UserAnalysisService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; 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/datareport/dao/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore 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/datareport/dao/group/GroupDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/group/GroupDao.java index e2a8410272..975b49ba5a 100644 --- 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/datareport/dao/group/GroupDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.group; +package com.epmet.datareport.dao.group; import com.epmet.group.dto.result.*; import org.apache.ibatis.annotations.Mapper; 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/datareport/dao/issue/IssueDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/IssueDao.java index abf2c4d350..53cab40c92 100644 --- 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/datareport/dao/issue/IssueDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.issue; +package com.epmet.datareport.dao.issue; import com.epmet.issue.dto.result.IssueDataDTO; import org.apache.ibatis.annotations.Mapper; 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/datareport/dao/project/ProjectDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java index 3ae53720f7..b8920580bf 100644 --- 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/datareport/dao/project/ProjectDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.project; +package com.epmet.datareport.dao.project; import com.epmet.project.dto.FactAgencyProjectDailyDTO; import com.epmet.project.dto.result.*; 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/datareport/dao/publicity/PublicityDao.java similarity index 99% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/publicity/PublicityDao.java index a4babe6039..b65c16b9a1 100644 --- 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/datareport/dao/publicity/PublicityDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.datareport.dao.publicity; import com.epmet.publicity.dto.result.*; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java new file mode 100644 index 0000000000..87f26f3b01 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + + +/** + * 基层党建-党员基本情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenCpcBaseDataDao{ + + /** + * @Description 查询党员年龄分布情况 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.18 17:47 + **/ + PartymemberAgeDistributionResultDTO selectPartymemberAgeDistribution(@Param("agencyId") String agencyId); + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java new file mode 100644 index 0000000000..c97ac8b8e0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.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.datareport.dao.screen; + +import com.epmet.screen.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-08-18 + */ +@Mapper +public interface ScreenCustomerAgencyDao { + + /** + * @Description 查询客户根组织ID + * @param customerId + * @author zxc + * @date 2020/8/18 2:44 下午 + */ + TreeResultDTO selectRootAgencyId(@Param("customerId")String customerId); + + /** + * @Description 查询下级机关的 名称和id + * @param subAgencyPids + * @author zxc + * @date 2020/8/18 4:48 下午 + */ + List selectSubAgencyList(@Param("subAgencyPids") String subAgencyPids); + + /** + * @Description 查询当前机关的区域信息 + * @param agencyId + * @author zxc + * @date 2020/8/18 4:51 下午 + */ + CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId")String agencyId); + + /** + * @Description 查询子级区域分布信息【机关级别】 + * @param agencyId + * @author zxc + * @date 2020/8/18 5:12 下午 + */ + List selectSubDistribution(@Param("agencyId")String agencyId); + + /** + * @Description 查询子级用户分布【机关级别】 + * @param parentId + * @author zxc + * @date 2020/8/19 9:33 上午 + */ + List selectUserDistributionAgency(@Param("parentId")String parentId); + + /** + * @Description 查询子级党员分布【机关级别】 + * @param parentId + * @author zxc + * @date 2020/8/19 10:30 上午 + */ + List selectParymemberDistribution(@Param("parentId")String parentId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java new file mode 100644 index 0000000000..e6ae450514 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.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.datareport.dao.screen; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 部门信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenCustomerDeptDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java new file mode 100644 index 0000000000..4e57c2f71d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.AgencyDistributionResultDTO; +import com.epmet.screen.dto.result.BranchResultDTO; +import com.epmet.screen.dto.result.ParymemberDistributionResultDTO; +import com.epmet.screen.dto.result.UserDistributionResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenCustomerGridDao { + + /** + * @Description 查询子级区域分布信息【网格级别】 + * @param agencyId + * @author zxc + * @date 2020/8/18 5:12 下午 + */ + List selectSubDistribution(@Param("agencyId")String agencyId); + + /** + * @Description 查询党支部信息 + * @param agencyId + * @author zxc + * @date 2020/8/19 9:13 上午 + */ + List selectBranch(@Param("agencyId")String agencyId); + + /** + * @Description 查询子级用户分布【网格级别】 + * @param parentId + * @author zxc + * @date 2020/8/19 9:33 上午 + */ + List selectUserDistribution(@Param("parentId")String parentId); + + /** + * @Description 查询子级党员分布【网格级别】 + * @param parentId + * @author zxc + * @date 2020/8/19 10:30 上午 + */ + List selectParymemberDistribution(@Param("parentId")String parentId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java new file mode 100644 index 0000000000..17d2e7a420 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.DifficultProjectResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenDifficultyDataDao { + + /** + * @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数 + * @param + * @return + * @author wangc + * @date 2020.08.20 14:26 + **/ + List selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java new file mode 100644 index 0000000000..92f1641cce --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.screen.dto.result.ProjectResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenEventDataDao{ + + /** + * @Description 查询事件 + * @param parentId + * @author zxc + * @date 2020/8/19 2:09 下午 + */ + List selectEvent(@Param("parentId")String parentId); + + /** + * @Description 3、项目详情 + * @param projectId + * @author zxc + * @date 2020/8/19 4:36 下午 + */ + ProjectDetailResultDTO selectEventDetail(@Param("projectId")String projectId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java new file mode 100644 index 0000000000..8090ce00c7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.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.datareport.dao.screen; + +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-08-18 + */ +@Mapper +public interface ScreenEventImgDataDao { + + /** + * @Description 查询事件imgUrl集合 + * @param projectId + * @author zxc + * @date 2020/8/19 5:11 下午 + */ + List selectEventImgList(@Param("projectId")String projectId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java new file mode 100644 index 0000000000..3cf167fc5e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.GovernCapacityResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenGovernRankDataDao{ + + /** + * @Description 查询政府治理能力各项指标 + * @param monthId + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 17:34 + **/ + List selectGovernCapacityRatio(@Param("monthId") String monthId,@Param("agencyId") String agencyId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java new file mode 100644 index 0000000000..2e18647c39 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.screen.dto.result.MonthBarchartResult; +import com.epmet.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenIndexDataMonthlyDao{ + + /** + * @Description 2、月度指数分析-饼状图 + * @param agencyId + * @author zxc + * @date 2020/8/19 3:43 下午 + */ + MonthPieChartResultDTO selectMonthPieChart(@Param("agencyId")String agencyId); + + /** + * @Description 查询近一年的指数值【不包括本月】 + * @param customerId + * @param agencyId + * @author zxc + * @date 2020/8/20 9:02 上午 + */ + List selectMonthBarchart(@Param("customerId")String customerId, @Param("agencyId")String agencyId); + + /** + * @Description 4、下级部门指数排行 + * @param subAgencyIndexRankFormDTO + * @author zxc + * @date 2020/8/20 10:04 上午 + */ + List selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java new file mode 100644 index 0000000000..304351b3b7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 指数-指数数据(按年统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface ScreenIndexDataYearlyDao{ + + /** + * @Description 1、年度平均指数 + * @param agencyId + * @author zxc + * @date 2020/8/19 3:43 下午 + */ + YearAverageIndexResultDTO selectYearAverageIndex(@Param("agencyId")String agencyId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java new file mode 100644 index 0000000000..fbee5cd15c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.OrgRankDataResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenOrgRankDataDao{ + + /** + * @Description 查询指定机关的直属网格月度数据 + * @param agencyId + * @param monthId + * @return + * @author wangc + * @date 2020.08.21 13:58 + **/ + List selectGridDataMonthly(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java new file mode 100644 index 0000000000..0117eec4a7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.BranchBuildOrderByCountResultDTO; +import com.epmet.screen.dto.result.BranchIssueDataResultDTO; +import com.epmet.screen.dto.result.VolunteerServiceResult; +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-08-18 + */ +@Mapper +public interface ScreenPartyBranchDataDao { + + /** + * @Description 根据agencyTd、type(数据类别 party:支部建设;union:联合建设)查出共有多少议题主题 + * @param agencyId + * @param type + * @return List + * @author wangc + * @date 2020.08.19 10:44 + **/ + List selectIssueGroup(@Param("agencyId") String agencyId , @Param("type") String type); + + /** + * @Description 根据议题名称查找近12个月的数据 + * @param agencyId .. + * @return List + * @author wangc + * @date 2020.08.19 10:59 + **/ + List selectBranchDataByTypeAndTimeZone(@Param("agencyId") String agencyId , @Param("type") String type, @Param("category") String category, @Param("bottomMonthId") String bottomMonthId); + + /** + * @Description 查询党员志愿服务 + * @param agencyId + * @author zxc + * @date 2020/8/20 3:30 下午 + */ + List selectVolunteerServiceResult(@Param("agencyId")String agencyId); + /** + * @Description 查找指定组织的下一级组织的数据排行 + * @param agencyId .. + * @return List + * @author wangc + * @date 2020.08.20 09:46 + **/ + List selectBranchDataByTypeOrder(@Param("agencyId")String agencyId,@Param("category")String category,@Param("monthId")String monthId,@Param("bottomMonthId")String bottomMonthId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java new file mode 100644 index 0000000000..dfa5c1f6d2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.ContactMassLineChartResult; +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-08-18 + */ +@Mapper +public interface ScreenPartyLinkMassesDataDao { + + /** + * @Description 查询党员联系群众 + * @param agencyId + * @author zxc + * @date 2020/8/20 2:48 下午 + */ + List selectContactMassLineChart(@Param("agencyId")String agencyId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java new file mode 100644 index 0000000000..946ac2a096 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.PartyUserPointResultDTO; +import com.epmet.screen.dto.result.UserPointResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenPartyUserRankDataDao{ + + /** + * @Description 查询指定机关下的用户积分排名 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 11:11 + **/ + List selectUserPointOrder(@Param("agencyId")String agencyId); + + /** + * @Description 查询指定机关所属网格的党员积分排名 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.21 14:32 + **/ + List selectPartymemberPointOrder(@Param("agencyId")String agencyId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java new file mode 100644 index 0000000000..4b477689c3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.FineExampleResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 党建引领-先锋模范数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenPioneerDataDao{ + + /** + * @Description 查询先锋模范 + * @param agencyId + * @author zxc + * @date 2020/8/20 5:22 下午 + */ + FineExampleResultDTO selectFineExample(@Param("agencyId")String agencyId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java new file mode 100644 index 0000000000..0edee635d4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO; +import com.epmet.screen.dto.result.UserJoinMonthlyResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenUserJoinDao { + + /** + * @Description 查询用户参与数据 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 15:07 + **/ + UserJoinIndicatorGrowthRateResultDTO selectUserJoinData(@Param("agencyId") String agencyId, @Param("monthId")String monthId); + + /** + * @Description 查询月度用户参与数据 + * @param agencyId + * @param monthId + * @return + * @author wangc + * @date 2020.08.21 09:54 + **/ + List selectUserJoinDataMonthly(@Param("agencyId")String agencyId,@Param("monthId") String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java new file mode 100644 index 0000000000..a03353e825 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.screen.dto.result.PublicPartiRankResultDTO; +import com.epmet.screen.dto.result.TopProfileResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenUserTotalDataDao { + + /** + * @Description 党员基本情况-饼状图概况 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.18 15:17 + **/ + PartymemberPercentResultDTO selectAgencyPartymemberPercent(@Param("agencyId")String agencyId); + + /** + * @Description 查询top区概况 + * @param agencyId + * @author zxc + * @date 2020/8/19 2:13 下午 + */ + TopProfileResultDTO selectTopProfile(@Param("agencyId")String agencyId); + + /** + * @Description 求出人均议题 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 14:54 + **/ + int selectAvgIssue(@Param("agencyId")String agencyId); + + /** + * @Description 查询用户数据 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 16:00 + **/ + List selectUserTotalData(@Param("agencyId") String agencyId); +} \ 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/datareport/dao/topic/TopicDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/topic/TopicDao.java index 2ab863ab78..4c0fb9d377 100644 --- 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/datareport/dao/topic/TopicDao.java @@ -1,6 +1,5 @@ -package com.epmet.dao.topic; +package com.epmet.datareport.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; 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/datareport/dao/user/UserAnalysisDao.java similarity index 99% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/UserAnalysisDao.java index 2df268feb2..c0a69f82fc 100644 --- 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/datareport/dao/user/UserAnalysisDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.user; +package com.epmet.datareport.dao.user; import com.epmet.dto.DimAgencyDTO; 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/datareport/service/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/.gitignore 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/datareport/service/group/GroupService.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/group/GroupService.java index d644029bcf..66d57fc92c 100644 --- 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/datareport/service/group/GroupService.java @@ -1,4 +1,4 @@ -package com.epmet.service.group; +package com.epmet.datareport.service.group; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.group.dto.form.GroupIncrTrendFormDTO; 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/datareport/service/group/impl/GroupServiceImpl.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/group/impl/GroupServiceImpl.java index d1be53ee85..be4faf115d 100644 --- 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/datareport/service/group/impl/GroupServiceImpl.java @@ -1,15 +1,15 @@ -package com.epmet.service.group.impl; +package com.epmet.datareport.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.datareport.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 com.epmet.datareport.service.group.GroupService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; 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/datareport/service/issue/IssueService.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/issue/IssueService.java index c0d33b2a3b..d0b3b6156d 100644 --- 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/datareport/service/issue/IssueService.java @@ -1,4 +1,4 @@ -package com.epmet.service.issue; +package com.epmet.datareport.service.issue; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; 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/datareport/service/issue/impl/IssueServiceImpl.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/issue/impl/IssueServiceImpl.java index d44576202e..86953616b1 100644 --- 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/datareport/service/issue/impl/IssueServiceImpl.java @@ -1,22 +1,20 @@ -package com.epmet.service.issue.impl; +package com.epmet.datareport.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.datareport.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 com.epmet.datareport.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; 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/datareport/service/project/ProjectService.java similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/ProjectService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java 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/datareport/service/project/impl/ProjectServiceImpl.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 6e5366827f..41af9351ac 100644 --- 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/datareport/service/project/impl/ProjectServiceImpl.java @@ -1,10 +1,10 @@ -package com.epmet.service.project.impl; +package com.epmet.datareport.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.commons.tools.utils.DateUtils; -import com.epmet.dao.project.ProjectDao; +import com.epmet.datareport.dao.project.ProjectDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; 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/datareport/service/publicity/PublicityService.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/publicity/PublicityService.java index bec823066c..35b6fff93b 100644 --- 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/datareport/service/publicity/PublicityService.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.service.publicity; +package com.epmet.datareport.service.publicity; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.publicity.dto.result.*; 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/datareport/service/publicity/impl/PublicityServiceImpl.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/publicity/impl/PublicityServiceImpl.java index b01f9339bc..9a8ceaca2f 100644 --- 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/datareport/service/publicity/impl/PublicityServiceImpl.java @@ -15,16 +15,16 @@ * along with this program. If not, see . */ -package com.epmet.service.publicity.impl; +package com.epmet.datareport.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.datareport.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 com.epmet.datareport.service.publicity.PublicityService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java new file mode 100644 index 0000000000..d3eee4f133 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java @@ -0,0 +1,35 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.screen.dto.form.CompartmentFormDTO; +import com.epmet.screen.dto.result.CompartmentResultDTO; +import com.epmet.screen.dto.result.TreeResultDTO; + +import java.util.List; + +/** + * 组织相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:18 + */ +public interface AgencyService { + + /** + * @Description 1、组织机构树 + * @param + * @author zxc + * @date 2020/8/18 2:04 下午 + */ + TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam); + + /** + * @Description 2、组织区域查询 + * @param compartmentFormDTO + * @author zxc + * @date 2020/8/18 2:33 下午 + */ + CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java new file mode 100644 index 0000000000..62a0d0d7bf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java @@ -0,0 +1,56 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.*; +import com.epmet.screen.dto.result.*; + +import java.util.List; + +/** + * 中央区相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:19 + */ +public interface DistributionService { + + /** + * @Description 1、党支部 + * @param formDTO + * @author zxc + * @date 2020/8/18 10:59 上午 + */ + List branch(BranchFormDTO formDTO); + + /** + * @Description 2、用户分布 + * @param userFormDTO + * @author zxc + * @date 2020/8/18 11:10 上午 + */ + UserResultDTO user(UserFormDTO userFormDTO); + + /** + * @Description 3、党员分布 + * @param parymemberFormDTO + * @author zxc + * @date 2020/8/18 11:20 上午 + */ + ParymemberResultDTO parymember(ParymemberFormDTO parymemberFormDTO); + + /** + * @Description 4、事件 + * @param projectFormDTO + * @author zxc + * @date 2020/8/19 1:29 下午 + */ + List project(ProjectFormDTO projectFormDTO); + + /** + * @Description 5、top区概况 + * @param topProfileFormDTO + * @author zxc + * @date 2020/8/19 1:52 下午 + */ + TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java new file mode 100644 index 0000000000..12315295b5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java @@ -0,0 +1,77 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.AgencyFormDTO; +import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.screen.dto.result.*; + +import java.util.List; + +/** + * 基层治理相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:20 + */ +public interface GrassRootsGovernService { + + /** + * @Description 1、热心市民积分排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544 + * @param param + * @return + * @author wangc + * @date 2020.08.20 11:16 + **/ + UserPointRankResultDTO userPointRank(AgencyAndNumFormDTO param); + + /** + * @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 + * @param param + * @return + * @author wangc + * @date 2020.08.20 13:55 + **/ + List difficultProject(AgencyNumTypeParamFormDTO param); + + /** + * @Description 3、公众参与概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321975 + * @param param + * @return + * @author wangc + * @date 2020.08.20 14:37 + **/ + PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param); + + /** + * @Description 4、公众参与-排行榜 + * @NEI https://nei.netease.com/interface/detail/?pid=57068&id=321978 + * @param param + * @return + * @author wangc + * @date 2020.08.20 15:32 + **/ + List publicPartiRank(AgencyAndNumFormDTO param); + + /** + * @Description 5、治理能力榜单 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627 + * @param param + * @return + * @author wangc + * @date 2020.08.20 17:46 + **/ + List governCapacityRank(AgencyAndNumFormDTO param); + + /** + * @Description 6、公众参与-柱状折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=322434 + * @param param + * @return + * @author wangc + * @date 2020.08.21 09:58 + **/ + PublicPartiChartResultDTO publicPartiChart(AgencyFormDTO param); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java new file mode 100644 index 0000000000..a870d21585 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java @@ -0,0 +1,58 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.screen.dto.form.ParymemberFormDTO; +import com.epmet.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.screen.dto.result.PartymemberPercentResultDTO; + +/** + * 基层党建相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +public interface GrassrootsPartyDevService { + + /** + * @Description 1、党员基本情况-饼状图概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324 + * @param param + * @return + * @author wangc + * @date 2020.08.18 14:58 + **/ + PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param); + + /** + * @Description 2、党员基本情况-年龄分布 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 + * @param param + * @return + * @author wangc + * @date 2020.08.18 17:54 + **/ + PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param); + + /** + * @Description 3、支部建设情况|联建共建情况-折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321981 + * @param param + * @return BranchBuildTrendResultDTO + * @author wangc + * @date 2020.08.19 11:02 + **/ + BranchBuildTrendResultDTO branchBuildTrend(BranchBuildTrendFormDTO param); + + /** + * @Description 4、支部建设情况|联建共建情况-排行 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321982 + * @param param + * @return + * @author wangc + * @date 2020.08.19 15:25 + **/ + BranchBuildRankResultDTO branchBuildRank(BranchBuildRankFormDTO param); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java new file mode 100644 index 0000000000..5c0b5e4ade --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java @@ -0,0 +1,55 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; + +import java.util.List; + +/** + * 指数相关相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +public interface IndexService { + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO); + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO); + + /** + * @Description 3、月度指数分析-柱状图 + * @param monthBarchartFormDTO + * @author zxc + * @date 2020/8/19 5:27 下午 + */ + MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam); + + /** + * @Description 4、下级部门指数排行 + * @param subAgencyIndexRankFormDTO + * @author zxc + * @date 2020/8/20 10:04 上午 + */ + List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java new file mode 100644 index 0000000000..5f781b2622 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java @@ -0,0 +1,63 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.screen.dto.form.FineExampleFormDTO; +import com.epmet.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.screen.dto.result.*; + +import java.util.List; + +/** + * 党建引领相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:22 + */ +public interface PartyMemberLeadService { + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO); + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO); + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO); + + /** + * @Description 4、先进排行榜单-先进支部排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321539 + * @param param + * @return + * @author wangc + * @date 2020.08.21 11:05 + **/ + List advancedBranchRank(AgencyAndNumFormDTO param); + + /** + * @Description 5、先进排行榜单-先进党员排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321624 + * @param param + * @return List + * @author wangc + * @date 2020.08.21 14:22 + **/ + List advancedPartymemberRank(AgencyAndNumFormDTO param); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java new file mode 100644 index 0000000000..78543bc52f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java @@ -0,0 +1,22 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.screen.dto.result.ProjectDetailResultDTO; + +/** + * 项目 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:22 + */ +public interface ScreenProjectService { + + /** + * @Description 3、项目详情 + * @param projectDetailFormDTO + * @author zxc + * @date 2020/8/19 4:36 下午 + */ + ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java new file mode 100644 index 0000000000..9ca543828c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java @@ -0,0 +1,94 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.screen.ScreenCustomerGridDao; +import com.epmet.screen.dto.form.CompartmentFormDTO; +import com.epmet.screen.dto.result.AgencyDistributionResultDTO; +import com.epmet.screen.constant.*; +import com.epmet.screen.dto.result.CompartmentResultDTO; +import com.epmet.screen.dto.result.TreeResultDTO; +import com.epmet.datareport.service.screen.AgencyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 组织相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:18 + */ +@Service +public class AgencyServiceImpl implements AgencyService { + + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + + /** + * @Description 1、组织机构树 + * @param + * @author zxc + * @date 2020/8/18 2:04 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { + // 1. 查询客户根组织ID + String customerId = externalAppRequestParam.getCustomerId(); + TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); + if (null == rootAgency){ + return new TreeResultDTO(); + } + List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) ? "" : rootAgency.getPids() + ",") + rootAgency.getValue()); + rootAgency.setChildren(departmentList); + return rootAgency; + } + + /** + * @Description 递归查询填充下级 + * @param subAgencyPids + * @author zxc + * @date 2020/8/18 4:42 下午 + */ + private List getDepartmentList(String subAgencyPids) { + List subAgencyList = screenCustomerAgencyDao.selectSubAgencyList(subAgencyPids); + if (subAgencyList.size() > NumConstant.ZERO) { + for (TreeResultDTO sub : subAgencyList) { + List subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); + sub.setChildren(subAgency); + } + } + return subAgencyList; + } + + /** + * @Description 2、组织区域查询 + * @param compartmentFormDTO + * @author zxc + * @date 2020/8/18 2:33 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO) { + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(compartmentFormDTO.getAgencyId()); + if (null == agencyAreaInfo){ + return new CompartmentResultDTO(); + } + if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + // 当level为"community"时,查询screen_customer_grid表 + List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + }else { + List agencyDistributionResultDTOS = screenCustomerAgencyDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + } + return agencyAreaInfo; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java new file mode 100644 index 0000000000..97a627fb23 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java @@ -0,0 +1,133 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.screen.ScreenCustomerGridDao; +import com.epmet.datareport.dao.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; +import com.epmet.screen.dto.form.*; +import com.epmet.screen.dto.result.*; +import com.epmet.screen.constant.*; +import com.epmet.datareport.service.screen.DistributionService; +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 yinzuomei@elink-cn.com + * @date 2020/8/18 10:19 + */ +@Service +public class DistributionServiceImpl implements DistributionService { + + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenEventDataDao screenEventDataDao; + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + + /** + * @Description 1、党支部 + * @param formDTO + * @author zxc + * @date 2020/8/18 10:59 上午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List branch(BranchFormDTO formDTO) { + List branchResultDTOS = screenCustomerGridDao.selectBranch(formDTO.getAgencyId()); + return branchResultDTOS; + } + + /** + * @Description 2、用户分布 + * @param userFormDTO + * @author zxc + * @date 2020/8/18 11:10 上午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public UserResultDTO user(UserFormDTO userFormDTO) { + UserResultDTO userResult = new UserResultDTO(); + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(userFormDTO.getAgencyId()); + if (null == agencyAreaInfo){ + return userResult; + } + BeanUtils.copyProperties(agencyAreaInfo,userResult); + if (userResult.getLevel().equals(ScreenConstant.COMMUNITY)){ + List userDistributionResultDTOS = screenCustomerGridDao.selectUserDistribution(userFormDTO.getAgencyId()); + userResult.setUserDistribution(userDistributionResultDTOS); + }else { + List userDistributionResultDTOS = screenCustomerAgencyDao.selectUserDistributionAgency(userFormDTO.getAgencyId()); + userResult.setUserDistribution(userDistributionResultDTOS); + } + return userResult; + } + + /** + * @Description 3、党员分布 + * @param parymemberFormDTO + * @author zxc + * @date 2020/8/18 11:20 上午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public ParymemberResultDTO parymember(ParymemberFormDTO parymemberFormDTO) { + ParymemberResultDTO parymemberResult = new ParymemberResultDTO(); + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(parymemberFormDTO.getAgencyId()); + if (null == agencyAreaInfo){ + return parymemberResult; + } + BeanUtils.copyProperties(agencyAreaInfo,parymemberResult); + if (parymemberResult.getLevel().equals(ScreenConstant.COMMUNITY)){ + List parymemberDistributionResultDTOS = screenCustomerGridDao.selectParymemberDistribution(parymemberFormDTO.getAgencyId()); + parymemberResult.setUserDistribution(parymemberDistributionResultDTOS); + }else { + List parymemberDistributionResultDTOS = screenCustomerAgencyDao.selectParymemberDistribution(parymemberFormDTO.getAgencyId()); + parymemberResult.setUserDistribution(parymemberDistributionResultDTOS); + } + return parymemberResult; + } + + /** + * @Description 4、事件 + * @param projectFormDTO + * @author zxc + * @date 2020/8/19 1:29 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List project(ProjectFormDTO projectFormDTO) { + List projectResultDTOS = screenEventDataDao.selectEvent(projectFormDTO.getAgencyId()); + if (projectResultDTOS.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return projectResultDTOS; + } + + /** + * @Description 5、top区概况 + * @param topProfileFormDTO + * @author zxc + * @date 2020/8/19 1:52 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO) { + TopProfileResultDTO topProfileResultDTO = screenUserTotalDataDao.selectTopProfile(topProfileFormDTO.getAgencyId()); + if (null == topProfileResultDTO){ + return new TopProfileResultDTO(); + } + return topProfileResultDTO; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java new file mode 100644 index 0000000000..8b0db2c65a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java @@ -0,0 +1,229 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.*; +import com.epmet.datareport.service.screen.GrassRootsGovernService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.AgencyFormDTO; +import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.screen.dto.result.*; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 基层治理相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:20 + */ +@Service +public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + @Autowired + private ScreenUserJoinDao screenUserJoinDao; + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + @Autowired + private ScreenGovernRankDataDao screenGovernRankDataDao; + /** + * @Description 1、热心市民积分排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544 + * @param param + * @return + * @author wangc + * @date 2020.08.20 11:16 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public UserPointRankResultDTO userPointRank(AgencyAndNumFormDTO param) { + //默认5 + if(null == param.getTopNum()){ + param.setTopNum(NumConstant.FIVE); + } + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List userPointList = screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId()); + UserPointRankResultDTO result = new UserPointRankResultDTO(); + result.setNameData(userPointList.stream().map(UserPointResultDTO::getName).collect(Collectors.toList())); + result.setPointsData(userPointList.stream().map(UserPointResultDTO::getPoint).collect(Collectors.toList())); + return result; + } + + + /** + * @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 + * @param param + * @return + * @author wangc + * @date 2020.08.20 13:55 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List difficultProject(AgencyNumTypeParamFormDTO param) { + if(null == param.getTopNum()){ + param.setTopNum(NumConstant.TWO); + } + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); + if(null == result) return new ArrayList<>(); + return result; + } + + + /** + * @Description 3、公众参与概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321975 + * @param param + * @return + * @author wangc + * @date 2020.08.20 14:37 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) { + + String monthId = dateUtils.getPreviousMonthId(); + UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + if(null == latest) return new PublicPartiProfileResultDTO(); + PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest,PublicPartiProfileResultDTO.class); + result.setMonthIncr(convertPercentStr(latest.getMonthIncr(),NumConstant.ZERO)); + result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth(),NumConstant.ZERO)); + result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth(),NumConstant.ZERO)); + return result; + } + + /** + * @Description 4、公众参与-排行榜 + * @NEI https://nei.netease.com/interface/detail/?pid=57068&id=321978 + * @param param + * @return + * @author wangc + * @date 2020.08.20 15:32 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List publicPartiRank(AgencyAndNumFormDTO param) { + if(null == param.getTopNum()) param.setTopNum(NumConstant.TWO); + if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List result = screenUserTotalDataDao.selectUserTotalData(param.getAgencyId()); + if(null == result) return new ArrayList<>(); + return result; + } + + /** + * @Description 5、治理能力榜单 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627 + * @param param + * @return + * @author wangc + * @date 2020.08.20 17:46 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List governCapacityRank(AgencyAndNumFormDTO param) { + if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE); + if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List orderList = + screenGovernRankDataDao.selectGovernCapacityRatio(dateUtils.getPreviousMonthId(),param.getAgencyId()); + if(null == orderList || orderList.isEmpty()) return new ArrayList<>(); + List result = new LinkedList<>(); + orderList.forEach(o -> { + GovernCapacityRankResultDTO rank = new GovernCapacityRankResultDTO(); + rank.setAgencyName(o.getAgencyName()); + rank.setGovernRatio(convertPercentStr(o.getGovernRatio(),NumConstant.ONE)); + rank.setResolvedRatio(convertPercentStr(o.getResolvedRatio(),NumConstant.ONE)); + rank.setResponseRatio(convertPercentStr(o.getResponseRatio(),NumConstant.ONE)); + rank.setSatisfactionRatio(convertPercentStr(o.getSatisfactionRatio(),NumConstant.ONE)); + result.add(rank); + }); + return result; + } + + /** + * @Description 6、公众参与-柱状折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=322434 + * @param param + * @return + * @author wangc + * @date 2020.08.21 09:58 + **/ + @Override + public PublicPartiChartResultDTO publicPartiChart(AgencyFormDTO param) { + Map Xaxis = dateUtils.getXpro(); + List monthlyData = screenUserJoinDao.selectUserJoinDataMonthly(param.getAgencyId(),Xaxis.keySet().iterator().next()); + PublicPartiChartResultDTO result = new PublicPartiChartResultDTO(); + result.setXAxis(Xaxis.values().stream().collect(Collectors.toList())); + List defaultData = new LinkedList<>(); + for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){ + defaultData.add(NumConstant.ZERO); + } + if(null == monthlyData || monthlyData.isEmpty()){ + result.setAverageJoinNumList(defaultData); + result.setJoinUserNumList(defaultData); + result.setOrganizeNumList(defaultData); + return result; + } + result.setOrganizeNumList(new ArrayList<>()); + result.setJoinUserNumList(new ArrayList<>()); + result.setAverageJoinNumList(new ArrayList<>()); + Map> dataMap = monthlyData.stream().collect(Collectors.groupingBy(UserJoinMonthlyResultDTO :: getMonthId)); + Xaxis.keySet().stream().forEach(monthId -> { + List data = dataMap.get(monthId); + if(null == data || data.isEmpty()){ + result.getOrganizeNumList().add(NumConstant.ZERO); + result.getJoinUserNumList().add(NumConstant.ZERO); + result.getAverageJoinNumList().add(NumConstant.ZERO); + }else{ + Integer o = NumConstant.ZERO; + Integer j = NumConstant.ZERO; + Integer a = NumConstant.ZERO; + for(UserJoinMonthlyResultDTO unit : data){ + o = null == unit.getOrganizeNum() ? NumConstant.ZERO : o + unit.getOrganizeNum(); + j = null == unit.getJoinUserNum() ? NumConstant.ZERO : o + unit.getJoinUserNum(); + a = null == unit.getAverageJoinNum() ? NumConstant.ZERO : o + unit.getAverageJoinNum(); + } + result.getOrganizeNumList().add(o); + result.getJoinUserNumList().add(j); + result.getAverageJoinNumList().add(a); + } + }); + + return result; + } + + private String convertPercentStr(BigDecimal percent){ + if(null == percent || BigDecimal.ZERO == percent) return "0.00%"; + String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); + } + + private String convertPercentStr(BigDecimal percent,Integer digits){ + if(null == percent) percent = BigDecimal.ZERO; + String percentStr = percent.setScale(digits, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); + } + + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java new file mode 100644 index 0000000000..51a7a49ff6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -0,0 +1,261 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenCpcBaseDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; +import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.screen.dto.form.ParymemberFormDTO; +import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.screen.GrassrootsPartyDevService; +import com.github.pagehelper.PageHelper; +import com.google.common.collect.Maps; +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.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 基层党建相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +@Service +public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService { + + private static final Logger logger = LoggerFactory.getLogger(GrassrootsPartyDevServiceImpl.class); + + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + @Autowired + private ScreenCpcBaseDataDao screenCpcBaseDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + private List issueGroup; + + /** + * @Description 1、党员基本情况-饼状图概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324 + * @param param + * @return + * @author wangc + * @date 2020.08.18 14:58 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { + + PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); + if(null == result){ + logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); + result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); + return result; + } + //partymember / platform + if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){ + result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); + }else{ + result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue())))); + } + return result; + } + + /** + * @Description 2、党员基本情况-年龄分布 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 + * @param param + * @return + * @author wangc + * @date 2020.08.18 17:54 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) { + return screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + } + + /** + * @Description 3、支部建设情况|联建共建情况-折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321981 + * @param param + * @return BranchBuildTrendResultDTO + * @author wangc + * @date 2020.08.19 11:02 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public BranchBuildTrendResultDTO branchBuildTrend(BranchBuildTrendFormDTO param) { + if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_UNION,param.getCategory())){ + //联建共建情况 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_UNION); + }else if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_VOLUNTARY_SERVICE,param.getCategory())){ + //联建党员志愿服务情况 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE); + }else{ + //默认支部建设 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_PARTY); + } + BranchBuildTrendResultDTO result = new BranchBuildTrendResultDTO(); + //生成近十二个月的横坐标数组 + Map monthMap = getX(); + result.setXAxis(monthMap.values().stream().collect(Collectors.toList())); + + List dataArray = new LinkedList<>(); + List yearlyDataList = + screenPartyBranchDataDao.selectBranchDataByTypeAndTimeZone(param.getAgencyId(),param.getType(),param.getCategory(),monthMap.keySet().iterator().next()); + + + if(null != yearlyDataList && !yearlyDataList.isEmpty()){ + + Map> dataMapByIssue = + yearlyDataList.stream().collect(Collectors.groupingBy(BranchIssueDataResultDTO::getIssue)); + + + result.setLegend(new LinkedList<>(dataMapByIssue.keySet())); + + dataMapByIssue.forEach((issue,val) ->{ + List issueYearlyDataList = val; + List numArray = new LinkedList<>(); + BranchTrendSeriesDataResultDTO data = new BranchTrendSeriesDataResultDTO(); + data.setName(issue); + if(null != issueYearlyDataList && !issueYearlyDataList.isEmpty()){ + monthMap.keySet().forEach( monthId ->{ + Optional optional + = issueYearlyDataList.stream().filter(yearly -> StringUtils.equals(monthId,yearly.getMonthId())).findAny(); + if(optional.isPresent()){ + numArray.add(optional.get().getData()); + }else{ + numArray.add(NumConstant.ZERO); + } + }); + }else{ + for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){ + numArray.add(NumConstant.ZERO); + } + } + data.setData(numArray); + dataArray.add(data); + }); + } + + result.setSeriesData(dataArray); + result.setLegend(null == result.getLegend() ? new ArrayList<>() : result.getLegend()); + + return result; + } + + /** + * @Description 4、支部建设情况|联建共建情况-排行 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321982 + * @param param + * @return BranchBuildRankResultDTO + * @author wangc + * @date 2020.08.19 15:25 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public BranchBuildRankResultDTO branchBuildRank(BranchBuildRankFormDTO param) { + if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_UNION,param.getCategory())){ + //联建共建情况 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_UNION); + }else if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_VOLUNTARY_SERVICE,param.getCategory())){ + //联建党员志愿服务情况 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE); + }else{ + //默认支部建设 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_PARTY); + } + if(StringUtils.isBlank(param.getMonthId())){ + param.setMonthId(getPreviousMonthId()); + } + if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List orderList = + screenPartyBranchDataDao.selectBranchDataByTypeOrder(param.getAgencyId(),param.getCategory(),param.getMonthId(),param.getBottomMonthId()); + + BranchBuildRankResultDTO result = new BranchBuildRankResultDTO(); + result.setJoinData(new LinkedList<>()); + result.setOrganizeData(new LinkedList<>()); + result.setXAxis(new LinkedList<>()); + for(BranchBuildOrderByCountResultDTO data : orderList){ + result.getXAxis().add(data.getOrgName()); + result.getOrganizeData().add(data.getOrganizeData()); + result.getJoinData().add(data.getJoinData()); + } + return result; + } + + + private String convertPercentStr(BigDecimal percent){ + if(null == percent || BigDecimal.ZERO == percent) return "0.00%"; + String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); + } + + /** + * @Description 返回当前月以及前十一个月,升序 + * @param + * @return Map key:202001 value:1月 + * @author wangc + * @date 2020.08.19 12:46 + **/ + public Map getX(){ + SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + String currentMonth = format.format(calendar.getTime()); + Integer monthCounter = Integer.parseInt(currentMonth); + Map monthMap = new HashMap<>(); + int i = NumConstant.ONE; + while(i <= NumConstant.TWELVE){ + + if(monthCounter.toString().endsWith("00")){ + monthCounter -= NumConstant.EIGHTY_EIGHT; + } + + String abscissa = monthCounter.toString().substring(monthCounter.toString().length() - NumConstant.TWO); + if(abscissa.startsWith("0")) { + abscissa = abscissa.replace("0","").concat("月"); + }else{ + abscissa = abscissa.concat("月"); + } + monthMap.put(monthCounter.toString(),abscissa); + monthCounter-- ; + i++; + } + + Map result = Maps.newLinkedHashMap(); + monthMap.entrySet().stream().sorted(Map.Entry.comparingByKey()) + .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); + + return result; + } + + + /** + * @Description 得到上个月的monthId + * @param + * @return + * @author wangc + * @date 2020.08.20 10:19 + **/ + private String getPreviousMonthId(){ + SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + return format.format(calendar.getTime()); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java new file mode 100644 index 0000000000..e106a07d45 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java @@ -0,0 +1,136 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenIndexDataMonthlyDao; +import com.epmet.datareport.dao.screen.ScreenIndexDataYearlyDao; +import com.epmet.datareport.service.screen.IndexService; +import com.epmet.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 指数相关相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +@Service +public class IndexServiceImpl implements IndexService { + + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO) { + YearAverageIndexResultDTO yearAverageIndexResultDTO = screenIndexDataYearlyDao.selectYearAverageIndex(yearAverageIndexFormDTO.getAgencyId()); + if (null == yearAverageIndexResultDTO){ + return new YearAverageIndexResultDTO(); + } + return yearAverageIndexResultDTO; + } + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { + MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId()); + if (null == monthPieChartResultDTO){ + return new MonthPieChartResultDTO(); + } + return monthPieChartResultDTO; + } + + /** + * @Description 3、月度指数分析-柱状图 + * @param monthBarchartFormDTO + * @author zxc + * @date 2020/8/19 5:27 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + MonthBarchartResultDTO result = new MonthBarchartResultDTO(); + List serviceAbilityData = new ArrayList<>(); + List partyDevAbilityData = new ArrayList<>(); + List governAbilityData = new ArrayList<>(); + List totalIndexData = new ArrayList<>(); + // 1. x轴 + result.setXAxis(partyMemberLeadServiceImpl.getXPro()); + // 2. 查询近一年的指数值【不包括本月】 + List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(customerId, monthBarchartFormDTO.getAgencyId()); + if (monthBarchartResults.size() == NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { + serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); + partyDevAbilityData.add(NumConstant.ZERO_DOT_ZERO); + governAbilityData.add(NumConstant.ZERO_DOT_ZERO); + totalIndexData.add(NumConstant.ZERO_DOT_ZERO); + } + result.setServiceAbilityData(serviceAbilityData); + result.setPartyDevAbilityData(partyDevAbilityData); + result.setGovernAbilityData(governAbilityData); + result.setTotalIndexData(totalIndexData); + return result; + } + List collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList()); + collect.forEach(month -> { + serviceAbilityData.add(null == month.getServiceAbility() ? NumConstant.ZERO_DOT_ZERO : month.getServiceAbility()); + partyDevAbilityData.add(null == month.getPartyDevAbility() ? NumConstant.ZERO_DOT_ZERO : month.getPartyDevAbility()); + governAbilityData.add(null == month.getGovernAbility() ? NumConstant.ZERO_DOT_ZERO : month.getGovernAbility()); + totalIndexData.add(null == month.getIndexTotal() ? NumConstant.ZERO_DOT_ZERO : month.getIndexTotal()); + }); + result.setServiceAbilityData(serviceAbilityData); + result.setPartyDevAbilityData(partyDevAbilityData); + result.setGovernAbilityData(governAbilityData); + result.setTotalIndexData(totalIndexData); + return result; + } + + /** + * @Description 4、下级部门指数排行 + * @param subAgencyIndexRankFormDTO + * @author zxc + * @date 2020/8/20 10:04 上午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO) { + LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); + int yearId = now.getYear(); + subAgencyIndexRankFormDTO.setYearId(String.valueOf(yearId)); + List subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO); + if (subAgencyIndexRankResultDTOS.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return subAgencyIndexRankResultDTOS; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java new file mode 100644 index 0000000000..b1cecb92bb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -0,0 +1,224 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenOrgRankDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyLinkMassesDataDao; +import com.epmet.datareport.dao.screen.ScreenPioneerDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyUserRankDataDao; +import com.epmet.datareport.service.screen.PartyMemberLeadService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.screen.dto.form.FineExampleFormDTO; +import com.epmet.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.screen.dto.result.*; +import com.epmet.screen.constant.*; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 党建引领相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:22 + */ +@Service +public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { + + @Autowired + private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + @Autowired + private ScreenPioneerDataDao screenPioneerDataDao; + @Autowired + private ScreenOrgRankDataDao screenOrgRankDataDao; + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { + FineExampleResultDTO fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); + if (null == fineExampleResultDTO){ + return new FineExampleResultDTO(); + } + fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA())); + fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA())); + fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA())); + fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA())); + fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA())); + return fineExampleResultDTO; + } + + /** + * @Description 小数转换百分比 + * @param d + * @author zxc + * @date 2020/8/20 6:06 下午 + */ + public String getRatio(Double d){ + BigDecimal bigDecimal = new BigDecimal(d * NumConstant.ONE_HUNDRED); + return bigDecimal.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO); + } + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) { + ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); + List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + if (contactMassLineChartResults.size() == NumConstant.ZERO){ + result.setXAxis(new ArrayList<>()); + result.setGroupMemberData(new ArrayList<>()); + result.setGroupData(new ArrayList<>()); + return result; + } + List xAxis = new ArrayList<>(); + List groupData = new ArrayList<>(); + List groupMemberData = new ArrayList<>(); + contactMassLineChartResults.forEach(contact -> { + xAxis.add(contact.getOrgName()); + groupData.add(contact.getGroupTotal()); + groupMemberData.add(contact.getUserTotal()); + }); + result.setXAxis(xAxis); + result.setGroupData(groupData); + result.setGroupMemberData(groupMemberData); + return result; + } + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO) { + VolunteerServiceResultDTO result = new VolunteerServiceResultDTO(); + List organizeData = new ArrayList<>(); + List joinData = new ArrayList<>(); + List averageJoinUserData = new ArrayList<>(); + result.setXAxis(this.getXPro()); + List volunteerServiceResults = screenPartyBranchDataDao.selectVolunteerServiceResult(volunteerServiceFormDTO.getAgencyId()); + if (volunteerServiceResults.size() == NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { + organizeData.add(NumConstant.ZERO); + joinData.add(NumConstant.ZERO); + averageJoinUserData.add(NumConstant.ZERO); + } + result.setOrganizeData(organizeData); + result.setJoinData(joinData); + result.setAverageJoinUserData(averageJoinUserData); + return result; + } + List collect = volunteerServiceResults.stream().sorted(Comparator.comparing(VolunteerServiceResult::getMonthId)).collect(Collectors.toList()); + collect.forEach(volunteer -> { + organizeData.add(volunteer.getOrganizeData()); + joinData.add(volunteer.getJoinData()); + averageJoinUserData.add(volunteer.getAverageJoinUserData()); + }); + result.setOrganizeData(organizeData); + result.setJoinData(joinData); + result.setAverageJoinUserData(averageJoinUserData); + return result; + } + + /** + * @Description 获取之前的12个月份【不包括当前月】 + * @author zxc + * @date 2020/8/21 10:19 上午 + */ + public List getXPro(){ + List xAxis = new ArrayList<>(); + LocalDate today = LocalDate.now(); + for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + LocalDate localDate = today.minusMonths(i); + String s = localDate.getMonth().getValue() + ScreenConstant.MONTH; + xAxis.add(s); + } + return xAxis; + } + + /** + * @Description 4、先进排行榜单-先进支部排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321539 + * @param param + * @return + * @author wangc + * @date 2020.08.21 11:05 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List advancedBranchRank(AgencyAndNumFormDTO param) { + if(null == param.getTopNum()){ + param.setTopNum(NumConstant.FIVE); + }else if(NumConstant.ZERO == param.getTopNum()){ + param.setTopNum(NumConstant.MAX); + } + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List gridData = + screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),dateUtils.getPreviousMonthId()); + List result = new LinkedList<>(); + if(null == gridData || gridData.isEmpty()) return result; + gridData.forEach( data -> { + AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class); + o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio())); + o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio())); + result.add(o); + }); + + return result; + } + + /** + * @Description 5、先进排行榜单-先进党员排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321624 + * @param param + * @return List + * @author wangc + * @date 2020.08.21 14:22 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List advancedPartymemberRank(AgencyAndNumFormDTO param) { + if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List result = screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId()); + if(null == result) return new ArrayList<>(); + return result; + } + + + private String convertPercentStr(BigDecimal percent){ + if(null == percent || BigDecimal.ZERO == percent) return "0.0%"; + String percentStr = percent.setScale(NumConstant.ONE, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java new file mode 100644 index 0000000000..dce609636d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java @@ -0,0 +1,46 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.screen.ScreenEventImgDataDao; +import com.epmet.datareport.service.screen.ScreenProjectService; +import com.epmet.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:23 + */ +@Service +public class ScreenProjectServiceImpl implements ScreenProjectService { + + @Autowired + private ScreenEventDataDao screenEventDataDao; + @Autowired + private ScreenEventImgDataDao screenEventImgDataDao; + + /** + * @Description 3、项目详情 + * @param projectDetailFormDTO + * @author zxc + * @date 2020/8/19 4:36 下午 + */ + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + public ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO) { + ProjectDetailResultDTO projectDetailResultDTO = screenEventDataDao.selectEventDetail(projectDetailFormDTO.getProjectId()); + if (null == projectDetailResultDTO){ + return new ProjectDetailResultDTO(); + } + List imgList = screenEventImgDataDao.selectEventImgList(projectDetailFormDTO.getProjectId()); + projectDetailResultDTO.setImgList(imgList); + return projectDetailResultDTO; + } +} \ 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/datareport/service/topic/TopicService.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/topic/TopicService.java index 584ac1b1dc..f0dd505cb4 100644 --- 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/datareport/service/topic/TopicService.java @@ -1,4 +1,4 @@ -package com.epmet.service.topic; +package com.epmet.datareport.service.topic; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; 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/datareport/service/topic/impl/TopicServiceImpl.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/topic/impl/TopicServiceImpl.java index 298dcae7a3..12889caaae 100644 --- 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/datareport/service/topic/impl/TopicServiceImpl.java @@ -1,13 +1,12 @@ -package com.epmet.service.topic.impl; +package com.epmet.datareport.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.datareport.dao.topic.TopicDao; 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.service.topic.TopicService; +import com.epmet.datareport.service.topic.TopicService; import com.epmet.topic.constant.TopicConstant; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; import com.epmet.topic.dto.result.*; @@ -16,8 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.NumberFormat; import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; 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/datareport/service/user/UserAnalysisService.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/UserAnalysisService.java index 2c658fc1da..47c304f1b2 100644 --- 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/datareport/service/user/UserAnalysisService.java @@ -1,4 +1,4 @@ -package com.epmet.service.user; +package com.epmet.datareport.service.user; import com.epmet.dto.form.user.UserIncrTrendFormDTO; 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/datareport/service/user/impl/UserAnalysisServiceImpl.java similarity index 99% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java index 3244076896..88e39067b4 100644 --- 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/datareport/service/user/impl/UserAnalysisServiceImpl.java @@ -1,4 +1,4 @@ -package com.epmet.service.user.impl; +package com.epmet.datareport.service.user.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; @@ -7,7 +7,7 @@ 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.datareport.dao.user.UserAnalysisDao; import com.epmet.dto.DimAgencyDTO; import com.epmet.dto.DimDepartmentDTO; import com.epmet.dto.DimGridDTO; @@ -19,7 +19,7 @@ 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 com.epmet.datareport.service.user.UserAnalysisService; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java new file mode 100644 index 0000000000..6db1756fdb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java @@ -0,0 +1,128 @@ +package com.epmet.datareport.utils; + +import com.epmet.commons.tools.constant.NumConstant; +import com.google.common.collect.Maps; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description + * @ClassName DateUtils + * @Auth wangc + * @Date 2020-08-20 10:56 + */ +@Component +public class DateUtils { + private static SimpleDateFormat defaultFormat = new SimpleDateFormat("yyyyMM"); + private static DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMM"); + /** + * @Description 返回当前月以及前十一个月,升序 + * @param + * @return Map key:202001 value:1月 + * @author wangc + * @date 2020.08.19 12:46 + **/ + public Map getX(){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + String currentMonth = defaultFormat.format(calendar.getTime()); + Integer monthCounter = Integer.parseInt(currentMonth); + Map monthMap = new HashMap<>(); + int i = NumConstant.ONE; + while(i <= NumConstant.TWELVE){ + + if(monthCounter.toString().endsWith("00")){ + monthCounter -= NumConstant.EIGHTY_EIGHT; + } + + String abscissa = monthCounter.toString().substring(monthCounter.toString().length() - NumConstant.TWO); + if(abscissa.startsWith("0")) { + abscissa = abscissa.replace("0","").concat("月"); + }else{ + abscissa = abscissa.concat("月"); + } + monthMap.put(monthCounter.toString(),abscissa); + monthCounter-- ; + i++; + } + + Map result = Maps.newLinkedHashMap(); + monthMap.entrySet().stream().sorted(Map.Entry.comparingByKey()) + .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); + + return result; + } + + public Map getXpro(){ + Map xAxis = new HashMap<>(); + LocalDate today = LocalDate.now(); + + for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + LocalDate localDate = today.minusMonths(i); + String s = localDate.getMonth().getValue() + "月"; + xAxis.put(localDate.format(fmt),s); + } + Map result = Maps.newLinkedHashMap(); + xAxis.entrySet().stream().sorted(Map.Entry.comparingByKey()) + .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); + return result; + } + + /** + * @Description 得到上个月的monthId + * @param + * @return + * @author wangc + * @date 2020.08.20 10:19 + **/ + public String getPreviousMonthId(){ + SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + return format.format(calendar.getTime()); + } + + public String getPreviousMonthIdByDest(Date date,String dateStr){ + SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); + Calendar c = Calendar.getInstance(); + if(null == date && StringUtils.isNotBlank(dateStr)){ + try{ + date = format.parse(dateStr); + + }catch(Exception e){ + e.printStackTrace(); + } + }else{ + return null; + } + c.setTime(date); + c.add(Calendar.MONTH, NumConstant.ONE_NEG); + return format.format(c.getTime()); + } + + public static void main(String[] args) { + DateUtils util = new DateUtils(); + Map result = util.getXpro(); + result.forEach((k,v) -> { + System.out.print(k); + System.out.print(" -> "); + System.out.print(v); + System.out.println(); + }); + + List xLine = result.values().stream().collect(Collectors.toList()); + xLine.forEach(x -> { + System.out.println(x); + }); + + result.keySet().forEach(key -> System.out.println(key)); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java new file mode 100644 index 0000000000..9314d3ba3b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java @@ -0,0 +1,24 @@ +package com.epmet.datareport.utils; + +public interface ModuleConstant { + + String PARAM_BRANCH_CATEGORY_UNION = "ljgj"; + + String PARAM_BRANCH_CATEGORY_VOLUNTARY_SERVICE = "ljdyzy"; + + String PARAM_BRANCH_CATEGORY_PARTY = "zbjs"; + + String KEY_BRANCH_CATEGORY_UNION = "union"; + + String KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE = "voluntaryservice"; + + String KEY_BRANCH_CATEGORY_PARTY = "party"; + + String SYMBOL_PERCENT = "%"; + + String PARAM_DIFFICULTY_TYPE_TIME_LONGEST = "timelongest"; + + String PARAM_DIFFICULTY_TYPE_MOST_DEPTS = "mostdepts"; + + String PARAM_DIFFICULTY_TYPE_MOST_HANDLED = "mosthandled"; +} 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 index 19e6e4b584..d4db395aa8 100644 --- 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 @@ -24,9 +24,9 @@ spring: druid: #MySQL driver-class-name: com.mysql.cj.jdbc.Driver - url: @datasource.druid.url@ - username: @datasource.druid.username@ - password: @datasource.druid.password@ + url: @datasource.druid.stats.url@ + username: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ cloud: nacos: discovery: @@ -53,11 +53,11 @@ spring: # 数据迁移工具flyway flyway: - enabled: false + enabled: @spring.flyway.enabled@ locations: classpath:db/migration - url: @datasource.druid.url@ - user: @datasource.druid.username@ - password: @datasource.druid.password@ + url: @datasource.druid.stats.url@ + user: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ baseline-on-migrate: true baseline-version: 0 @@ -91,6 +91,20 @@ mybatis-plus: call-setters-on-nulls: true jdbc-type-for-null: 'null' +#动态数据源 +dynamic: + datasource: + stats: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.stats.url@ + username: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ + statsDisplay: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.statsdisplay.url@ + username: @datasource.druid.statsdisplay.username@ + password: @datasource.druid.statsdisplay.password@ + feign: hystrix: enabled: true 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 index ad10364cb5..08a6a198d1 100644 --- 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 @@ -137,13 +137,14 @@ - - - - - - - + + + + + + + + @@ -156,13 +157,13 @@ - - - - - - - + + + + + + + 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 index b3b1faecd7..159a814a61 100644 --- 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 @@ -1,7 +1,7 @@ - + SELECT AGENCY_ID, 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 index 9ea5c548d6..21b472e4de 100644 --- 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 @@ -1,7 +1,7 @@ - + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml new file mode 100644 index 0000000000..3fc9c990b3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml new file mode 100644 index 0000000000..cfdb8da6de --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml new file mode 100644 index 0000000000..58e2171c3d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml new file mode 100644 index 0000000000..988e0b17cd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml new file mode 100644 index 0000000000..ab381cebba --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml new file mode 100644 index 0000000000..63cadbbd5e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml new file mode 100644 index 0000000000..e5e3e636af --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml new file mode 100644 index 0000000000..3fb4174055 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml new file mode 100644 index 0000000000..21293ad4c6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml new file mode 100644 index 0000000000..3d9329846d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml new file mode 100644 index 0000000000..f83ec244d7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml new file mode 100644 index 0000000000..8fbf102170 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml new file mode 100644 index 0000000000..5643b1e31b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml new file mode 100644 index 0000000000..66fb4d6a80 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml new file mode 100644 index 0000000000..5e509c8329 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml new file mode 100644 index 0000000000..8f17dc796a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml new file mode 100644 index 0000000000..a1700b05a4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 index 01d4a5d335..3b96ffc150 100644 --- 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 @@ -1,7 +1,7 @@ - + SELECT diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CompareConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CompareConstant.java new file mode 100644 index 0000000000..119cd1ca31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CompareConstant.java @@ -0,0 +1,26 @@ +package com.epmet.constant; + +/** + * 比较结果常量 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/8/19 10:28 + */ +public interface CompareConstant { + + /** + * 增加 + */ + String INCR_STR = "incr"; + + /** + * 下降 + */ + String DECR_STR = "decr"; + + /** + * 相等 + */ + String EQ_STR = "eq"; +} 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 index 920fc14e14..be529605de 100644 --- 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 @@ -4,6 +4,7 @@ public interface DataSourceConstant { String GOV_ORG = "govOrg"; String STATS = "stats"; + String STATS_DISPLAY = "statsDisplay"; String GOV_ISSUE = "govIssue"; String GOV_PROJECT = "govProject"; String GOV_VOICE = "govVoice"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java new file mode 100644 index 0000000000..50cc040c44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 8、治理能力-部门相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class DeptGovrnAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String deptId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * allRegion:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 区直部门被吹哨次数 + */ + private Integer transferedCount; + + /** + * 区直部门办结项目数 + */ + private Integer closedProjectCount; + + /** + * 区直部门项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 区直部门办结项目的处理效率 + */ + private BigDecimal handleProjectRatio; + + /** + * 区直部门项目办结率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java new file mode 100644 index 0000000000..ef4efd6a24 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 6、治理能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridGovrnAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格办结项目数 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 网格议题转项目率 + */ + private BigDecimal avgShiftProjectRatio; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java new file mode 100644 index 0000000000..8738c5c3f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java @@ -0,0 +1,107 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 2、党建能力-网格相关指标上报(按照月份) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridPartyAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 网格党员用户数 + */ + private Integer partyCount; + + /** + * 网格党员人均提出的议题转项目数 + */ + private Integer partyAvgShiftProjectCount; + + /** + * 网格活跃群众用户数 + */ + private Integer activeUserCount; + + /** + * 网格活跃党员用户数 + */ + private Integer activePartyCount; + + /** + * 网格党员人均提出话题数 + */ + private Integer partyAvgTopicCount; + + /** + * 网格群众人均提出话题数 + */ + private Integer userAvgTopicCount; + + /** + * 网格群众用户数 + */ + private Integer userCount; + + /** + * 网格群众人均提出的议题转项目数 + */ + private Integer userAvgShiftProjectCount; + + /** + * 建群党员数(累计值) + */ + private Integer createGroupPartyCount; + + /** + * 网格发文数 + */ + private Integer publishArticleCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 组织三会一课次数 + */ + private Integer createThreeMeetsCount; + + /** + * 党员参加三会一课人次 + */ + private Integer joinThreeMeetsCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java new file mode 100644 index 0000000000..7993cb2355 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -0,0 +1,98 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; +import org.apache.poi.hpsf.Decimal; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 1、党建能力-党员相关指标上报(按照月份) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridPartyMemberDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 党员提出的话题数 + */ + private Integer createTopicCount; + + /** + * 党员参与话题数(支持,反对,评论,浏览) + */ + private Integer joinTopicCount; + + /** + * 话题转议题数 + */ + private Integer shiftIssueCount; + + /** + * 议题转项目数 + */ + private Integer shiftProjectCount; + + /** + * 参加三会一课次数 + */ + private Integer joinThreeMeetsCount; + + /** + * 自建群群众人数 + */ + private Integer groupUserCount; + + /** + * 自建群活跃度-话题数 + */ + private Integer groupTopicCount; + + /** + * 议题转项目率 + */ + private BigDecimal topicToIssueRatio; + + /** + * 提出的议题转项目数 + */ + private Integer issueToProjectCount; + + /** + * 用户id + */ + private String userId; + + /** + * 上级组织Id + */ + private String parentId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java new file mode 100644 index 0000000000..02b7906a36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java @@ -0,0 +1,58 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 4、服务能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridServiceAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 网格活动组织次数 爱心活动 + */ + private Integer activityCount; + + /** + * 网格志愿者占比 + */ + private Integer volunteerRatio; + + /** + * 网格党员志愿者率 + */ + private BigDecimal partyVolunteerRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java new file mode 100644 index 0000000000..7ddb9e785a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 7、治理能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgGovrnAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * allRegion:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 被吹哨次数 + */ + private Integer transferedCount; + + /** + * 办结项目数 + */ + private Integer closedProjectCount; + + /** + * 项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 办结项目率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 超期项目率 + */ + private BigDecimal overdueProjectRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java new file mode 100644 index 0000000000..e5ad40ef3f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 3、党建能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgPartyAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * allRegion:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 发文数 + */ + private Integer publishArticleCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java new file mode 100644 index 0000000000..6ef48c6fa4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 5、服务能力-组织(街道|社区|全区)相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgServiceAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * allRegion:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 社区/街道活动组织次数 爱心活动 + */ + private Integer activityCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java new file mode 100644 index 0000000000..49e30cdb21 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java @@ -0,0 +1,23 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:初始化客户指标权重参数实体类 + * @author liujianjun + */ +@Data +public class IndexCalculateForm implements Serializable { + private static final long serialVersionUID = 3280392511156378209L; + /** + * desc:客户id + */ + private String customerId; + + /** + * desc:月份id + */ + private String monthId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/InitCustomerIndexForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/InitCustomerIndexForm.java new file mode 100644 index 0000000000..4016a9656e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/InitCustomerIndexForm.java @@ -0,0 +1,18 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:初始化客户指标权重参数实体类 + * @author liujianjun + */ +@Data +public class InitCustomerIndexForm implements Serializable { + private static final long serialVersionUID = 3280392511156378209L; + /** + * desc:客户id + */ + private String customerId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ImgDataListDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ImgDataListDTO.java new file mode 100644 index 0000000000..fb63116850 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ImgDataListDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.screencoll; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 图片列表 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class ImgDataListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 原始事件id + */ + private String eventId; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 排序 + */ + private Integer sort; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java new file mode 100644 index 0000000000..ee1674ce96 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java @@ -0,0 +1,86 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 2、党员基本情况 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CpcBaseDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 注册用户数 + */ + private Integer registerUserCount; + + /** + * 群众用户数 + */ + private Integer resiTotal; + + /** + * 注册党员数 + */ + private Integer partyMemberCount; + + /** + * 小于20岁 + */ + private Integer ageLevel1; + + /** + * 20-30岁 + */ + private Integer ageLevel2; + + /** + * 31-40岁 + */ + private Integer ageLevel3; + + /** + * 41-50岁 + */ + private Integer ageLevel4; + + /** + * 51-60岁 + */ + private Integer ageLevel5; + + /** + * 60+岁 + */ + private Integer ageLevel6; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java new file mode 100644 index 0000000000..cebf258d31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 14、组织层级 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 父级id ,顶级,此列为0 + */ + private String pid; + + /** + * 所有上级ID,用逗号分开 + */ + private String pids; + + /** + * 所有组织名称以-链接 + */ + private String allParentNames; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党工委|街道党委的位置,预留字段 + */ + private String partyMark; + + /** + * 机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + */ + private String level; + + /** + * 行政地区编码 + */ + private String areaCode; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java new file mode 100644 index 0000000000..a99713701a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 16、部门信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerDeptFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 部门所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域可空 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 部门所在位置 + */ + private String deptMark; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java new file mode 100644 index 0000000000..38094a105a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 15、网格信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerGridFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域可空 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党支部的位置!!! + */ + private String partyMark; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java new file mode 100644 index 0000000000..7d136c4b27 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java @@ -0,0 +1,102 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 3、难点赌点 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class DifficultyDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 事件原Id + */ + private String eventId; + + /** + * 事件图片 URL + */ + private String eventImgUrl; + + /** + * 事件来源 eg: XXX街道-xx社区-网格 + */ + private String eventSource; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件耗时单位:分钟 + */ + private Integer eventCostTime; + + /** + * 事件设计部门数 + */ + private Integer eventReOrg; + + /** + * 事件类别编码 + */ + private String eventCategoryCode; + + /** + * 事件状态编码 + */ + private String eventStatusCode; + + /** + * 事件类别名称 + */ + private String eventCategoryName; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 最近一次操作说明 eg: 转项目,结案,流转 + */ + private String latestOperateDesc; + + /** + * 事件被处理次数(08-21新增) + */ + private Integer eventHandledCount; + + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java new file mode 100644 index 0000000000..21e8ee718e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java @@ -0,0 +1,124 @@ +package com.epmet.dto.screencoll.form; + +import com.epmet.dto.screencoll.ImgDataListDTO; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 4、事件数据(中央区-事件数据) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class EventDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 原始事件Id + */ + private String eventId; + + /** + * 事件名称 + */ + private String eventTitle; + + /** + * yyyy-MM-dd HH:mm:ss事件时间 + */ + private String eventCreateTime; + + /** + * 联系人 + */ + private String linkMobile; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件图片(如果有图片,此列为第一张图片) + */ + private String eventImgUrl; + + /** + * 事件待处理级别 red:红;yellow:黄 , green绿色 + */ + private String eventLevel; + + /** + * 事件发生的地址 + */ + private String eventAddress; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 维度 + */ + private BigDecimal latitude; + + /** + * 最后处理的组织名称 + */ + private String lastProcessDept; + + /** + * 最后处理的时间 + */ + private String lastProcessDate; + + /** + * 图片列表 + */ + private List imgDataList; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 事件状态key + */ + private String eventStatusCode; + + /** + * 最近一次操作说明 eg: 转项目,结案,流转 + */ + private String latestOperateDesc; + + /** + * 数据更新至: yyyy|yyyMM|yyyyMMdd 8.21增加字段 + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java new file mode 100644 index 0000000000..f12e196ab7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 5、基层治理-治理能力数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GovernRankDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 年Id :yyyy + */ + private String yearId; + + /** + * 月份Id :yyyyMM + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率,最大值100,保留小数点后4位 + */ + private BigDecimal responseRatio; + + /** + * 解决率 最大值100,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 最大值100,保留小数点后4位 + */ + private BigDecimal governRatio; + + /** + * 满意率,最大值100,保留小数点后四位 + */ + private BigDecimal satisfactionRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java new file mode 100644 index 0000000000..c27f75db87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 1、指数_按月统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyy + */ + private String yearId; + + /** + * yyyyMM eg :202007 + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java new file mode 100644 index 0000000000..4eafd27be7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 17、指数_按年统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataYearlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyy + */ + private String yearId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java new file mode 100644 index 0000000000..8b0a753839 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 6、党建引领-组织排行 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgRankDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 年Id :yyyy + */ + private String yearId; + + /** + * 月份Id :yyyyMM + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员总数 + */ + private Integer partyTotal; + + /** + * 小组(支部建设总数) + */ + private Integer groupTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 结案率,最大值100,保留小数点后四位 + */ + private BigDecimal closeProjectRatio; + + /** + * 满意率,最大值100,保留小数点后四位 + */ + private BigDecimal satisfactionRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java new file mode 100644 index 0000000000..21144c89ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 7、基层党建-建设情况数据(支部、联建、志愿) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyBranchDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 年Id :yyyy + */ + private String yearId; + + /** + * 月份Id :yyyyMM + */ + private String monthId; + + /** + * 数据类别 party:支部建设;union:联合建设党员志愿服务:voluntaryservice + */ + private String type; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 会议分类名称 + */ + private String meetCategoryName; + + /** + * 会议分类id + */ + private String meetCategoryId; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 参加人数 + */ + private Integer joinUserCount; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java new file mode 100644 index 0000000000..c57728d3fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 8、党建引领-党员联系群众数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyLinkMassesDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 建群总数 + */ + private Integer createGroupTotal; + + /** + * 群成员总数 + */ + private Integer groupUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java new file mode 100644 index 0000000000..29b35aa147 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 9、党建引领|基层治理-居民(党员)积分排行榜 入参 + * @Auther: zhangyong + * @Date: 2020-08-21 09:59 + */ +@Data +public class PartyUserRankDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd + */ + private String dataEndTime; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 用户所属网格id + */ + private String gridId; + + /** + * 用户所属网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String orgId; + + /** + * 网格所属的组织名称 + */ + private String orgName; + + /** + * 是否是党员标志:1是。0不是党员 + */ + private String partyFlag; + + /** + * 用户Id + */ + private String userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 用户积分 + */ + private Integer pointTotal; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java new file mode 100644 index 0000000000..7e79fce0b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java @@ -0,0 +1,93 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 10、党建引领-先锋模范数据 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PioneerDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员发布议题 + */ + private Integer publishIssueTotal; + + /** + * 议事数 + */ + private Integer issueTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题转项目数 + */ + private Integer shiftProjectTotal; + + /** + * 解决项目总数 + */ + private Integer resolvedProjectTotal; + + + /** + * 议事占比 + */ + private BigDecimal issueRatio; + + /** + * 话题占比 + */ + private BigDecimal topicRatio; + + /** + * 议题转项目占比 + */ + private BigDecimal shiftProjectRatio; + + /** + * 解决项目占比 + */ + private BigDecimal resolvedProjectRatio; + + /** + * 党员发布议题占比 + */ + private BigDecimal publishIssueRatio; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java new file mode 100644 index 0000000000..9abd6012d6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 11、基层治理-公众参与 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserJoinFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 年Id :yyyy + */ + private String yearId; + + /** + * 月份Id :yyyyMM + */ + private String monthId; + + /** + * 人均议题 + */ + private Integer avgIssue; + + /** + * 总的参与次数 + */ + private Integer joinTotal; + + /** + * 平均参与度 + */ + private Integer avgJoin; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java new file mode 100644 index 0000000000..14f4df673d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 12、中央区各类总数 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserTotalDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 用户总数 + */ + private Integer userTotal; + + /** + * 注册党员数 + */ + private Integer partyTotal; + + /** + * 小组(党群)总数 + */ + private Integer groupTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 注册人数(08-21新增) + */ + private Integer regUserTotal; + + /** + * 参与人数(08-21新增) + */ + private Integer joinUserTotal; +} 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 index 0d7479b1ec..a34bca869d 100644 --- 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 @@ -2,7 +2,7 @@ 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.42 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.45 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 543f5dc3f9..70a64c3864 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.42 + 0.3.45 data-statistical com.epmet @@ -68,6 +68,31 @@ 2.0.0 compile + + com.epmet + epmet-commons-extapp-auth + 2.0.0 + compile + + + + + + org.apache.poi + poi + 3.17 + + + + org.apache.poi + poi-ooxml + 3.17 + + + com.alibaba + easyexcel + 2.2.6 + @@ -153,6 +178,12 @@ epmet_user_user EpmEt-db-UsEr + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + 0 192.168.1.130 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 index ad4e2110fa..21b5ea51b7 100644 --- 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 @@ -3,13 +3,18 @@ package com.epmet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.scheduling.annotation.EnableAsync; +@EnableDiscoveryClient +@EnableFeignClients @SpringBootApplication (exclude = {DataSourceAutoConfiguration.class}) @EnableAsync public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); + //HttpClientManager.getInstance().sendAlarmMsg("DataStatsApplication started!"); } } 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 index b8f7c3e3d2..6ed40fc377 100644 --- 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 @@ -1,11 +1,15 @@ package com.epmet.controller; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -26,6 +30,9 @@ public class DemoController { @Autowired private ExecutorService executorService; + @Autowired + private DimAgencyService dimAgencyService; + @GetMapping("testAlarm") public void testAlarm() { //for (int i = 0; i < 20; i++) { @@ -91,4 +98,14 @@ public class DemoController { List result = demoService.getAllAgency(); return result; } + + /** + * 参数指定数据源 + * @return + */ + @PostMapping("paramDataSource") + public Result paramDataSource() { + List list = dimAgencyService.getAgencyListByCustomerId("ba7c0b5b21e882b263ee8456e2cfb63e"); + return new Result().ok(list); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java new file mode 100644 index 0000000000..7c12fec411 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -0,0 +1,156 @@ +package com.epmet.controller; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.indexcollect.form.*; +import com.epmet.service.indexcollect.FactIndexCollectService; +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; + +/** + * 指标采集相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/20 9:38 + */ +@RestController +@RequestMapping("indexcollect") +public class FactIndexCollectController { + + @Autowired + private FactIndexCollectService factIndexCollectService; + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridpartymemberdata") + public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridPartyMemberData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridpartyability") + public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 3、党建能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orgpartyability") + public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 4、服务能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridserviceability") + public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orgserviceability") + public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 6、治理能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridgovrnability") + public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 7、治理能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orggovrnability") + public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 8、治理能力-部门相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("deptgovrnability") + public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java new file mode 100644 index 0000000000..cba12740c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -0,0 +1,154 @@ +package com.epmet.controller; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.service.screen.IndexCalculateService; +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; + +/** + * 指标计算controller + * + * @author liujianjun@elink-cn.com + * @date 2020/8/24 14:38 + */ +@RestController +@RequestMapping("indexcalculate") +public class IndexCalculateController { + + @Autowired + private IndexCalculateService indexCalculateService; + + /** + * 1、党建能力-党员相关指标计算(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("cpc") + public Result cpcIndexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexCalculateForm formDTO) { + indexCalculateService.cpcIndexCalculate(formDTO); + return new Result(); + } + + /* *//** + * 2、党建能力-网格相关指标上报(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("gridpartyability") + public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 3、党建能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("orgpartyability") + public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 4、服务能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("gridserviceability") + public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("orgserviceability") + public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 6、治理能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("gridgovrnability") + public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 7、治理能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("orggovrnability") + public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 8、治理能力-部门相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("deptgovrnability") + public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + }*/ +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java new file mode 100644 index 0000000000..c26189717e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java @@ -0,0 +1,86 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screen.form.InitCustomerIndexForm; +import com.epmet.model.IndexExcelDataListener; +import com.epmet.model.IndexModel; +import com.epmet.service.screen.IndexDictService; +import com.epmet.service.screen.IndexGroupDetailTemplateService; +import com.epmet.service.screen.IndexGroupService; +import com.epmet.service.screen.IndexGroupTemplateService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @author liujianjun + */ +@RequestMapping("indexdict") +@RestController +@Slf4j +public class IndexDictController { + + @Autowired + private IndexDictService indexDictService; + @Autowired + private IndexGroupTemplateService indexGroupTemplateService; + @Autowired + private IndexGroupService indexGroupService; + @Autowired + private IndexGroupDetailTemplateService indexGroupDetailTemplateService; + + /** + * url:http://localhost:8108/data/stats/indexdict/initFromExcel + * desc:从excel初始化指标,分组,权重 + * + * @param file + * @return + */ + @PostMapping("initFromExcel") + public Result testTx(@RequestPart("file") MultipartFile file) { + ExcelReader excelReader = null; + try { + InputStream inputStream = null; + try { + inputStream = file.getInputStream(); + } catch (IOException e) { + return new Result().error("读取文件失败"); + } + excelReader = EasyExcel.read(inputStream).build(); + // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener + ReadSheet readSheet = EasyExcel.readSheet(1).head(IndexModel.class) + .registerReadListener(new IndexExcelDataListener(indexDictService, indexGroupTemplateService, indexGroupDetailTemplateService)) + .build(); + excelReader.read(readSheet); + } finally { + if (excelReader != null) { + excelReader.finish(); + } + } + return new Result<>(); + } + + /** + * url:http://localhost:8108/data/stats/indexdict/initCustomerIndex + * desc: 初始化客户的评价指标数据 + * @param formDTO customerId + * @return + */ + @PostMapping("initCustomerIndex") + public Result initCustomerIndex(@RequestBody InitCustomerIndexForm formDTO){ + if (StringUtils.isBlank(formDTO.getCustomerId())){ + throw new RenException("参数错误"); + } + Boolean aBoolean = indexGroupService.initCustomerIndexGroup(formDTO.getCustomerId()); + return new Result().ok(aBoolean); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java new file mode 100644 index 0000000000..080ba5384b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java @@ -0,0 +1,286 @@ +package com.epmet.controller; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screencoll.form.*; +import com.epmet.service.screen.ScreenCollService; +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; + +/** + * 大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:25 + */ +@RestController +@RequestMapping("screencoll") +public class ScreenCollController { + + @Autowired + private ScreenCollService screenCollService; + + /** + * 9、党建引领|基层治理-居民(党员)积分排行榜 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("partyuserrankdata") + public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 8、党建引领-党员联系群众数据 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("partylinkmassesdata") + public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 7、基层党建-建设情况数据(支部、联建、志愿) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("meetdata") + public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 6、党建引领-组织排行 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("orgrankdata") + public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 5、基层治理-治理能力数据 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("governrankdata") + public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 4、事件数据 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("eventdata") + public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 3、难点赌点 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("difficultydata") + public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 2、党员基本情况 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("cpcbasedata") + public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 1、指数_按月统计 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("indexdatamonthly") + public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + // -- + + /** + * 17、指数_按年统计 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("indexdatayearly") + public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 16、部门信息上传 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("customerdept") + public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 15、网格信息上传 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("customergrid") + public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 14、组织层级 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("customeragency") + public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 12、中央区各类总数 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("usertotaldata") + public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 11、基层治理-公众参与 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("userjoin") + public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 10、党建引领-先锋模范数据 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("pioneerdata") + public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java new file mode 100644 index 0000000000..f56638a3f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -0,0 +1,66 @@ +package com.epmet.dao.indexcoll; /** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao { + /** + * 8、治理能力-部门相关指标 + * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param deptId + * @param yearId + * @param monthId + * @param quarterId + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("deptId") String deptId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 8、治理能力-部门相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityDeptMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java new file mode 100644 index 0000000000..e591ba928d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.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.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao { + + /** + * 6、治理能力-网格相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 6、治理能力-网格相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..9013d4f9cf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.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.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgGovrnAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao { + /** + * 7、治理能力-街道及社区相关指标 + * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 7、治理能力-街道及社区相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java new file mode 100644 index 0000000000..387a369af1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridPartyMemberDataFormDTO; +import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao { + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 1) 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、USER_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param userId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityCpcMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("userId") String userId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityCpcMonthly(@Param("list") List list, + @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java new file mode 100644 index 0000000000..b5cb8d2c5e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.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.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexPartyAblityGridMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao { + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 1) 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..73a73a1c50 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgPartyAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao { + + /** + * 3、党建能力-街道及社区相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 3、党建能力-街道及社区相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java new file mode 100644 index 0000000000..9eb7051762 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao { + /** + * 4、服务能力-网格相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 4、服务能力-网格相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexServiceAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..31c268cd75 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgServiceAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao { + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexServiceAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexServiceAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.java new file mode 100644 index 0000000000..7aa2ab9733 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexDictEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 评价指标字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexDictDao extends BaseDao { + + int deleteAll(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java new file mode 100644 index 0000000000..5458720940 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexGroupDao extends BaseDao { + + int inertGroupFromTable(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java new file mode 100644 index 0000000000..1a7dd4a0a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexGroupDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.java new file mode 100644 index 0000000000..29f074c13f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.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.screen; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexGroupDetailTemplateDao extends BaseDao { + + int deleteAll(); + + List selectAll(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.java new file mode 100644 index 0000000000..c1e14b531c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexGroupTemplateEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 默认指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexGroupTemplateDao extends BaseDao { + + int deleteAll(); + + List selectAll(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java new file mode 100644 index 0000000000..12271b8e3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CpcBaseDataFormDTO; +import com.epmet.entity.screen.ScreenCpcBaseDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenCpcBaseDataDao extends BaseDao { + + /** + * 2、党员基本情况 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCpcBaseData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 2、党员基本情况 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCpcBaseData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java new file mode 100644 index 0000000000..d7851cd754 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; +import com.epmet.dto.screencoll.form.CustomerGridFormDTO; +import com.epmet.entity.screen.ScreenCustomerAgencyEntity; +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-08-18 + */ +@Mapper +public interface ScreenCustomerAgencyDao extends BaseDao { + /** + *14、组织层级 + * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyIds 组织id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCustomerAgency(@Param("customerId") String customerId, + @Param("agencyIds") String[] agencyIds); + + /** + * 14、组织层级 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCustomerAgency(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java new file mode 100644 index 0000000000..53f37049a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CustomerDeptFormDTO; +import com.epmet.entity.screen.ScreenCustomerDeptEntity; +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-08-18 + */ +@Mapper +public interface ScreenCustomerDeptDao extends BaseDao { + + /** + *16、部门信息上传 + * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param deptIds 部门Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCustomerDept(@Param("customerId") String customerId, + @Param("deptIds") String[] deptIds); + + /** + * 16、部门信息上传 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCustomerDept(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java new file mode 100644 index 0000000000..c9fa856582 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CustomerGridFormDTO; +import com.epmet.entity.screen.ScreenCustomerGridEntity; +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-08-18 + */ +@Mapper +public interface ScreenCustomerGridDao extends BaseDao { + /** + *15、网格信息上传 + * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param gridIds 网格Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCustomerGrid(@Param("customerId") String customerId, + @Param("gridIds") String[] gridIds); + + /** + * 15、网格信息上传 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCustomerGrid(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java new file mode 100644 index 0000000000..1a9b991bac --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.DifficultyDataFormDTO; +import com.epmet.entity.screen.ScreenDifficultyDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenDifficultyDataDao extends BaseDao { + /** + * 3、难点赌点 + * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + + * @param customerId 一 + * @param eventId 多 + * @param orgId 多 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteDifficultyData(@Param("customerId")String customerId, + @Param("eventId")String eventId, + @Param("orgId")String orgId); + + /** + * 3、难点赌点 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertDifficultyData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java new file mode 100644 index 0000000000..ec80809c55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.EventDataFormDTO; +import com.epmet.entity.screen.ScreenEventDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenEventDataDao extends BaseDao { + /** + * 4、事件数据 + * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId 一 + * @param eventId 多 + * @param orgId 多 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteEventData(@Param("customerId")String customerId, + @Param("eventId")String eventId, + @Param("orgId")String orgId); + + /** + * 4、事件数据 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertEventData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.java new file mode 100644 index 0000000000..42ca86859e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.ScreenEventImgDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 中央区-事件数据图片数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenEventImgDataDao extends BaseDao { + + /** + * 根据原始事件Id,进行物理删除 + * + * @param eventId + * @return void + * @Author zhangyong + * @Date 16:47 2020-08-18 + **/ + void delEventImgDataByEventId(@Param("eventId") String eventId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java new file mode 100644 index 0000000000..ea3d67aa68 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.GovernRankDataFormDTO; +import com.epmet.entity.screen.ScreenGovernRankDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenGovernRankDataDao extends BaseDao { + /** + * 5、基层治理-治理能力数据 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteGovernRankData(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 5、基层治理-治理能力数据 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertGovernRankData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java new file mode 100644 index 0000000000..e97406febf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; +import com.epmet.entity.screen.ScreenIndexDataMonthlyEntity; +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-08-18 + */ +@Mapper +public interface ScreenIndexDataMonthlyDao extends BaseDao { + + /** + *1、指数相关 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteIndexDataMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 1、指数相关 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertIndexDataMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java new file mode 100644 index 0000000000..4ca64f6944 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; +import com.epmet.entity.screen.ScreenIndexDataYearlyEntity; +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-08-19 + */ +@Mapper +public interface ScreenIndexDataYearlyDao extends BaseDao { + + /** + * 17、指数_按年统计 + * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteIndexDataYearly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("orgIds") String[] orgIds); + + /** + * 17、指数_按年统计 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertIndexDataYearly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java new file mode 100644 index 0000000000..4eabfd508a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.OrgRankDataFormDTO; +import com.epmet.entity.screen.ScreenOrgRankDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenOrgRankDataDao extends BaseDao { + /** + * 6、党建引领-组织排行 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteOrgRankData(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 6、党建引领-组织排行 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertOrgRankData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java new file mode 100644 index 0000000000..3cae4a160d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO; +import com.epmet.entity.screen.ScreenPartyBranchDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenPartyBranchDataDao extends BaseDao { + /** + * 7、基层党建-建设情况数据(支部、联建、志愿) + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deletePartyBranchData(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 7、基层党建-建设情况数据(支部、联建、志愿) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertPartyBranchData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java new file mode 100644 index 0000000000..276b08e356 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO; +import com.epmet.entity.screen.ScreenPartyLinkMassesDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenPartyLinkMassesDataDao extends BaseDao { + + /** + * 8、党建引领-党员联系群众数据 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deletePartyLinkMassesData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 8、党建引领-党员联系群众数据 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertPartyLinkMassesData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.java new file mode 100644 index 0000000000..9e43669618 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyUserRankDataFormDTO; +import com.epmet.entity.screen.ScreenPartyUserRankDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenPartyUserRankDataDao extends BaseDao { + + /** + * 9、党建引领|基层治理-居民(党员)积分排行榜 + * 1) 根据CUSTOMER_ID、GRID_ID、USER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param gridId + * @param userId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deletePartyUserRankData(@Param("customerId") String customerId, + @Param("gridId") String gridId, + @Param("userId") String userId); + + /** + * 9、党建引领|基层治理-居民(党员)积分排行榜 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertPartyUserRankData(@Param("list") List list,@Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java new file mode 100644 index 0000000000..202fc4aa59 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PioneerDataFormDTO; +import com.epmet.entity.screen.ScreenPioneerDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenPioneerDataDao extends BaseDao { + + /** + * 10、党建引领-先锋模范数据 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deletePioneerData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 10、党建引领-先锋模范数据 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertPioneerData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java new file mode 100644 index 0000000000..69422c07c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.ScreenUserJoinEntity; +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-08-18 + */ +@Mapper +public interface ScreenUserJoinDao extends BaseDao { + + /** + * 11、基层治理-公众参与 + * 0) 查询上月的基础数据,可用来计算本月的增长率 + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @return java.util.List + * @Author zhangyong + * @Date 14:46 2020-08-21 + **/ + List selectLastMonthScreenUserJoinList(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 11、基层治理-公众参与 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteUserJoin(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 11、基层治理-公众参与 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertUserJoin(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java new file mode 100644 index 0000000000..e0712dee50 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.UserTotalDataFormDTO; +import com.epmet.entity.screen.ScreenUserTotalDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenUserTotalDataDao extends BaseDao { + + /** + * 12、中央区各类总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteUserTotalData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 12、中央区各类总数 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertUserTotalData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java new file mode 100644 index 0000000000..24827756fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.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.entity.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_govrn_ablity_dept_monthly") +public class FactIndexGovrnAblityDeptMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门所属机关Id + */ + private String agencyId; + + /** + * 部门id + */ + private String deptId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 区直部门被吹哨次数 + */ + private Integer transferedCount; + + /** + * 区直部门办结项目数 + */ + private Integer closedProjectCount; + + /** + * 区直部门项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 区直部门办结项目的处理效率 + */ + private BigDecimal handleProjectRatio; + + /** + * 区直部门项目办结率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..c1c6553ef5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.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.entity.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_govrn_ablity_grid_monthly") +public class FactIndexGovrnAblityGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal avgShiftProjectRatio; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; + + /** + * 网格办结项目数 统计期内办结的项目数目 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..94eec97d6f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.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.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_govrn_ablity_org_monthly") +public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 上级组织Id,如果是根级组织,此列为0 + */ + private String parentId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 + */ + private String dataType; + + /** + * 被吹哨次数 + */ + private Integer transferedCount; + + /** + * 办结项目数 + */ + private Integer closedProjectCount; + + /** + * 项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 办结项目率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 超期项目率 + */ + private BigDecimal overdueProjectRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java new file mode 100644 index 0000000000..e6ec77f0fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.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.entity.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_party_ablity_cpc_monthly") +public class FactIndexPartyAblityCpcMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 用户Id: + */ + private String userId; + + /** + * 月维度Id: yyyMM + */ + private String monthId; + + /** + * 季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id : yyyy + */ + private String yearId; + + /** + * 党员提出的话题数 + */ + private Integer createTopicCount; + + /** + * 党员参与话题数(支持,反对,评论,浏览) + */ + private Integer joinTopicCount; + + /** + * 话题转议题数 + */ + private Integer shiftIssueCount; + + /** + * 议题转项目数 + */ + private Integer shiftProjectCount; + + /** + * 参加三会一课次数 + */ + private Integer joinThreeMeetsCount; + + /** + * 自建群群众人数 + */ + private Integer groupUserCount; + + /** + * 自建群活跃度-话题数 + */ + private Integer groupTopicCount; + + /** + * 议题转项目率 + */ + private BigDecimal topicToIssueRatio; + + /** + * 提出的议题转项目数 + */ + private Integer issueToProjectCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..208106e87a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.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.entity.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_party_ablity_grid_monthly") +public class FactIndexPartyAblityGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id + */ + private String monthId; + + /** + * 季度Id + */ + private String quarterId; + + /** + * 年Id + */ + private String yearId; + + /** + * 网格群众用户数 + */ + private Integer userCount; + + /** + * 网格党员用户数 + */ + private Integer partyCount; + + /** + * 网格活跃群众用户数 + */ + private Integer activeUserCount; + + /** + * 网格活跃党员用户数 + */ + private Integer activePartyCount; + + /** + * 网格党员人均提出话题数 + */ + private Integer partyAvgTopicCount; + + /** + * 网格群众人均提出话题数 + */ + private Integer userAvgTopicCount; + + /** + * 网格党员人均提出的议题转项目数 + */ + private Integer partyAvgShiftProjectCount; + + /** + * 网格群众人均提出的议题转项目数 + */ + private Integer userAvgShiftProjectCount; + + /** + * 建群党员数(累计值) 去重 + */ + private Integer createGroupPartyCount; + + /** + * 网格发文数 + */ + private Integer publishArticleCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 组织三会一课次数 + */ + private Integer createThreeMeetsCount; + + /** + * 党员参加三会一课人次 + */ + private Integer joinThreeMeetsCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..1bf023f055 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.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.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_party_ablity_org_monthly") +public class FactIndexPartyAblityOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 月维度Id + */ + private String monthId; + + /** + * 季度Id + */ + private String quarterId; + + /** + * 年Id + */ + private String yearId; + + /** + * 发文数 + */ + private Integer publishArticleCount; + + /** + * 数据类型 allRegion:全区;community:社区;street:街道 + */ + private String dataType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..d4c6aa6ab6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_service_ablity_grid_monthly") +public class FactIndexServiceAblityGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属组织Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 网格活动组织次数 爱心活动 + */ + private Integer activityCount; + + /** + * 网格志愿者占比 + */ + private BigDecimal volunteerRatio; + + /** + * 网格党员志愿者率 + */ + private BigDecimal partyVolunteerRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..8abeb1c172 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.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.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_service_ablity_org_monthly") +public class FactIndexServiceAblityOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 社区/街道活动组织次数 爱心活动 + */ + private Integer activityCount; + + /** + * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 + */ + private String dataType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java new file mode 100644 index 0000000000..2ea5745dba --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.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.screen; + +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-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_dict") +public class IndexDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 指标名 + */ + private String indexName; + + /** + * 指标描述 + */ + private String indexDesc; + + /** + * 指标级别(1,2,3,4,5) + */ + private String level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java new file mode 100644 index 0000000000..c0088d5383 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_detail") +public class IndexGroupDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java new file mode 100644 index 0000000000..569cda48d9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_detail_template") +public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 阈值 如果是百分比 则为除以100以后的值 + */ + private BigDecimal threshold; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java new file mode 100644 index 0000000000..24df1ef18a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.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.screen; + +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-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group") +public class IndexGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指标id + */ + private String indexId; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java new file mode 100644 index 0000000000..3348ebdeda --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.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.screen; + +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-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_template") +public class IndexGroupTemplateEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 指标id + */ + private String indexId; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.java new file mode 100644 index 0000000000..e649e5e89f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_cpc_base_data") +public class ScreenCpcBaseDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 注册用户数 + */ + private Integer registerUserCount; + + /** + * 群众用户数 + */ + private Integer resiTotal; + + /** + * 注册党员数 + */ + private Integer partyMemberCount; + + /** + * 小于20岁的党员总人数 + */ + private Integer ageLevel1; + + /** + * 20-30岁的党员总人数 + */ + private Integer ageLevel2; + + /** + * 31-40岁的党员总人数 + */ + private Integer ageLevel3; + + /** + * 41-50岁的党员总人数 + */ + private Integer ageLevel4; + + /** + * 51-60岁的党员总人数 + */ + private Integer ageLevel5; + + /** + * 60+岁的党员总人数 + */ + private Integer ageLevel6; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.java new file mode 100644 index 0000000000..96b2e23dfe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.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.entity.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_agency") +public class ScreenCustomerAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 父级id ,顶级,此列为0 + */ + private String pid; + + /** + * 所有上级ID,用逗号(英文)分开 + */ + private String pids; + + /** + * 所有组织名称以-链接 + */ + private String allParentNames; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党工委或者党委的位置,目前此阶段为预留字段 + */ + private String partyMark; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 行政地区编码 + */ + private String areaCode; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.java new file mode 100644 index 0000000000..f020e44cd8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_dept") +public class ScreenCustomerDeptEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 部门所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 部门所在位置(目前预留此字段) + */ + private String deptMark; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java new file mode 100644 index 0000000000..99b6c99553 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_grid") +public class ScreenCustomerGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党支部(=网格)的位置 + */ + private String partyMark; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java new file mode 100644 index 0000000000..845bbb7db0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java @@ -0,0 +1,130 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_difficulty_data") +public class ScreenDifficultyDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 事件原Id + */ + private String eventId; + + /** + * 事件图片 + */ + private String eventImgUrl; + + /** + * 事件来源 XX街道-社区-网格 + */ + private String eventSource; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件耗时 单位:分钟 + */ + private Integer eventCostTime; + + /** + * 事件涉及部门数 + */ + private Integer eventReOrg; + + /** + * 事件被处理次数(08-21新增) + */ + private Integer eventHandledCount; + /** + * 事件类别编码 + */ + private String eventCategoryCode; + + /** + * 事件类别名称 + */ + private String eventCategoryName; + + /** + * 事件状态key + */ + private String eventStatusCode; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 最近一次操作说明 + */ + private String latestOperateDesc; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java new file mode 100644 index 0000000000..e666f852b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.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.entity.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_event_data") +public class ScreenEventDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 原始事件Id + */ + private String eventId; + + /** + * 事件名称 + */ + private String eventTitle; + + /** + * 事件时间 + */ + private Date eventCreateTime; + + /** + * 联系人 联系人 + */ + private String linkMobile; + + /** + * 事件描述 + */ + private String eventContent; + + /** + * 事件图片 + */ + private String eventImgUrl; + + /** + * 事件待处理级别 red:红;yellow:黄;绿色:green + */ + private String eventLevel; + + /** + * 事件地址 + */ + private String eventAddress; + + /** + * 事件所在经度 + */ + private BigDecimal longitude; + + /** + * 事件所在维度 + */ + private BigDecimal latitude; + + /** + * 最后处理组织 + */ + private String lastProcessDept; + + /** + * 最后处理时间 + */ + private Date lastProcessDate; + + /** + * 事件状态key + */ + private String eventStatusCode; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 最近一次操作说明 + */ + private String latestOperateDesc; + + /** + * 数据更新至: yyyy|yyyMM|yyyyMMdd + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.java new file mode 100644 index 0000000000..fb0e81290b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_event_img_data") +public class ScreenEventImgDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 原始事件Id + */ + private String eventId; + + /** + * 图片图片地址 + */ + private String eventImgUrl; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.java new file mode 100644 index 0000000000..d280785a6c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_govern_rank_data") +public class ScreenGovernRankDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率 + */ + private BigDecimal responseRatio; + + /** + * 解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + */ + private BigDecimal governRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java new file mode 100644 index 0000000000..fbeb83ba9a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_index_data_monthly") +public class ScreenIndexDataMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 月份Id yyyyMM + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java new file mode 100644 index 0000000000..259947010d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_index_data_yearly") +public class ScreenIndexDataYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java new file mode 100644 index 0000000000..a732eda4b9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.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.entity.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_org_rank_data") +public class ScreenOrgRankDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员总数 + */ + private Integer partyTotal; + + /** + * 小组(支部建设)总数 + */ + private Integer groupTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 结案率 + */ + private BigDecimal closeProjectRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.java new file mode 100644 index 0000000000..cb870d2de7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.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.entity.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_party_branch_data") +public class ScreenPartyBranchDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice + */ + private String type; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 会议分类Id + */ + private String meetCategoryId; + + /** + * 会议分类名称(三会党课、主题党日.....等等) + */ + private String meetCategoryName; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 参加人数 + */ + private Integer joinUserCount; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.java new file mode 100644 index 0000000000..c663fc770b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_party_link_masses_data") +public class ScreenPartyLinkMassesDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员建群总数 + */ + private Integer createGroupTotal; + + /** + * 群成员总数 + */ + private Integer groupUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java new file mode 100644 index 0000000000..702e184439 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_party_user_rank_data") +public class ScreenPartyUserRankDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String orgId; + + /** + * 网格所属的组织名称 + */ + private String orgName; + + /** + * 是否是党员标志:1是。0不是党员 + */ + private Integer partyFlag; + + /** + * 用户Id + */ + private String userId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓名 + */ + private String userName; + + /** + * 用户积分 + */ + private Integer pointTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java new file mode 100644 index 0000000000..b53561b229 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_pioneer_data") +public class ScreenPioneerDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员参与议事 + */ + private Integer issueTotal; + + /** + * 党员参与议事占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题 + */ + private Integer topicTotal; + + /** + * 党员发布话题占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布议题 + */ + private Integer publishIssueTotal; + + /** + * 党员发布议题占比 + */ + private BigDecimal publishIssueRatio; + + /** + * 议题转项目数 + */ + private Integer shiftProjectTotal; + + /** + * 议题转项目占比 + */ + private BigDecimal shiftProjectRatio; + + /** + * 解决项目总数 + */ + private Integer resolvedProjectTotal; + + /** + * 解决项目总数占比 + */ + private BigDecimal resolvedProjectRatio; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.java new file mode 100644 index 0000000000..8a2009d9ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.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.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_user_join") +public class ScreenUserJoinEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 数据更新至 年Id: yyyy + */ + private String yearId; + + /** + * 数据更新至 :月份Id :yyyyMM + */ + private String monthId; + + /** + * 总的参与次数 + */ + private Integer joinTotal; + + /** + * 总的参与次数较上月增长率(采集的时候后台自己计算) + */ + private BigDecimal joinTotalUpRate; + + /** + * 增长:incr;下降:decr; 相等 :eq + */ + private String joinTotalUpFlag; + + /** + * 人均议题 + */ + private Integer avgIssue; + + /** + * 人均议题较上月增长率(采集的时候后台自己计算) + */ + private BigDecimal avgIssueUpRate; + + /** + * 增长:incr;下降:decr; 相等 :eq + */ + private String avgIssueUpFlag; + + /** + * 平均参与度 + */ + private Integer avgJoin; + + /** + * 平均参与度较上月增长率(采集的时候后台自己计算) + */ + private BigDecimal agvgJoinUpRate; + + /** + * 增长:incr;下降:decr; 相等 :eq + */ + private String agvgJoinUpFlag; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java new file mode 100644 index 0000000000..a58f257cc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.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.entity.screen; + +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-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_user_total_data") +public class ScreenUserTotalDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;网格:grid;部门:department; + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称,也可能是网格名称 + */ + private String orgName; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 用户总数 + */ + private Integer userTotal; + + /** + * 注册党总数 + */ + private Integer partyTotal; + + /** + * 小组(党群)总数 + */ + private Integer groupTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 注册人数(08-21新增) + */ + private Integer regUserTotal; + + /** + * 参与人数(08-21新增) + */ + private Integer joinUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java new file mode 100644 index 0000000000..76f0897890 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -0,0 +1,272 @@ +package com.epmet.model; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.UniqueIdGenerator; +import com.epmet.entity.screen.IndexDictEntity; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.screen.IndexGroupTemplateEntity; +import com.epmet.service.screen.IndexDictService; +import com.epmet.service.screen.IndexGroupDetailTemplateService; +import com.epmet.service.screen.IndexGroupTemplateService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * 读取转换异常 + * + * @author Jiaju Zhuang + */ +public class IndexExcelDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(IndexExcelDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static volatile boolean isGroup = false; + ; + AtomicInteger total = new AtomicInteger(0); + Map indexDicMap = new HashMap<>(); + Map indexGroupMap = new HashMap<>(); + Map indexGroupDetailMap = new HashMap<>(); + List indexModelList = new ArrayList<>(); + private String preWheight; + + private Integer wheightSum = 0; + /** + * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 + */ + private IndexDictService indexDictService; + + private IndexGroupTemplateService indexGroupTemplateService; + + private IndexGroupDetailTemplateService indexGroupDetailTemplateService; + + + /** + * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 + * + * @param indexDictService + */ + public IndexExcelDataListener(IndexDictService indexDictService, IndexGroupTemplateService indexGroupTemplateService, IndexGroupDetailTemplateService indexGroupDetailTemplateService) { + this.indexDictService = indexDictService; + this.indexGroupTemplateService = indexGroupTemplateService; + this.indexGroupDetailTemplateService = indexGroupDetailTemplateService; + } + + /** + * 这个每一条数据解析都会来调用 + * + * @param data one row value. Is is same as {@link AnalysisContext#readRowHolder()} + * @param context + */ + @Override + public void invoke(IndexModel data, AnalysisContext context) { + if (data == null || data.getIsUsed() == null || data.getIsUsed() != 1) { + return; + } + + //合并单元格的 权重 处理 + String weight = data.getWeight(); + if (StringUtils.isNotBlank(weight)) { + weight = weight.replace("%", ""); + data.setWeight(weight); + preWheight = data.getWeight(); + } else { + data.setWeight(preWheight); + } + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + + IndexDictEntity entity = new IndexDictEntity(); + IndexDictEntity entity2 = new IndexDictEntity(); + IndexDictEntity entity3 = new IndexDictEntity(); + IndexDictEntity entity4 = new IndexDictEntity(); + IndexDictEntity entity5 = new IndexDictEntity(); + + indexModelList.add(data); + buildIndexDicEntity(data, entity, entity2, entity3, entity4, entity5); + + buildIndexGroupEntity(); + + total.addAndGet(1); + + + // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM + /*if (isGroup) { + saveData(); + // 存储完成清理 list + list.clear(); + }*/ + } + + private void buildIndexGroupEntity() { + List collect = indexModelList.stream().sorted(Comparator.comparing(IndexModel::getLevel1Index)).collect(Collectors.toList()); + collect.forEach(index -> { + if (index.getLevel1Index().equals("党员相关")) { + IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); + String level1GroupId = UniqueIdGenerator.generate(); + IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); + if (group1 == null) { + group1 = new IndexGroupTemplateEntity(); + group1.setIndexId(indexDictEntity.getId()); + group1.setParentIndexGroupId("0"); + group1.setId(level1GroupId); + indexGroupMap.put(index.getLevel1Index(), group1); + } + + String level4Index = index.getLevel4Index(); + indexDictEntity = indexDicMap.get(level4Index); + String level2GroupId = UniqueIdGenerator.generate(); + + IndexGroupTemplateEntity group2 = indexGroupMap.get(level4Index); + IndexGroupDetailTemplateEntity templateEntity = null; + if (group2 == null) { + group2 = new IndexGroupTemplateEntity(); + group2.setIndexId(indexDictEntity.getId()); + group2.setParentIndexGroupId(level1GroupId); + group2.setId(level2GroupId); + indexGroupMap.put(level4Index, group2); + //构建 分组明细 + templateEntity = indexGroupDetailMap.get(level4Index); + if (templateEntity == null) { + buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2); + } + } + indexDictEntity = indexDicMap.get(index.getLevel5Index()); + + templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); + if (templateEntity == null) { + buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5); + } + } else { + //todo 测试完去掉 + //if ("街道相关".equals(index.getLevel1Index())) { + IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); + String level1GroupId = UniqueIdGenerator.generate(); + IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); + if (group1 == null) { + group1 = new IndexGroupTemplateEntity(); + group1.setIndexId(indexDictEntity.getId()); + group1.setParentIndexGroupId("0"); + group1.setId(level1GroupId); + indexGroupMap.put(index.getLevel1Index(), group1); + } + + String level2Index = index.getLevel2Index(); + indexDictEntity = indexDicMap.get(level2Index); + String level2GroupId = UniqueIdGenerator.generate(); + + IndexGroupTemplateEntity group2 = indexGroupMap.get(level2Index); + IndexGroupDetailTemplateEntity templateEntity = null; + if (group2 == null) { + group2 = new IndexGroupTemplateEntity(); + group2.setIndexId(indexDictEntity.getId()); + group2.setParentIndexGroupId(level1GroupId); + group2.setId(level2GroupId); + indexGroupMap.put(level2Index, group2); + //构建 分组明细 + templateEntity = indexGroupDetailMap.get(level2Index); + if (templateEntity == null) { + buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2); + } + } + indexDictEntity = indexDicMap.get(index.getLevel5Index()); + + templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); + if (templateEntity == null) { + buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5); + } + } + //} + }); + LOGGER.info("所有指标分组数据解析完成:{}", JSON.toJSONString(indexGroupMap.values())); + LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values())); + } + + private void buildIndexGroupDetail(IndexDictEntity indexDictEntity, IndexModel index, String groupId, Integer level) { + IndexGroupDetailTemplateEntity templateEntity; + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(groupId); + templateEntity.setIndexId(indexDictEntity.getId()); + + if (level == 5) { + String level5WeightStr = index.getLevel5Weight().replace("%", ""); + templateEntity.setWeight(new BigDecimal(level5WeightStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); + indexGroupDetailMap.put(index.getLevel5Index(), templateEntity); + } else { + indexGroupDetailMap.put(indexDictEntity.getIndexName(), templateEntity); + templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); + } + templateEntity.setId(UniqueIdGenerator.generate()); + if (StringUtils.isNotBlank(index.getThreshold())) { + String thresholdStr = index.getThreshold().replace("%", ""); + templateEntity.setThreshold(new BigDecimal(thresholdStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); + } + } + + private void buildIndexDicEntity(IndexModel data, IndexDictEntity entity, IndexDictEntity entity2, IndexDictEntity entity3, IndexDictEntity entity4, IndexDictEntity entity5) { + if (!indexDicMap.containsKey(data.getLevel1Index())) { + entity.setId(UniqueIdGenerator.generate()); + entity.setIndexName(data.getLevel1Index()); + entity.setLevel("1"); + indexDicMap.put(data.getLevel1Index(), entity); + } + if (!indexDicMap.containsKey(data.getLevel2Index())) { + entity2.setId(UniqueIdGenerator.generate()); + entity2.setIndexName(data.getLevel2Index()); + entity2.setLevel("2"); + indexDicMap.put(data.getLevel2Index(), entity2); + } + if (!indexDicMap.containsKey(data.getLevel3Index())) { + entity3.setId(UniqueIdGenerator.generate()); + entity3.setIndexName(data.getLevel3Index()); + entity3.setLevel("3"); + indexDicMap.put(data.getLevel3Index(), entity3); + } + if (!indexDicMap.containsKey(data.getLevel4Index())) { + entity4.setId(UniqueIdGenerator.generate()); + entity4.setIndexName(data.getLevel4Index()); + entity4.setLevel("4"); + indexDicMap.put(data.getLevel4Index(), entity4); + } + if (!indexDicMap.containsKey(data.getLevel5Index())) { + entity5.setId(UniqueIdGenerator.generate()); + entity5.setIndexName(data.getLevel5Index()); + entity5.setLevel("5"); + indexDicMap.put(data.getLevel5Index(), entity5); + } + } + + /** + * 所有数据解析完成了 都会来调用 + * + * @param context + */ + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 这里也要保存数据,确保最后遗留的数据也存储到数据库 + saveData(); + LOGGER.info("所有数据解析完成!total:{}", total.intValue()); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", indexDicMap.size()); + indexDictService.deleteAndInsertBatch(indexDicMap.values()); + + buildIndexGroupEntity(); + + indexGroupTemplateService.deleteAndInsertBatch(indexGroupMap.values()); + indexGroupDetailTemplateService.deleteAndInsertBatch(indexGroupDetailMap.values()); + LOGGER.info("存储数据库成功!指标:{}个,分组:{}个,详情:{}个", indexDicMap.values().size(), indexGroupMap.values().size(), indexGroupDetailMap.values().size()); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java new file mode 100644 index 0000000000..f264a2c39e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -0,0 +1,26 @@ +package com.epmet.model; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class IndexModel { + @ExcelProperty(value = "一级指标") + private String level1Index; + @ExcelProperty(value = "二级指标") + private String level2Index; + @ExcelProperty(value = "三级指标") + private String level3Index; + @ExcelProperty(value = "四级指标") + private String level4Index; + @ExcelProperty(value = "五级指标") + private String level5Index; + @ExcelProperty(value = "是否采用") + private Integer isUsed; + @ExcelProperty(value = "权重") + private String weight; + @ExcelProperty(value = "五级权重") + private String level5Weight; + @ExcelProperty(value = "阈值") + private String threshold; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java new file mode 100644 index 0000000000..17b4fa0634 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java @@ -0,0 +1,54 @@ +package com.epmet.model; + +import lombok.Data; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +@Data +public class ParseIndexExcelResult implements Serializable { + private String id; + private String groupId; + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + /** + * 指标编码(唯一) + */ + private String indexCode; + + /** + * 指标名 + */ + private String indexName; + + /** + * 指标描述 + */ + private String indexDesc; + + /** + * 指标级别(1,2,3,4,5) + */ + private String level; + + private Set children = new HashSet<>(); + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ParseIndexExcelResult that = (ParseIndexExcelResult) o; + return indexCode.equals(that.indexCode) && + indexName.equals(that.indexName) && + level.equals(that.level); + } + + @Override + public int hashCode() { + return Objects.hash(indexCode, indexName, indexDesc, level); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java new file mode 100644 index 0000000000..c9d876996b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java @@ -0,0 +1,110 @@ +package com.epmet.service.indexcollect; + +import com.epmet.dto.indexcollect.form.*; + +import java.util.List; + +/** + * 大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface FactIndexCollectService { + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、USER_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridPartyMemberData(List formDTO, String customerId); + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridPartyAbility(List formDTO, String customerId); + + /** + * 3、党建能力-街道及社区相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgPartyAbility(List formDTO, String customerId); + + /** + * 4、服务能力-网格相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridServiceAbility(List formDTO, String customerId); + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgServiceAbility(List formDTO, String customerId); + + /** + * 6、治理能力-网格相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridGovrnAbility(List formDTO, String customerId); + + /** + * 7、治理能力-街道及社区相关指标 + * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgGovrnAbility(List formDTO, String customerId); + + /** + * 8、治理能力-部门相关指标 + * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertDeptGovrnAbility(List formDTO, String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java new file mode 100644 index 0000000000..cd767ff580 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java @@ -0,0 +1,162 @@ +package com.epmet.service.indexcollect.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.indexcoll.*; +import com.epmet.dto.indexcollect.form.*; +import com.epmet.service.indexcollect.FactIndexCollectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @Auther: zhangyong + * @Date: 2020-08-20 10:05 + */ +@Service +public class FactIndexCollectServiceImpl implements FactIndexCollectService { + + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridPartyMemberData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getUserId(), + formDTO.get(i).getYearId(), formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridPartyAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgPartyAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridServiceAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgServiceAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertDeptGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getDeptId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO, customerId); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java new file mode 100644 index 0000000000..a43dcc2907 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java @@ -0,0 +1,17 @@ +package com.epmet.service.screen; + +import com.epmet.dto.screen.form.IndexCalculateForm; + +/** + * 指标计算service + * + * @author liujianjun@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface IndexCalculateService { + /** + * desc:计算党员相关指标 + * @param formDTO + */ + void cpcIndexCalculate(IndexCalculateForm formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.java new file mode 100644 index 0000000000..9e3b4f83ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexDictEntity; + +import java.util.Collection; + +/** + * 评价指标字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexDictService extends BaseService { + + Boolean deleteAndInsertBatch(Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java new file mode 100644 index 0000000000..ea03e298a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexGroupDetailEntity; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupDetailService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.java new file mode 100644 index 0000000000..3b0c48f7f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; + +import java.util.Collection; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupDetailTemplateService extends BaseService { + + Boolean deleteAndInsertBatch(Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.java new file mode 100644 index 0000000000..88c66b3da6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexGroupEntity; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupService extends BaseService { + + Boolean initCustomerIndexGroup(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.java new file mode 100644 index 0000000000..1f23716176 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexGroupTemplateEntity; + +import java.util.Collection; + +/** + * 默认指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupTemplateService extends BaseService { + + Boolean deleteAndInsertBatch(Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java new file mode 100644 index 0000000000..e81e4497c3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java @@ -0,0 +1,221 @@ +package com.epmet.service.screen; + +import com.epmet.dto.screencoll.form.*; + +import java.util.List; +/** + * 大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface ScreenCollService { + + /** + * 9、党建引领|基层治理-居民(党员)积分排行榜 + * 1) 根据CUSTOMER_ID、GRID_ID、USER_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertPartyUserRankData(List formDTO, String customerId); + + /** + * 8、党建引领-党员联系群众数据 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertPartyLinkMassesData(List formDTO, String customerId); + + /** + * 7、基层党建-建设情况数据(支部、联建、志愿) + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertPartyBranchData(List formDTO, String customerId); + + /** + * 6、党建引领-组织排行 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertOrgRankData(List formDTO, String customerId); + + /** + * 5、基层治理-治理能力数据 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertGovernRankData(List formDTO, String customerId); + + /** + * 4、事件数据 + * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertEventData(List formDTO, String customerId); + + /** + * 3、难点赌点 + * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertDifficultyData(List formDTO, String customerId); + + /** + * 2、党员基本情况 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertCpcbaseData(List formDTO, String customerId); + + /** + * 1、指数_按月统计 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertIndexDataMonthly(List formDTO, String customerId); + + /** + * 17、指数_按年统计 + * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertIndexDataYearly(List formDTO, String customerId); + + /** + * 16、部门信息上传 + * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertCustomerDept(List formDTO, String customerId); + + /** + * 15、网格信息上传 + * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertCustomerGrid(List formDTO, String customerId); + + /** + * 14、组织层级 + * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertCustomerAgency(List formDTO, String customerId); + + /** + * 12、中央区各类总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertUserTotalData(List formDTO, String customerId); + + /** + * 11、基层治理-公众参与 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertUserJoin(List formDTO, String customerId); + + /** + * 10、党建引领-先锋模范数据 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertPioneerData(List formDTO, String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java new file mode 100644 index 0000000000..7aff662edf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -0,0 +1,16 @@ +package com.epmet.service.screen.impl; + +import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.service.screen.IndexCalculateService; +import org.springframework.stereotype.Service; + +/** + * @author liujianjun + */ +@Service +public class IndexCalculateServiceImpl implements IndexCalculateService { + @Override + public void cpcIndexCalculate(IndexCalculateForm formDTO) { + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.java new file mode 100644 index 0000000000..16e4815226 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.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.service.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.screen.IndexDictDao; +import com.epmet.entity.screen.IndexDictEntity; +import com.epmet.service.screen.IndexDictService; +import org.springframework.stereotype.Service; + +import java.util.Collection; + +/** + * 评价指标字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexDictServiceImpl extends BaseServiceImpl implements IndexDictService { + + + @Override + public Boolean deleteAndInsertBatch(Collection values) { + int n = baseDao.deleteAll(); + return this.insertBatch(values,10); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java new file mode 100644 index 0000000000..db9fe1f411 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.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.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.screen.IndexGroupDetailDao; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.service.screen.IndexGroupDetailService; +import org.springframework.stereotype.Service; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.java new file mode 100644 index 0000000000..081f94ef3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.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.service.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.screen.IndexGroupDetailTemplateDao; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import com.epmet.service.screen.IndexGroupDetailTemplateService; +import org.springframework.stereotype.Service; + +import java.util.Collection; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexGroupDetailTemplateServiceImpl extends BaseServiceImpl implements IndexGroupDetailTemplateService { + + @Override + public Boolean deleteAndInsertBatch(Collection values) { + baseDao.deleteAll(); + return this.insertBatch(values, 10); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java new file mode 100644 index 0000000000..65fc39f131 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.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.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.UniqueIdGenerator; +import com.epmet.dao.screen.IndexGroupDao; +import com.epmet.dao.screen.IndexGroupDetailDao; +import com.epmet.dao.screen.IndexGroupDetailTemplateDao; +import com.epmet.dao.screen.IndexGroupTemplateDao; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.screen.IndexGroupEntity; +import com.epmet.entity.screen.IndexGroupTemplateEntity; +import com.epmet.service.screen.IndexGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexGroupServiceImpl extends BaseServiceImpl implements IndexGroupService { +@Autowired +private IndexGroupTemplateDao indexGroupTemplateDao; + @Autowired + private IndexGroupDetailTemplateDao indexGroupDetailTemplateDao; + + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + + @Transactional(rollbackFor = Exception.class) + @Override + public Boolean initCustomerIndexGroup(String customerId) { + List groupTempList = indexGroupTemplateDao.selectAll(); + List groupDetailTempList = indexGroupDetailTemplateDao.selectAll(); + if (CollectionUtils.isEmpty(groupTempList) || CollectionUtils.isEmpty(groupDetailTempList)){ + throw new RenException("没有需要初始化的数据"); + } + List groupEntityList = groupTempList.stream().map(groupTemp -> { + IndexGroupEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupEntity.class); + entity.setId(UniqueIdGenerator.generate()); + entity.setCustomerId(customerId); + return entity; + }).collect(Collectors.toList()); + this.insertBatch(groupEntityList,10); + + List groupTempEntityList = groupDetailTempList.stream().map(groupTemp -> { + IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupDetailEntity.class); + entity.setId(UniqueIdGenerator.generate()); + entity.setCustomerId(customerId); + return entity; + }).collect(Collectors.toList()); + groupTempEntityList.forEach(o->{ + indexGroupDetailDao.insert(o); + }); + return true; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.java new file mode 100644 index 0000000000..058cf911eb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.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.service.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.screen.IndexGroupTemplateDao; +import com.epmet.entity.screen.IndexGroupTemplateEntity; +import com.epmet.service.screen.IndexGroupTemplateService; +import org.springframework.stereotype.Service; + +import java.util.Collection; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexGroupTemplateServiceImpl extends BaseServiceImpl implements IndexGroupTemplateService { + + @Override + public Boolean deleteAndInsertBatch(Collection values) { + + baseDao.deleteAll(); + return this.insertBatch(values, 10); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java new file mode 100644 index 0000000000..b5e65fd193 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java @@ -0,0 +1,448 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.CompareConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.screen.*; +import com.epmet.dto.screencoll.form.*; +import com.epmet.entity.screen.ScreenEventImgDataEntity; +import com.epmet.entity.screen.ScreenUserJoinEntity; +import com.epmet.service.screen.ScreenCollService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +/** + * 大屏数据采集 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +public class ScreenCollServiceImpl implements ScreenCollService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + @Autowired + private ScreenOrgRankDataDao screenOrgRankDataDao; + @Autowired + private ScreenGovernRankDataDao screenGovernRankDataDao; + @Autowired + private ScreenEventDataDao screenEventDataDao; + @Autowired + private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + @Autowired + private ScreenCpcBaseDataDao screenCpcBaseDataDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + @Autowired + private ScreenUserJoinDao screenUserJoinDao; + @Autowired + private ScreenPioneerDataDao screenPioneerDataDao; + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyUserRankData(List formDTO,String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + screenPartyUserRankDataDao.deletePartyUserRankData(customerId, + formDTO.get(NumConstant.ZERO).getGridId(), + formDTO.get(NumConstant.ZERO).getUserId()); + } + + screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO,customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyLinkMassesData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId, orgIds); + + screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyBranchData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenPartyBranchDataDao.deletePartyBranchData(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgRankData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenOrgRankDataDao.deleteOrgRankData(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + screenOrgRankDataDao.batchInsertOrgRankData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGovernRankData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenGovernRankDataDao.deleteGovernRankData(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + screenGovernRankDataDao.batchInsertGovernRankData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertEventData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + screenEventDataDao.deleteEventData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); + } + + screenEventDataDao.batchInsertEventData(formDTO, customerId); + + for (int i = NumConstant.ZERO; i < formDTO.size(); i++) { + if (null != formDTO.get(i).getImgDataList() && formDTO.get(i).getImgDataList().size() > NumConstant.ZERO) { + // 根据原始事件ID,物理删除 - 事件数据图片数据 + screenEventImgDataDao.delEventImgDataByEventId(formDTO.get(i).getEventId()); + for (int j = NumConstant.ZERO; j < formDTO.get(i).getImgDataList().size(); j++){ + // 新增 中央区-事件数据图片数据 表 + ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); + imgDataEntity.setEventId(formDTO.get(i).getImgDataList().get(j).getEventId()); + imgDataEntity.setEventImgUrl(formDTO.get(i).getImgDataList().get(j).getImgUrl()); + imgDataEntity.setSort(formDTO.get(i).getImgDataList().get(j).getSort()); + screenEventImgDataDao.insert(imgDataEntity); + } + } + } + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertDifficultyData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + screenDifficultyDataDao.deleteDifficultyData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); + } + + screenDifficultyDataDao.batchInsertDifficultyData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCpcbaseData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenCpcBaseDataDao.deleteCpcBaseData(customerId, orgIds); + + screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIndexDataMonthly(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIndexDataYearly(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + orgIds); + + screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerDept(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] deptIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + deptIds[i] = formDTO.get(i).getDeptId(); + } + screenCustomerDeptDao.deleteCustomerDept(customerId, deptIds); + + screenCustomerDeptDao.batchInsertCustomerDept(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerGrid(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] gridIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + gridIds[i] = formDTO.get(i).getGridId(); + } + screenCustomerGridDao.deleteCustomerGrid(customerId, gridIds); + + screenCustomerGridDao.batchInsertCustomerGrid(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerAgency(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + screenCustomerAgencyDao.deleteCustomerAgency(customerId, agencyIds); + + screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserTotalData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenUserTotalDataDao.deleteUserTotalData(customerId, orgIds); + + screenUserTotalDataDao.batchInsertUserTotalData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserJoin(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenUserJoinDao.deleteUserJoin(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + String[] lastMonth = this.lastMonthDate(); + // 获取上个月的基本数据 + List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, + lastMonth[NumConstant.ZERO], + lastMonth[NumConstant.ONE], + orgIds); + + // 定义本月待添加数据的集合 + List curMonthJoinEntityList = new ArrayList<>(); + // 增加率计算 + if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO){ + // 存在上个月的数据 (本月-上月)/上月 *100 + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++){ + if (formDTO.get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())){ + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); + entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); + entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); + entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); + entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); + entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); + curMonthJoinEntityList.add(entity); + } + } + } + } else { + // 计算增长率后的 待新增数据 + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + // 不存在上个月的数据 + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(zero); + entity.setJoinTotalUpFlag(""); + entity.setAvgIssueUpRate(zero); + entity.setAvgIssueUpFlag(""); + entity.setAgvgJoinUpRate(zero); + entity.setAgvgJoinUpFlag(""); + curMonthJoinEntityList.add(entity); + } + } + screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); + } + } + + /** + * 获取当前日期的前一个月的日期 + * @param + * @return java.lang.String[] + * @Author zhangyong + * @Date 15:33 2020-08-21 + **/ + private String[] lastMonthDate(){ + String[] date = new String[NumConstant.TWO]; + //Java获取当前日期的前一个月的日期 + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MONTH, NumConstant.ONE_NEG); + int year = calendar.get(Calendar.YEAR); + int month = calendar.get(Calendar.MONTH) + NumConstant.ONE; + date[NumConstant.ZERO] = String.valueOf(year); + date[NumConstant.ONE] = String.valueOf(month);; + if (NumConstant.TEN >= month){ + date[NumConstant.ONE] = NumConstant.ZERO_STR + month; + } + return date; + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.math.BigDecimal + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){ + BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); + BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP); + return bignum2; + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.util.String + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private String calculateGrowthRateFlag(Integer old, Integer now){ + if (old > now){ + return CompareConstant.DECR_STR; + } else if (old < now){ + return CompareConstant.INCR_STR; + } else { + return CompareConstant.EQ_STR; + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPioneerData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenPioneerDataDao.deletePioneerData(customerId, orgIds); + + screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); + } + } +} 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 index d40987c1bc..10d4ba7a44 100644 --- 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 @@ -19,12 +19,14 @@ 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.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.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DimAgencyConstant; import com.epmet.constant.RobotConstant; import com.epmet.constant.StatsSubject; @@ -208,6 +210,7 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAgencyListByCustomerId(String customerId) { if (StringUtils.isBlank(customerId)){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java new file mode 100644 index 0000000000..f7a31b1436 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java @@ -0,0 +1,17 @@ +package com.epmet.support.normalizing; + +/** + * 指标正负相关枚举 + */ +public enum Correlation { + POSITIVE("positive","正相关"), + NEGATIVE("negative","负相关"), + ; + + private String code; + private String desc; + Correlation(String code,String desc){ + this.code = code; + this.desc = desc; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java new file mode 100644 index 0000000000..87f34db1f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java @@ -0,0 +1,43 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; + +/** + * Double的分值计算 + * 每一种数据类型的计算都要继承ScoreCalculator并且实现其抽象方法,实现数据类型的转换 + */ +public class DoubleScoreCalculator extends ScoreCalculator { + + /** + * 初始化double类型分值计算 + * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ + * @param sourceArray 数据所在的数组 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public DoubleScoreCalculator(Double[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray; + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare(); + } + + @Override + public BigDecimal getMaxFromSourceArray() { + Double[] doubleSourceArrary = (Double[]) this.sourceArrary; + return new BigDecimal(doubleSourceArrary[doubleSourceArrary.length - 1]); + } + + @Override + public BigDecimal getMinFromSourceArray() { + Double[] intSourceArrary = (Double[]) this.sourceArrary; + return new BigDecimal(intSourceArrary[0]); + } + + @Override + public BigDecimal convertValue2BigDecimal(Object sourceValue) { + return new BigDecimal((Double) sourceValue); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java new file mode 100644 index 0000000000..333cd0a4a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java @@ -0,0 +1,45 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; + +/** + * Integer的分值计算 + * 每一种数据类型的计算都要继承ScoreCalculator并且实现其抽象方法,实现数据类型的转换 + */ +public class IntegerScoreCalculator extends ScoreCalculator { + + /** + * 初始化整数分值计算 + * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ + * @param sourceArray 数据所在的数组 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public IntegerScoreCalculator(Integer[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray; + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + + } + + @Override + public BigDecimal getMaxFromSourceArray() { + Integer[] intSourceArrary = (Integer[]) this.sourceArrary; + return new BigDecimal(intSourceArrary[intSourceArrary.length - 1]); + } + + @Override + public BigDecimal getMinFromSourceArray() { + Integer[] intSourceArrary = (Integer[]) this.sourceArrary; + return new BigDecimal(intSourceArrary[0]); + } + + @Override + public BigDecimal convertValue2BigDecimal(Object sourceValue) { + return new BigDecimal((Integer) sourceValue); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java new file mode 100644 index 0000000000..2fb3fab926 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -0,0 +1,114 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.util.Arrays; + +/** + * 所有数据类型计算器的父类,实现算法骨架,数据类型转换方法则由子类实现 + * @param 数据类型泛型 + */ +public abstract class ScoreCalculator { + + protected T[] sourceArrary; + + protected BigDecimal minScore; + protected BigDecimal maxScore; + + protected Correlation correlation; + + private BigDecimal maxValue; + private BigDecimal minValue; + private BigDecimal coefficient; + + /** + * 计算准备 + */ + protected void prepare() { + // 校验数组 + if (!validSourceArray(sourceArrary)) { + throw new RuntimeException("入参数组错误:请设置非空数组"); + } + Arrays.sort(sourceArrary); + maxValue = getMaxFromSourceArray(); + minValue = getMinFromSourceArray(); + //计算系数 + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + coefficient = getCoefficient(minValue, maxValue); + } + + /** + * 归一算法 + * @return + */ + public BigDecimal normalize(T sourceValue) { + + if (sourceValue == null) { + throw new RuntimeException("入参数组错误:请设置sourceValue"); + } + + if (!Arrays.asList(sourceArrary).contains(sourceValue)) { + throw new RuntimeException("请确认要计算的数组在数组中存在"); + } + + if (correlation == Correlation.POSITIVE) { + // 正相关 + BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); + BigDecimal score = minScore.add(x, MathContext.DECIMAL32); + return score; + } else if (correlation == Correlation.NEGATIVE) { + // 负相关 + BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); + BigDecimal score = minScore.add(x); + return maxScore.subtract(score, MathContext.DECIMAL32); + } else { + throw new RuntimeException("错误的相关性"); + } + } + + /** + * 校验数组 + * @param sourceArray + * @param + * @return + */ + protected boolean validSourceArray(T[] sourceArray) { + if (sourceArray == null || sourceArray.length == 0) { + return false; + } + return true; + } + + /** + * 计算系数 + * @return + */ + protected BigDecimal getCoefficient(BigDecimal min, BigDecimal max) { + BigDecimal fenmu = max.subtract(min); + if (fenmu.toString().equals("0"))return new BigDecimal(0); + BigDecimal fenzi = maxScore.subtract(minScore); + BigDecimal divide = fenzi.divide(fenmu, MathContext.DECIMAL32); + System.out.println("分子:"+fenzi+"分母:"+fenmu+"系数:"+divide.toString()); + return divide; + } + + /** + * 从源数组中获取最大值 + * @return + */ + protected abstract BigDecimal getMaxFromSourceArray(); + + /** + * 从源数组中获取最小值 + * @return + */ + protected abstract BigDecimal getMinFromSourceArray(); + + /** + * 将值转化为BigDecimal + * @param sourceValue + * @return + */ + protected abstract BigDecimal convertValue2BigDecimal(T sourceValue); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ExcelListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ExcelListener.java new file mode 100644 index 0000000000..e8ad7cbe66 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ExcelListener.java @@ -0,0 +1,17 @@ +package com.epmet.util; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import org.apache.poi.ss.formula.functions.T; + +public class ExcelListener extends AnalysisEventListener { + @Override + public void invoke(T t, AnalysisContext analysisContext) { + + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + System.out.println(analysisContext); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/TestFileUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/TestFileUtil.java new file mode 100644 index 0000000000..865e691e80 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/TestFileUtil.java @@ -0,0 +1,35 @@ +package com.epmet.util; + +import java.io.File; +import java.io.InputStream; + +public class TestFileUtil { + + public static InputStream getResourcesFileInputStream(String fileName) { + return Thread.currentThread().getContextClassLoader().getResourceAsStream("" + fileName); + } + + public static String getPath() { + return TestFileUtil.class.getResource("/").getPath(); + } + + public static File createNewFile(String pathName) { + File file = new File(getPath() + pathName); + if (file.exists()) { + file.delete(); + } else { + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + } + return file; + } + + public static File readFile(String pathName) { + return new File(getPath() + pathName); + } + + public static File readUserHomeFile(String pathName) { + return new File(System.getProperty("user.home") + File.separator + pathName); + } +} 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 index a475fa198f..7ece13bb19 100644 --- 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 @@ -155,6 +155,16 @@ dynamic: url: @datasource.druid.user.url@ username: @datasource.druid.user.username@ password: @datasource.druid.user.password@ + stats: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.stats.url@ + username: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ + statsDisplay: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.statsdisplay.url@ + username: @datasource.druid.statsdisplay.username@ + password: @datasource.druid.statsdisplay.password@ thread: # 线程池配置 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml new file mode 100644 index 0000000000..107b94abc1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_govrn_ablity_dept_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND DEPT_ID = #{deptId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + + + + insert into fact_index_govrn_ablity_dept_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + DEPT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + HANDLE_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.deptId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.transferedCount}, + #{item.closedProjectCount}, + #{item.respProjectRatio}, + #{item.handleProjectRatio}, + #{item.closedProjectRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..ed0f65cc79 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_govrn_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + + + + insert into fact_index_govrn_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_TOTAL, + AVG_ISSUE_COUNT, + AVG_SHIFT_PROJECT_RATIO, + PROJECT_TOTAL, + SELF_SOLVE_PROJECT_COUNT, + RESOLVE_PROJECT_COUNT, + TRANSFER_RIGHT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.issueTotal}, + #{item.avgIssueCount}, + #{item.avgShiftProjectRatio}, + #{item.projectTotal}, + #{item.selfSolveProjectCount}, + #{item.resolveProjectCount}, + #{item.transferRightRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..36e4d07b3a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_govrn_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + + + + insert into fact_index_govrn_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + DATA_TYPE, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO, + OVERDUE_PROJECT_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.dataType}, + #{item.transferedCount}, + #{item.closedProjectCount}, + #{item.respProjectRatio}, + #{item.closedProjectRatio}, + #{item.satisfactionRatio}, + #{item.overdueProjectRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml new file mode 100644 index 0000000000..836adcdb03 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_party_ablity_cpc_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + + + + insert into fact_index_party_ablity_cpc_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + GRID_ID, + USER_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + CREATE_TOPIC_COUNT, + JOIN__TOPIC_COUNT, + SHIFT_ISSUE_COUNT, + SHIFT_PROJECT_COUNT, + JOIN_THREE_MEETS_COUNT, + GROUP_USER_COUNT, + GROUP_TOPIC_COUNT, + TOPIC_TO_ISSUE_RATIO, + ISSUE_TO_PROJECT_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.gridId}, + #{item.userId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.createTopicCount}, + #{item.joinTopicCount}, + #{item.shiftIssueCount}, + #{item.shiftProjectCount}, + #{item.joinThreeMeetsCount}, + #{item.groupUserCount}, + #{item.groupTopicCount}, + #{item.topicToIssueRatio}, + #{item.issueToProjectCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..e51a7d4f7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_party_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + + + + insert into fact_index_party_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + USER_COUNT, + PARTY_COUNT, + ACTIVE_USER_COUNT, + ACTIVE_PARTY_COUNT, + PARTY_AVG_TOPIC_COUNT, + USER_AVG_TOPIC_COUNT, + PARTY_AVG_SHIFT_PROJECT_COUNT, + USER_AVG_SHIFT_PROJECT_COUNT, + CREATE_GROUP_PARTY_COUNT, + PUBLISH_ARTICLE_COUNT, + ISSUE_TO_PROJECT_RATIO, + CREATE_THREE_MEETS_COUNT, + JOIN_THREE_MEETS_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.userCount}, + #{item.partyCount}, + #{item.activeUserCount}, + #{item.activePartyCount}, + #{item.partyAvgTopicCount}, + #{item.userAvgTopicCount}, + #{item.partyAvgShiftProjectCount}, + #{item.userAvgShiftProjectCount}, + #{item.createGroupPartyCount}, + #{item.publishArticleCount}, + #{item.issueToProjectRatio}, + #{item.createThreeMeetsCount}, + #{item.joinThreeMeetsCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..758a686052 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_party_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + + + + insert into fact_index_party_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + PUBLISH_ARTICLE_COUNT, + DATA_TYPE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.publishArticleCount}, + #{item.dataType}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..bc4348ea56 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_service_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + + + + insert into fact_index_service_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ACTIVITY_COUNT, + VOLUNTEER_RATIO, + PARTY_VOLUNTEER_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.activityCount}, + #{item.volunteerRatio}, + #{item.partyVolunteerRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..c475e2aca1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_service_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + + + + insert into fact_index_service_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ACTIVITY_COUNT, + DATA_TYPE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.activityCount}, + #{item.dataType}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml new file mode 100644 index 0000000000..a91513e1d5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml @@ -0,0 +1,8 @@ + + + + + + delete from index_dict + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml new file mode 100644 index 0000000000..4597456ae7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.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/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml new file mode 100644 index 0000000000..b7854f3338 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.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/screen/IndexGroupDetailTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml new file mode 100644 index 0000000000..c044654dd8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml @@ -0,0 +1,14 @@ + + + + + + + delete from index_group_detail_template + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml new file mode 100644 index 0000000000..6adfa4474b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml @@ -0,0 +1,13 @@ + + + + + + delete from index_group_template + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml new file mode 100644 index 0000000000..7f8ddaf4f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -0,0 +1,71 @@ + + + + + + + delete from screen_cpc_base_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_cpc_base_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + REGISTER_USER_COUNT, + RESI_TOTAL, + PARTY_MEMBER_COUNT, + AGE_LEVEL_1, + AGE_LEVEL_2, + AGE_LEVEL_3, + AGE_LEVEL_4, + AGE_LEVEL_5, + AGE_LEVEL_6, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.registerUserCount}, + #{item.resiTotal}, + + #{item.partyMemberCount}, + #{item.ageLevel1}, + #{item.ageLevel2}, + #{item.ageLevel3}, + #{item.ageLevel4}, + #{item.ageLevel5}, + #{item.ageLevel6}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml new file mode 100644 index 0000000000..a9c6911a70 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -0,0 +1,63 @@ + + + + + + + delete from screen_customer_agency + where CUSTOMER_ID = #{customerId} + AND AGENCY_ID IN + + #{item} + + + + + insert into screen_customer_agency + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + AGENCY_NAME, + PID, + PIDS, + ALL_PARENT_NAMES, + AREA_MARKS, + CENTER_MARK, + PARTY_MARK, + `LEVEL`, + AREA_CODE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.agencyName}, + #{item.pid}, + #{item.pids}, + #{item.allParentNames}, + #{item.areaMarks}, + #{item.centerMark}, + #{item.partyMark}, + #{item.level}, + #{item.areaCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml new file mode 100644 index 0000000000..a3fedbf4d5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml @@ -0,0 +1,55 @@ + + + + + + + delete from screen_customer_dept + where CUSTOMER_ID = #{customerId} + AND DEPT_ID IN + + #{item} + + + + + insert into screen_customer_dept + ( + ID, + CUSTOMER_ID, + DEPT_ID, + DEPT_NAME, + PARENT_AGENCY_ID, + AREA_MARKS, + CENTER_MARK, + DEPT_MARK, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.deptId}, + #{item.deptName}, + #{item.parentAgencyId}, + #{item.areaMarks}, + #{item.centerMark}, + #{item.deptMark}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml new file mode 100644 index 0000000000..5381e9ddd2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -0,0 +1,55 @@ + + + + + + + delete from screen_customer_grid + where CUSTOMER_ID = #{customerId} + AND GRID_ID IN + + #{item} + + + + + insert into screen_customer_grid + ( + ID, + CUSTOMER_ID, + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + AREA_MARKS, + CENTER_MARK, + PARTY_MARK, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.areaMarks}, + #{item.centerMark}, + #{item.partyMark}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml new file mode 100644 index 0000000000..e26c43115c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -0,0 +1,71 @@ + + + + + + + delete from screen_difficulty_data + where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + + + + insert into screen_difficulty_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + EVENT_ID, + EVENT_IMG_URL, + EVENT_SOURCE, + EVENT_CONTENT, + EVENT_COST_TIME, + EVENT_RE_ORG, + EVENT_HANDLED_COUNT, + EVENT_CATEGORY_CODE, + EVENT_CATEGORY_NAME, + EVENT_STATUS_CODE, + EVENT_STATUS_DESC, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + LATEST_OPERATE_DESC, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.eventId}, + #{item.eventImgUrl}, + #{item.eventSource}, + #{item.eventContent}, + #{item.eventCostTime}, + #{item.eventReOrg}, + #{item.eventHandledCount}, + #{item.eventCategoryCode}, + #{item.eventCategoryName}, + #{item.eventStatusCode}, + #{item.eventStatusDesc}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.latestOperateDesc}, + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml new file mode 100644 index 0000000000..be95b118df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -0,0 +1,77 @@ + + + + + + + delete from screen_event_data + where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + + + + insert into screen_event_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + EVENT_ID, + EVENT_TITLE, + EVENT_CREATE_TIME, + LINK_MOBILE, + EVENT_CONTENT, + EVENT_IMG_URL, + EVENT_LEVEL, + EVENT_ADDRESS, + LONGITUDE, + LATITUDE, + LAST_PROCESS_DEPT, + LAST_PROCESS_DATE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + EVENT_STATUS_CODE, + EVENT_STATUS_DESC, + LATEST_OPERATE_DESC, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.eventId}, + #{item.eventTitle}, + #{item.eventCreateTime}, + #{item.linkMobile}, + #{item.eventContent}, + #{item.eventImgUrl}, + #{item.eventLevel}, + #{item.eventAddress}, + #{item.longitude}, + #{item.latitude}, + #{item.lastProcessDept}, + #{item.lastProcessDate}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.eventStatusCode}, + #{item.eventStatusDesc}, + #{item.latestOperateDesc}, + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml new file mode 100644 index 0000000000..eaef413fd8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml @@ -0,0 +1,11 @@ + + + + + + + delete from screen_event_img_data + where DEL_FLAG = '0' AND EVENT_ID = #{eventId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml new file mode 100644 index 0000000000..9a6e6c3c44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -0,0 +1,65 @@ + + + + + + + delete from screen_govern_rank_data + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_govern_rank_data + ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + + RESPONSE_RATIO, + RESOLVED_RATIO, + GOVERN_RATIO, + SATISFACTION_RATIO, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + + #{item.responseRatio}, + #{item.resolvedRatio}, + #{item.governRatio}, + #{item.satisfactionRatio}, + + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml new file mode 100644 index 0000000000..721c4e0af3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -0,0 +1,62 @@ + + + + + + + delete from screen_index_data_monthly + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_index_data_monthly + ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + INDEX_TOTAL, + PARTY_DEV_ABLITY, + SERVICE_ABLITY, + GOVERN_ABLITY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + + #{item.indexTotal}, + #{item.partyDevAblity}, + #{item.serviceAblity}, + #{item.governAblity}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml new file mode 100644 index 0000000000..8747e1219a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -0,0 +1,60 @@ + + + + + + + delete from screen_index_data_yearly + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_index_data_yearly + ( + ID, + CUSTOMER_ID, + YEAR_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + INDEX_TOTAL, + PARTY_DEV_ABLITY, + SERVICE_ABLITY, + GOVERN_ABLITY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + + #{item.indexTotal}, + #{item.partyDevAblity}, + #{item.serviceAblity}, + #{item.governAblity}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml new file mode 100644 index 0000000000..4ebe5e2c28 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -0,0 +1,67 @@ + + + + + + + delete from screen_org_rank_data + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_org_rank_data + ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + PARTY_TOTAL, + GROUP_TOTAL, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + CLOSE_PROJECT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.partyTotal}, + #{item.groupTotal}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + #{item.closeProjectRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml new file mode 100644 index 0000000000..afeaca9651 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -0,0 +1,64 @@ + + + + + + + delete from screen_party_branch_data + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_party_branch_data + ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + `TYPE`, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + MEET_CATEGORY_ID, + MEET_CATEGORY_NAME, + ORGANIZE_COUNT, + JOIN_USER_COUNT, + AVERAGE_JOIN_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.type}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.meetCategoryId}, + #{item.meetCategoryName}, + #{item.organizeCount}, + #{item.joinUserCount}, + #{item.averageJoinUserCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml new file mode 100644 index 0000000000..d317d97ee9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -0,0 +1,55 @@ + + + + + + + delete from screen_party_link_masses_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_party_link_masses_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + CREATE_GROUP_TOTAL, + GROUP_USER_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.createGroupTotal}, + #{item.groupUserTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml new file mode 100644 index 0000000000..070e952878 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -0,0 +1,59 @@ + + + + + + + delete from screen_party_user_rank_data + where CUSTOMER_ID = #{customerId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + + + + insert into screen_party_user_rank_data + ( + ID, + CUSTOMER_ID, + GRID_ID, + GRID_NAME, + ORG_ID, + ORG_NAME, + PARTY_FLAG, + USER_ID, + SURNAME, + `NAME`, + USER_NAME, + POINT_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.gridName}, + #{item.orgId}, + #{item.orgName}, + #{item.partyFlag}, + #{item.userId}, + #{item.surname}, + #{item.name}, + #{item.userName}, + #{item.pointTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml new file mode 100644 index 0000000000..8142176bee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -0,0 +1,72 @@ + + + + + + + delete from screen_pioneer_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_pioneer_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + PUBLISH_ISSUE_TOTAL, + ISSUE_TOTAL, + TOPIC_TOTAL, + SHIFT_PROJECT_TOTAL, + RESOLVED_PROJECT_TOTAL, + PUBLISH_ISSUE_RATIO, + ISSUE_RATIO, + TOPIC_RATIO, + SHIFT_PROJECT_RATIO, + RESOLVED_PROJECT_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.publishIssueTotal}, + #{item.issueTotal}, + #{item.topicTotal}, + #{item.shiftProjectTotal}, + #{item.resolvedProjectTotal}, + + #{item.publishIssueRatio}, + #{item.issueRatio}, + #{item.topicRatio}, + #{item.shiftProjectRatio}, + #{item.resolvedProjectRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml new file mode 100644 index 0000000000..9751293f5f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -0,0 +1,91 @@ + + + + + + + + + delete from screen_user_join + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_user_join + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + YEAR_ID, + MONTH_ID, + JOIN_TOTAL, + JOIN_TOTAL_UP_RATE, + JOIN_TOTAL_UP_FLAG, + AVG_ISSUE, + AVG_ISSUE_UP_RATE, + AVG_ISSUE_UP_FLAG, + AVG_JOIN, + AGVG_JOIN_UP_RATE, + AGVG_JOIN_UP_FLAG, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.yearId}, + #{item.monthId}, + + #{item.joinTotal}, + #{item.joinTotalUpRate}, + #{item.joinTotalUpFlag}, + + #{item.avgIssue}, + #{item.avgIssueUpRate}, + #{item.avgIssueUpFlag}, + + #{item.avgJoin}, + #{item.agvgJoinUpRate}, + #{item.agvgJoinUpFlag}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml new file mode 100644 index 0000000000..a3f29dd5a6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -0,0 +1,67 @@ + + + + + + + delete from screen_user_total_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_user_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + USER_TOTAL, + PARTY_TOTAL, + GROUP_TOTAL, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + REG_USER_TOTAL, + JOIN_USER_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.userTotal}, + #{item.partyTotal}, + #{item.groupTotal}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + #{item.regUserTotal}, + #{item.joinUserTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + 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 index dedf82d8fe..3b7fb8b8ba 100644 --- 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 @@ -128,6 +128,7 @@ ID, CUSTOMER_ID, PID, + AGENCY_NAME, LEVEL FROM dim_agency diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoData.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoData.java new file mode 100644 index 0000000000..234e66cb58 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoData.java @@ -0,0 +1,17 @@ +package com.epmet.stats.test.model; + +import lombok.Data; + +import java.util.Date; + +/** + * 基础数据类.这里的排序和excel里面的排序一致 + * + * @author Jiaju Zhuang + **/ +@Data +public class DemoData { + private String string; + private Date date; + private Double doubleData; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java new file mode 100644 index 0000000000..d218327ad1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java @@ -0,0 +1,84 @@ +package com.epmet.stats.test.model; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import com.epmet.dao.screen.ScreenCustomerAgencyDao; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +/** + * 模板的读取类 + * + * @author Jiaju Zhuang + */ +// 有个很重要的点 DemoDataListener 不能被spring管理,要每次读取excel都要new,然后里面用到spring可以构造方法传进去 +public class DemoDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(DemoDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static final int BATCH_COUNT = 5; + List list = new ArrayList(); + /** + * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 + */ + private ScreenCustomerAgencyDao demoDAO; + + public DemoDataListener() { + // 这里是demo,所以随便new一个。实际使用如果到了spring,请使用下面的有参构造函数 + demoDAO = null; + } + + /** + * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 + * + * @param demoDAO + */ + public DemoDataListener(ScreenCustomerAgencyDao demoDAO) { + this.demoDAO = demoDAO; + } + + /** + * 这个每一条数据解析都会来调用 + * + * @param data + * one row value. Is is same as {@link AnalysisContext#readRowHolder()} + * @param context + */ + @Override + public void invoke(DemoData data, AnalysisContext context) { + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + list.add(data); + // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM + if (list.size() >= BATCH_COUNT) { + saveData(); + // 存储完成清理 list + list.clear(); + } + } + + /** + * 所有数据解析完成了 都会来调用 + * + * @param context + */ + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 这里也要保存数据,确保最后遗留的数据也存储到数据库 + saveData(); + LOGGER.info("所有数据解析完成!"); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", list.size()); + //demoDAO.save(list); + LOGGER.info("存储数据库成功!"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterData.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterData.java new file mode 100644 index 0000000000..9a9be1642d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterData.java @@ -0,0 +1,30 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.alibaba.excel.annotation.format.NumberFormat; +import lombok.Data; + +/** + * 基础数据类.这里的排序和excel里面的排序一致 + * + * @author Jiaju Zhuang + **/ +@Data +public class ConverterData { + /** + * 我自定义 转换器,不管数据库传过来什么 。我给他加上“自定义:” + */ + @ExcelProperty(converter = CustomStringStringConverter.class) + private String string; + /** + * 这里用string 去接日期才能格式化。我想接收年月日格式 + */ + @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒") + private String date; + /** + * 我想接收百分比的数字 + */ + @NumberFormat("#.##%") + private String doubleData; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterDataListener.java new file mode 100644 index 0000000000..7c28d41fe8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterDataListener.java @@ -0,0 +1,48 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +/** + * 模板的读取类 + * + * @author Jiaju Zhuang + */ +public class ConverterDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(ConverterDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static final int BATCH_COUNT = 5; + List list = new ArrayList(); + + @Override + public void invoke(ConverterData data, AnalysisContext context) { + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + list.add(data); + if (list.size() >= BATCH_COUNT) { + saveData(); + list.clear(); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + saveData(); + LOGGER.info("所有数据解析完成!"); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", list.size()); + LOGGER.info("存储数据库成功!"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java new file mode 100644 index 0000000000..584e563a77 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java @@ -0,0 +1,59 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.CellData; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.property.ExcelContentProperty; + +/** + * String and string converter + * + * @author Jiaju Zhuang + */ +public class CustomStringStringConverter implements Converter { + @Override + public Class supportJavaTypeKey() { + return String.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + /** + * 这里读的时候会调用 + * + * @param cellData + * NotNull + * @param contentProperty + * Nullable + * @param globalConfiguration + * NotNull + * @return + */ + @Override + public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { + return "自定义:" + cellData.getStringValue(); + } + + /** + * 这里是写的时候会调用 不用管 + * + * @param value + * NotNull + * @param contentProperty + * Nullable + * @param globalConfiguration + * NotNull + * @return + */ + @Override + public CellData convertToExcelData(String value, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { + return new CellData(value); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDAO.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDAO.java new file mode 100644 index 0000000000..bf09288f59 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDAO.java @@ -0,0 +1,15 @@ +package com.epmet.stats.test.read; + +import java.util.List; + +/** + * 假设这个是你的DAO存储。当然还要这个类让spring管理,当然你不用需要存储,也不需要这个类。 + * + * @author Jiaju Zhuang + **/ +public class DemoDAO { + + public void save(List list) { + // 如果是mybatis,尽量别直接调用多次insert,自己写一个mapper里面新增一个方法batchInsert,所有数据一次性插入 + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoData.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoData.java new file mode 100644 index 0000000000..ceb3dd37ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoData.java @@ -0,0 +1,17 @@ +package com.epmet.stats.test.read; + +import lombok.Data; + +import java.util.Date; + +/** + * 基础数据类.这里的排序和excel里面的排序一致 + * + * @author Jiaju Zhuang + **/ +@Data +public class DemoData { + private String string; + private Date date; + private Double doubleData; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDataListener.java new file mode 100644 index 0000000000..539f1903b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDataListener.java @@ -0,0 +1,97 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import com.epmet.model.IndexModel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 模板的读取类 + * + * @author Jiaju Zhuang + */ +// 有个很重要的点 DemoDataListener 不能被spring管理,要每次读取excel都要new,然后里面用到spring可以构造方法传进去 +public class DemoDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(DemoDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static final int BATCH_COUNT = 5; + List list = new ArrayList(); + AtomicInteger total = new AtomicInteger(0); + + private String preWheight; + /** + * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 + */ + private DemoDAO demoDAO; + + public DemoDataListener() { + // 这里是demo,所以随便new一个。实际使用如果到了spring,请使用下面的有参构造函数 + demoDAO = new DemoDAO(); + } + + /** + * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 + * + * @param demoDAO + */ + public DemoDataListener(DemoDAO demoDAO) { + this.demoDAO = demoDAO; + } + + /** + * 这个每一条数据解析都会来调用 + * + * @param data + * one row value. Is is same as {@link AnalysisContext#readRowHolder()} + * @param context + */ + @Override + public void invoke(IndexModel data, AnalysisContext context) { + if (data == null || data.getIsUsed() == null || data.getIsUsed() != 1){ + return; + } + if ( data.getWeight() != null){ + preWheight = data.getWeight(); + }else{ + data.setWeight(preWheight); + } + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + list.add(data); + total.addAndGet(1); + // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM + if (list.size() >= BATCH_COUNT) { + saveData(); + // 存储完成清理 list + list.clear(); + } + } + + /** + * 所有数据解析完成了 都会来调用 + * + * @param context + */ + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 这里也要保存数据,确保最后遗留的数据也存储到数据库 + saveData(); + LOGGER.info("所有数据解析完成!total:{}",total.intValue()); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", list.size()); + //demoDAO.save(list); + LOGGER.info("存储数据库成功!"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ReadTest.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ReadTest.java new file mode 100644 index 0000000000..85ee1e7806 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ReadTest.java @@ -0,0 +1,70 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.epmet.model.IndexModel; +import com.epmet.util.TestFileUtil; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.FileNotFoundException; + + +/** + * 读的常见写法 + * + * @author Jiaju Zhuang + */ +@Ignore +public class ReadTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(ReadTest.class); + + + + /** + * 读多个或者全部sheet,这里注意一个sheet不能读取多次,多次读取需要重新读取文件 + *

+ * 1. 创建excel对应的实体对象 参照{@link DemoData} + *

+ * 2. 由于默认一行行的读取excel,所以需要创建excel一行一行的回调监听器,参照{@link DemoDataListener} + *

+ * 3. 直接读即可 + */ + @Test + public void repeatedRead() throws FileNotFoundException { + String fileName = ""; + /* String fileName = TestFileUtil.getPath() + File.separator + "评价指标体系算法需求-备注.xlsx"; + // 读取全部sheet + // 这里需要注意 DemoDataListener的doAfterAllAnalysed 会在每个sheet读取完毕后调用一次。然后所有sheet都会往同一个DemoDataListener里面写 + EasyExcel.read(fileName, IndexModel.class, new DemoDataListener()).doReadAll(); +*/ + // 读取部分sheet + String excelName = "评价指标体系算法需求-备注.xlsx"; + fileName = TestFileUtil.getPath() + File.separator + excelName; + //fileName = this.getClass().getResource(File.separator).getPath().concat(excelName); + ExcelReader excelReader = null; + try { + //ExcelImportUtil.importExcel(null); + + //EasyExcel.read(new FileInputStream(new File(fileName)),IndexModel.class); + excelReader = EasyExcel.read(fileName).build(); + // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener + ReadSheet readSheet1 = + EasyExcel.readSheet(0).head(IndexModel.class).registerReadListener(new DemoDataListener()).build(); + ReadSheet readSheet2 = + EasyExcel.readSheet(1).head(IndexModel.class).registerReadListener(new DemoDataListener()).build(); + // 这里注意 一定要把sheet1 sheet2 一起传进去,不然有个问题就是03版的excel 会读取多次,浪费性能 + excelReader.read(readSheet2); + } finally { + if (excelReader != null) { + // 这里千万别忘记关闭,读的时候会创建临时文件,到时磁盘会崩的 + excelReader.finish(); + } + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/util/TestFileUtil.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/util/TestFileUtil.java new file mode 100644 index 0000000000..5035e52046 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/util/TestFileUtil.java @@ -0,0 +1,35 @@ +package com.epmet.stats.test.util; + +import java.io.File; +import java.io.InputStream; + +public class TestFileUtil { + + public static InputStream getResourcesFileInputStream(String fileName) { + return Thread.currentThread().getContextClassLoader().getResourceAsStream("" + fileName); + } + + public static String getPath() { + return TestFileUtil.class.getResource("/").getPath(); + } + + public static File createNewFile(String pathName) { + File file = new File(getPath() + pathName); + if (file.exists()) { + file.delete(); + } else { + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + } + return file; + } + + public static File readFile(String pathName) { + return new File(getPath() + pathName); + } + + public static File readUserHomeFile(String pathName) { + return new File(System.getProperty("user.home") + File.separator + pathName); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx new file mode 100644 index 0000000000..592e740466 Binary files /dev/null and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx differ diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppAuthFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppAuthFormDTO.java index 2d6470db80..a144b37f81 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppAuthFormDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppAuthFormDTO.java @@ -15,4 +15,14 @@ public class ExternalAppAuthFormDTO { */ private String token; + /** + * 时间戳 + */ + private Long ts; + + /** + * 认证类型:md5,jwt + */ + private String authType; + } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppFormDTO.java index 36a504a135..00b99a500e 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppFormDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppFormDTO.java @@ -9,8 +9,9 @@ public class ExternalAppFormDTO { public interface AddExternalApp {} public interface UpdateExternalApp {} + public interface UpdateAppSecret {} - @NotBlank(message = "缺少应用ID", groups = { UpdateExternalApp.class }) + @NotBlank(message = "缺少应用ID", groups = { UpdateExternalApp.class, UpdateAppSecret.class }) private String appId; @NotBlank(message = "缺少应用名称", groups = { AddExternalApp.class, UpdateExternalApp.class }) diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ExtAppAuthTypeConstant.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ExtAppAuthTypeConstant.java new file mode 100644 index 0000000000..b281c6d7e6 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ExtAppAuthTypeConstant.java @@ -0,0 +1,8 @@ +package com.epmet.constant; + +public interface ExtAppAuthTypeConstant { + + String JWT = "jwt"; + String MD5 = "md5"; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java index 976c4e4ef0..45bdb8bef6 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java @@ -1,5 +1,6 @@ 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.Result; @@ -40,12 +41,14 @@ public class ExternalAppController { public Result auth(@RequestBody ExternalAppAuthFormDTO formDTO) { String appId = formDTO.getAppId(); String token = formDTO.getToken(); + Long ts = formDTO.getTs(); + String authType = formDTO.getAuthType(); if (StringUtils.isAnyBlank(token, appId)) { throw new RenException("请求头中的token和appId不能为空"); } logger.info("外部应用请求认证拦截Aspect。appId:{}, token:{}", appId, token); - ExternalAppAuthResultDTO auth = externalAppAuthService.auth(appId, token); + ExternalAppAuthResultDTO auth = externalAppAuthService.auth(appId, token, ts, authType); return new Result().ok(auth); } @@ -95,4 +98,20 @@ public class ExternalAppController { return new Result>().ok(page); } + /** + * 重置应用秘钥 + * @param formDTO + * @return + */ + @PostMapping("/resetsecret") + public Result resetSecret(@RequestBody ExternalAppFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ExternalAppFormDTO.UpdateAppSecret.class); + String newSecret = externalAppService.resetSecret(formDTO.getAppId()); + if (StringUtils.isBlank(newSecret)) { + return new Result().error(EpmetErrorCode.OPER_EXT_APP_SECRET_RESET_FAIL.getCode(), + EpmetErrorCode.OPER_EXT_APP_SECRET_RESET_FAIL.getMsg()); + } + return new Result().ok(newSecret); + } + } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java index f56aa08cb0..fd2342c7c6 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java @@ -40,4 +40,5 @@ public interface ExternalAppSecretDao extends BaseDao { */ ExternalAppSecretEntity getSecretsByAppId(@Param("appId") String appId); + int updateSecret(@Param("appId") String appId, @Param("secret") String secret); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppAuthService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppAuthService.java index e1158c592c..3f76a1e83d 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppAuthService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppAuthService.java @@ -1,10 +1,9 @@ package com.epmet.service; import com.epmet.dto.result.ExternalAppAuthResultDTO; -import com.epmet.dto.result.ExternalAppResultDTO; public interface ExternalAppAuthService { - ExternalAppAuthResultDTO auth(String appId, String token); + ExternalAppAuthResultDTO auth(String appId, String token, Long ts, String authType); } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java index dff718695f..8f38fa2a83 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java @@ -32,4 +32,6 @@ public interface ExternalAppService { ExternalAppResultDTO updateById(String appId, String appName, String customerId); PageData listPage(Integer pageNo, Integer pageSize, String customerId); + + String resetSecret(String appId); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java index e87a4c6f46..e598c3ab2c 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java @@ -1,19 +1,10 @@ package com.epmet.service.impl; -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.redis.RedisKeys; -import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.dao.ExternalAppDao; -import com.epmet.dao.ExternalAppSecretDao; +import com.epmet.constant.ExtAppAuthTypeConstant; import com.epmet.dto.result.ExternalAppAuthResultDTO; -import com.epmet.dto.result.ExternalAppResultDTO; -import com.epmet.entity.ExternalAppEntity; -import com.epmet.entity.ExternalAppSecretEntity; import com.epmet.service.ExternalAppAuthService; -import com.epmet.utils.externalapp.ExtAppJwtTokenUtils; -import io.jsonwebtoken.Claims; +import com.epmet.utils.externalapp.ExtAppJwtAuthProcessor; +import com.epmet.utils.externalapp.ExtAppMD5AuthProcessor; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,90 +17,23 @@ public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { private static Logger logger = LoggerFactory.getLogger(ExternalAppAuthServiceImpl.class); @Autowired - private RedisUtils redisUtils; + private ExtAppJwtAuthProcessor jwtAuthProcessor; @Autowired - private ExtAppJwtTokenUtils jwtTokenUtils; - - @Autowired - private ExternalAppSecretDao externalAppSecretDao; - - @Autowired - private ExternalAppDao externalAppDao; - - private int diffMillins = 1000 * 60 * 5; + private ExtAppMD5AuthProcessor md5AuthProcessor; @Override - public ExternalAppAuthResultDTO auth(String appId, String token) { - String secret; - if (StringUtils.isBlank(secret = getTokenByAppId(appId))) { - return fillAuthResult(false, String.format("根据AppId:%s没有找到对应的秘钥", appId), null); + public ExternalAppAuthResultDTO auth(String appId, String token, Long ts, String authType) { + // 没传或者传的jwt都用jwtprocessor处理 + if (StringUtils.isBlank(authType) || ExtAppAuthTypeConstant.JWT.equals(authType)) { + return jwtAuthProcessor.auth(appId, token, ts); + } else if (ExtAppAuthTypeConstant.MD5.equals(authType)) { + return md5AuthProcessor.auth(appId, token, ts); + } else { + ExternalAppAuthResultDTO rst = new ExternalAppAuthResultDTO(); + rst.setMessage("错误的认证类型"); + rst.setSuccess(false); + return rst; } - - Claims claim; - try { - claim = jwtTokenUtils.getClaimByToken(token, secret); - } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error("解析token失败:{}", errorStackTrace); - return fillAuthResult(false, "解析token失败", null); - } - - String appIdIn = (String)claim.get("appId"); - String customerId = (String)claim.get("customerId"); - Long timestamp = (Long)claim.get("ts"); - - //校验时间戳,允许5分钟误差 - if (StringUtils.isAnyBlank(appIdIn, customerId) || timestamp == null) { - logger.error("access token不完整。{},{},{}", appIdIn, customerId, timestamp); - return fillAuthResult(false, "access token不完整。", null); - } - - // TODO -// if (!validTimeStamp(timestamp)) { -// logger.error("服务器存在时差过大,请求被拒绝", appId, appIdIn); -// return fillAuthResult(false, "服务器存在时差过大,请求被拒绝", null); -// } - - if (!appId.equals(appIdIn)) { - logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn); - return fillAuthResult(false, "Header中的AppId不匹配", null); - } - return fillAuthResult(true, "解析成功", customerId); - } - - private boolean validTimeStamp(Long timestamp) { - long now = System.currentTimeMillis(); -// System.out.println(new Date(timestamp)); - if (Math.abs(now - timestamp) > diffMillins) { - return false; - } - return true; - } - - /** - * 通过APP ID查询对应的秘钥 - * @param appId - * @return - */ - public String getTokenByAppId(String appId) { - String secret = (String)redisUtils.get(RedisKeys.getExternalAppSecretKey(appId)); - if (StringUtils.isBlank(secret)) { - ExternalAppSecretEntity secretEntity = externalAppSecretDao.getSecretsByAppId(appId); - if (secretEntity == null) { - return null; - } - secret = secretEntity.getSecret(); - redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret); - } - return secret; - } - - public ExternalAppAuthResultDTO fillAuthResult(Boolean result, String message, String customerId) { - ExternalAppAuthResultDTO authResult = new ExternalAppAuthResultDTO(); - authResult.setSuccess(result); - authResult.setMessage(message); - authResult.setCustomerId(customerId); - return authResult; } } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java index 5f92de268e..dcfc930aad 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java @@ -130,4 +130,13 @@ public class ExternalAppServiceImpl implements ExternalAppService { return new PageData<>(list, pageInfo.getTotal()); } + @Override + public String resetSecret(String appId) { + String secret = genSecret(); + if (externalAppSecretDao.updateSecret(appId, secret) > 0) { + return secret; + } + return null; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppAuthProcessor.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppAuthProcessor.java new file mode 100644 index 0000000000..b0f5fef000 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppAuthProcessor.java @@ -0,0 +1,73 @@ +package com.epmet.utils.externalapp; + +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dao.ExternalAppSecretDao; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import com.epmet.entity.ExternalAppSecretEntity; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; + + +/** + * 外部应用认证处理器父类 + */ +public abstract class ExtAppAuthProcessor { + + @Autowired + private RedisUtils redisUtils; + + @Autowired + private ExternalAppSecretDao externalAppSecretDao; + + private int diffMillins = 1000 * 60 * 5; + + public abstract ExternalAppAuthResultDTO auth(String appId, String token, Long ts); + + /** + * 通过APP ID查询对应的秘钥 + * @param appId + * @return + */ + public String getTokenByAppId(String appId) { + String secret = (String)redisUtils.get(RedisKeys.getExternalAppSecretKey(appId)); + if (StringUtils.isBlank(secret)) { + ExternalAppSecretEntity secretEntity = externalAppSecretDao.getSecretsByAppId(appId); + if (secretEntity == null) { + return null; + } + secret = secretEntity.getSecret(); + redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret); + } + return secret; + } + + /** + * 时间戳校验 + * @param timestamp + * @return + */ + protected boolean validTimeStamp(Long timestamp) { + long now = System.currentTimeMillis(); + if (Math.abs(now - timestamp) > diffMillins) { + return false; + } + return true; + } + + /** + * 封装结果 + * @param result + * @param message + * @param customerId + * @return + */ + public ExternalAppAuthResultDTO fillAuthResult(Boolean result, String message, String customerId) { + ExternalAppAuthResultDTO authResult = new ExternalAppAuthResultDTO(); + authResult.setSuccess(result); + authResult.setMessage(message); + authResult.setCustomerId(customerId); + return authResult; + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtAuthProcessor.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtAuthProcessor.java new file mode 100644 index 0000000000..2ec771fd02 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtAuthProcessor.java @@ -0,0 +1,61 @@ +package com.epmet.utils.externalapp; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import io.jsonwebtoken.Claims; +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.Component; + +/** + * jwt 认证处理器 + */ +@Component +public class ExtAppJwtAuthProcessor extends ExtAppAuthProcessor { + + private static Logger logger = LoggerFactory.getLogger(ExtAppJwtAuthProcessor.class); + + @Autowired + private ExtAppJwtTokenUtils jwtTokenUtils; + + public ExternalAppAuthResultDTO auth(String appId, String token, Long ts) { + String secret; + if (StringUtils.isBlank(secret = getTokenByAppId(appId))) { + return fillAuthResult(false, String.format("根据AppId:%s没有找到对应的秘钥", appId), null); + } + + Claims claim; + try { + claim = jwtTokenUtils.getClaimByToken(token, secret); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error("解析token失败:{}", errorStackTrace); + return fillAuthResult(false, "解析token失败", null); + } + + String appIdIn = (String)claim.get("appId"); + String customerId = (String)claim.get("customerId"); + Long timestamp = (Long)claim.get("ts"); + + //校验时间戳,允许5分钟误差 + if (StringUtils.isAnyBlank(appIdIn, customerId) || timestamp == null) { + logger.error("access token不完整。{},{},{}", appIdIn, customerId, timestamp); + return fillAuthResult(false, "access token不完整。", null); + } + + // TODO 暂时去掉时间差判断 + //if (!validTimeStamp(timestamp)) { + // logger.error("服务器存在时差过大,请求被拒绝"); + // return fillAuthResult(false, "服务器存在时差过大,请求被拒绝", null); + //} + + if (!appId.equals(appIdIn)) { + logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn); + return fillAuthResult(false, "Header中的AppId不匹配", null); + } + + return fillAuthResult(true, "解析成功,认证成功", customerId); + } +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 1c3a326c75..2e49c80102 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -75,11 +75,13 @@ public class ExtAppJwtTokenUtils { public static void genToken() { HashMap claim = new HashMap<>(); - claim.put("appId", "227fb75ae4baa820755aaf43bf7f0a69"); + claim.put("appId", "2c448b7da527055fbeebb628f8d3dcb0"); claim.put("customerId", "c1"); - claim.put("ts", System.currentTimeMillis() - 1000 * 60 * 4); + long ts = System.currentTimeMillis() - 1000 * 60 * 4; + System.out.println("时间戳:" + ts); + claim.put("ts", ts); - String abc = new ExtAppJwtTokenUtils().createToken(claim, "4a762660254c57996343f8ee42fbc0a6"); + String abc = new ExtAppJwtTokenUtils().createToken(claim, "d4b73db4cf8e46ef99fa1f95149c2791ef2396fded114dd09e406cbce83fc88a"); System.out.println(abc); } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppMD5AuthProcessor.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppMD5AuthProcessor.java new file mode 100644 index 0000000000..3954738758 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppMD5AuthProcessor.java @@ -0,0 +1,42 @@ +package com.epmet.utils.externalapp; + +import com.epmet.commons.tools.utils.Md5Util; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +/** + * md5 认证处理器 + */ +@Component +public class ExtAppMD5AuthProcessor extends ExtAppAuthProcessor { + + private static Logger logger = LoggerFactory.getLogger(ExtAppMD5AuthProcessor.class); + + public ExternalAppAuthResultDTO auth(String appId, String token, Long ts) { + if (ts == null) { + return fillAuthResult(false, "需要传入时间戳参数", null); + } + String secret; + if (StringUtils.isBlank(secret = getTokenByAppId(appId))) { + return fillAuthResult(false, String.format("根据AppId:%s没有找到对应的秘钥", appId), null); + } + + String localDigest = Md5Util.md5(secret.concat(":") + ts); + if (!localDigest.equals(token)) { + // 调用方生成的摘要跟本地生成的摘要不匹配 + return fillAuthResult(false, "签名不匹配,认证失败", null); + } + + // TODO 暂时去掉时间差判断 + //if (!validTimeStamp(ts)) { + // logger.error("服务器存在时差过大,请求被拒绝"); + // return fillAuthResult(false, "服务器存在时差过大,请求被拒绝", null); + //} + + return fillAuthResult(true, "签名匹配,认证成功", null); + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.3__extApp.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.3__extApp.sql new file mode 100644 index 0000000000..8faeaf51f9 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.3__extApp.sql @@ -0,0 +1,56 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +CREATE TABLE `external_app` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `APP_NAME` varchar(64) NOT NULL COMMENT 'APP名字', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `DEL_FLAG` tinyint(1) DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', + `REVISION` int(10) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) DEFAULT NULL COMMENT '创建者id', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) DEFAULT NULL COMMENT '更新者id', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='外部应用列表'; + +CREATE TABLE `external_app_secret` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `APP_ID` varchar(64) NOT NULL COMMENT 'APP ID', + `SECRET` varchar(255) NOT NULL COMMENT '秘钥', + `DEL_FLAG` tinyint(1) DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', + `REVISION` int(10) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) DEFAULT NULL COMMENT '创建者id', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) DEFAULT NULL COMMENT '更新者id', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='外部应用秘钥列表'; + +CREATE TABLE `external_customer` ( + `ID` varchar(64) NOT NULL COMMENT '客户ID', + `CUSTOMER_NAME` varchar(255) NOT NULL COMMENT '客户名称', + `DEL_FLAG` tinyint(1) DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', + `REVISION` int(10) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) DEFAULT NULL COMMENT '创建者id', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) DEFAULT NULL COMMENT '更新者id', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +BEGIN; +INSERT INTO `external_app` VALUES ('227fb75ae4baa820755aaf43bf7f0a69', '便捷通行', '7e07311f4c4a56c65fa1dd5d16e0b743', 0, 0, 'wxz', '2020-08-18 13:39:32', 'wxz', '2020-08-18 13:39:37'); +INSERT INTO `external_app` VALUES ('acc4ad66c82a7b46e741364b4c62dce2', '市北大屏', 'b09527201c4409e19d1dbc5e3c3429a1', 0, 0, 'wxz', '2020-08-18 13:39:32', 'wxz', '2020-08-18 13:39:37'); +INSERT INTO `external_app` VALUES ('dbfad3110c124c89948d16e8b06a8888', '数据采集', 'b09527201c4409e19d1dbc5e3c3429a1', 0, 0, 'wxz', '2020-08-18 13:39:32', 'wxz', '2020-08-18 13:39:37'); + +INSERT INTO `external_app_secret` VALUES ('44ed58fd256ae51b473b6ff8555c7131', '227fb75ae4baa820755aaf43bf7f0a69', 'a44a4fc41eb513cd93a0f957db3ef764e189e6aebb2369471396a8c3b32f61ed', 0, 0, 'wxz', '2020-08-18 13:40:03', 'xz', '2020-08-18 13:40:07'); +INSERT INTO `external_app_secret` VALUES ('95d16f5fe76d1139023107476871a077', 'dbfad3110c124c89948d16e8b06a8888', '0f7e983b017ac180b0da1877abe11bab22ab6288580e64d39b5e415dbb0fcc8f', 0, 0, 'wxz', '2020-08-18 13:40:03', 'xz', '2020-08-18 13:40:07'); +INSERT INTO `external_app_secret` VALUES ('9ca67b7b02dc2e80e9ba6ba4793aea54', 'acc4ad66c82a7b46e741364b4c62dce2', '612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970', 0, 0, 'wxz', '2020-08-18 13:40:03', 'xz', '2020-08-18 13:40:07'); + +INSERT INTO `external_customer` VALUES ('7e07311f4c4a56c65fa1dd5d16e0b743', '外挂功能', 0, 0, 'wxz', '2020-08-19 14:21:52', 'APP_USER', '2020-08-21 15:23:35'); +INSERT INTO `external_customer` VALUES ('b09527201c4409e19d1dbc5e3c3429a1', '市北党建', 0, 0, 'wxz', '2020-08-19 14:21:52', 'wxz', '2020-08-19 14:21:58'); + +COMMIT; + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml index e207a36013..995dbd0270 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml @@ -15,6 +15,13 @@ + + + update external_app_secret + set SECRET=#{secret} + where ID = #{appId} + + + diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index bf1f32b69b..b9b3cde204 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -203,8 +203,8 @@ 123456 true - 192.168.1.130:8848 - 6ceab336-d004-4acf-89c6-e121d06f4988 + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b false diff --git a/epmet-module/gov-access/gov-access-client/pom.xml b/epmet-module/gov-access/gov-access-client/pom.xml index b20a28582a..a0cf511f5f 100644 --- a/epmet-module/gov-access/gov-access-client/pom.xml +++ b/epmet-module/gov-access/gov-access-client/pom.xml @@ -17,5 +17,11 @@ epmet-commons-tools 2.0.0 + + io.swagger + swagger-annotations + 1.5.20 + compile + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovLanguageDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovLanguageDTO.java new file mode 100644 index 0000000000..ed7f5924db --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovLanguageDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 国际化 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovLanguageDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 表名 + */ + private String tableName; + + /** + * 表主键 + */ + private String tableId; + + /** + * 字段名 + */ + private String fieldName; + + /** + * 字段值 + */ + private String fieldValue; + + /** + * 语言 + */ + private String language; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java new file mode 100644 index 0000000000..fb130e9c65 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.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.dto; + +import com.epmet.commons.tools.utils.TreeStringNode; +import com.epmet.dto.result.MenuResourceDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 菜单管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovMenuDTO extends TreeStringNode implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 上级ID,一级菜单为0 + */ + private String pid; + + /** + * 菜单名称 + */ + private String name; + + /** + * 菜单URL + */ + private String url; + + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 权限标识,如:sys:menu:save + */ + private String permissions; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 菜单资源 + */ + private List resourceList; + + /** + * 上级菜单名称 + */ + private String parentName; + + /** + * 是否显示,1:显示 0不显示 + */ + private Integer showFlag; +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovResourceDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovResourceDTO.java new file mode 100644 index 0000000000..59a9576598 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovResourceDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovResourceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 资源编码,如菜单ID + */ + private String resourceCode; + + /** + * 资源名称 + */ + private String resourceName; + + /** + * 资源URL + */ + private String resourceUrl; + + /** + * 请求方式(如:GET、POST、PUT、DELETE) + */ + private String resourceMethod; + + /** + * 菜单标识 0:非菜单资源 1:菜单资源 + */ + private Integer menuFlag; + + /** + * 认证等级 0:权限认证 1:登录认证 2:无需认证 + */ + private Integer authLevel; + + /** + * 删除标识: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-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleDTO.java new file mode 100644 index 0000000000..efe6643df6 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleDTO.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; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 角色管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 角色名称 + */ + private String name; + + /** + * 备注 + */ + private String remark; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 菜单ID列表 + */ + private List menuIdList; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleMenuDTO.java new file mode 100644 index 0000000000..eacde30cf3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleMenuDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 角色菜单关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovRoleMenuDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 菜单ID + */ + private String menuId; + + /** + * 删除标识: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-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleUserDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleUserDTO.java new file mode 100644 index 0000000000..d3881edeb2 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleUserDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 角色用户关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovRoleUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 用户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-access/gov-access-client/src/main/java/com/epmet/dto/result/MenuResourceDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/MenuResourceDTO.java new file mode 100644 index 0000000000..86df7d55ca --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/MenuResourceDTO.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dto.result; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 菜单资源 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "菜单资源") +public class MenuResourceDTO { + @ApiModelProperty(value = "资源URL") + private String resourceUrl; + @ApiModelProperty(value = "请求方式(如:GET、POST、PUT、DELETE)") + private String resourceMethod; + +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuFlagEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuFlagEnum.java new file mode 100644 index 0000000000..2a880a728a --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuFlagEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 菜单资源标识 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum MenuFlagEnum { + /** + * 菜单资源 + */ + YES(1), + /** + * 非菜单资源 + */ + NO(0); + + private int value; + + MenuFlagEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuTypeEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuTypeEnum.java new file mode 100644 index 0000000000..7132fa2ce3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuTypeEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 菜单类型枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum MenuTypeEnum { + /** + * 菜单 + */ + MENU(0), + /** + * 按钮 + */ + BUTTON(1); + + private int value; + + MenuTypeEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLeafEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLeafEnum.java new file mode 100644 index 0000000000..36300e201f --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLeafEnum.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 叶子节点枚举 + * + * @author Mark sunlightcs@gmail.com + */ +public enum RegionLeafEnum { + YES(1), + NO(0); + + private int value; + + RegionLeafEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLevelEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLevelEnum.java new file mode 100644 index 0000000000..b29c456897 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLevelEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 行政区域 级别枚举 + * + * @author Mark sunlightcs@gmail.com + */ +public enum RegionLevelEnum { + ONE(1), + TWO(2), + THREE(3); + + private int value; + + RegionLevelEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/UserStatusEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/UserStatusEnum.java new file mode 100644 index 0000000000..dbc043f529 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/UserStatusEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 用户状态 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum UserStatusEnum { + DISABLE(0), + ENABLED(1); + + private int value; + + UserStatusEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovLanguageController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovLanguageController.java new file mode 100644 index 0000000000..85e8bce73d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovLanguageController.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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GovLanguageDTO; +import com.epmet.service.GovLanguageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 国际化 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@RestController +@RequestMapping("operlanguage") +public class GovLanguageController { + + @Autowired + private GovLanguageService govLanguageService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govLanguageService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovLanguageDTO data = govLanguageService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovLanguageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govLanguageService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovLanguageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govLanguageService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govLanguageService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java new file mode 100644 index 0000000000..d3a67c889f --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java @@ -0,0 +1,156 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.ErrorCode; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GovMenuDTO; +import com.epmet.dto.result.MenuResourceDTO; +import com.epmet.service.GovMenuService; +import com.epmet.service.GovResourceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * + * 菜单管理 + * + * @author zhaoqifeng + * @date 2020/3/17 16:35 + */ +@RestController +@RequestMapping("menu") +public class GovMenuController { + + @Autowired + private GovMenuService govMenuService; + + @Autowired + private GovResourceService govResourceService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovMenuDTO data = govMenuService.get(id); + + //菜单资源列表 + List resourceList = govResourceService.getMenuResourceList(id); + + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovMenuDTO dto, @LoginUser TokenDto tokenDto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govMenuService.save(dto,tokenDto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovMenuDTO dto, @LoginUser TokenDto tokenDto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govMenuService.update(dto,tokenDto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govMenuService.delete(ids); + return new Result(); + } + + @DeleteMapping("{id}") + public Result delete(@PathVariable("id") String id, @LoginUser TokenDto tokenDto){ + //效验数据 + AssertUtils.isNull(id, "id"); + + //判断是否有子菜单或按钮 + List list = govMenuService.getListPid(id); + if(list.size() > 0){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + + govMenuService.delete(id, tokenDto); + + return new Result(); + } + + + /** + * 获取菜单列表 + * @param type 类型 + * @return Result> + */ + @GetMapping("list") + public Result> list(Integer type){ + List list = govMenuService.getMenuList(type); + + return new Result>().ok(list); + } + + /** + * 导航 + * @param tokenDto token + * @return List + */ + @GetMapping("nav") + public Result> nav(@LoginUser TokenDto tokenDto){ + List list = govMenuService.getUserMenuNavList(tokenDto); + return new Result>().ok(list); + } + + /** + * 权限标识 + * @param tokenDto token + * @return Set + */ + @GetMapping("permissions") + public Result> permissions(@LoginUser TokenDto tokenDto){ + Set set = govMenuService.getUserPermissions(tokenDto); + return new Result>().ok(set); + } + + /** + * 角色菜单权限 + * @param tokenDto token + * @return + */ + @GetMapping("select") + public Result> select(@LoginUser TokenDto tokenDto){ + List list = govMenuService.getUserMenuList(tokenDto, null); + + return new Result>().ok(list); + } + + /** + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 运营端用户退出系统,清空菜单和操作权限 + * @Date 2020/5/21 18:07 + **/ + @GetMapping("cleargovuseraccess") + public Result clearGovUserAccess(@LoginUser TokenDto tokenDto) { + govMenuService.clearOperUserAccess(tokenDto.getApp(), tokenDto.getClient(), tokenDto.getUserId()); + return new Result(); + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovResourceController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovResourceController.java new file mode 100644 index 0000000000..72193db454 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovResourceController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GovResourceDTO; +import com.epmet.service.GovResourceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@RestController +@RequestMapping("govresource") +public class GovResourceController { + + @Autowired + private GovResourceService govResourceService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govResourceService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovResourceDTO data = govResourceService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovResourceDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govResourceService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovResourceDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govResourceService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govResourceService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java new file mode 100644 index 0000000000..7a1ded893c --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GovRoleDTO; +import com.epmet.service.GovRoleMenuService; +import com.epmet.service.GovRoleService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 角色管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@RestController +@RequestMapping("govrole") +public class GovRoleController { + + @Autowired + private GovRoleService govRoleService; + @Autowired + private GovRoleMenuService govRoleMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govRoleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovRoleDTO data = govRoleService.get(id); + + //查询角色对应的菜单 + List menuIdList = govRoleMenuService.getMenuIdList(id); + data.setMenuIdList(menuIdList); + + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govRoleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govRoleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govRoleService.delete(ids); + return new Result(); + } + + + @GetMapping("list") + @ApiOperation("列表") + public Result> list(){ + List data = govRoleService.list(new HashMap<>(1)); + + return new Result>().ok(data); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleMenuController.java new file mode 100644 index 0000000000..8b8a7d8aed --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleMenuController.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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GovRoleMenuDTO; +import com.epmet.service.GovRoleMenuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 角色菜单关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@RestController +@RequestMapping("govrolemenu") +public class GovRoleMenuController { + + @Autowired + private GovRoleMenuService govRoleMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govRoleMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovRoleMenuDTO data = govRoleMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovRoleMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govRoleMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovRoleMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govRoleMenuService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govRoleMenuService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleUserController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleUserController.java new file mode 100644 index 0000000000..fcd5733a4d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleUserController.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.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GovRoleUserDTO; +import com.epmet.service.GovRoleUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 角色用户关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@RestController +@RequestMapping("govroleuser") +public class GovRoleUserController { + + @Autowired + private GovRoleUserService govRoleUserService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govRoleUserService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovRoleUserDTO data = govRoleUserService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovRoleUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govRoleUserService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovRoleUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govRoleUserService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govRoleUserService.delete(ids); + return new Result(); + } + + + /** + * 获取权限id列表 + * @param id 用户id + * @return List + * @author zhaoqifeng + */ + @GetMapping("getRoleIdList/{id}") + public Result>getRoleIdList(@PathVariable("id") String id) { + List list = govRoleUserService.getRoleIdList(id); + return new Result>().ok(list); + } + + /** + * 保存更新权限 + * @param userId 用户id + * @param roleIdList 权限列表 + * @author zhaoqifeng + */ + @PostMapping("saveOrUpdateRole") + public Result saveOrUpdate(@RequestParam("userId") String userId, @RequestBody List roleIdList) { + govRoleUserService.saveOrUpdate(userId, roleIdList); + return new Result(); + } + + /** + * 根据用户id,删除角色用户关系 + * @param id 用户id + * @return Result + */ + @PostMapping("deleteByUserId") + public Result deleteByUserId(String id) { + govRoleUserService.deleteByUserId(id); + return new Result(); + } + + /** + * 根据用户ids,删除角色用户关系 + * @param ids 用户ids + * @return Result + */ + @PostMapping("deleteByUserIds") + public Result deleteByUserIds(@RequestBody String[] ids) { + govRoleUserService.deleteByUserIds(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovLanguageDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovLanguageDao.java new file mode 100644 index 0000000000..acd505c019 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovLanguageDao.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovLanguageEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface GovLanguageDao extends BaseDao { + + GovLanguageEntity getLanguage(GovLanguageEntity entity); + + void updateLanguage(GovLanguageEntity entity); + + void insertOperLanguageEntity(GovLanguageEntity entity); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java new file mode 100644 index 0000000000..1e36bff758 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovMenuDao extends BaseDao { + + GovMenuEntity getById(@Param("id") String id, @Param("language") String language); + + /** + * 查询所有菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + */ + List getMenuList(@Param("type") Integer type, @Param("language") String language); + + /** + * 查询用户菜单列表 + * + * @param userId 用户ID + * @param type 菜单类型 + * @param language 语言 + */ + List getUserMenuList(@Param("userId") String userId, @Param("type") Integer type, @Param("language") String language); + + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(String pid); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovResourceDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovResourceDao.java new file mode 100644 index 0000000000..4970d56e9c --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovResourceDao.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovResourceEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovResourceDao extends BaseDao { + /** + * 根据资源编码,删除对应的资源 + * @param code 资源编码 + */ + void deleteByCode(String code); + + /** + * 获取资源列表 + * @param menuId 菜单ID + */ + List getMenuResourceList(String menuId); + + /** + * 获取所有资源列表 + */ + List getResourceList(); + + /** + * 获取用户资源列表 + * @param userId 用户ID + */ + List getUserResourceList(@Param("userId") String userId); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java new file mode 100644 index 0000000000..768fc42792 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovRoleDao extends BaseDao { + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleMenuDao.java new file mode 100644 index 0000000000..dc0559acb3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleMenuDao.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovRoleMenuDao extends BaseDao { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(String roleId); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleId 角色id + */ + void deleteByRoleId(String roleId); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(String menuId); + + + /** + * 根据角色ids,删除角色菜单关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(String[] roleIds); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleUserDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleUserDao.java new file mode 100644 index 0000000000..bf400e0584 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleUserDao.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovRoleUserEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovRoleUserDao extends BaseDao { + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(String[] roleIds); + + /** + * 根据用户ids,删除角色用户关系 + * @param userIds 用户ids + */ + void deleteByUserIds(String[] userIds); + + /** + * 根据角色id,删除角色用户关系 + * @param roleId 角色id + */ + void deleteByRoleId(String roleId); + + /** + * 根据用户id,删除角色用户关系 + * @param userId 用户id + */ + void deleteByUserId(String userId); + + /** + * 角色ID列表 + * @param userId 用户ID + * + * @return + */ + List getRoleIdList(String userId); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovLanguageEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovLanguageEntity.java new file mode 100644 index 0000000000..ee84f846d9 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovLanguageEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_language") +public class GovLanguageEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 表名 + */ + private String tableName; + /** + * 表主键 + */ + private String tableId; + /** + * 字段名 + */ + private String fieldName; + /** + * 字段值 + */ + private String fieldValue; + /** + * 语言 + */ + private String language; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java new file mode 100644 index 0000000000..fcb8a5fa38 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_menu") +public class GovMenuEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + + /** + * 上级ID,一级菜单为0 + */ + private String pid; + /** + * 菜单名称 + */ + @TableField(exist = false) + private String name; + /** + * 菜单URL + */ + private String url; + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + /** + * 菜单图标 + */ + private String icon; + /** + * 权限标识,如:sys:menu:save + */ + private String permissions; + /** + * 排序 + */ + private Integer sort; + /** + * 上级菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 是否显示,1:显示 0不显示 + */ + private Integer showFlag; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovResourceEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovResourceEntity.java new file mode 100644 index 0000000000..1d5d716c22 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovResourceEntity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_resource") +public class GovResourceEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + + /** + * 资源编码,如菜单ID + */ + private String resourceCode; + /** + * 资源名称 + */ + private String resourceName; + /** + * 资源URL + */ + private String resourceUrl; + /** + * 请求方式(如:GET、POST、PUT、DELETE) + */ + private String resourceMethod; + /** + * 菜单标识 0:非菜单资源 1:菜单资源 + */ + private Integer menuFlag; + /** + * 认证等级 0:权限认证 1:登录认证 2:无需认证 + */ + private Integer authLevel; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleEntity.java new file mode 100644 index 0000000000..4bc4575836 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleEntity.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_role") +public class GovRoleEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色名称 + */ + private String name; + /** + * 备注 + */ + private String remark; + /** + * 部门ID + */ + @TableField(fill = FieldFill.INSERT) + private Long deptId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleMenuEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleMenuEntity.java new file mode 100644 index 0000000000..6ea4d1f2a5 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleMenuEntity.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_role_menu") +public class GovRoleMenuEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + /** + * 角色ID + */ + private String roleId; + /** + * 菜单ID + */ + private String menuId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleUserEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleUserEntity.java new file mode 100644 index 0000000000..599ca7f3e2 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleUserEntity.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_role_user") +public class GovRoleUserEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private String roleId; + /** + * 用户ID + */ + private String userId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index eaabe43f49..d88b8358a3 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.OperUserDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; @@ -60,5 +61,17 @@ public interface EpmetUserFeignClient { */ @PostMapping("/epmetuser/staffrole/staffroles") Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); + + /** + * + * 根据id查询运营人员详情 + * + * @param operUserId oper_user表主键 + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/3/19 09:28 + **/ + @GetMapping("/operuser/queryOperUserDtoById/{operUserId}") + Result info(@PathVariable("operUserId") String operUserId); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 12a4b4e6c6..cd39c87452 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -5,6 +5,7 @@ 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.GovStaffRoleDTO; +import com.epmet.dto.OperUserDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; @@ -31,6 +32,12 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { public Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRolesOfStaff"); } + + @Override + public Result info(String operUserId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "info", operUserId); + } + @Override public Result getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffLatestGrid",latestGridFormDTO); diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovLanguageRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovLanguageRedis.java new file mode 100644 index 0000000000..8f9595582b --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovLanguageRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 国际化 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Component +public class GovLanguageRedis { + @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-access/gov-access-server/src/main/java/com/epmet/redis/GovMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovMenuRedis.java new file mode 100644 index 0000000000..361d6c3014 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovMenuRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.HttpContextUtils; +import com.epmet.dto.GovMenuDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Set; + +/** + * 菜单管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Component +public class GovMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(String userId, String app, String client) { + redisUtils.deleteByPattern(RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage())); + redisUtils.delete(RedisKeys.getUserPermissionsKey(userId, app, client)); + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + + public void setUserMenuNavList(String userId, String app, String client, List menuList){ + String key = RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage()); + redisUtils.set(key, menuList); + } + + public List getUserMenuNavList(String userId, String app, String client){ + String key = RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage()); + return (List)redisUtils.get(key); + } + + public void setUserPermissions(String userId, String app, String client, Set permsSet){ + String key = RedisKeys.getUserPermissionsKey(userId, app, client); + redisUtils.set(key, permsSet); + } + + public Set getUserPermissions(String userId, String app, String client){ + String key = RedisKeys.getUserPermissionsKey(userId, app, client); + return (Set)redisUtils.get(key); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovResourceRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovResourceRedis.java new file mode 100644 index 0000000000..e21bd5095c --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovResourceRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Component +public class GovResourceRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete() { + String key = RedisKeys.getSysResourceKey(); + + redisUtils.delete(key); + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleMenuRedis.java new file mode 100644 index 0000000000..c778d22c7d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色菜单关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Component +public class GovRoleMenuRedis { + @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-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleRedis.java new file mode 100644 index 0000000000..3e87e447dd --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Component +public class GovRoleRedis { + @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-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleUserRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleUserRedis.java new file mode 100644 index 0000000000..7a7aad6c8c --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleUserRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 角色用户关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Component +public class GovRoleUserRedis { + @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-access/gov-access-server/src/main/java/com/epmet/service/GovLanguageService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovLanguageService.java new file mode 100644 index 0000000000..1f4a5e65e3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovLanguageService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovLanguageDTO; +import com.epmet.entity.GovLanguageEntity; + +import java.util.List; +import java.util.Map; + +/** + * 国际化 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovLanguageService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovLanguageDTO + * @author generator + * @date 2020-03-18 + */ + GovLanguageDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovLanguageDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovLanguageDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 保存或更新 + * @param tableName 表名 + * @param tableId 表主键 + * @param fieldName 字段名 + * @param fieldValue 字段值 + * @param language 语言 + */ + void saveOrUpdate(String tableName, String tableId, String fieldName, String fieldValue, String language); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java new file mode 100644 index 0000000000..b5c0cf12a3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java @@ -0,0 +1,144 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +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.GovMenuDTO; +import com.epmet.entity.GovMenuEntity; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 菜单管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovMenuDTO + * @author generator + * @date 2020-03-18 + */ + GovMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovMenuDTO dto, TokenDto tokenDto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovMenuDTO dto, TokenDto tokenDto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 删除 + * + * @param id id + * @author generator + * @date 2020-03-18 + */ + void delete(String id, TokenDto tokenDto); + + /** + * 用户菜单列表 + * + * @param tokenDto 用户信息 + * @param type 菜单类型 + * @return java.util.List + */ + List getUserMenuList(TokenDto tokenDto, Integer type); + + /** + * 菜单列表 + * + * @param type 菜单类型 + */ + List getMenuList(Integer type); + + /** + * 用户菜单导航 + * @param tokenDto 用户信息 + * @return java.util.List + */ + List getUserMenuNavList(TokenDto tokenDto); + + /** + * 获取用户权限标识 + * @param tokenDto 用户信息 + * @return java.util.Set + */ + Set getUserPermissions(TokenDto tokenDto); + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(String pid); + + void clearOperUserAccess(String app, String client, String userId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovResourceService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovResourceService.java new file mode 100644 index 0000000000..8b6b8f5e6d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovResourceService.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovResourceDTO; +import com.epmet.dto.result.MenuResourceDTO; +import com.epmet.entity.GovResourceEntity; + +import java.util.List; +import java.util.Map; + +/** + * 资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovResourceService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovResourceDTO + * @author generator + * @date 2020-03-18 + */ + GovResourceDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovResourceDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovResourceDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 保存菜单资源 + * @param menuId 菜单ID + * @param menuName 菜单名称 + * @param resourceList 资源列表 + */ + void saveMenuResource(String menuId, String menuName, List resourceList); + + /** + * 获取菜单资源列表 + * @param menuId 菜单ID + */ + List getMenuResourceList(String menuId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleMenuService.java new file mode 100644 index 0000000000..7b0d2af34a --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleMenuService.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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovRoleMenuDTO; +import com.epmet.entity.GovRoleMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色菜单关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovRoleMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovRoleMenuDTO + * @author generator + * @date 2020-03-18 + */ + GovRoleMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovRoleMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovRoleMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(String roleId); + + /** + * 保存或修改 + * @param roleId 角色ID + * @param menuIdList 菜单ID列表 + */ + void saveOrUpdate(String roleId, List menuIdList); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleId 角色id + */ + void deleteByRoleId(String roleId); + + /** + * 根据角色ids,删除角色菜单关系 + * @param roleIds + */ + void deleteByRoleIds(String[] roleIds); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(String menuId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java new file mode 100644 index 0000000000..4fbf7e0f58 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.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.GovRoleDTO; +import com.epmet.entity.GovRoleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovRoleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovRoleDTO + * @author generator + * @date 2020-03-18 + */ + GovRoleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovRoleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovRoleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleUserService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleUserService.java new file mode 100644 index 0000000000..ff67c7d239 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleUserService.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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovRoleUserDTO; +import com.epmet.entity.GovRoleUserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色用户关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovRoleUserService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovRoleUserDTO + * @author generator + * @date 2020-03-18 + */ + GovRoleUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovRoleUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovRoleUserDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 保存或修改 + * @param userId 用户ID + * @param roleIdList 角色ID列表 + */ + void saveOrUpdate(String userId, List roleIdList); + + /** + * 根据角色id,删除角色用户关系 + * @param roleId 角色id + */ + void deleteByRoleId(String roleId); + + /** + * 根据用户id,删除角色用户关系 + * @param userId 用户id + */ + void deleteByUserId(String userId); + + /** + * 角色ID列表 + * @param userId 用户ID + * @return List + */ + List getRoleIdList(String userId); + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(String[] roleIds); + + /** + * 根据用户ids,删除角色用户关系 + * @param userIds 用户ids + */ + void deleteByUserIds(String[] userIds); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovLanguageServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovLanguageServiceImpl.java new file mode 100644 index 0000000000..43e21684ef --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovLanguageServiceImpl.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.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.GovLanguageDao; +import com.epmet.dto.GovLanguageDTO; +import com.epmet.entity.GovLanguageEntity; +import com.epmet.redis.GovLanguageRedis; +import com.epmet.service.GovLanguageService; +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-03-18 + */ +@Service +public class GovLanguageServiceImpl extends BaseServiceImpl implements GovLanguageService { + + @Autowired + private GovLanguageRedis govLanguageRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovLanguageDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovLanguageDTO.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 GovLanguageDTO get(String id) { + GovLanguageEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovLanguageDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovLanguageDTO dto) { + GovLanguageEntity entity = ConvertUtils.sourceToTarget(dto, GovLanguageEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovLanguageDTO dto) { + GovLanguageEntity entity = ConvertUtils.sourceToTarget(dto, GovLanguageEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void saveOrUpdate(String tableName, String tableId, String fieldName, String fieldValue, String language) { + GovLanguageEntity entity = new GovLanguageEntity(); + entity.setTableName(tableName); + entity.setTableId(tableId); + entity.setFieldName(fieldName); + entity.setFieldValue(fieldValue); + entity.setLanguage(language); + + //判断是否有数据 + if(baseDao.getLanguage(entity) == null){ + baseDao.insertOperLanguageEntity(entity); + }else { + baseDao.updateLanguage(entity); + } + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java new file mode 100644 index 0000000000..5a6efd43f2 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -0,0 +1,247 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.Constant; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.ErrorCode; +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.HttpContextUtils; +import com.epmet.commons.tools.utils.TreeUtils; +import com.epmet.dao.GovMenuDao; +import com.epmet.dto.GovMenuDTO; +import com.epmet.entity.GovMenuEntity; +import com.epmet.enums.MenuTypeEnum; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.redis.GovMenuRedis; +import com.epmet.service.GovLanguageService; +import com.epmet.service.GovMenuService; +import com.epmet.service.GovResourceService; +import com.epmet.service.GovRoleMenuService; +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-03-18 + */ +@Service +public class GovMenuServiceImpl extends BaseServiceImpl implements GovMenuService { + protected Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private GovMenuRedis govMenuRedis; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private GovRoleMenuService govRoleMenuService; + @Autowired + private GovResourceService govResourceService; + @Autowired + private GovLanguageService govLanguageService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovMenuDTO.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 GovMenuDTO get(String id) { + GovMenuEntity entity = baseDao.getById(id, HttpContextUtils.getLanguage()); + + return ConvertUtils.sourceToTarget(entity, GovMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovMenuDTO dto, TokenDto tokenDto) { + GovMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovMenuEntity.class); + + //保存菜单 + insert(entity); + saveLanguage(entity.getId(), "name", entity.getName()); + + //保存菜单资源 + govResourceService.saveMenuResource(entity.getId(), entity.getName(), dto.getResourceList()); + + //清空当前用户,菜单导航、权限标识 + govMenuRedis.delete(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovMenuDTO dto, TokenDto tokenDto) { + GovMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovMenuEntity.class); + + //上级菜单不能为自身 + if(entity.getId().equals(entity.getPid())){ + throw new RenException(ErrorCode.SUPERIOR_MENU_ERROR); + } + + //更新菜单 + updateById(entity); + saveLanguage(entity.getId(), "name", entity.getName()); + + //更新菜单资源 + govResourceService.saveMenuResource(entity.getId(), entity.getName(), dto.getResourceList()); + + //清空当前用户,菜单导航、权限标识 + govMenuRedis.delete(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id, TokenDto tokenDto) { + //逻辑删除 + baseDao.deleteBatchIds(Collections.singletonList(id)); + //删除角色菜单关系 + govRoleMenuService.deleteByMenuId(id); + + //清空当前用户,菜单导航、权限标识 + govMenuRedis.delete(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + } + + @Override + public List getUserMenuList(TokenDto tokenDto, Integer type) { + List menuList; + +// Result govUserDTOResult = epmetUserFeignClient.info(tokenDto.getUserId()); + +// //系统管理员,拥有最高权限 +// if(govUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){ + menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); +// }else { +// menuList = baseDao.getUserMenuList(tokenDto.getUserId(), type, HttpContextUtils.getLanguage()); +// } + + List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); + + return TreeUtils.buildTree(dtoList); + } + + @Override + public List getMenuList(Integer type) { + List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + + List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); + + return TreeUtils.buildTree(dtoList, Constant.OPER_MENU_ROOT); + } + + @Override + public List getUserMenuNavList(TokenDto tokenDto) { + List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + if(menuList == null){ + menuList = getUserMenuList(tokenDto, MenuTypeEnum.MENU.value()); + + govMenuRedis.setUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), menuList); + } + + return menuList; + } + + @Override + public Set getUserPermissions(TokenDto tokenDto) { + //用户权限列表 + Set permsSet = govMenuRedis.getUserPermissions(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + if(permsSet != null){ + return permsSet; + } + +// Result govUserDTOResult = epmetUserFeignClient.info(tokenDto.getUserId()); + + //超级管理员,拥有最高权限 + List menuList; +// if(govUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){ + menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); +// }else{ +// menuList = baseDao.getUserMenuList(tokenDto.getUserId(), MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); +// } + + permsSet = new HashSet<>(); + for(GovMenuEntity menu : menuList){ + if(StringUtils.isNotBlank(menu.getPermissions())){ + permsSet.add(menu.getPermissions()); + } + } + + //保存到缓存 + govMenuRedis.setUserPermissions(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), permsSet); + + return permsSet; + } + + @Override + public List getListPid(String pid) { + List menuList = baseDao.getListPid(pid); + + return ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); + } + + @Override + public void clearOperUserAccess(String app, String client, String userId) { + //清空当前用户,菜单导航、权限标识 + govMenuRedis.delete(userId, app, client); + logger.info(String.format("运营端用户退出系统%s,清空菜单、权限成功",userId)); + } + + private void saveLanguage(String tableId, String fieldName, String fieldValue){ + govLanguageService.saveOrUpdate("gov_menu", tableId, fieldName, fieldValue, HttpContextUtils.getLanguage()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovResourceServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovResourceServiceImpl.java new file mode 100644 index 0000000000..2cb1da7087 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovResourceServiceImpl.java @@ -0,0 +1,143 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.enums.ResourceAuthEnum; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GovResourceDao; +import com.epmet.dto.GovResourceDTO; +import com.epmet.dto.result.MenuResourceDTO; +import com.epmet.entity.GovResourceEntity; +import com.epmet.enums.MenuFlagEnum; +import com.epmet.redis.GovResourceRedis; +import com.epmet.service.GovResourceService; +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-03-18 + */ +@Service +public class GovResourceServiceImpl extends BaseServiceImpl implements GovResourceService { + + @Autowired + private GovResourceRedis govResourceRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovResourceDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovResourceDTO.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 GovResourceDTO get(String id) { + GovResourceEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovResourceDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovResourceDTO dto) { + GovResourceEntity entity = ConvertUtils.sourceToTarget(dto, GovResourceEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovResourceDTO dto) { + GovResourceEntity entity = ConvertUtils.sourceToTarget(dto, GovResourceEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void saveMenuResource(String menuId, String menuName, List resourceList) { + //先删除菜单资源关系 + baseDao.deleteByCode(menuId+""); + + //删除缓存 + govResourceRedis.delete(); + + //菜单没有一个资源的情况 + if(CollUtil.isEmpty(resourceList)){ + return ; + } + + //保存菜单资源关系 + for(MenuResourceDTO dto : resourceList){ + GovResourceEntity entity = new GovResourceEntity(); + entity.setResourceCode(menuId+""); + entity.setResourceName(menuName); + entity.setResourceUrl(dto.getResourceUrl()); + entity.setResourceMethod(dto.getResourceMethod()); + entity.setAuthLevel(ResourceAuthEnum.PERMISSIONS_AUTH.value()); + entity.setMenuFlag(MenuFlagEnum.YES.value()); + + //保存 + insert(entity); + } + } + + @Override + public List getMenuResourceList(String menuId) { + List entityList = baseDao.getMenuResourceList(menuId+""); + + return ConvertUtils.sourceToTarget(entityList, MenuResourceDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleMenuServiceImpl.java new file mode 100644 index 0000000000..ec31c69146 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleMenuServiceImpl.java @@ -0,0 +1,150 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 cn.hutool.core.collection.CollUtil; +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.GovRoleMenuDao; +import com.epmet.dto.GovRoleMenuDTO; +import com.epmet.entity.GovRoleMenuEntity; +import com.epmet.redis.GovRoleMenuRedis; +import com.epmet.service.GovRoleMenuService; +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-03-18 + */ +@Service +public class GovRoleMenuServiceImpl extends BaseServiceImpl implements GovRoleMenuService { + + @Autowired + private GovRoleMenuRedis govRoleMenuRedis; + @Autowired + private GovRoleMenuDao govRoleMenuDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovRoleMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovRoleMenuDTO.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 GovRoleMenuDTO get(String id) { + GovRoleMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovRoleMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovRoleMenuDTO dto) { + GovRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleMenuEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovRoleMenuDTO dto) { + GovRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleMenuEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List getMenuIdList(String roleId){ + return baseDao.getMenuIdList(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(String roleId, List menuIdList) { + //先删除角色菜单关系 + deleteByRoleId(roleId); + + //角色没有一个菜单权限的情况 + if(CollUtil.isEmpty(menuIdList)){ + return ; + } + + //保存角色菜单关系 + for(String menuId : menuIdList){ + GovRoleMenuEntity govRoleMenuEntity = new GovRoleMenuEntity(); + govRoleMenuEntity.setMenuId(menuId); + govRoleMenuEntity.setRoleId(roleId); + + //保存 + insert(govRoleMenuEntity); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleId(String roleId) { + baseDao.deleteByRoleId(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleIds(String[] roleIds) { + govRoleMenuDao.deleteByRoleIds(roleIds); + } + + @Override + public void deleteByMenuId(String menuId) { + baseDao.deleteByMenuId(menuId); + } +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java new file mode 100644 index 0000000000..5810b420e5 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.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.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.GovRoleDao; +import com.epmet.dto.GovRoleDTO; +import com.epmet.entity.GovRoleEntity; +import com.epmet.redis.GovRoleRedis; +import com.epmet.service.GovRoleMenuService; +import com.epmet.service.GovRoleService; +import com.epmet.service.GovRoleUserService; +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-03-18 + */ +@Service +public class GovRoleServiceImpl extends BaseServiceImpl implements GovRoleService { + + @Autowired + private GovRoleRedis govRoleRedis; + @Autowired + private GovRoleMenuService govRoleMenuService; + @Autowired + private GovRoleUserService govRoleUserService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovRoleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovRoleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + String name = (String)params.get(FieldConstant.NAME_HUMP); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id).like(StringUtils.isNotBlank(name), FieldConstant.NAME, name); + + return wrapper; + } + + @Override + public GovRoleDTO get(String id) { + GovRoleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovRoleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovRoleDTO dto) { + GovRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleEntity.class); + insert(entity); + //保存角色菜单关系 + govRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovRoleDTO dto) { + GovRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleEntity.class); + updateById(entity); + //保存角色菜单关系 + govRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + + govRoleMenuService.deleteByRoleIds(ids); + + govRoleUserService.deleteByRoleIds(ids); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleUserServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleUserServiceImpl.java new file mode 100644 index 0000000000..21b796cc3b --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleUserServiceImpl.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.service.impl; + +import cn.hutool.core.collection.CollUtil; +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.GovRoleUserDao; +import com.epmet.dto.GovRoleUserDTO; +import com.epmet.entity.GovRoleUserEntity; +import com.epmet.redis.GovRoleUserRedis; +import com.epmet.service.GovRoleUserService; +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-03-18 + */ +@Service +public class GovRoleUserServiceImpl extends BaseServiceImpl implements GovRoleUserService { + + @Autowired + private GovRoleUserRedis govRoleUserRedis; + @Autowired + private GovRoleUserDao govRoleUserDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovRoleUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovRoleUserDTO.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 GovRoleUserDTO get(String id) { + GovRoleUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovRoleUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovRoleUserDTO dto) { + GovRoleUserEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovRoleUserDTO dto) { + GovRoleUserEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleUserEntity.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 saveOrUpdate(String userId, List roleIdList) { + //先删除角色用户关系 + deleteByUserId(userId); + + //用户没有一个角色权限的情况 + if(CollUtil.isEmpty(roleIdList)){ + return ; + } + + //保存角色用户关系 + for(String roleId : roleIdList){ + GovRoleUserEntity govRoleUserEntity = new GovRoleUserEntity(); + govRoleUserEntity.setUserId(userId); + govRoleUserEntity.setRoleId(roleId); + + //保存 + insert(govRoleUserEntity); + } + } + + @Override + public void deleteByRoleId(String roleId) { + govRoleUserDao.deleteByRoleId(roleId); + } + + @Override + public void deleteByUserId(String userId) { + govRoleUserDao.deleteByUserId(userId); + } + + @Override + public List getRoleIdList(String userId) { + + return baseDao.getRoleIdList(userId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleIds(String[] roleIds) { + govRoleUserDao.deleteByRoleIds(roleIds); + } + + @Override + public void deleteByUserIds(String[] userIds) { + govRoleUserDao.deleteByUserIds(userIds); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.2__add.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.2__add.sql new file mode 100644 index 0000000000..7933982d49 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.2__add.sql @@ -0,0 +1,91 @@ +CREATE TABLE `gov_language` ( + `table_name` varchar(32) NOT NULL COMMENT '表名', + `table_id` varchar(64) NOT NULL COMMENT '表主键', + `field_name` varchar(32) NOT NULL COMMENT '字段名', + `field_value` varchar(200) NOT NULL COMMENT '字段值', + `language` varchar(10) NOT NULL COMMENT '语言', + PRIMARY KEY (`table_name`,`table_id`,`field_name`,`language`) USING BTREE, + KEY `idx_table_id` (`table_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='国际化'; +CREATE TABLE `gov_menu` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `pid` varchar(64) DEFAULT NULL COMMENT '上级ID,一级菜单为0', + `url` varchar(200) DEFAULT NULL COMMENT '菜单URL', + `type` tinyint(3) unsigned DEFAULT NULL COMMENT '类型 0:菜单 1:按钮', + `icon` varchar(50) DEFAULT NULL COMMENT '菜单图标', + `permissions` varchar(32) DEFAULT NULL COMMENT '权限标识,如:sys:menu:save', + `sort` int(11) DEFAULT NULL COMMENT '排序', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + `SHOW_FLAG` int(11) NOT NULL DEFAULT '1' COMMENT '是否显示,1:显示 0不显示', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_pid` (`pid`) USING BTREE, + KEY `idx_del_flag` (`DEL_FLAG`) USING BTREE, + KEY `idx_create_date` (`CREATED_TIME`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='菜单管理'; +CREATE TABLE `gov_resource` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `resource_code` varchar(32) DEFAULT NULL COMMENT '资源编码,如菜单ID', + `resource_name` varchar(32) DEFAULT NULL COMMENT '资源名称', + `resource_url` varchar(100) DEFAULT NULL COMMENT '资源URL', + `resource_method` varchar(8) DEFAULT NULL COMMENT '请求方式(如:GET、POST、PUT、DELETE)', + `menu_flag` tinyint(3) unsigned DEFAULT NULL COMMENT '菜单标识 0:非菜单资源 1:菜单资源', + `auth_level` tinyint(3) unsigned DEFAULT NULL COMMENT '认证等级 0:权限认证 1:登录认证 2:无需认证', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_resource_code` (`resource_code`) USING BTREE, + KEY `idx_create_date` (`CREATED_TIME`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='资源管理'; +CREATE TABLE `gov_role` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `name` varchar(32) DEFAULT NULL COMMENT '角色名称', + `remark` varchar(100) DEFAULT NULL COMMENT '备注', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `dept_id` bigint(20) DEFAULT NULL COMMENT '部门ID', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_dept_id` (`dept_id`) USING BTREE, + KEY `idx_del_flag` (`DEL_FLAG`) USING BTREE, + KEY `idx_create_date` (`CREATED_TIME`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='角色管理'; +CREATE TABLE `gov_role_menu` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `role_id` varchar(64) DEFAULT NULL COMMENT '角色ID', + `menu_id` varchar(64) DEFAULT NULL COMMENT '菜单ID', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_role_id` (`role_id`) USING BTREE, + KEY `idx_menu_id` (`menu_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='角色菜单关系'; +CREATE TABLE `gov_role_user` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `role_id` varchar(64) DEFAULT NULL COMMENT '角色ID', + `user_id` varchar(64) DEFAULT NULL COMMENT '用户ID', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_role_id` (`role_id`) USING BTREE, + KEY `idx_user_id` (`user_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='角色用户关系'; \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovLanguageDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovLanguageDao.xml new file mode 100644 index 0000000000..5b829dc734 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovLanguageDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + INSERT INTO `gov_language` ( `table_name`, `table_id`, `field_name`, `field_value`, `language` ) + VALUES + ( #{tableName}, #{tableId}, #{fieldName}, #{fieldValue}, #{language} ) + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml new file mode 100644 index 0000000000..90d0b8ee92 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovResourceDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovResourceDao.xml new file mode 100644 index 0000000000..8296d14065 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovResourceDao.xml @@ -0,0 +1,25 @@ + + + + + + + delete from gov_resource where resource_code = #{value} + + + + + + + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleDao.xml new file mode 100644 index 0000000000..2de28e07bf --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleDao.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleMenuDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleMenuDao.xml new file mode 100644 index 0000000000..862679b5de --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleMenuDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + update gov_role_menu set del_flag = 1 where del_flag = 0 and role_id in + + #{roleId} + + + + + update gov_role_menu set del_flag = 1 where role_id = #{value} and del_flag = 0 + + + + update gov_role_menu set del_flag = 1 where menu_id = #{value} and del_flag = 0 + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleUserDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleUserDao.xml new file mode 100644 index 0000000000..b5cb172451 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleUserDao.xml @@ -0,0 +1,32 @@ + + + + + + + update gov_role_user set del_flag = 1 where del_flag = 0 and role_id in + + #{roleId} + + + + + update gov_role_user set del_flag = 1 where del_flag = 0 and user_id in + + #{userId} + + + + + update gov_role_user set del_flag = 1 where role_id = #{value} and del_flag = 0 + + + + update gov_role_user set del_flag = 1 where user_id = #{value} and del_flag = 0 + + + + + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index de87b9eea4..6c42e6e7dc 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -220,6 +220,14 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { Result staffGridResult = govOrgFeignClient.getStaffGrid(latestGridFormDTO); if (staffGridResult.success() && null != staffGridResult.getData() && StringUtils.isNotBlank(staffGridResult.getData().getGridId())) { + StaffGridVisitedFormDTO gridRecordParam = new StaffGridVisitedFormDTO(); + gridRecordParam.setGridId(staffGridResult.getData().getGridId()); + gridRecordParam.setCustomerId(latestGridFormDTO.getCustomerId()); + gridRecordParam.setStaffId(latestGridFormDTO.getStaffId()); + Result writeRecordResult = epmetUserFeignClient.saveStaffGridVisitedRecord(gridRecordParam); + if(writeRecordResult.success()){ + logger.warn("com.epmet.service.impl.StaffAgencyServiceImpl.getLatestGrid,工作人员网格访问网格写入失败,staffId:{},gridId:{}",latestGridFormDTO.getStaffId(),staffGridResult.getData().getGridId()); + } return staffGridResult; } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffTransferRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffTransferRecordDTO.java new file mode 100644 index 0000000000..79899e2e05 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffTransferRecordDTO.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-08-27 + */ +@Data +public class StaffTransferRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 调动人员Id(操作人) + */ + private String operateStaffId; + + /** + * 被调动人员Id + */ + private String operatedStaffId; + + /** + * 调动前组织Id + */ + private String oldAgencyId; + + /** + * 调动后组织Id + */ + private String agencyId; + + /** + * 备注说明 + */ + private String remarks; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffTransferFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffTransferFormDTO.java new file mode 100644 index 0000000000..fad8bc2dd9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffTransferFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/27 16:05 + */ +@NoArgsConstructor +@Data +public class StaffTransferFormDTO implements Serializable { + + private static final long serialVersionUID = -9011669876505775874L; + /** + * 被调动工作人员Id + */ + private String staffId; + /** + * 调动后组织Id + */ + private String agencyId; + /** + * 备注说明 + */ + private String remarks; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java index a02fdb01ee..e4592c5b0b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -40,4 +41,9 @@ public class AgencyResultDTO implements Serializable { * 机关组织名称 */ private String agencyName = ""; + /** + * 所有上级组织机构ID(以英文:隔开) + */ + @JsonIgnore + private String pids = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java index 8408c42dbf..9aa4c9b982 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java @@ -26,6 +26,11 @@ public class ExtStaffPermissionResultDTO implements Serializable { * */ private String agencyName; + /** + * 机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + * */ + private String level; + /** * 直属机关直属网格列表 * */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInAgencyListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInAgencyListResultDTO.java new file mode 100644 index 0000000000..52261bc95a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInAgencyListResultDTO.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; +import java.util.List; + + +/** + * 工作端-查询当前人员所属组织及所有下级组织--接口返参 + * + * @author sun + */ +@Data +public class StaffInAgencyListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当前组织信息 + */ + private AgencyResultDTO agencyList; + /** + * 下级组织信息(递归) + */ + private List subAgencyList; +} \ No newline at end of file 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 080702e2ab..952b5c665f 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.86 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.87 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 d7a0b5fc61..5886913a2a 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.86 + 0.3.87 com.epmet gov-org @@ -89,6 +89,12 @@ 2.0.0 compile + + com.epmet + epmet-heart-client + 2.0.0 + compile + 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 b1a42c4209..da89288f00 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 @@ -67,4 +67,8 @@ public interface CustomerAgencyConstant { * 网格党建指导员角色 */ String GRID_PARTY_DIRECTOR = "grid_party_director"; + /** + * 获取工作人员组织信息失败 + */ + String SELECT_STAFF_AGENCY_EXCEPTION = "获取工作人员组织信息失败"; } 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 fb76995133..c8b2350e16 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 @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -229,4 +231,15 @@ public class CustomerAgencyController { Result userInfoExt(@RequestBody ExtUserInfoResultDTO result){ return new Result().ok(customerAgencyService.extUserInfo(result)); } + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 工作端-查询当前人员所属组织及所有下级组织 + **/ + @PostMapping("staffinagencylist") + public Result staffInAgencyList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(customerAgencyService.staffInAgencyList(tokenDTO.getUserId())); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 664f425aee..c3187e3e8e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; +import com.epmet.dto.form.StaffTransferFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.*; import com.epmet.service.StaffService; @@ -135,4 +136,19 @@ public class StaffController { public Result mine(@RequestBody StaffInfoFromDTO fromDTO){ return new Result().ok(staffService.mine(fromDTO)); } + + /** + * 工作人员调动 + * + * @author zhaoqifeng + * @date 2020/8/27 16:12 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("stafftransfer") + public Result staffTransfer(@LoginUser TokenDto tokenDto, @RequestBody StaffTransferFormDTO formDTO){ + staffService.staffTransfer(tokenDto, formDTO); + return new Result(); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffTransferRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffTransferRecordController.java new file mode 100644 index 0000000000..4cd9ea0e05 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffTransferRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.StaffTransferRecordDTO; +import com.epmet.excel.StaffTransferRecordExcel; +import com.epmet.service.StaffTransferRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@RestController +@RequestMapping("stafftransferrecord") +public class StaffTransferRecordController { + + @Autowired + private StaffTransferRecordService staffTransferRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = staffTransferRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + StaffTransferRecordDTO data = staffTransferRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody StaffTransferRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + staffTransferRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody StaffTransferRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + staffTransferRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + staffTransferRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = staffTransferRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, StaffTransferRecordExcel.class); + } + +} \ 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 26ec50ed8e..eeeecf60db 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 @@ -133,7 +133,14 @@ public interface CustomerAgencyDao extends BaseDao { * @date 2020.08.17 09:50 **/ ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); - + /** + * @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 09:50 + **/ + ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId")String staffId); /** * @Description 根据agencyId查找指定机构的信息,直属网格、部门 * @param agencyId @@ -161,4 +168,11 @@ public interface CustomerAgencyDao extends BaseDao { **/ List selectDeptList(@Param("agencyId") String agencyId); + /** + * @param staffId + * @return + * @Author sun + * @Description 查询工作人员所属组织信息 + **/ + AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId); } \ 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 2debda4fce..12d2b81c7e 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 @@ -84,4 +84,13 @@ public interface CustomerDepartmentDao extends BaseDao * @Description 查询机关下部门列表信息 **/ List selectAgencyDeptMsgList(@Param("agencyId") String agencyId); + + /** + * 删除工作人员与部门关联 + * @author zhaoqifeng + * @date 2020/8/28 15:12 + * @param staffId + * @return void + */ + void deleteStaffDep(@Param("staffId") String staffId); } \ 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 1d50d1453a..ec450bfa63 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 @@ -224,4 +224,22 @@ public interface CustomerGridDao extends BaseDao { * @date 2020/8/12 5:10 下午 */ Integer selectGridCount(@Param("customerId")String customerId); + + /** + * 删除工作人员与网格关联 + * @author zhaoqifeng + * @date 2020/8/28 15:32 + * @param staffId + * @return void + */ + void deleteGridStaff(@Param("staffId") String staffId); + + /** + * 查询工作人员所在网格 + * @author zhaoqifeng + * @date 2020/8/28 15:41 + * @param staffId + * @return java.util.List + */ + List selectGridByStaff(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffTransferRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffTransferRecordDao.java new file mode 100644 index 0000000000..73b5217498 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffTransferRecordDao.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.StaffTransferRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Mapper +public interface StaffTransferRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffTransferRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffTransferRecordEntity.java new file mode 100644 index 0000000000..b52c91c45e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffTransferRecordEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_transfer_record") +public class StaffTransferRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 调动人员Id(操作人) + */ + private String operateStaffId; + + /** + * 被调动人员Id + */ + private String operatedStaffId; + + /** + * 调动前组织Id + */ + private String oldAgencyId; + + /** + * 调动后组织Id + */ + private String agencyId; + + /** + * 备注说明 + */ + private String remarks; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/StaffTransferRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/StaffTransferRecordExcel.java new file mode 100644 index 0000000000..6729be83f9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/StaffTransferRecordExcel.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-08-27 + */ +@Data +public class StaffTransferRecordExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "调动人员Id(操作人)") + private String operateStaffId; + + @Excel(name = "被调动人员Id") + private String operatedStaffId; + + @Excel(name = "调动前组织Id") + private String oldAgencyId; + + @Excel(name = "调动后组织Id") + private String agencyId; + + @Excel(name = "备注说明") + private String remarks; + + @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/StaffTransferRecordRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java new file mode 100644 index 0000000000..deb0f9f76a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Component +public class StaffTransferRecordRedis { + @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 02d05a373c..b7a556c5b0 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 @@ -205,4 +205,12 @@ public interface CustomerAgencyService extends BaseService * @date 2020.08.21 17:31 **/ ExtUserInfoResultDTO extUserInfo(ExtUserInfoResultDTO result); + + /** + * @param staffId + * @return + * @Author sun + * @Description 工作端-查询当前人员所属组织及所有下级组织 + **/ + StaffInAgencyListResultDTO staffInAgencyList(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java index 9722ca82af..bcb0267e38 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java @@ -92,4 +92,14 @@ public interface CustomerDepartmentService extends BaseService { * @date 2020/8/14 9:31 上午 */ CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO); + + /** + * 更新网格工作人员关系 + * @author zhaoqifeng + * @date 2020/8/28 15:36 + * @param staffId + * @return void + */ + void updateGrid(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index 22f423738a..dab238f3fb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; +import com.epmet.dto.form.StaffTransferFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.*; @@ -84,11 +85,22 @@ public interface StaffService { /** * 我的基本信息 + * * @author zhaoqifeng * @date 2020/5/22 16:57 * @param fromDTO * @return com.epmet.dto.result.MineResultDTO */ MineResultDTO mine(StaffInfoFromDTO fromDTO); + + /** + * 工作人员调动 + * @author zhaoqifeng + * @date 2020/8/27 16:13 + * @param tokenDto + * @param fromDTO + * @return void + */ + void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffTransferRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffTransferRecordService.java new file mode 100644 index 0000000000..8f326cdb27 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffTransferRecordService.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.StaffTransferRecordDTO; +import com.epmet.entity.StaffTransferRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +public interface StaffTransferRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return StaffTransferRecordDTO + * @author generator + * @date 2020-08-27 + */ + StaffTransferRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-27 + */ + void save(StaffTransferRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-27 + */ + void update(StaffTransferRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-27 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index c401f89afc..db160cba61 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 @@ -848,8 +848,12 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agency = - epmetUserOpenFeignClient.latestAgency(staffId); - if(agency.success() && StringUtils.isNotBlank(agency.getData())){ - //2.根据此agencyId查询数据权限 - ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(agency.getData()); - return res; - }else{ - logger.error("com.epmet.service.impl.CustomerAgencyServiceImpl.staffPermissionExt,没有找到工作人员最近一次登陆的Agency信息,用户Id:{}",staffId); + + CustomerStaffAgencyDTO agency = customerStaffAgencyDao.selectLatestCustomerByStaff(staffId); + if(null == agency || StringUtils.isBlank(agency.getAgencyId())){ + logger.error("com.epmet.service.impl.CustomerAgencyServiceImpl.staffPermissionExt,没有找到工作人员所属的机关信息,用户Id:{}",staffId); ExtStaffPermissionResultDTO emptyResult = new ExtStaffPermissionResultDTO(); checkFieldAndSetDefault(emptyResult); return emptyResult; } - - + ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(agency.getAgencyId()); + return res; } /** @@ -971,4 +970,28 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl%s", staffId)); + throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION); + } + resultDTO.setAgencyList(agencyList); + + //2.递归查询所有下级组织信息 + List subAgencyList = getDepartmentList(("".equals(agencyList.getPids()) ? "" : agencyList.getPids() + ":") + agencyList.getAgencyId()); + resultDTO.setSubAgencyList(subAgencyList); + + return resultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java index e3b81d7432..a236f77464 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java @@ -20,11 +20,13 @@ 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.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.CustomerDepartmentDao; import com.epmet.dto.CustomerDepartmentDTO; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; import com.epmet.redis.CustomerDepartmentRedis; import com.epmet.service.CustomerDepartmentService; @@ -33,6 +35,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; @@ -101,4 +104,25 @@ public class CustomerDepartmentServiceImpl extends BaseServiceImpl list = baseDao.listDepartmentListByStaffId(staffId); + if (null != list && list.size() > NumConstant.ZERO) { + List entityList = new ArrayList<>(); + for (DepartmentListResultDTO dto : list) { + CustomerDepartmentEntity entity = new CustomerDepartmentEntity(); + entity.setId(dto.getDepartmentId()); + entity.setTotalUser(dto.getTotalUser() - NumConstant.ONE); + entityList.add(entity); + } + //更新部门总人数 + updateBatchById(entityList); + //删除工作人员与部门关联 + baseDao.deleteStaffDep(staffId); + } + } + + } \ 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 afece523c4..215e32b471 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 @@ -649,4 +649,17 @@ public class CustomerGridServiceImpl extends BaseServiceImpl gridList = baseDao.selectGridByStaff(staffId); + if(null != gridList && gridList.size() > NumConstant.ZERO) { + gridList.forEach(entity -> { + entity.setTotalUser(entity.getTotalUser() - 1); + }); + updateBatchById(gridList); + baseDao.deleteGridStaff(staffId); + } + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index eea0a80d21..9cae28ab76 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -1,22 +1,17 @@ package com.epmet.service.impl; +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.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.CustomerStaffAgencyDTO; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.form.StaffInfoFromDTO; -import com.epmet.dto.form.StaffSubmitFromDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.*; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerStaffAgencyEntity; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.OperCrmFeignClient; -import com.epmet.service.CustomerAgencyService; -import com.epmet.service.CustomerStaffAgencyService; -import com.epmet.service.StaffService; +import com.epmet.feign.*; +import com.epmet.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -40,6 +35,18 @@ public class StaffServiceImpl implements StaffService { private CustomerAgencyService customerAgencyService; @Autowired private CustomerStaffAgencyService customerStaffAgencyService; + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; + @Autowired + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; + @Autowired + private CustomerDepartmentService customerDepartmentService; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private StaffTransferRecordService staffTransferRecordService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -183,4 +190,66 @@ public class StaffServiceImpl implements StaffService { } return result; } + + @Override + @Transactional(rollbackFor = Exception.class) + public void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO) { + //1.获取工作人员与机关关系 + CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId()); + String oldAgency = staffAgencyDTO.getAgencyId(); + //2.查询是否有未处理项目 + ProjectListFromDTO projectFromDTO = new ProjectListFromDTO(); + projectFromDTO.setCustomerId(staffAgencyDTO.getCustomerId()); + projectFromDTO.setUserId(fromDTO.getStaffId()); + projectFromDTO.setPageNo(1); + projectFromDTO.setPageSize(10); + Result> pendResult = govProjectOpenFeignClient.getPendProjectList(projectFromDTO); + if (!pendResult.success()) { + throw new RenException(pendResult.getCode(), pendResult.getMsg()); + } + if (null != pendResult.getData() && pendResult.getData().size() > NumConstant.ZERO) { + throw new RenException(EpmetErrorCode.EXIT_PEND_PROJECT.getCode()); + } + //3.查询是否有活动未结束 + Result> actInfoResult = epmetHeartOpenFeignClient.getPublishedAct(fromDTO.getStaffId()); + if (!actInfoResult.success()) { + throw new RenException(actInfoResult.getCode(), actInfoResult.getMsg()); + } + if (null != actInfoResult.getData() && actInfoResult.getData().size() > NumConstant.ZERO) { + throw new RenException(EpmetErrorCode.EXIT_PUBLISHED_ACTIVITY.getCode()); + } + //4.修改人员所属组织 + CustomerStaffAgencyDTO staffAgency = new CustomerStaffAgencyDTO(); + staffAgency.setId(staffAgencyDTO.getId()); + staffAgency.setAgencyId(fromDTO.getAgencyId()); + customerStaffAgencyService.update(staffAgency); + //原来组织总人数减一 + CustomerAgencyDTO oldAgencyDTO = customerAgencyService.get(oldAgency); + oldAgencyDTO.setTotalUser(oldAgencyDTO.getTotalUser() - NumConstant.ONE); + customerAgencyService.update(oldAgencyDTO); + //新组织总人数加一 + CustomerAgencyDTO newAgencyDTO = customerAgencyService.get(fromDTO.getAgencyId()); + newAgencyDTO.setTotalUser(newAgencyDTO.getTotalUser() - NumConstant.ONE); + customerAgencyService.update(newAgencyDTO); + //5.逻辑删除工作人员原组织加入的部门、网格,部门、网格总人数减1 + customerDepartmentService.updateDepartment(fromDTO.getStaffId()); + customerGridService.updateGrid(fromDTO.getStaffId()); + //6.更改工作人员组织角色 + StaffRoleDTO staffRoleDTO = new StaffRoleDTO(); + staffRoleDTO.setOrgId(fromDTO.getAgencyId()); + staffRoleDTO.setStaffId(fromDTO.getStaffId()); + Result result = epmetUserOpenFeignClient.changeRoleOrg(staffRoleDTO); + if (!result.success()) { + throw new RenException(result.getCode(), result.getMsg()); + } + //7.操作记录表新增调动记录 + StaffTransferRecordDTO staffTransferRecordDTO = new StaffTransferRecordDTO(); + staffTransferRecordDTO.setCustomerId(tokenDto.getCustomerId()); + staffTransferRecordDTO.setOperateStaffId(tokenDto.getUserId()); + staffTransferRecordDTO.setOperatedStaffId(fromDTO.getStaffId()); + staffTransferRecordDTO.setOldAgencyId(oldAgency); + staffTransferRecordDTO.setAgencyId(fromDTO.getAgencyId()); + staffTransferRecordDTO.setRemarks(fromDTO.getRemarks()); + staffTransferRecordService.save(staffTransferRecordDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java new file mode 100644 index 0000000000..6ef500a018 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.StaffTransferRecordDao; +import com.epmet.dto.StaffTransferRecordDTO; +import com.epmet.entity.StaffTransferRecordEntity; +import com.epmet.redis.StaffTransferRecordRedis; +import com.epmet.service.StaffTransferRecordService; +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-08-27 + */ +@Service +public class StaffTransferRecordServiceImpl extends BaseServiceImpl implements StaffTransferRecordService { + + @Autowired + private StaffTransferRecordRedis staffTransferRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, StaffTransferRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, StaffTransferRecordDTO.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 StaffTransferRecordDTO get(String id) { + StaffTransferRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, StaffTransferRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(StaffTransferRecordDTO dto) { + StaffTransferRecordEntity entity = ConvertUtils.sourceToTarget(dto, StaffTransferRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(StaffTransferRecordDTO dto) { + StaffTransferRecordEntity entity = ConvertUtils.sourceToTarget(dto, StaffTransferRecordEntity.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-org/gov-org-server/src/main/resources/db/migration/V0.0.2__staff_transfer_record.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.2__staff_transfer_record.sql new file mode 100644 index 0000000000..3b447e519e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.2__staff_transfer_record.sql @@ -0,0 +1,16 @@ +CREATE TABLE `staff_transfer_record` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `OPERATE_STAFF_ID` varchar(64) NOT NULL COMMENT '调动人员Id(操作人)', + `OPERATED_STAFF_ID` varchar(64) NOT NULL COMMENT '被调动人员Id', + `OLD_AGENCY_ID` varchar(64) NOT NULL COMMENT '调动前组织Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '调动后组织Id', + `REMARKS` varchar(255) DEFAULT NULL COMMENT '备注说明', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作人员调动记录表'; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index c2fb090e3f..0721780e09 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -169,6 +169,22 @@ ORDER BY created_time DESC + + + + + \ 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 a31747facc..bf175e9127 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 @@ -2,6 +2,10 @@ + + UPDATE customer_staff_department SET DEL_FLAG = '1' + WHERE USER_ID = #{staffId} AND DEL_FLAG = '0' + 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 b9a98117e1..422984c415 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 @@ -2,6 +2,10 @@ + + UPDATE customer_staff_grid SET DEL_FLAG = '1' + WHERE USER_ID = #{staffId} AND DEL_FLAG = '0' + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffTransferRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffTransferRecordDao.xml new file mode 100644 index 0000000000..7a9e787e1c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffTransferRecordDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file 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 index b2e6b7f32c..c16b8da399 100644 --- 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 @@ -1,9 +1,16 @@ package com.epmet.feign; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ProjectListFromDTO; +import com.epmet.dto.result.PendProjectListResultDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -13,4 +20,13 @@ import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; */ @FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class) public interface GovProjectOpenFeignClient { + /** + * 待处理项目列表 + * @author zhaoqifeng + * @date 2020/8/27 16:56 + * @param fromDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("gov/project/project/pendprojectlist") + Result> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO); } 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 index 4b8c2cd82b..aa84f509c5 100644 --- 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 @@ -1,8 +1,15 @@ 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.ProjectListFromDTO; +import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.feign.GovProjectOpenFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -11,4 +18,8 @@ import org.springframework.stereotype.Component; */ @Component public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignClient { + @Override + public Result> getPendProjectList(ProjectListFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getPendProjectList", fromDTO); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index ad3faa944b..5ccc25b279 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -17,7 +17,11 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -27,10 +31,12 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.LatestListFormDTO; +import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.form.ShiftProjectFormDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; import com.epmet.dto.result.IssueProjectResultDTO; import com.epmet.dto.result.LatestListResultDTO; +import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ShiftProjectResultDTO; import com.epmet.excel.ProjectExcel; import com.epmet.service.ProjectService; @@ -132,4 +138,18 @@ public class ProjectController { return new Result>().ok(projectService.getClosedProjectList(formDTO)); } + + /** + * 获取待处理项目列表 + * @author zhaoqifeng + * @date 2020/8/27 16:55 + * @param fromDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("pendprojectlist") + public Result> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO) { + List result = projectService.getPendProjectList(fromDTO); + return new Result>().ok(result); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index e34e2ecd21..9f3bfa8bf1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -106,6 +106,7 @@ public interface ProjectService extends BaseService { */ List getPendProjectList(ProjectListFromDTO fromDTO); + /** * 我发起的项目列表 * diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml index d3dfe53760..ea567d95a0 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.15 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.17 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 bd0017f012..3dc00901d9 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-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"> - 0.3.15 + 0.3.17 oper-access com.epmet diff --git a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/service/impl/OperMenuServiceImpl.java b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/service/impl/OperMenuServiceImpl.java index 8c7354a086..df8c7fc154 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/service/impl/OperMenuServiceImpl.java +++ b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/service/impl/OperMenuServiceImpl.java @@ -166,7 +166,9 @@ public class OperMenuServiceImpl extends BaseServiceImpl menuList; Result operUserDTOResult = epmetUserFeignClient.info(tokenDto.getUserId()); - + if(!operUserDTOResult.success()||null==operUserDTOResult.getData()){ + return new ArrayList<>(); + } //系统管理员,拥有最高权限 if(operUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){ menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java similarity index 94% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java rename to epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java index f522bfab50..ddf4551a57 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java @@ -25,7 +25,7 @@ public class UpdateCustomerParameterFormDTO implements Serializable { /** * 最大允许创建网格数 */ - private Integer gridNumber; + private Integer maxGridNumber; public interface Customer{} } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java index 6c2bd282bf..6ef2596917 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java @@ -6,4 +6,5 @@ import lombok.Data; public class CustomerInfoDTO { private String customerName; private String organizationLevel; + private String logo; } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java index 3d08316bb9..e55e97197a 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java @@ -34,7 +34,7 @@ public class CustomerListResultDTO implements Serializable { /** * 客户组织级别:0.省级,1市级,2.区县级,3.乡镇街道级 字典表key:organizationlevel */ - private String organizationLevels; + private String organizationLevel; /** * 客户logo */ 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 d7be013098..1bc90fa0c0 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.69 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.70 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 30bde5bb69..e4ae80fc6e 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -31,7 +31,10 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.*; +import com.epmet.dto.result.CustomerDetailResultDTO; +import com.epmet.dto.result.CustomerInfoResultDTO; +import com.epmet.dto.result.GridCountResultDTO; +import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.excel.CustomerExcel; import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.CustomerService; diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index 6749bd9763..c9745552ed 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -22,7 +22,10 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.*; +import com.epmet.dto.result.CustomerDetailResultDTO; +import com.epmet.dto.result.CustomerInfoResultDTO; +import com.epmet.dto.result.GridCountResultDTO; +import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.CustomerEntity; import java.text.ParseException; diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 4ce8fb2412..9857f910c5 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -679,7 +679,7 @@ public class CustomerServiceImpl extends BaseServiceImpl formDTO.getGridNumber()) { + if (entity.getGridNumber() > formDTO.getMaxGridNumber()) { throw new RenException(ModuleConstant.GRID_NUMBER_ERROR); } SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); @@ -691,7 +691,7 @@ public class CustomerServiceImpl extends BaseServiceImpl 4.0.0 - 0.3.37 + 0.3.42 com.epmet oper-customize diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java index 42f69d00e2..245d5018a2 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -188,8 +188,7 @@ public class CustomerFunctionDetailController { @PostMapping("customerfunctioncollect") public Result customerFunctionCollect(@LoginUser TokenDto tokenDto, @RequestBody CustomerFunctionCollectFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, CustomerFunctionCollectFormDTO.AddUserInternalGroup.class, CustomerFunctionCollectFormDTO.AddUserShowGroup.class); - customerFunctionDetailService.customerFunctionCollect(formDTO); - return new Result(); + return customerFunctionDetailService.customerFunctionCollect(formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateController.java index e842ec2794..99fd872b92 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateController.java @@ -17,6 +17,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -26,8 +28,12 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.CustomerHomeTemplateDTO; +import com.epmet.dto.form.HomeTemplateCommonFormDTO; +import com.epmet.dto.result.ComponentListByCustomerResultDTO; +import com.epmet.dto.result.HomeDesignByCustomerResultDTO; import com.epmet.excel.CustomerHomeTemplateExcel; import com.epmet.service.CustomerHomeTemplateService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -91,4 +97,42 @@ public class CustomerHomeTemplateController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerHomeTemplateExcel.class); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO clientType 所属端:0.居民端,1.领导端 + * @author yinzuomei + * @description 获取可用组件列表 + * @Date 2020/8/24 21:15 + **/ + @PostMapping("getcomponentlist") + public Result getComponetList(@RequestBody HomeTemplateCommonFormDTO formDTO) { + return new Result().ok(customerHomeTemplateService.getComponentListByCustomer(formDTO.getClientType())); + } + + /** + * @param formDTO clientType 所属端:0.居民端,1.领导端 + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 获取小程序首页配置 + * @Date 2020/8/24 22:06 + **/ + @PostMapping("gethometemplate") + public Result getHomeTemplate(@RequestBody HomeTemplateCommonFormDTO formDTO) { + return new Result().ok(customerHomeTemplateService.getHomeTemplate(formDTO.getClientType())); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 保存小程序首页配置 + * @Date 2020/8/24 22:19 + **/ + @PostMapping("savecustomerhometemplate") + public Result saveCustomerHomeTemplate(@RequestBody CustomerHomeTemplateFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + customerHomeTemplateService.saveCustomerHomeTemplate(formDTO); + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateFormDTO.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateFormDTO.java new file mode 100644 index 0000000000..9ee71fddd9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.controller; + +import com.epmet.dto.form.HomeComponentFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 保存小程序首页配置 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/24 22:18 + */ +@Data +public class CustomerHomeTemplateFormDTO implements Serializable { + /** + * 所属端类型 0:居民端 1:政府端 + */ + @NotBlank(message = "所属端类型不能为空") + private String clientType; + + /** + * 组件集合 + */ + private List componentList; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java index 1862cb7ceb..2973fbf1cd 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java @@ -28,6 +28,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.FunctionDTO; +import com.epmet.dto.form.QueryFunctionListFormDTO; import com.epmet.excel.FunctionExcel; import com.epmet.service.FunctionService; import org.springframework.beans.factory.annotation.Autowired; @@ -101,8 +102,8 @@ public class FunctionController { * @Date 2020/3/23 22:11 **/ @GetMapping("queryFunctionList") - public Result> queryFunctionList() { - return functionService.queryFunctionList(); + public Result> queryFunctionList(QueryFunctionListFormDTO formDTO) { + return new Result>().ok(functionService.getFunctionList(formDTO)); } /** diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java index fd82ce4fb6..8326a0a528 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java @@ -143,7 +143,7 @@ public class FunctionCustomizedController { /** * 定制功能修改 * 有客户在使用该功能时则不允许修改上下架状态、业务域名和外链地址、所属端app, - * 只能修改功能名称和大小图标 + * 只能修改功能名称和大小图标、功能说明 * 修改的要判断是否有客户在使用,有用的要批量更新已使用客户数据 * * @param formDTO diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java index 1a6572179d..bfbefc518d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -19,9 +19,11 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.form.CustomerFunctionCollectFormDTO; import com.epmet.dto.form.FunctionDetailFromDTO; import com.epmet.dto.form.UpdateCustomerFunctionFormDTO; import com.epmet.dto.form.UpdateShoppingStatusFormDTO; +import com.epmet.dto.result.CustomerFunctionCollectResultDTO; import com.epmet.dto.result.CustomerResultDTO; import com.epmet.dto.result.FunctionDetailResultDTO; import com.epmet.entity.CustomerFunctionDetailEntity; @@ -101,4 +103,12 @@ public interface CustomerFunctionDetailDao extends BaseDao { + /** + * @param clientType 所属端类型0.居民端,1.政府端 + * @return java.util.List + * @author yinzuomei + * @description 通用组件列表 + * @Date 2020/8/24 21:30 + **/ + List selectListCommonComponent(@Param("clientType") String clientType); + + /** + * @return java.util.List + * @author yinzuomei + * @description 功能组件列表(以功能分组) + * @Date 2020/8/24 21:30 + **/ + List selectListFunction(); + + /** + * @param functionId + * @param clientType + * @return java.util.List + * @author yinzuomei + * @description 根据功能,所属端,查询功能组件列表 + * @Date 2020/8/24 21:56 + **/ + List selectListFunctionComponent(@Param("functionId") String functionId, + @Param("clientType") String clientType); + + /** + * @return java.util.List + * @param clientType 所属端:0.居民端,1.领导端 + * @author yinzuomei + * @description 获取小程序首页配置 + * @Date 2020/8/24 22:12 + **/ + List selectCustomerTemplate(@Param("clientType") String clientType); + + /** + * @return int + * @param clientType + * @param userId + * @author yinzuomei + * @description 删除某一端的默认配置 + * @Date 2020/8/24 22:35 + **/ + int deleteByClientType(@Param("clientType") String clientType,@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionDao.java index 0ad172a342..f39d3bff0c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.FunctionDTO; +import com.epmet.dto.form.QueryFunctionListFormDTO; import com.epmet.entity.FunctionEntity; import org.apache.ibatis.annotations.Mapper; @@ -48,4 +49,12 @@ public interface FunctionDao extends BaseDao { * @Description 查询所有已上架功能列表(默认、定制功能) **/ List selectShopFunctionList(int shoppingStatus); + + /** + * @param + * @return java.util.List + * @Author sun + * @Description 查询已上架的所有功能,供下拉框使用 + **/ + List selectQueryFunctionList(QueryFunctionListFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java index 7729d60bcd..d0561093e3 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -150,5 +150,5 @@ public interface CustomerFunctionDetailService extends BaseService */ List getTemplateByClient(Integer client); + + /** + * @return com.epmet.dto.result.ComponentListByCustomerResultDTO + * @param clientType + * @author yinzuomei + * @description 获取可用组件列表 + * @Date 2020/8/24 21:16 + **/ + ComponentListByCustomerResultDTO getComponentListByCustomer(String clientType); + + /** + * @return com.epmet.dto.result.HomeDesignByCustomerResultDTO + * @param clientType 所属端:0.居民端,1.领导端 + * @author yinzuomei + * @description + * @Date 2020/8/24 22:06 + **/ + HomeDesignByCustomerResultDTO getHomeTemplate(String clientType); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 保存小程序首页配置 + * @Date 2020/8/24 22:20 + **/ + void saveCustomerHomeTemplate(CustomerHomeTemplateFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java index a02b628755..24411c0d80 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java @@ -130,7 +130,7 @@ public interface FunctionCustomizedService extends BaseService { * @Description 默认功能新增 **/ void saveFunction(FunctionDTO dto); + + /** + * @param + * @return java.util.List + * @Author sun + * @Description 查询已上架的所有功能,供下拉框使用 + **/ + List getFunctionList(QueryFunctionListFormDTO formDTO); + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java index 73bcd4a0f7..d57623db5d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -36,10 +36,7 @@ import com.epmet.dto.CustomerFunctionDetailDTO; import com.epmet.dto.FunctionCustomizedDTO; import com.epmet.dto.FunctionShoppingHistoryDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.CustomerFunctionCustomizedListResultDTO; -import com.epmet.dto.result.CustomerResultDTO; -import com.epmet.dto.result.FunctionDetailResultDTO; -import com.epmet.dto.result.FunctionResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerFunctionDetailEntity; import com.epmet.entity.CustomerFunctionEntity; import com.epmet.entity.FunctionShoppingHistoryEntity; @@ -156,6 +153,17 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl= NumConstant.TWELVE) { + return new Result().error(8000, String.format("当前客户在[%s]已存在12个上线功能,不允许再次采集!", dto.getFromAppName())); + } + //1.查询定制功能详细信息 FunctionCustomizedDTO functionDTO = functionCustomizedDao.selectByFunctionId(formDTO.getFunctionId()); if(functionDTO == null){ @@ -259,6 +274,7 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -108,4 +117,85 @@ public class CustomerHomeTemplateServiceImpl extends BaseServiceImpl commonList=baseDao.selectListCommonComponent(clientType); + resultDTO.setCommonList(commonList); + List functionList = baseDao.selectListFunction(); + for (FunctionComponentResultDTO function : functionList) { + function.setComponentList(baseDao.selectListFunctionComponent(function.getFunctionId(), clientType)); + } + resultDTO.setFunctionList(functionList); + return resultDTO; + } + + /** + * @param clientType 所属端:0.居民端,1.领导端 + * @return com.epmet.dto.result.HomeDesignByCustomerResultDTO + * @author yinzuomei + * @description + * @Date 2020/8/24 22:06 + **/ + @Override + public HomeDesignByCustomerResultDTO getHomeTemplate(String clientType) { + HomeDesignByCustomerResultDTO resultDTO = new HomeDesignByCustomerResultDTO(); + //根据客户id,所属端获取客户首页配置的设计稿 + List list = baseDao.selectCustomerTemplate(clientType); + List titleList = new ArrayList<>(); + List topList = new ArrayList<>(); + List functionList = new ArrayList<>(); + List floatingList = new ArrayList<>(); + //使用过的组件集合 + List usedComponent = new ArrayList<>(); + for (CommonComponentDesignResultDTO c : list) { + usedComponent.add(c.getComponentId()); + //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + if (ReginConstant.TITLE_LIST.equals(c.getRegion())) { + titleList.add(c); + } else if (ReginConstant.TOP_LIST.equals(c.getRegion())) { + topList.add(c); + } else if (ReginConstant.FUNCTION_LIST.equals(c.getRegion())) { + functionList.add(c); + } else if (ReginConstant.FLOATING_LIST.equals(c.getRegion())) { + floatingList.add(c); + } + } + resultDTO.setTitleList(titleList); + resultDTO.setTopList(topList); + resultDTO.setFloatingList(floatingList); + resultDTO.setFunctionList(functionList); + resultDTO.setUsedComponentIdList(usedComponent); + return resultDTO; + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 保存小程序首页配置 + * @Date 2020/8/24 22:20 + **/ + @Override + public void saveCustomerHomeTemplate(CustomerHomeTemplateFormDTO formDTO) { + int deletedNum = baseDao.deleteByClientType(formDTO.getClientType(), loginUserUtil.getLoginUserId()); + for (HomeComponentFormDTO homeComponentFormDTO : formDTO.getComponentList()) { + CustomerHomeTemplateDTO customerHomeTemplateDTO = new CustomerHomeTemplateDTO(); + customerHomeTemplateDTO.setComponentId(homeComponentFormDTO.getComponentId()); + customerHomeTemplateDTO.setClientType(Integer.valueOf(formDTO.getClientType())); + customerHomeTemplateDTO.setRegion(homeComponentFormDTO.getRegion()); + customerHomeTemplateDTO.setConfiguration(homeComponentFormDTO.getConfiguration()); + customerHomeTemplateDTO.setDemoData(homeComponentFormDTO.getDemoData()); + customerHomeTemplateDTO.setDisplayOrder(homeComponentFormDTO.getDisplayOrder()); + save(customerHomeTemplateDTO); + } + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index 611f7de98e..9a7a1dc122 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -200,18 +200,18 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl + * @Author sun + * @Description 查询已上架的所有功能,供下拉框使用 + **/ + @Override + public List getFunctionList(QueryFunctionListFormDTO formDTO) { + return baseDao.selectQueryFunctionList(formDTO); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__up_function_customized_visited.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__up_function_customized_visited.sql new file mode 100644 index 0000000000..e6bf92320c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__up_function_customized_visited.sql @@ -0,0 +1,7 @@ +ALTER TABLE `function_customized_visited` +MODIFY COLUMN `MSG` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '原因 失败的原因(例:请求超时、404、500等)' AFTER `RESULT`; + + +ALTER TABLE `function_customized_visited` +MODIFY COLUMN `URL` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '请求地址 访问的url地址' AFTER `FUNCTION_ID`; + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml index 3f38163bde..6766e64678 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml @@ -28,7 +28,6 @@ cfd.icon_large_img AS "iconLargeImg", cfd.icon_small_img AS "iconSmallImg", CONCAT( - 'https://', cfd.domain_name, cfd.target_link ) AS "url", @@ -42,7 +41,7 @@ AND f.del_flag = '0' AND fc.del_flag = '0' AND f.function_group = '1' - AND f.shopping_status = '1' + AND cfd.shopping_status = '1' AND cfd.customer_id = #{customerId} AND fc.from_app = #{clientType} ORDER BY @@ -98,6 +97,30 @@ LIMIT 1 + + + UPDATE customer_function_detail SET diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeTemplateDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeTemplateDao.xml index f6d4b056c1..c47c431bb9 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeTemplateDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeTemplateDao.xml @@ -18,5 +18,91 @@ + + + + + + + + + + + + + UPDATE customer_home_template + SET DEL_FLAG = '1', + UPDATED_BY = #{userId}, + UPDATED_TIME = NOW() + WHERE + CLIENT_TYPE = #{clientType} + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml index e1ad29efb4..a9840f4e42 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -63,10 +63,10 @@ WHERE f.DEL_FLAG = '0' AND cu.DEL_FLAG = '0' - AND cu.CUSTOMIZED_NAME = #{customizedName} + AND cu.CUSTOMIZED_NAME like concat('%', #{customizedName}, '%') - AND cu.FROM_APP = 'gov' + AND cu.FROM_APP = #{fromApp} ORDER BY cu.FROM_APP, f.CREATED_TIME DESC @@ -81,10 +81,10 @@ WHERE f.DEL_FLAG = '0' AND cu.DEL_FLAG = '0' - AND cu.CUSTOMIZED_NAME = #{customizedName} + AND cu.CUSTOMIZED_NAME like concat('%', #{customizedName}, '%') - AND cu.FROM_APP = 'gov' + AND cu.FROM_APP = #{fromApp} + + 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 8a0958ff8b..93aa5af28c 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 @@ -173,15 +173,16 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService Result result = new Result(); //校验手机验证码是否正常 - //TODO 党员认证信息提交暂时注释验证码校验 - /*String code = partyMemberInfoRedis.getUserMobileCode(partyMemberInfoDTO.getUserId(), - partyMemberInfoDTO.getMobile(), - partyMemberInfoDTO.getCode()); - if (null == code) { - saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, - PartyMemberConstant.OPERATE_AUTO_FAILED); - return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); - }*/ + if (StringUtils.isNotBlank(partyMemberInfoDTO.getCode())) { + String code = partyMemberInfoRedis.getUserMobileCode(partyMemberInfoDTO.getUserId(), + partyMemberInfoDTO.getMobile(), + partyMemberInfoDTO.getCode()); + if (null == code) { + saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, + PartyMemberConstant.OPERATE_AUTO_FAILED); + return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + } + } //获取党员基本信息(匹配) PartymemberConfirmAutoDTO confirmAutoDTO = diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerListFormDTO.java new file mode 100644 index 0000000000..696e5a890c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerListFormDTO.java @@ -0,0 +1,26 @@ +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; + +/** + * 查询登陆用户客户列表(工作端) + * @CreateTime 2020/8/25 + */ +@Data +public class CustomerListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface UserIdGroup extends CustomerClientShowGroup{} + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空",groups = UserIdGroup.class) + private String phone; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovWebOperLoginFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovWebOperLoginFormDTO.java new file mode 100644 index 0000000000..5acbfd6b05 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovWebOperLoginFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description PC工作端登陆获取登陆人信息-接口入参 + * @Author sun + */ +@Data +public class GovWebOperLoginFormDTO implements Serializable { + private static final long serialVersionUID = -6653010297552029277L; + + @NotBlank(message = "客户Id不能为空") + private String customerId; + + @NotBlank(message = "手机号不能为空") + private String mobile; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java index aa999da0f6..75453a1d22 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java @@ -82,7 +82,7 @@ public class InfoSubmitFromDTO implements Serializable { /** * 手机验证码 */ - @NotBlank(message = "手机验证码不能为空") + // @NotBlank(message = "手机验证码不能为空") @Length(max=6,message = "手机验证码不能超过6位") private String mobileCode; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java new file mode 100644 index 0000000000..3c6189e8b2 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 查询登陆用户客户列表(工作端) + * @CreateTime 2020/8/25 + */ +@Data +public class CustomerListResultDTO implements Serializable { + + /** + * 客户Id + */ + private String customerId; + + /** + * 客户名称 + */ + private String customerName; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java new file mode 100644 index 0000000000..dc08614749 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description PC工作端登陆获取登陆人信息-接口返参 + * @Author sun + */ +@Data +public class GovWebOperLoginResultDTO implements Serializable { + private static final long serialVersionUID = -5353521601282463394L; + private String userId; + private String passWord; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java new file mode 100644 index 0000000000..04962a5396 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 获取pc工作端登陆用户信息 + * @CreateTime 2020/8/25 + */ +@Data +public class StaffBasicInfoResultDTO implements Serializable { + + /** + * 客户Id + */ + private String customerId; + + /** + * 用户Id + */ + private String id; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 性别0.未知,1男,2.女 + */ + private String gender; + + /** + * 头像 + */ + private String headUrl; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号 + */ + private String phone; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 超级管理员 0:否 1:是 + */ + private Integer superAdmin; + + /** + * 状态 0:停用 1:正常 + */ + private Integer status; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 63e3380b6b..4e3da40627 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -4,10 +4,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.UserBaseInfoDTO; -import com.epmet.dto.UserDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback; @@ -269,15 +266,6 @@ public interface EpmetUserOpenFeignClient { @PostMapping("epmetuser/customerstaff/getstaffinfolist") Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO); - /** - * @Description 根绝staffId查询最近一次(既当前)登录到的AgencyId - * @param staffId - * @return - * @author wangc - * @date 2020.08.17 17:45 - **/ - @GetMapping("/epmetuser/staffagencyvisited/latestagency/{staffId}") - Result latestAgency(@PathVariable("staffId") String staffId); /** * 修改根管理员信息 @@ -308,4 +296,14 @@ public interface EpmetUserOpenFeignClient { **/ @PostMapping("/epmetuser/userbaseinfo/extuserinfo") Result extUserInfo( @RequestBody CommonUserIdFormDTO param); + + /** + * 更改角色所属组织 + * @author zhaoqifeng + * @date 2020/8/31 10:36 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("epmetuser/staffrole/changeroleorg") + Result changeRoleOrg(@RequestBody StaffRoleDTO 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 index 480ba8862e..a60c9611ae 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -4,10 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.UserBaseInfoDTO; -import com.epmet.dto.UserDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -189,11 +186,6 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoList", formDTO); } - @Override - public Result latestAgency(String staffId) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "latestAgency", staffId); - } - @Override public Result updateRootManage(UpdateRootManageFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateRootManage", formDTO); @@ -208,4 +200,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result extUserInfo(CommonUserIdFormDTO param) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "extUserInfo", param); } + + @Override + public Result changeRoleOrg(StaffRoleDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeRoleOrg", 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 b7e4db73ed..7f1bcc84c1 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.120 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.121 ports: - "8087:8087" network_mode: host # 不会创建新的网络 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 08ed13c97a..0075470f27 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 @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -359,4 +361,44 @@ public class CustomerStaffController { customerStaffService.updateRootManage(formDTO); return new Result(); } + + /** + * 查询登陆用户客户列表(工作端) + * 根据手机号查询customer_staff表数据,在根据查询到的数据的userId判断是不是根管理员,最后将同一手机号对应的客户列表且该手机都是根管理员的客户列表返给前端 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 10:03 2020-08-25 + **/ + @PostMapping(value = "customerlist") + public Result> customerList(@RequestBody CustomerListFormDTO formDTO){ + return customerStaffService.selectCustomerList(formDTO); + } + + /** + * 获取pc工作端登陆用户信息 + * 根据token中userId,去查询登陆用户基本信息 + * @param tokenDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:09 2020-08-25 + **/ + @PostMapping(value = "staffbasicinfo") + public Result staffBasicInfo(@LoginUser TokenDto tokenDTO){ + return customerStaffService.selectStaffBasicInfo(tokenDTO.getUserId()); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + @PostMapping("getstaffidandpwd") + public Result getStaffIdAndPwd(@RequestBody GovWebOperLoginFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(customerStaffService.getStaffIdAndPwd(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java index 69ffa0ebd8..71ad8f1962 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java @@ -63,16 +63,4 @@ public class StaffAgencyVisitedController { } - /** - * @Description 根绝staffId查询最近一次(既当前)登录到的AgencyId - * @param staffId - * @return - * @author wangc - * @date 2020.08.17 17:45 - **/ - @GetMapping(value = "latestagency/{staffId}") - public Result latestAgency(@PathVariable("staffId") String staffId){ - return new Result().ok(staffAgencyVisitedService.getLatestStaffAgencyId(staffId)); - } - } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 2eada17f01..60b4d5400e 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 @@ -5,6 +5,7 @@ import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerRoleFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; @@ -167,4 +168,17 @@ public class StaffRoleController { public Result> getStaffRoles(@PathVariable String staffId) { return new Result>().ok(staffRoleService.getStaffRoles(staffId)); } + + /** + * 更改角色所属组织 + * @author zhaoqifeng + * @date 2020/8/31 10:29 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("changeroleorg") + public Result changeRoleOrg(@RequestBody StaffRoleDTO formDTO) { + staffRoleService.changeRoleOrg(formDTO); + return new Result(); + } } 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 41c7a550e6..2fdc573473 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 @@ -172,4 +172,23 @@ public interface CustomerStaffDao extends BaseDao { * @return com.epmet.dto.CustomerStaffDTO */ CustomerStaffDTO selectRootManage(@Param("orgId") String orgId, @Param("roleKey") String roleKey); -} \ No newline at end of file + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据客户Id和手机号查询工作人员信息 + **/ + GovWebOperLoginResultDTO selectByCustomerIdAndPhone(GovWebOperLoginFormDTO formDTO); + + /** + * 获取pc工作端登陆用户信息 + * 根据token中userId,去查询登陆用户基本信息 + * + * @param userId + * @return com.epmet.dto.result.StaffBasicInfoResultDTO + * @Author zhangyong + * @Date 10:07 2020-08-26 + **/ + StaffBasicInfoResultDTO selectStaffBasicInfo(@Param("userId") String userId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java index 4e55a5e731..4358e4910e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java @@ -40,5 +40,4 @@ public interface StaffAgencyVisitedDao extends BaseDao StaffLatestAgencyResultDTO selectLatestStaffWechatLoginRecord(String openId); - StaffLatestAgencyResultDTO selectLatestCustomer(String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java index 6869f1a5bf..554da4a12d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java @@ -23,6 +23,8 @@ import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.entity.StaffGridVisitedEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.Date; + /** * 工作人员进入网格日志表 * @@ -41,4 +43,23 @@ public interface StaffGridVisitedDao extends BaseDao { **/ String selectStaffLatestGrid(LatestGridFormDTO latestGridFormDTO); + /** + * @Description 根据staffId和customerId查询当前用户上一次登陆的网格Id,Id,创建时间 + * @param latestGridFormDTO + * @return StaffGridVisitedEntity + * @author wangc + * @date 2020.08.27 15:05 + **/ + StaffGridVisitedEntity selectVisitedRecordByStaffId(LatestGridFormDTO latestGridFormDTO); + + /** + * @Description 更新工作人员网格登陆记录的时间 + * @param id + * @param date + * @return + * @author wangc + * @date 2020.08.27 16:28 + **/ + void updateRecordTime(String id, Date date); + } \ 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 6de16bc4f8..dfc5407272 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 @@ -23,11 +23,13 @@ import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; -import com.epmet.dto.result.*; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.springframework.context.annotation.Scope; import java.util.List; @@ -100,4 +102,24 @@ public interface StaffRoleDao extends BaseDao { List selectStaffRoles(@Param("staffId") String staffId); List listStaffRoleEntytiesByStaffIdAndOrgId(@Param("agencyId") String agencyId, @Param("staffId") String staffId); -} \ No newline at end of file + + /** + * 根据用户id、角色id,查询 工作人员-角色关系表 + * + * @param staffId + * @param roleId + * @return com.epmet.dto.StaffRoleDTO + * @Author zhangyong + * @Date 10:45 2020-08-25 + **/ + StaffRoleDTO selectStaffRoleByStaffIdAndRoleId(@Param("staffId") String staffId, @Param("roleId") String roleId); + + /** + * 更改角色所属组织 + * @author zhaoqifeng + * @date 2020/8/31 10:33 + * @param dto + * @return void + */ + void updateStaffRoleOrgId(StaffRoleDTO dto); +} 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 3a49fc6f2d..996848c4ea 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 @@ -284,4 +284,35 @@ public interface CustomerStaffService extends BaseService { * @return com.epmet.dto.CustomerStaffDTO */ void updateRootManage(UpdateRootManageFormDTO formDTO); -} \ No newline at end of file + + /** + * 查询登陆用户客户列表(工作端) + * 根据手机号查询customer_staff表数据,在根据查询到的数据的userId判断是不是根管理员,最后将同一手机号对应的客户列表且该手机都是根管理员的客户列表返给前端 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 10:03 2020-08-25 + **/ + Result> selectCustomerList(CustomerListFormDTO formDTO); + + /** + * 获取pc工作端登陆用户信息 + * 根据token中userId,去查询登陆用户基本信息 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:10 2020-08-25 + **/ + Result selectStaffBasicInfo(String userId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + GovWebOperLoginResultDTO getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java index d70addb077..9d584aa2e6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java @@ -114,13 +114,5 @@ public interface StaffAgencyVisitedService extends BaseService { List getStaffRoles(String staffId); List getStaffRoleEntytiesByStaffIdAndOrgId(String agencyId, String staffId); + + /** + * 更改角色组织 + * @author zhaoqifeng + * @date 2020/8/31 10:31 + * @param formDTO + * @return void + */ + void changeRoleOrg(StaffRoleDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 030a917e71..72f9c416b2 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 @@ -17,12 +17,14 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.entity.DataScope; 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.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -47,6 +49,7 @@ import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.UserEntity; import com.epmet.feign.AuthFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.redis.CustomerStaffRedis; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; @@ -99,6 +102,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -611,4 +616,53 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> selectCustomerList(CustomerListFormDTO formDTO) { + List listResultDTO = new ArrayList<>(); + CustomerDTO customerDTO = new CustomerDTO(); + // 1.根据手机号,去 customer_staff表,进行查询; 查询结果 多条:字段 customer_id,user_id + List customerStaffList = baseDao.selectListCustomerStaffDTO(formDTO.getPhone()); + + for (CustomerStaffDTO staffDTO : customerStaffList){ + // 2.根据 customer_id 去 gov_staff_role表,查询 customer_id + role_key = root_manager ,确定 根管理员的id,即roleId + GovStaffRoleDTO roleKey = govStaffRoleDao.getRoleByCustomerIdAndRoleKey(staffDTO.getCustomerId(), RoleKeyConstants.ROLE_KEY_ROOT_MANAGER); + // 3.根据roleId + staff_id(即 userId) 查 staff_role表的主键id, 如果查到了,那这个userId就是 根管理员 + StaffRoleDTO staffRoleDTO = staffRoleDao.selectStaffRoleByStaffIdAndRoleId(staffDTO.getUserId(), roleKey.getId()); + if (null != staffRoleDTO){ + // 4.如果userID是根管理员的话,则根据customerId 去 customer表 查询 id、customer_name + customerDTO.setId(staffDTO.getCustomerId()); + Result customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); + if (!customerInfo.success()) { + logger.error(String.format("获取根管理员信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); + } else { + if (null != customerInfo.getData()){ + CustomerListResultDTO resultDTO = new CustomerListResultDTO(); + resultDTO.setCustomerId(customerInfo.getData().getId()); + resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); + listResultDTO.add(resultDTO); + } + } + } + } + return new Result>().ok(listResultDTO); + } + + @Override + public Result selectStaffBasicInfo(String userId) { + StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); + return new Result().ok(resultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + @Override + public GovWebOperLoginResultDTO getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO) { + //1.根据客户Id和手机号查询用户信息 + return baseDao.selectByCustomerIdAndPhone(formDTO); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java index 7e2e2fd706..8118bbe6f6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java @@ -127,20 +127,6 @@ public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { + Calendar currentCal = Calendar.getInstance(); + currentCal.setTime(new Date()); CustomerGridByUserIdResultDTO gridResult = new CustomerGridByUserIdResultDTO(); - String gridId = baseDao.selectStaffLatestGrid(latestGridFormDTO); + StaffGridVisitedEntity recordEntity = baseDao.selectVisitedRecordByStaffId(latestGridFormDTO); + String gridId = null == recordEntity ? null : recordEntity.getGridId(); if(StringUtils.isNotBlank(gridId)){ + Calendar recordCal = Calendar.getInstance(); + recordCal.setTime(recordEntity.getCreatedTime()); + if(currentCal.get(Calendar.YEAR) == recordCal.get(Calendar.YEAR) && + currentCal.get(Calendar.DAY_OF_YEAR) == recordCal.get(Calendar.DAY_OF_YEAR) + && StringUtils.isNotBlank(recordEntity.getId())){ + //同一天 更新 + baseDao.updateRecordTime(recordEntity.getId(),currentCal.getTime()); + }else{ + //非同一天 新增 + recordEntity.setCustomerId(latestGridFormDTO.getCustomerId()); + recordEntity.setStaffId(latestGridFormDTO.getStaffId()); + recordEntity.setId(null); + recordEntity.setCreatedTime(null); + baseDao.insert(recordEntity); + } CustomerGridFormDTO param = new CustomerGridFormDTO(); param.setGridId(gridId); Result gridInfoResult = 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 231ab010ea..bb85550f3c 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 @@ -182,4 +182,10 @@ public class StaffRoleServiceImpl extends BaseServiceImpl - \ No newline at end of file + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml index 82bc2cace3..faaa5757e9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml @@ -35,19 +35,5 @@ sav.CREATED_TIME DESC LIMIT 1 - + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml index 73978e23f3..8805ed9dab 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml @@ -33,4 +33,35 @@ LIMIT 1 + + + + + + UPDATE + STAFF_GRID_VISITED + SET + CREATED_TIME = #{date}, + UPDATED_TIME = #{date} + WHERE + DEL_FLAG = '0' + AND + ID = #{id} + \ 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 b02425c697..aabdfd6d71 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 @@ -23,6 +23,11 @@ and sr.ORG_ID = #{orgId} and sr.DEL_FLAG = '0' + + UPDATE staff_role SET ORG_ID = #{orgId} + WHERE STAFF_ID = #{staffId} + AND DEL_FLAG = '0' + @@ -164,4 +169,16 @@ and sr.ORG_ID = #{agencyId} and sr.DEL_FLAG='0' - \ No newline at end of file + + +