diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 9058e3065d..df371df8a9 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -84,12 +84,41 @@ dev + + 8082 + dev + + + + + + epmet_admin_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8082 - dev + local @@ -103,7 +132,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -116,9 +145,6 @@ test - 8082 test diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index c26333a04a..f533348156 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.68 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.69 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/deploy/docker-compose-prod.yml b/epmet-auth/deploy/docker-compose-prod.yml index 8c5773f2d5..afffcf2474 100644 --- a/epmet-auth/deploy/docker-compose-prod.yml +++ b/epmet-auth/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.68 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.69 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index f97682e9ba..7a7fcd5f9c 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.68 + 0.3.69 com.epmet epmet-cloud @@ -156,9 +156,6 @@ dev - - true - 8081 dev @@ -192,12 +189,46 @@ e5e72147737cfeb2b0f3a43624cadb3f--> + + local + + true + + + 8081 + local + + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + wxcb6ce2ed0c5ae54c + c7f74941ee97fa9b2e1065772d34c397 + 12345678Yzm + jiKrJoPQsUIP9ayAwmuJQeAVPBjFOh5D1JxFDd7ZSU3 + + wx07674c23af51b521 + a2fd0d29b007cbbcf8c8dda8c693d99b + + wx3d1372029eb816a3 + 651f02d71ed3f123dfb584b8bf0f4d8b + + + test - 8081 test 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..e540bdc6fe --- /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", "evaluationIndex"), + DATA_STATISTICAL_FAKE("data-statistical-server", "fake", "statsDisplay"), + DATA_REPORT_REAL("data-report-server", "real", "evaluationIndex"), + 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/aspect/CustomerApplicationRunner.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java new file mode 100644 index 0000000000..8e065c792a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.aspect; + +import com.epmet.commons.tools.dto.form.DingTalkTextMsg; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.cloud.commons.util.InetUtils; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +/** + * 应用 启动健康检查 通知类 + * CustomerApplicationRunner + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +@Order(value = 99) +public class CustomerApplicationRunner implements ApplicationRunner { + private static Logger logger = LogManager.getLogger(CustomerApplicationRunner.class); + @Value("${spring.application.name}") + private String appName; + + @Override + public void run(ApplicationArguments args) { + //发送启动成功消息 + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + logger.info(currentEnv); + if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode())) { + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + + //开发小组 群机器人地址 + String url = "https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"; + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(EnvEnum.getCurrentEnv().getName()) + .append("【") + .append(appName) + .append("】") + .append("ip地址: ") + .append(serverIp) + .append("部署完毕!"); + DingTalkTextMsg msg = new DingTalkTextMsg(); + msg.setWebHook(url); + msg.setAtAll(true); + msg.setContent(stringBuilder.toString()); + Result stringResult = HttpClientManager.getInstance().sendPostByJSON(url, msg.getMsgContent()); + logger.info(stringResult); + } + } + +} 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..e906535166 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 @@ -1,5 +1,7 @@ package com.epmet.commons.tools.constant; +import java.math.BigDecimal; + /** * 常用数字常量 * @@ -35,6 +37,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; @@ -52,4 +58,6 @@ public interface NumConstant { String POSITIVE_EIGHT_STR = "+8"; String EMPTY_STR = ""; String ONE_NEG_STR = "-1"; + + String FIFTY_STR="50"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index 655635e6d7..03233b7c47 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -77,4 +77,8 @@ public interface StrConstant { String NULL_STR="null"; String NOT_FILLED = "无"; + + String MIN="MIN"; + + String MAX="MAX"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java index ed265248e6..0c3f798318 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java @@ -1,5 +1,8 @@ package com.epmet.commons.tools.enums; +import com.epmet.commons.tools.utils.SpringContextUtils; +import org.springframework.core.env.Environment; + /** * 系统环境变量枚举类 * dev|test|prod @@ -34,6 +37,20 @@ public enum EnvEnum { return EnvEnum.UN_KNOWN; } + public static EnvEnum getCurrentEnv(){ + try { + Environment environment = SpringContextUtils.getBean(Environment.class); + String[] activeProfiles = environment.getActiveProfiles(); + if (activeProfiles != null && activeProfiles.length > 0) { + return getEnum(activeProfiles[0]); + } + } catch (Exception e) { + e.printStackTrace(); + } + return EnvEnum.UN_KNOWN; + } + + public String getCode() { return code; } 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 4be3bd90b9..b7844243d3 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 @@ -106,6 +106,7 @@ public enum EpmetErrorCode { OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"), OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"), OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"), + OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index a5be29eb58..0d623e2010 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -297,4 +297,12 @@ public class RedisKeys { public static String getExternalAppSecretKey(String appId) { return String.format(rootPrefix+"externalapp:secret:%s",appId); } + + /** + * 计算指标时获取指标code和fields关系缓存Key + * @return + */ + public static String getIndexCodeFieldReKey() { + return rootPrefix.concat("data:index:indexcode:field"); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 0a45a6b290..75174f4216 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -9,6 +9,7 @@ package com.epmet.commons.tools.utils; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -33,6 +34,11 @@ public class DateUtils { public static final List Q3Months = Arrays.asList(7, 8, 9); public static final List Q4Months = Arrays.asList(10, 11, 12); + public static final List Q1MonthsStrList = Arrays.asList("1", "2", "3","01","02","03"); + public static final List Q2MonthsStrList = Arrays.asList("4", "5", "6","04", "05", "06"); + public static final List Q3MonthsStrList = Arrays.asList("7", "8", "9","07", "08", "09"); + public static final List Q4MonthsStrList = Arrays.asList("10", "11", "12"); + /** 时间格式(yyyy-MM-dd) */ public final static String DATE_PATTERN = "yyyy-MM-dd"; /** 时间格式(yyyy-MM-dd HH:mm:ss) */ @@ -298,6 +304,29 @@ public class DateUtils { return 4; } + /** + * 获取季度 + * @param monthId yyyyMM + * @return yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + public static String getQuarterId(String monthId) { + String year = monthId.substring(0, 4); + String month = monthId.substring(4, 6); + if (Q1MonthsStrList.contains(month)) { + return year.concat("Q1"); + } + if (Q2MonthsStrList.contains(month)) { + return year.concat("Q2"); + } + if (Q3MonthsStrList.contains(month)) { + return year.concat("Q3"); + } + if(Q4MonthsStrList.contains(month)){ + return year.concat("Q4"); + } + return StrConstant.EPMETY_STR; + } + /** * 根据季度查询季度的月份列表 * @param quarterIndex @@ -557,4 +586,11 @@ public class DateUtils { System.out.println(comparteDate(yesterDay,today)); System.out.println(comparteDate(tomorrow,today)); } + + public static String getYearId(String monthId) { + if (StringUtils.isNotBlank(monthId) && monthId.length() > 4) { + return monthId.substring(NumConstant.ZERO, NumConstant.FOUR); + } + return StrConstant.EPMETY_STR; + } } 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/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index 82a1bb2c15..3329f89b6d 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.32 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.35 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/deploy/docker-compose-prod.yml b/epmet-gateway/deploy/docker-compose-prod.yml index 6b8419721d..c5c27e870b 100644 --- a/epmet-gateway/deploy/docker-compose-prod.yml +++ b/epmet-gateway/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.30 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.33 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 7e5875d3c5..e64e3f45c3 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.32 + 0.3.35 com.epmet epmet-cloud @@ -87,9 +87,6 @@ dev - - true - 8080 @@ -201,6 +198,122 @@ + + local + + true + + + 8080 + + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + lb://epmet-auth-server + + lb://epmet-admin-server + + lb://epmet-oss-server + + lb://epmet-message-server + + lb://epmet-activiti-server + + lb://epmet-job-server + + + + lb://epmet-user-server + + lb://epmet-demo-server + + lb://oper-customize-server + + lb://oper-crm-server + + + lb://resi-guide-server + + + lb://gov-org-server + + + lb://oper-access-server + + + lb://resi-mine-server + + + lb://resi-group-server + + + lb://resi-partymember-server + + + lb://gov-grid-server + + + lb://gov-access-server + + + + lb://gov-mine-server + + lb://resi-hall-server + + + lb://gov-issue-server + + + lb://gov-project-server + + lb://common-service-server + + lb://resi-home-server + + + lb://gov-voice-server + + + lb://resi-voice-server + + + lb://data-report-server + + + lb://data-statistical-server + + + lb://epmet-openapi-scan + + + lb://epmet-third-server + + + + lb://epmet-heart-server + + + lb://epmet-point-server + + + lb://epmet-ext-server + + + test + + com.epmet + epmet-commons-dynamic-datasource + 2.0.0 + @@ -96,19 +102,81 @@ dev + + 8109 + dev + + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8109 - dev + local - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr 0 @@ -117,7 +185,7 @@ 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -127,6 +195,10 @@ false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -139,11 +211,24 @@ test - + - - epmet - elink@833066 + + epmet + elink@833066 + + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + 0 @@ -162,6 +247,10 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -174,11 +263,23 @@ prod - + - - epmet_data_statistical - EpmEt-db-UsEr + + epmet_data_statistical + EpmEt-db-UsEr + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr 0 @@ -197,6 +298,10 @@ true + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java index cee0ed9096..989bf71965 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java @@ -1,5 +1,7 @@ package com.epmet; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @@ -13,5 +15,6 @@ import org.springframework.scheduling.annotation.EnableAsync; public class DataReportApplication { public static void main(String[] args) { SpringApplication.run(DataReportApplication.class, args); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } 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..1b063dd470 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -0,0 +1,54 @@ +package com.epmet.datareport.controller.screen; + +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.evaluationindex.screen.AgencyService; +import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +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; + +/** + * 组织相关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..248547cc4c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -0,0 +1,94 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.DistributionService; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.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: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..220fb0ca4a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -0,0 +1,108 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.evaluationindex.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..66b7555ac8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -0,0 +1,92 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.evaluationindex.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..d670c65b1c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -0,0 +1,87 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.IndexService; +import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.evaluationindex.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){ + ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); + return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO)); + } + + /** + * @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..d3f4242013 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -0,0 +1,98 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.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..dc80b5178e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -0,0 +1,40 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.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/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java new file mode 100644 index 0000000000..e752fe40dd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java new file mode 100644 index 0000000000..17c48ae989 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerDeptDao.java new file mode 100644 index 0000000000..15ed670395 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.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/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java new file mode 100644 index 0000000000..b6196411f8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.evaluationindex.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 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); + + /** + * @Description 查询机关下的网格 + * @param agencyId + * @author zxc + * @date 2020/8/26 5:29 下午 + */ + List selectGridInfo(@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/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java new file mode 100644 index 0000000000..8697ba9adf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenEventDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventDataDao.java new file mode 100644 index 0000000000..16e023adff --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.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,@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/evaluationindex/screen/ScreenEventImgDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenEventImgDataDao.java new file mode 100644 index 0000000000..f0da56ccd9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.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/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java new file mode 100644 index 0000000000..e973aa85f3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java new file mode 100644 index 0000000000..372dacf9dd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.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.datareport.dao.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult; +import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.evaluationindex.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,@Param("monthId")String monthId); + + /** + * @Description 查询近一年的指数值【不包括本月】 + * @param agencyId + * @author zxc + * @date 2020/8/20 9:02 上午 + */ + List selectMonthBarchart(@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/evaluationindex/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java new file mode 100644 index 0000000000..c63c17fa57 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenOrgRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java new file mode 100644 index 0000000000..2b9bdba497 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java new file mode 100644 index 0000000000..fa2836e4fb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyBranchDataDao.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.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.BranchBuildOrderByCountResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchIssueDataResultDTO; +import com.epmet.evaluationindex.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); + + /** + * @Description 查询组织总数或者总参与人数 + * @param category + * @param type + * @param agencyId + * @param monthId + * @return + * @author wangc + * @date 2020.08.28 17:56 + **/ + Integer selectTotalOrganizationCount(@Param("category") String category,@Param("type") String type, @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/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java new file mode 100644 index 0000000000..1ca974982f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java new file mode 100644 index 0000000000..2c4358ce15 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java new file mode 100644 index 0000000000..92177ec52c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java new file mode 100644 index 0000000000..88c2aa0e77 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.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.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.PublicPartiRankResultDTO; +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-24 + */ +@Mapper +public interface ScreenPublicPartiTotalDataDao{ + /** + * @Description 查询公众参与各类总数 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 16:00 + **/ + List selectPublicPartiTotal(@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/evaluationindex/screen/ScreenUserJoinDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java new file mode 100644 index 0000000000..962691f625 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO; +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java new file mode 100644 index 0000000000..653cf3f606 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.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.datareport.dao.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO; +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 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); + +} \ No newline at end of file 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/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/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java new file mode 100644 index 0000000000..d633b94ea2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -0,0 +1,32 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; + +/** + * 组织相关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/evaluationindex/screen/DistributionService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java new file mode 100644 index 0000000000..a73d1ccfcd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/DistributionService.java @@ -0,0 +1,56 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.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/evaluationindex/screen/GrassRootsGovernService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java new file mode 100644 index 0000000000..fecde12a9f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassRootsGovernService.java @@ -0,0 +1,77 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.evaluationindex.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/evaluationindex/screen/GrassrootsPartyDevService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java new file mode 100644 index 0000000000..41c8fafc28 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java @@ -0,0 +1,58 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.evaluationindex.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/evaluationindex/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java new file mode 100644 index 0000000000..266898530d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java @@ -0,0 +1,54 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.evaluationindex.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); + + /** + * @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/evaluationindex/screen/PartyMemberLeadService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PartyMemberLeadService.java new file mode 100644 index 0000000000..5e75a3946c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/PartyMemberLeadService.java @@ -0,0 +1,63 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; +import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.evaluationindex.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/evaluationindex/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java new file mode 100644 index 0000000000..aea908ff15 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java @@ -0,0 +1,22 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.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/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java new file mode 100644 index 0000000000..6eef8b2387 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -0,0 +1,139 @@ +package com.epmet.datareport.service.evaluationindex.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.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; +import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; +import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 组织相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:18 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { + // 1. 查询客户根组织ID +// String customerId = externalAppRequestParam.getCustomerId(); + + + // 验签关闭,customerId无法获取,暂时写死 + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + + + TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); + if (null == rootAgency){ + return new TreeResultDTO(); + } + List centerMark = this.getCenterMark(rootAgency.getCenterMarkA()); + rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); + if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)){ + List treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue()); + rootAgency.setChildren(treeResultDTOS); + }else { + List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue())); + rootAgency.setChildren(departmentList); + } + return rootAgency; + } + + /** + * @Description 处理centerMark + * @param centerMark + * @author zxc + * @date 2020/8/26 5:18 下午 + */ + public List getCenterMark(String centerMark){ + if (centerMark.length() == NumConstant.ZERO || centerMark.equals(ScreenConstant.SQUARE_BRACKETS)) { + return new ArrayList<>(); + } + List result = new ArrayList<>(); + String substring = centerMark.substring(NumConstant.TWO, centerMark.length() - NumConstant.TWO); + String[] split = substring.split(ScreenConstant.COMMA); + for (String s : split) { + result.add(Double.valueOf(s)); + } + return result; + } + + /** + * @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) { + subAgencyList.forEach(sub -> { + List centerMark = this.getCenterMark(sub.getCenterMarkA()); + sub.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark); + if (sub.getLevel().equals(ScreenConstant.COMMUNITY)){ + List treeResultDTOS = screenCustomerGridDao.selectGridInfo(sub.getValue()); + treeResultDTOS.forEach(tree -> { + List centerMarkTree = this.getCenterMark(tree.getCenterMarkA()); + tree.setCenterMark(centerMarkTree.size() == NumConstant.ZERO ? new ArrayList<>() : centerMarkTree); + }); + sub.setChildren(treeResultDTOS); + }else { + 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.EVALUATION_INDEX,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/evaluationindex/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java new file mode 100644 index 0000000000..b65c0fe059 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/DistributionServiceImpl.java @@ -0,0 +1,134 @@ +package com.epmet.datareport.service.evaluationindex.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.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.evaluationindex.screen.DistributionService; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.*; +import com.epmet.evaluationindex.screen.dto.result.*; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 中央区相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:19 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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.EVALUATION_INDEX,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.EVALUATION_INDEX,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.EVALUATION_INDEX,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.EVALUATION_INDEX,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.EVALUATION_INDEX,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/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java new file mode 100644 index 0000000000..d750c1ee03 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -0,0 +1,252 @@ +package com.epmet.datareport.service.evaluationindex.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.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; +import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + @Autowired + private ScreenUserJoinDao screenUserJoinDao; + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenGovernRankDataDao screenGovernRankDataDao; + @Autowired + private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + + /** + * @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.EVALUATION_INDEX,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.EVALUATION_INDEX,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.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) { + + String monthId = dateUtils.getCurrentMonthId(); + UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + //保证获取公众参与概率数据的最大可能性 + int time = NumConstant.TWELVE; + while(null == latest && time > NumConstant.ONE) + { + time --; + monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + 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.EVALUATION_INDEX,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 = screenPublicPartiTotalDataDao.selectPublicPartiTotal(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.EVALUATION_INDEX,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()); + String monthId = dateUtils.getCurrentMonthId(); + List orderList = + screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId()); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + orderList = + screenGovernRankDataDao.selectGovernCapacityRatio(monthId,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,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/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java new file mode 100644 index 0000000000..619eba4625 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -0,0 +1,237 @@ +package com.epmet.datareport.service.evaluationindex.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.evaluationindex.screen.ScreenCpcBaseDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyBranchDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +import com.github.pagehelper.PageHelper; +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.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 基层党建相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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; + @Autowired + private DateUtils dateUtils; + + /** + * @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.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { + + PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); + if(null == result){ + result = new PartymemberPercentResultDTO(); + logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); + result = new PartymemberPercentResultDTO(); + 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.EVALUATION_INDEX,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.EVALUATION_INDEX,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 = dateUtils.getXpro(); + 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()); + List _ymList = monthMap.keySet().stream().collect(Collectors.toList()); + //总组织次数 + Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,param.getAgencyId(),monthMap.keySet().iterator().next()); + //自旋一次 + totalOrganizationCount = Optional.ofNullable(totalOrganizationCount).orElse( + screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,param.getAgencyId(),_ymList.get(NumConstant.ONE)) + ); + //总参与人数 + Integer totalJoinUserCount = screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,param.getAgencyId(),monthMap.keySet().iterator().next()); + //自旋一次 + totalJoinUserCount = Optional.ofNullable(totalJoinUserCount).orElse( + screenPartyBranchDataDao.selectTotalOrganizationCount(param.getCategory(),ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,param.getAgencyId(),_ymList.get(NumConstant.ONE)) + ); + + result.setTotalOrganizationCount(Optional.ofNullable(totalOrganizationCount).orElse(NumConstant.ZERO)); + result.setTotalJoinUserCount(Optional.ofNullable(totalJoinUserCount).orElse(NumConstant.ZERO)); + 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.EVALUATION_INDEX,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(dateUtils.getCurrentMonthId()); + } + 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()); + + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ + time --; + param.setMonthId(dateUtils.getPreviousMonthIdByDest(null,param.getMonthId())); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + 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); + } + + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java new file mode 100644 index 0000000000..22f6aa376b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -0,0 +1,185 @@ +package com.epmet.datareport.service.evaluationindex.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.evaluationindex.screen.ScreenIndexDataMonthlyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao; +import com.epmet.datareport.service.evaluationindex.screen.IndexService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexServiceImpl implements IndexService { + + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; + @Autowired + private DateUtils dateUtils; + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,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.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { + + MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),null); + String monthId = dateUtils.getCurrentMonthId(); + int time = NumConstant.TWELVE; + //保证获取月度指数数据的最大可能性 + while(null == monthPieChartResultDTO && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),monthId); + } + if (null == monthPieChartResultDTO){ + return new MonthPieChartResultDTO(); + } + return monthPieChartResultDTO; + } + + /** + * @Description 3、月度指数分析-柱状图 + * @param monthBarchartFormDTO + * @author zxc + * @date 2020/8/19 5:27 下午 + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO) { + 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(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()); + //升序 当前月份在队尾 + List _ymList = dateUtils.getXpro().keySet().stream().collect(Collectors.toList()); + //针对集合collect的游标 + int cursor = NumConstant.ZERO; + //针对X轴,数据集合不全则进行数据填充 + a:for(int i = NumConstant.ZERO; i < _ymList.size(); i++){ + //这里的collect必须是有序且升序的 + if(cursor >= collect.size()) break a; + //如果存在过期数据,即从数据库中查询出超出横坐标左边界的月份值 + if(Integer.parseInt(collect.get(cursor).getMonthId()) < Integer.parseInt(_ymList.get(NumConstant.ZERO))) { + //控制当前循环重复进行 + i--; + //忽略过期数据 + cursor++; + continue ; + } + if(!StringUtils.equals(collect.get(cursor).getMonthId(),_ymList.get(i))){ + //SET DEFAULT + serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); + partyDevAbilityData.add(NumConstant.ZERO_DOT_ZERO); + governAbilityData.add(NumConstant.ZERO_DOT_ZERO); + totalIndexData.add(NumConstant.ZERO_DOT_ZERO); + //保持cursor不变 + }else{ + MonthBarchartResult data = collect.get(cursor); + //SET DATA + serviceAbilityData.add(null == data.getServiceAbility() ? NumConstant.ZERO_DOT_ZERO : data.getServiceAbility()); + partyDevAbilityData.add(null == data.getPartyDevAbility() ? NumConstant.ZERO_DOT_ZERO : data.getPartyDevAbility()); + governAbilityData.add(null == data.getGovernAbility() ? NumConstant.ZERO_DOT_ZERO : data.getGovernAbility()); + totalIndexData.add(null == data.getIndexTotal() ? NumConstant.ZERO_DOT_ZERO : data.getIndexTotal()); + //统计日期一致后移动游标 + cursor++; + } + + } + + /*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.EVALUATION_INDEX,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 (CollectionUtils.isEmpty(subAgencyIndexRankResultDTOS)){ + return new ArrayList<>(); + } + return subAgencyIndexRankResultDTOS; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java new file mode 100644 index 0000000000..203b5cb456 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -0,0 +1,261 @@ +package com.epmet.datareport.service.evaluationindex.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.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; +import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.evaluationindex.screen.dto.result.*; +import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.*; + +/** + * 党建引领相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:22 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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.EVALUATION_INDEX,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); + 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.EVALUATION_INDEX,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); + result.setGroupTotal(groupData.stream().mapToInt(Integer :: intValue).sum()); + result.setGroupMemberTotal(groupMemberData.stream().mapToInt(Integer :: intValue).sum()); + return result; + } + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,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()); + //创建缺省值对象 + VolunteerServiceResult defaultObj = new VolunteerServiceResult(); + defaultObj.setAverageJoinUserData(NumConstant.ZERO); + defaultObj.setJoinData(NumConstant.ZERO); + defaultObj.setOrganizeData(NumConstant.ZERO); + + //倒叙取十二个月的数据,从本月开始,有可能取不到十二条,要对X轴空白的缺口进行填补 + 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; + } + + Set yyyyMMList = dateUtils.getXpro().keySet(); + yyyyMMList.forEach(mm -> { + Optional opt = volunteerServiceResults.stream() + .filter(obj -> StringUtils.equals(mm,obj.getMonthId())).findAny(); + VolunteerServiceResult find = opt.isPresent() ? opt.get() : defaultObj; + organizeData.add(find.getOrganizeData()); + joinData.add(find.getJoinData()); + averageJoinUserData.add(find.getAverageJoinUserData()); + }); + + + result.setOrganizeData(organizeData); + result.setJoinData(joinData); + result.setAverageJoinUserData(averageJoinUserData); + String bottomMonthId = yyyyMMList.iterator().next(); + //总组织次数 + Integer totalOrganizationCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); + //自旋一次 + totalOrganizationCount = Optional.ofNullable(totalOrganizationCount).orElse( + screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_ORGAN,volunteerServiceFormDTO.getAgencyId(),dateUtils.getPreviousMonthIdByDest(null,bottomMonthId)) + ); + //总参与人数 + Integer totalJoinUserCount = screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,volunteerServiceFormDTO.getAgencyId(),bottomMonthId); + //自旋一次 + totalJoinUserCount = Optional.ofNullable(totalJoinUserCount).orElse( + screenPartyBranchDataDao.selectTotalOrganizationCount(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE,ModuleConstant.PARAM_BRANCH_DATA_TYPE_JOIN,volunteerServiceFormDTO.getAgencyId(),dateUtils.getPreviousMonthIdByDest(null,bottomMonthId)) + ); + result.setTotalOrganizationCount(null == totalOrganizationCount ? NumConstant.ZERO : totalOrganizationCount); + result.setTotalJoinUserCount(null == totalJoinUserCount ? NumConstant.ZERO : totalJoinUserCount); + 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.ELEVEN;i >= NumConstant.ZERO; 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.EVALUATION_INDEX,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()); + String monthId = dateUtils.getCurrentMonthId(); + List gridData = + screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); + } + 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.EVALUATION_INDEX,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/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java new file mode 100644 index 0000000000..2cf288cae9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -0,0 +1,47 @@ +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO) { + ProjectDetailResultDTO projectDetailResultDTO = screenEventDataDao.selectEventDetail(projectDetailFormDTO.getProjectId(),projectDetailFormDTO.getAgencyId()); + 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/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/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..b2d99c00f1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java @@ -0,0 +1,141 @@ +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.ELEVEN;i >= NumConstant.ZERO; 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()); + } + + /** + * @Description 得到当前月份的monthId + * @param + * @return + * @author wangc + * @date 2020.08.27 13:43 + **/ + public String getCurrentMonthId(){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + return defaultFormat.format(calendar.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..7e3af9f112 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java @@ -0,0 +1,34 @@ +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"; + + /** + * 支部建设情况折线图 查询数据类型 组织次数 + * */ + String PARAM_BRANCH_DATA_TYPE_ORGAN = "organize"; + + /** + * 支部建设情况折线图 查询数据类型 参与人数 + * */ + String PARAM_BRANCH_DATA_TYPE_JOIN = "joinuser"; +} 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..5899ead6dd 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,25 @@ 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@ + evaluationIndex: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.evaluationIndex.url@ + username: @datasource.druid.evaluationIndex.username@ + password: @datasource.druid.evaluationIndex.password@ + feign: hystrix: enabled: true @@ -116,4 +135,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/data-report/data-report-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/data-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..793be083a1 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 @@ -5,6 +5,8 @@ + + ${appname} @@ -125,11 +127,14 @@ 15 - - + + ERROR ACCEPT DENY + ${webHook} + ${secret} + ${appname} @@ -137,13 +142,14 @@ - - - - - - - + + + + + + + + @@ -156,13 +162,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..fa89221e37 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.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/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml new file mode 100644 index 0000000000..22a62be6d0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ 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..cf939d024a --- /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..6cafd96036 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + \ 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..0bb479ed65 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + \ 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..b877ad611d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + \ 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..ef20677ece --- /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..7976de7ff1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + \ 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..37f45b8084 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + \ 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..d224b92d4e --- /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..310320029e --- /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..0ee2a6a315 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + \ 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..2bbdece16c --- /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..8d865b6341 --- /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..992c347f9b --- /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/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml new file mode 100644 index 0000000000..1a94210725 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + \ 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..cbbc5fe211 --- /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..57b2959430 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + \ 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..f89ede1ba6 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,11 +4,13 @@ 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"; String OPER_CRM = "operCrm"; String RESI_GROUP = "resiGroup"; String EPMET_USER = "epmetuser"; + String EVALUATION_INDEX = "evaluationIndex"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java new file mode 100644 index 0000000000..f02185071f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IndexCalConstant.java @@ -0,0 +1,69 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/27 15:20 + */ +public interface IndexCalConstant { + + Integer PAGE_SIZE = 10; + + String GRID_ID="GRID_ID"; + + String DEPT_ID="DEPT_ID"; + + String AGENCY_ID="AGENCY_ID"; + + String PARENT_AGENCY_ID = "parentAgencyId"; + + String PARENT_ID = "PARENT_ID"; + + String CUSTOMER_ID="CUSTOMER_ID"; + + String MONTH_ID="MONTH_ID"; + + String USER_ID="USER_ID"; + String YEAR_ID = "YEAR_ID"; + + String COMMUNITY_LEVEL = "community"; + + String STREET_LEVEL = "street"; + + String DISTRICT_LEVEL = "district"; + + String COMMUNITY_RELATE = "shequxiangguan"; + + + + + // 测试插入数据用 + String customerId="b09527201c4409e19d1dbc5e3c3429a1"; + //社区S1-C1 + String SHE_QU_S1_C1="S1-C1"; + //社区S1-C2 + String SHE_QU_S1_C2="S1-C2"; + //网格S1-C1-G1 + String S1_C1_G1="S1-C1-G1"; + //网格S1-C1-G2 + String S1_C1_G2="S1-C1-G2"; + //网格S1-C2-G1 + String S1_C2_G1="S1-C2-G1"; + + String monthId="202008"; + String insertUser="yinzuomei"; + + String INDEX_DETAIL_LIST_NULL = "指标明细查询集合为空"; + String COMMUNITY_PARTY_AVG_NULL = "查询下属所有【社区】的党建能力平均值集合为空"; + String GRID_PARTY_AVG_NULL = "查询下属所有【网格】的党建能力平均值集合为空"; + String DISTRICT_PARTY_AVG_NULL = "查询【区县】的党建能力平均值集合为空"; + String STREET_PUBLISH_ARTICLE_LIST_NULL = "查询【街道】名义发文数量集合为空"; + String DISTRICT_PUBLISH_ARTICLE_LIST_NULL = "查询【区/县】名义发文数量集合为空"; + String COMMUNITY_PUBLISH_ARTICLE_LIST_NULL = "查询【社区】名义发文数量集合为空"; + String INDEX_CODE_NULL = "指标Code未查询出对应字段 【 %s 】"; + String STREET_GOVERN_ABILITY_NULL = "查询【街道】治理能力的六个五级指标集合为空"; + String COMMUNITY_GOVERN_ABILITY_NULL = "查询【社区】治理能力的六个五级指标集合为空"; + String STREET_SERVICE_ABILITY_NULL = "查询街道活动组织次数集合为空"; + String COMMUNITY_SERVICE_ABILITY_NULL = "查询社区活动组织次数集合为空"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java new file mode 100644 index 0000000000..a9abd3411f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -0,0 +1,135 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.indexcal; + +import java.io.Serializable; +import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.IndexCalConstant; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +public class AgencyScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id(eg:社区或者街道id) + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; + + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public AgencyScoreDTO() { + this.isTotal = NumConstant.ZERO_STR; + this.score = new BigDecimal(NumConstant.ZERO); + this.indexCode = ""; + this.dataType = IndexCalConstant.STREET_LEVEL; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java new file mode 100644 index 0000000000..187f69c960 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 指标计算通用入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:49 + */ +@Data +public class CalculateCommonFormDTO implements Serializable { + private static final long serialVersionUID = -5689788391963427717L; + /** + * 月份id: yyyyMM + */ + private String monthId; + + /** + * 客户id + */ + private String customerId; + + public CalculateCommonFormDTO() { + super(); + } + + public CalculateCommonFormDTO(String customerId, String monthId) { + this.monthId=monthId; + this.customerId=customerId; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java new file mode 100644 index 0000000000..16ede875bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.indexcal; + +import com.epmet.dto.ScreenCustomerGridDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 客户下所有网格 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 13:45 + */ +@Data +public class CustomerGridInfoDTO implements Serializable { + private static final long serialVersionUID = -3211409107659568304L; + + /** + * 网格总数 + */ + private Integer total; + + /** + * 网格列表 + */ + private List gridList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java new file mode 100644 index 0000000000..5051aa3d82 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcal; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +public class DeptScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 治理能力:zhilinengli; + */ + private String indexCode; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java new file mode 100644 index 0000000000..fd383a61dd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueCommonDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 最值通用DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:39 + */ +@Data +public class ExtremeValueCommonDTO implements Serializable { + + private static final long serialVersionUID = -6295067080250068024L; + /** + * 最小值 + */ + private BigDecimal minValue; + + /** + * 最小值 + */ + private BigDecimal maxValue; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java new file mode 100644 index 0000000000..4dbabbf958 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/ExtremeValueDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 最值通用DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:39 + */ +@Data +public class ExtremeValueDTO implements Serializable { + + private static final long serialVersionUID = -2227402439857459667L; + + /** + * 最小值 + */ + private BigDecimal minValue1; + private BigDecimal minValue2; + private BigDecimal minValue3; + private BigDecimal minValue4; + private BigDecimal minValue5; + private BigDecimal minValue6; + private BigDecimal minValue7; + private BigDecimal minValue8; + private BigDecimal minValue9; + private BigDecimal minValue10; + + private BigDecimal maxValue1; + private BigDecimal maxValue2; + private BigDecimal maxValue3; + private BigDecimal maxValue4; + private BigDecimal maxValue5; + private BigDecimal maxValue6; + private BigDecimal maxValue7; + private BigDecimal maxValue8; + private BigDecimal maxValue9; + private BigDecimal maxValue10; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java new file mode 100644 index 0000000000..5e3b4096f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 网格相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/31 16:38 + */ +@Data +public class GridScoreDTO implements Serializable { + /** + * 网格Id + */ + private String gridId; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + private List detailList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java new file mode 100644 index 0000000000..e2573fbfd9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/GridScoreDetailDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 网格相关分值 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/31 16:39 + */ +@Data +public class GridScoreDetailDTO implements Serializable { + /** + * 1:总分;0不是 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java new file mode 100644 index 0000000000..3db0986065 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 分页查询网格列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/27 14:37 + */ +@Data +public class PageQueryGridFormDTO implements Serializable { + /** + * 客户id + */ + private String customerId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + + /** + * 每页多少条 + * */ + private Integer pageSize; + + private Integer pageIndex; + + + public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize){ + this.customerId=customerId; + this.monthId=monthId; + this.pageIndex=pageIndex; + this.pageNo=pageNo; + this.pageSize=pageSize; + } + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java new file mode 100644 index 0000000000..f88e035b7b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:32 上午 + */ +@Data +public class SubAgencyScoreAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 6913351504675726385L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java new file mode 100644 index 0000000000..06b06109f1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/2 6:01 下午 + */ +@Data +public class SubCommunityAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 7681907923515081626L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java new file mode 100644 index 0000000000..013d8c02dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityGovernAvgResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/2 5:54 下午 + */ +@Data +public class SubCommunityGovernAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 4591964909777753497L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityPartyAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityPartyAvgResultDTO.java new file mode 100644 index 0000000000..997b9fed0b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityPartyAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/2 4:28 下午 + */ +@Data +public class SubCommunityPartyAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -6439835738195045820L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..80ec8c7100 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexGovrnAblityGridMonthlyDTO.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 治理能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexGovrnAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户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; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..901ff46b9e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexPartyAblityGridMonthlyDTO.java @@ -0,0 +1,167 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党建能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexPartyAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户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; + + /** + * 年Idyyyy + */ + 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; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java new file mode 100644 index 0000000000..decd896d03 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/FactIndexServiceAblityGridMonthlyDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.indexcollect; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class FactIndexServiceAblityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户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; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/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..b35ca1537a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java @@ -0,0 +1,72 @@ +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; + + /** + * 区直部门被吹哨次数 + */ + 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..021533fe59 --- /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 issueToProjectRatio; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + 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/GridPartyMemberDataDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java new file mode 100644 index 0000000000..364b19c34f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataDetailFormDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 1、党建能力-党员相关指标上报(按照月份) 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/4 16:04 + */ +@Data +public class GridPartyMemberDataDetailFormDTO implements Serializable { + private static final long serialVersionUID = 2923515319015973995L; + /** + * 机关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; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 党员自建群活跃群众人数(08-24) + */ + private Integer groupActiveUserCount; + + /** + * 用户id + */ + private String userId; +} 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..5a0a9fb3c8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; +import org.apache.poi.hpsf.Decimal; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 1、党建能力-党员相关指标上报(按照月份) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridPartyMemberDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List partyMemberDataList; +} 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..c2eadf4dc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java @@ -0,0 +1,83 @@ +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; + + /** + * district:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 被吹哨次数 + */ + private Integer transferedCount; + + /** + * 办结项目数 + */ + private Integer closedProjectCount; + + /** + * 项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 办结项目率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 社区超期项目率,dataTyp=commnuity有值 + */ + private BigDecimal overdueProjectRatio; + + + /** + * 街道办结项目的处理效率, data_type=street时有值 + */ + private BigDecimal handleProjectRatio; +} 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..cc1401d424 --- /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; + + /** + * district:全区;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..59050bced2 --- /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; + + /** + * district:全区;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/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java new file mode 100644 index 0000000000..8ad2ec6658 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 社区相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Data +public class FactIndexCommunityScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 社区上一级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan + */ + private String indexCode; + + /** + * 删除状态 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public FactIndexCommunityScoreDTO() { + this.customerId = ""; + this.agencyId = ""; + this.parentAgencyId = ""; + this.yearId = ""; + this.quarterId = ""; + this.monthId = ""; + this.isTotal = "0"; + this.score = new BigDecimal(0); + this.indexCode = ""; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java new file mode 100644 index 0000000000..d5be2db6e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-28 + */ +@Data +public class FactIndexGridScoreDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 年维度Id: yyyy + */ + private String yearId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关(前三者之和):wanggexiangguan + */ + private String indexCode; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.java new file mode 100644 index 0000000000..efe372f027 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/IndexGroupDetailDTO.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.dto.screen; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class IndexGroupDetailDTO { + + 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-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java new file mode 100644 index 0000000000..ee7863d40b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格(党支部)信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-26 + */ +@Data +public class ScreenCustomerGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党支部(=网格)的位置 + */ + private String partyMark; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} \ No newline at end of file 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..af11109fa3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * desc:初始化客户指标权重参数实体类 + * @author liujianjun + */ +@Data +public class IndexCalculateForm implements Serializable { + private static final long serialVersionUID = 3280392511156378209L; + /** + * desc:客户ids + */ + private List customerIds; + + /** + * 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/screen/result/CommunityActivityCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java new file mode 100644 index 0000000000..ec3b17f615 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityActivityCountResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/31 2:12 下午 + */ +@Data +public class CommunityActivityCountResultDTO implements Serializable { + + private static final long serialVersionUID = -6623426101220283941L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 发文数 + */ + public Integer activityCount; + + public CommunityActivityCountResultDTO() { + this.agencyId = ""; + this.parentId = ""; + this.monthId = ""; + this.quarterId = ""; + this.yearId = ""; + this.activityCount = 0; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java new file mode 100644 index 0000000000..84ab47503d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityCalculateResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 1:21 下午 + */ +@Data +public class CommunityGovernAbilityCalculateResultDTO implements Serializable { + + private static final long serialVersionUID = 3766218681545581100L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private Double score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java new file mode 100644 index 0000000000..92b80e3ecf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityGovernAbilityResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 11:20 上午 + */ +@Data +public class CommunityGovernAbilityResultDTO implements Serializable { + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 社区被吹哨次数 + */ + private Integer transferedCount; + + /** + * 社区办结项目数 + */ + private Integer closedProjectCount; + + /** + * 社区项目响应度 + */ + private Double respProjectRatio; + + /** + * 社区项目超期率 + */ + private Double overDueProjectRatio; + + /** + * 社区办结项目率 + */ + private Double closedProjectRatio; + + /** + * 社区办结项目满意度 + */ + private Double satisfactionRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java new file mode 100644 index 0000000000..148d6abd80 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountCalculateResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:43 上午 + */ +@Data +public class CommunityPublishArticleCountCalculateResultDTO implements Serializable { + + private static final long serialVersionUID = 3527690541253204132L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private Double score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java new file mode 100644 index 0000000000..cf29133001 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CommunityPublishArticleCountResultDTO.java @@ -0,0 +1,59 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:37 上午 + */ +@Data +public class CommunityPublishArticleCountResultDTO implements Serializable { + + private static final long serialVersionUID = -8260746179353253237L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 发文数 + */ + public Integer publishArticleCount; + + public CommunityPublishArticleCountResultDTO() { + this.agencyId = ""; + this.parentId = ""; + this.monthId = ""; + this.quarterId = ""; + this.yearId = ""; + this.publishArticleCount = 0; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java new file mode 100644 index 0000000000..0d6cea89c8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/IndexGroupDetailResult.java @@ -0,0 +1,28 @@ +package com.epmet.dto.screen.result; + +import com.epmet.dto.screen.IndexGroupDetailDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * desc:计算指标时 获取要计算的组的指标 + * + * @author liujianjun + */ +@Data +public class IndexGroupDetailResult implements Serializable { + private static final long serialVersionUID = 3937041236261115759L; + + /** + * 是否有下一组 + */ + private Boolean hasNextGroup; + + /** + * desc:指标详情列表 如果hasNextGroup是true则返回的是明细,否则返回的是上级的分组的指标明细 + * 例如:网格的三大能力上次已经返回完毕,下一次调用时返回的是网格相关的三大能力的 指标明细 + */ + private List indexGroupDetailList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java new file mode 100644 index 0000000000..aa9f471405 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinBigDecimalResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/30 8:11 下午 + */ +@Data +public class MaxAndMinBigDecimalResultDTO implements Serializable { + + private static final long serialVersionUID = 76227645470470839L; + + private BigDecimal min; + + private BigDecimal max; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java new file mode 100644 index 0000000000..32b429f188 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinDoubleResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/28 9:51 上午 + */ +@Data +public class MaxAndMinDoubleResultDTO implements Serializable { + + private static final long serialVersionUID = -3927045097012156582L; + + /** + * 最小值 + */ + private Double min; + + /** + * 最大值 + */ + private Double max; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java new file mode 100644 index 0000000000..d807e42344 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/MaxAndMinIntegerResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/28 9:49 上午 + */ +@Data +public class MaxAndMinIntegerResultDTO implements Serializable { + + private static final long serialVersionUID = 5845694081181431599L; + + /** + * 最小值 + */ + private Integer min; + + /** + * 最大值 + */ + private Integer max; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java new file mode 100644 index 0000000000..460eb12640 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/28 3:15 下午 + */ +@Data +public class SubGridAvgResultDTO implements Serializable { + + private static final long serialVersionUID = 1592381327492545907L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java new file mode 100644 index 0000000000..64f3cc7319 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridGovernAvgResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/31 9:11 上午 + */ +@Data +public class SubGridGovernAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -1354963771895272899L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java new file mode 100644 index 0000000000..ba6329aef1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridServiceAvgResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screen.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/8/31 1:53 下午 + */ +@Data +public class SubGridServiceAvgResultDTO implements Serializable { + + private static final long serialVersionUID = -405197363477213644L; + + /** + * + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String parentId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 分数 + */ + private BigDecimal score; +} 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..75eb13a0fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java @@ -0,0 +1,56 @@ +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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java new file mode 100644 index 0000000000..ab77a2363c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java @@ -0,0 +1,105 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/4 15:43 + */ +@Data +public class DifficultyDataDetailFormDTO implements Serializable { + private static final long serialVersionUID = 4893795146396420078L; + /** + * 组织类别 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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} 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..a0de181acb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 3、难点赌点 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class DifficultyDataFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * 难点堵点数据 + */ + private List diffcultyDataList; + +} 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..6c2cbe43a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java @@ -0,0 +1,129 @@ +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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} 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..5e962e47bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java @@ -0,0 +1,87 @@ +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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} 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..5d9f5da32b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java @@ -0,0 +1,81 @@ +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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} 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/PublicPartiTotalDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java new file mode 100644 index 0000000000..df902a06a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 18、公众参与各类总数 入参 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PublicPartiTotalDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id,如果是网格,传入网格所属的组织id + */ + private String parentId; + + /** + * 组织名称(可以是网格名称,也可以是组织名称) + */ + private String orgName; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 注册人数 + */ + private Integer regUserTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 参与人数 + */ + private Integer joinUserTotal; + + /** + * 数据更新至: 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..3111d5136d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java @@ -0,0 +1,71 @@ +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; +} 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..36afabff51 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.48 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml index 029e37c343..b62847d615 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.48 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml index 2e5a7af0e8..075a43a0af 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.47 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..d930651a68 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.48 data-statistical com.epmet @@ -68,6 +68,36 @@ 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 + + + io.github.wnjustdoit + pinyin4j + 2.6.0 + @@ -97,12 +127,107 @@ dev + + 8108 + dev + + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + + + + epmet_gov_voice_user + EpmEt-db-UsEr + + + + + epmet_oper_crm_user + EpmEt-db-UsEr + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + + + + epmet_user_user + EpmEt-db-UsEr + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + 5 + 8 + 10 + 30 + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8108 - dev + local @@ -153,13 +278,25 @@ epmet_user_user EpmEt-db-UsEr + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 192.168.1.130 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -239,6 +376,18 @@ epmet elink@833066 + + + + epmet + elink@833066 + + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -321,6 +470,18 @@ epmet_user_user EpmEt-db-UsEr + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com @@ -350,4 +511,4 @@ - \ No newline at end of file + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index ad4e2110fa..eee1f3bca7 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 @@ -1,15 +1,22 @@ package com.epmet; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; 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(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java new file mode 100644 index 0000000000..7c88be956c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * 组织类别/机关级别 常量 + * + * @author sun + * @since 1.0.0 + */ +public interface OrgTypeConstant { + + /** + * 部门 + */ + String DEPARTMENT = "department"; + + /** + * 网格 + */ + String GRID = "grid"; + + /** + * 组织 + */ + String AGENCY = "agency"; + + /** + * 乡(镇、街道)级 + */ + String STREET = "street"; + + /** + * 区县级 + */ + String DISTRICT = "district"; + + /** + * 社区级 + */ + String COMMUNITY = "community"; + +} 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..bf2e750a65 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,14 +1,34 @@ package com.epmet.controller; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; +import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.evaluationindex.indexcal.*; +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; +import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; import java.util.concurrent.ExecutionException; @@ -19,13 +39,25 @@ import java.util.concurrent.Future; @RestController @Slf4j public class DemoController { - @Autowired private StatsDemoService demoService; @Autowired private ExecutorService executorService; + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private IndexCalculateCommunityService indexCalculateCommunityService; + @Autowired + private GridCorreLationService gridCorreLationService; + @Autowired + private IndexCalculateStreetService indexCalculateStreetService; + @Autowired + private DeptScoreService deptScoreService; + @Autowired + private IndexCalculateDistrictService indexCalculateDistrictService; + @GetMapping("testAlarm") public void testAlarm() { //for (int i = 0; i < 20; i++) { @@ -91,4 +123,364 @@ 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); + } + + @PostMapping("zxc2") + public Result getZxc2(){ + indexCalculateCommunityService.calCommunityAll("b09527201c4409e19d1dbc5e3c3429a1","202008"); + return new Result(); + } + + @PostMapping("testcalculategridcorrelation") + public Result testcalculateGridCorreLation(){ + CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); + gridCorreLationService.calculateGridCorreLation(formDTO); + return new Result(); + } + + @Autowired + private GridScoreDao gridScoreDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; +// private static Integer testcal=100; + + @PostMapping("testcal") + public Result testCal(){ + CalculateCommonFormDTO formDTO=new CalculateCommonFormDTO("b09527201c4409e19d1dbc5e3c3429a1","202008"); +// //查询总记录数 +// List gridScoreDTOList=gridScoreDao.selectList(formDTO); +// return new Result>().ok(gridScoreDTOList); + gridCorreLationService.calculateGridCorreLation(formDTO); +// deptScoreService.calculateDeptCorreLation(formDTO); + return new Result(); + } + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @PostMapping("insertgridinfo") + public Result insertScreenCustomerGrid(){ + ScreenCustomerGridEntity entity1=new ScreenCustomerGridEntity(); + entity1.setCustomerId(IndexCalConstant.customerId); + entity1.setGridId(IndexCalConstant.S1_C1_G1); + entity1.setGridName("网格S1-C1-G1"); + entity1.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity1.setAllParentIds("S1,C1"); + entity1.setCreatedBy(IndexCalConstant.insertUser); + entity1.setUpdatedBy(IndexCalConstant.insertUser); + entity1.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity1); + + ScreenCustomerGridEntity entity2=new ScreenCustomerGridEntity(); + entity2.setCustomerId(IndexCalConstant.customerId); + entity2.setGridId(IndexCalConstant.S1_C1_G2); + entity2.setGridName("网格S1-C1-G2"); + entity2.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity2.setAllParentIds("S1,C1"); + entity2.setCreatedBy(IndexCalConstant.insertUser); + entity2.setUpdatedBy(IndexCalConstant.insertUser); + entity2.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity2); + + ScreenCustomerGridEntity entity3=new ScreenCustomerGridEntity(); + entity3.setCustomerId(IndexCalConstant.customerId); + entity3.setGridId(IndexCalConstant.S1_C2_G1); + entity3.setGridName("网格S1-C2-G1"); + entity3.setParentAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity3.setAllParentIds("S1,C2"); + entity3.setCreatedBy(IndexCalConstant.insertUser); + entity3.setUpdatedBy(IndexCalConstant.insertUser); + entity3.setDataEndTime("20200901"); + screenCustomerGridDao.insert(entity3); + + return new Result(); + } + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @PostMapping("inserttestdata") + public Result test(){ + //网格相关-党建能力 + FactIndexPartyAblityGridMonthlyEntity entity1=this.getPartyAblityGridMonthlyEntity1(); + factIndexPartyAblityGridMonthlyDao.insert(entity1); + FactIndexPartyAblityGridMonthlyEntity entity2=this.getPartyAblityGridMonthlyEntity2(); + factIndexPartyAblityGridMonthlyDao.insert(entity2); + FactIndexPartyAblityGridMonthlyEntity entity3=this.getPartyAblityGridMonthlyEntity3(); + factIndexPartyAblityGridMonthlyDao.insert(entity3); + + //网格相关-治理能力 + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity1=this.getGovrnAblityGridMonthlyEntity1(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity1); + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity2=this.getGovrnAblityGridMonthlyEntity2(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity2); + FactIndexGovrnAblityGridMonthlyEntity zhiliEntity3=this.getGovrnAblityGridMonthlyEntity3(); + factIndexGovrnAblityGridMonthlyDao.insert(zhiliEntity3); + + //网格相关-服务能力 + FactIndexServiceAblityGridMonthlyEntity fuwuEntity1=this.getServiceAblityGridMonthlyEntity1(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity1); + FactIndexServiceAblityGridMonthlyEntity fuwuEntity2=this.getServiceAblityGridMonthlyEntity2(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity2); + FactIndexServiceAblityGridMonthlyEntity fuwuEntity3=this.getServiceAblityGridMonthlyEntity3(); + factIndexServiceAblityGridMonthlyDao.insert(fuwuEntity3); + + return new Result(); + } + + //网格相关-党建能力-网格1 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity1() { + FactIndexPartyAblityGridMonthlyEntity entity1=new FactIndexPartyAblityGridMonthlyEntity(); + entity1.setCustomerId(IndexCalConstant.customerId); + entity1.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity1.setGridId(IndexCalConstant.S1_C1_G1); + entity1.setMonthId(IndexCalConstant.monthId); + entity1.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity1.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity1.setUserCount(10); // 网格群众用户数 + entity1.setPartyCount(50); // 网格党员用户数 + entity1.setActiveUserCount(100); // 网格活跃群众用户数 + entity1.setActivePartyCount(80); //网格活跃党员用户数 + entity1.setPartyAvgTopicCount(30); //网格党员人均提出话题数 + entity1.setUserAvgTopicCount(10); //网格群众人均提出话题数 + entity1.setPartyAvgShiftProjectCount(50); //网格党员人均提出的议题转项目数 + entity1.setUserAvgShiftProjectCount(50); //网格群众人均提出的议题转项目数 + entity1.setCreateGroupPartyCount(35); //建群党员数(累计值) 去重 + entity1.setPublishArticleCount(50); //网格发文数 + entity1.setIssueToProjectRatio(new BigDecimal("50")); //网格议题转项目率 + entity1.setCreateThreeMeetsCount(10); //组织三会一课次数 + entity1.setJoinThreeMeetsCount(30); //党员参加三会一课人次 + + entity1.setCreatedBy(IndexCalConstant.insertUser); + entity1.setUpdatedBy(IndexCalConstant.insertUser); + return entity1; + } + + //网格相关-党建能力-网格2 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity2() { + FactIndexPartyAblityGridMonthlyEntity entity2=new FactIndexPartyAblityGridMonthlyEntity(); + entity2.setCustomerId(IndexCalConstant.customerId); + entity2.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity2.setGridId(IndexCalConstant.S1_C1_G2); + entity2.setMonthId(IndexCalConstant.monthId); + entity2.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity2.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity2.setUserCount(20); // 网格群众用户数 + entity2.setPartyCount(30); // 网格党员用户数 + entity2.setActiveUserCount(20); // 网格活跃群众用户数 + entity2.setActivePartyCount(20); //网格活跃党员用户数 + entity2.setPartyAvgTopicCount(10); //网格党员人均提出话题数 + entity2.setUserAvgTopicCount(50); //网格群众人均提出话题数 + entity2.setPartyAvgShiftProjectCount(35); //网格党员人均提出的议题转项目数 + entity2.setUserAvgShiftProjectCount(55); //网格群众人均提出的议题转项目数 + entity2.setCreateGroupPartyCount(30); //建群党员数(累计值) 去重 + entity2.setPublishArticleCount(30); //网格发文数 + entity2.setIssueToProjectRatio(new BigDecimal("30")); //网格议题转项目率 + entity2.setCreateThreeMeetsCount(35); //组织三会一课次数 + entity2.setJoinThreeMeetsCount(20); //党员参加三会一课人次 + + entity2.setCreatedBy(IndexCalConstant.insertUser); + entity2.setUpdatedBy(IndexCalConstant.insertUser); + return entity2; + } + //网格相关-党建能力-网格3 + private FactIndexPartyAblityGridMonthlyEntity getPartyAblityGridMonthlyEntity3() { + FactIndexPartyAblityGridMonthlyEntity entity3=new FactIndexPartyAblityGridMonthlyEntity(); + entity3.setCustomerId(IndexCalConstant.customerId); + entity3.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity3.setGridId(IndexCalConstant.S1_C2_G1); + entity3.setMonthId(IndexCalConstant.monthId); + entity3.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity3.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity3.setUserCount(60); // 网格群众用户数 + entity3.setPartyCount(80); // 网格党员用户数 + entity3.setActiveUserCount(70); // 网格活跃群众用户数 + entity3.setActivePartyCount(70); //网格活跃党员用户数 + entity3.setPartyAvgTopicCount(40); //网格党员人均提出话题数 + entity3.setUserAvgTopicCount(20); //网格群众人均提出话题数 + entity3.setPartyAvgShiftProjectCount(30); //网格党员人均提出的议题转项目数 + entity3.setUserAvgShiftProjectCount(30); //网格群众人均提出的议题转项目数 + entity3.setCreateGroupPartyCount(20); //建群党员数(累计值) 去重 + entity3.setPublishArticleCount(80); //网格发文数 + entity3.setIssueToProjectRatio(new BigDecimal("80")); //网格议题转项目率 + entity3.setCreateThreeMeetsCount(100); //组织三会一课次数 + entity3.setJoinThreeMeetsCount(100); //党员参加三会一课人次 + + entity3.setCreatedBy(IndexCalConstant.insertUser); + entity3.setUpdatedBy(IndexCalConstant.insertUser); + return entity3; + } + //网格相关-治理能力-网格1 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity1() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(100); //网格总议题数 + entity.setAvgIssueCount(100); //网格人均议题数目 + entity.setIssueToProjectRatio(new BigDecimal("20")); //网格议题转项目率 + entity.setProjectTotal(20);// 网格总项目数 + entity.setSelfSolveProjectCount(10); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(100);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("100"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("100"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-治理能力-网格2 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity2() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G2); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(70); //网格总议题数 + entity.setAvgIssueCount(10); //网格人均议题数目 + entity.setIssueToProjectRatio(new BigDecimal("20")); //网格议题转项目率 + entity.setProjectTotal(40);// 网格总项目数 + entity.setSelfSolveProjectCount(15); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(20);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("10"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("70"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + + return entity; + } + //网格相关-治理能力-网格3 + private FactIndexGovrnAblityGridMonthlyEntity getGovrnAblityGridMonthlyEntity3() { + FactIndexGovrnAblityGridMonthlyEntity entity=new FactIndexGovrnAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity.setGridId(IndexCalConstant.S1_C2_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setIssueTotal(80); //网格总议题数 + entity.setAvgIssueCount(70); //网格人均议题数目 + entity.setIssueToProjectRatio(new BigDecimal("100")); //网格议题转项目率 + entity.setProjectTotal(100);// 网格总项目数 + entity.setSelfSolveProjectCount(20); // 网格自治项目数 统计期网格自身内办结的项目数目 + entity.setResolveProjectCount(20);//网格办结项目数 统计期内办结的项目数目 + entity.setTransferRightRatio(new BigDecimal("70"));//网格吹哨部门准确率 + entity.setSatisfactionRatio(new BigDecimal("10"));//网格内解决的项目的满意度 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + + return entity; + } + + //网格相关-服务能力-网格1 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity1() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(80);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("70"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("60"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-服务能力-网格2 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity2() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C1); + entity.setGridId(IndexCalConstant.S1_C1_G2); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(40);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("30"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("80"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + //网格相关-服务能力-网格3 + private FactIndexServiceAblityGridMonthlyEntity getServiceAblityGridMonthlyEntity3() { + FactIndexServiceAblityGridMonthlyEntity entity=new FactIndexServiceAblityGridMonthlyEntity(); + entity.setCustomerId(IndexCalConstant.customerId); + entity.setAgencyId(IndexCalConstant.SHE_QU_S1_C2); + entity.setGridId(IndexCalConstant.S1_C2_G1); + entity.setMonthId(IndexCalConstant.monthId); + entity.setQuarterId(DateUtils.getQuarterId(IndexCalConstant.monthId)); + entity.setYearId(DateUtils.getYearId(IndexCalConstant.monthId)); + + entity.setActivityCount(20);//网格活动组织次数 爱心活动 + entity.setVolunteerRatio(new BigDecimal("80"));//网格志愿者占比 + entity.setPartyVolunteerRatio(new BigDecimal("20"));// 网格党员志愿者率 + + entity.setCreatedBy(IndexCalConstant.insertUser); + entity.setUpdatedBy(IndexCalConstant.insertUser); + return entity; + } + + @PostMapping("streetZxc") + public void getStreet(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + indexCalculateStreetService.calStreetAll(customerId,monthId); + } + + @PostMapping("districtZxc") + public void getDistrict(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + indexCalculateDistrictService.calDistrictAll(customerId,monthId); + } + @PostMapping("gridZxc") + public void getGrid(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + CalculateCommonFormDTO c = new CalculateCommonFormDTO(); + c.setCustomerId(customerId); + c.setMonthId(monthId); + gridCorreLationService.calculateGridCorreLation(c); + } + @PostMapping("deptZxc") + public void getDept(){ + String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + String monthId = "202008"; + CalculateCommonFormDTO c = new CalculateCommonFormDTO(); + c.setCustomerId(customerId); + c.setMonthId(monthId); + deptScoreService.calculateDeptCorreLation(c); + } } 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..138ab5cbb7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.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.indexcollect.form.*; +import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; +import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +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 GridPartyMemberDataFormDTO 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..978181b3a4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -0,0 +1,177 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; +import com.epmet.util.DimIdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +/** + * 指标计算controller + * + * @author liujianjun@elink-cn.com + * @date 2020/8/24 14:38 + */ +@RestController +@RequestMapping("indexcalculate") +public class IndexCalculateController { + + @Autowired + private IndexCalculateService indexCalculateService; + + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; + + /** + * 按照客户计算所有指标(按照月份) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @PostMapping("all") + public Result indexCalculate(@RequestBody IndexCalculateForm formDTO) { + Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); + if (aBoolean){ + return new Result().ok(true); + } + return new Result().error("指标计算失败"); + } + + /** + * desc:计算党员指标分数 + * + * @return + */ + @PostMapping("cpc") + public Result cpc(@RequestBody CalculateCommonFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getMonthId())) { + //默认 当前月份-1 + formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); + } + return new Result().ok(cpcIndexCalculateService.cpcIndexCalculate(formDTO)); + } + + /* *//** + * 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..03deff604d --- /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.evaluationindex.screen.IndexDictService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; +import com.epmet.service.evaluationindex.screen.IndexGroupService; +import com.epmet.service.evaluationindex.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..d83f8df3c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java @@ -0,0 +1,303 @@ +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.evaluationindex.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 DifficultyDataFormDTO 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(); + } + + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * + * @param formDTO + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:44 2020-08-25 + **/ + @ExternalAppRequestAuth + @PostMapping("publicpartitotaldata") + public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java new file mode 100644 index 0000000000..5cbcfb20e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +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-09-02 + */ +@Mapper +public interface AgencyScoreDao extends BaseDao { + + /** + * @Description 【街道】中间表插入 + * @param lists + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertStreetRecord(@Param("lists") List lists); + + /** + * @Description 删除旧记录 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/2 15:47 + */ + void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + + /** + * @Description 查询【fact_index_agency_score】相关信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType); + + /** + * @Description 区下级街道得分平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + + + /** + * 根据入参查询 区/街道相关分数表 记录 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListAgencyScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 批量插入区/街道相关分数表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertAgencyScoreData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * 根据入参查询 区/街道相关分数表id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListAgencyId(@Param("customerId")String customerId, @Param("monthId")String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java new file mode 100644 index 0000000000..9c3d339ae8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Collection; +import java.util.List; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Mapper +public interface CpcScoreDao extends BaseDao { + + /** + * @param customerId + * @param monthId + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值) + * @Date 2020/8/31 10:56 + **/ + BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("gridId") String gridId); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 + * @Date 2020/8/31 12:10 + **/ + List selectListGridContactMassesAvgValue(CalculateCommonFormDTO formDTO); + + /** + * @param calculateCommonFormDTO + * @return java.util.List + * @author yinzuomei + * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 + * @Date 2020/8/31 14:42 + **/ + List selectListJoinIssueAvgValue(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @param customerId + * @param monthId + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 组织内党员的参与议事能力考评分(平均值) + * @Date 2020/8/31 15:51 + **/ + BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); + + List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId); + + int insertBatch(@Param("list") Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java new file mode 100644 index 0000000000..4be461b59a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.indexcal.DeptScoreDTO; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +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-09-02 + */ +@Mapper +public interface DeptScoreDao extends BaseDao { + + /** + * 根据入参查询 区直部门分值表 记录 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListDeptScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 批量插入 区直部门分值表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertDeptScoreData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * 根据入参查询 区直部门分值表id + * @param customerId + * @param monthId + * @return java.lang.String + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListDeptId(@Param("customerId")String customerId, @Param("monthId")String monthId); + + + /** + * @Description 所有直属部门治理能力平均值 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/4 10:53 上午 + */ + List selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + + /** + * @return int + * @param customerId + * @param monthId + * @param deptId + * @author yinzuomei + * @description + * @Date 2020/9/7 14:30 + **/ + int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, @Param("monthId")String monthId,@Param("deptId") String deptId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java new file mode 100644 index 0000000000..2e4a10cde2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java @@ -0,0 +1,69 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.GridScoreDTO; +import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; +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-31 + */ +@Mapper +public interface GridScoreDao extends BaseDao { + /** + * @param customerId + * @param monthId + * @param indexCode + * @param isTotal 1:总分;0不是 + * @return int + * @author yinzuomei + * @description + * @Date 2020/8/31 14:00 + **/ + int deleteByCusAndMonthId(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("indexCode") String indexCode, + @Param("isTotal") String isTotal); + + /** + * @return int + * @param gridScoreEntityList + * @author yinzuomei + * @description + * @Date 2020/8/31 14:01 + **/ + int insertBatches(List gridScoreEntityList); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description + * @Date 2020/8/31 16:42 + **/ + List selectList(CalculateCommonFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java new file mode 100644 index 0000000000..5a9350a63e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -0,0 +1,112 @@ +package com.epmet.dao.evaluationindex.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.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 治理能力-部门相关数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-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); + + /** + * @return java.lang.Integer + * @param calculateCommonFormDTO + * @author yinzuomei + * @description 查询(fact_index_govrn_ablity_dept_monthly治理能力-区直部门相关数据 )当前月共上传了多少条记录 + * @Date 2020/9/3 9:31 + **/ + Integer selectCount(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @return java.util.Map + * @param calculateCommonFormDTO + * @author yinzuomei + * @description 计算最大最小值 + * @Date 2020/9/3 9:36 + **/ + Map selectExtremeValue(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @return java.util.List> + * @param customerId 客户id + * @param monthId yyyyMM + * @param offset + * @param pageSize + * @author yinzuomei + * @description + * @Date 2020/9/3 11:00 + **/ + List> selectListByMonthId(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("offset") Integer offset, + @Param("pageSize") Integer pageSize); + + /** + * @return com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity + * @param customerId + * @param monthId + * @author yinzuomei + * @description 只有一条数据时用 + * @Date 2020/9/3 16:45 + **/ + FactIndexGovrnAblityDeptMonthlyEntity selectOneRecord(@Param("customerId") String customerId, @Param("monthId")String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java new file mode 100644 index 0000000000..55d0e5730b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.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.dao.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 治理能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-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); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:58 + **/ + List> selectListGovrnAblityGrid(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询治理能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 13:10 + **/ + Map selectGovrnAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return int + * @param formDTO + * @author yinzuomei + * @description 查询(治理能力-网格相关事实表)当前月共上传了多少条记录 + * @Date 2020/8/31 14:31 + **/ + int selectCount(CalculateCommonFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 场景:客户这个月只上传了一个网格的事实记录 + * @Date 2020/9/2 14:46 + **/ + String selectTheOneGrid(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..2b7277f7d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.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.dao.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgGovrnAbilityFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 治理能力-街道及社区相关数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-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); + + /** + * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、【街道办结项目的处理效率,level为street时存在】、办结项目率、办结项目满意度】 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + List> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java new file mode 100644 index 0000000000..ffdc533581 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.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.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridPartyMemberDataDetailFormDTO; +import com.epmet.dto.indexcollect.form.GridPartyMemberDataFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 党建能力-党员相关的事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-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 monthId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + int deleteFactIndexPartyAblityCpcMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + int batchInsertFactIndexPartyAblityCpcMonthly(@Param("list") List list, + @Param("customerId") String customerId); + + List> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); + + Map getExtremeValue(@Param("customerId") String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java new file mode 100644 index 0000000000..aeaf65e6b5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.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.dao.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 党建能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-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); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/26 15:57 + **/ + List> selectListPartyAblityGrid(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询党建能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:51 + **/ + Map selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.lang.Integer + * @param formDTO + * @author yinzuomei + * @description 查询(党建能力-网格相关事实表) 这个月共上传记录数 + * @Date 2020/9/2 14:28 + **/ + Integer selectCount(CalculateCommonFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 场景:客户这个月只上传了一个网格的事实记录 + * @Date 2020/9/2 14:45 + **/ + String selectTheOneGrid(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..44d3a19638 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgPartyAbilityFormDTO; +import com.epmet.dto.screen.result.CommunityPublishArticleCountResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 党建能力-街道及社区相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-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); + + /** + * @Description 查询社区下的发文数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 10:49 上午 + */ + List selectPublishArticleCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 查询社区下的发文数 Map + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 10:49 上午 + */ + List> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java new file mode 100644 index 0000000000..ca2489ba6f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-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); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:59 + **/ + List> selectListServiceAblityGrid(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 13:15 + **/ + Map selectServiceAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return int + * @param formDTO + * @author yinzuomei + * @description 查询(服务能力-网格相关事实表)共上传记录数 + * @Date 2020/9/2 14:28 + **/ + int selectCount(CalculateCommonFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 场景:客户这个月只上传了一个网格的事实记录 + * @Date 2020/9/2 14:46 + **/ + String selectTheOneGrid(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..b17ad01eea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgServiceAbilityFormDTO; +import com.epmet.dto.screen.result.CommunityActivityCountResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 服务能力-组织(街道|社区|全区)相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-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); + + /** + * @Description 社区活动组织次数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 2:15 下午 + */ + List selectActivityCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 社区活动组织次数 + * @param customerId + * @param monthId + * @param level + * @author zxc + * @date 2020/9/2 2:09 下午 + */ + List> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java new file mode 100644 index 0000000000..40fd49e6ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; +import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; +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-31 + */ +@Mapper +public interface FactIndexCommunityScoreDao extends BaseDao { + + /** + * @Description 【社区】中间表插入 + * @param lists + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertCommunityPartyRecord(@Param("lists") List lists); + + /** + * @Description 删除旧记录 + * @param customerId + * @param monthId + * @param indexCode + * @author zxc + * @date 2020/9/1 9:03 上午 + */ + void deleteOldRecord(@Param("customerId") String customerId,@Param("monthId")String monthId,@Param("indexCode")String indexCode); + + /** + * @Description 查询社区相关信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectCommunityInfo(@Param("customerId") String customerId,@Param("monthId")String monthId); + + /** + * 根据入参查询 查询社区相关信息 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListCommunityScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + /** + * @Description 街道下级所有社区得分平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + + /** + * 批量插入 社区相关分数表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertCommunityScoreData(@Param("list") List list, @Param("customerId")String customerId); + + /** + * 根据入参查询 查询社区id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListCommunityId(@Param("customerId")String customerId, @Param("monthId")String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java new file mode 100644 index 0000000000..77c3f85366 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.FactIndexGridScoreDTO; +import com.epmet.dto.screen.result.SubGridAvgResultDTO; +import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; +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-28 + */ +@Mapper +public interface FactIndexGridScoreDao extends BaseDao { + + /** + * @Description 下属所有网格的平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/28 3:20 下午 + */ + List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + + /** + * 根据入参查询 网格相关分值记录 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 根据入参查询 网格id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 批量插入 网格相关分值表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertGridScoreData(@Param("list") List list,@Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexCodeFieldReDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexCodeFieldReDao.java new file mode 100644 index 0000000000..4289caf4db --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexCodeFieldReDao.java @@ -0,0 +1,13 @@ +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.IndexCodeFieldReEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface IndexCodeFieldReDao extends BaseDao { + List getAllData(); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexDictDao.java new file mode 100644 index 0000000000..780fabd1d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/IndexGroupDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDao.java new file mode 100644 index 0000000000..26cb71f2ec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java new file mode 100644 index 0000000000..17e7a7eb82 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +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 IndexGroupDetailDao extends BaseDao { + + List getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailTemplateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailTemplateDao.java new file mode 100644 index 0000000000..eb0c0b260a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/IndexGroupTemplateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupTemplateDao.java new file mode 100644 index 0000000000..0e1b5a2a06 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java new file mode 100644 index 0000000000..8cd75faff7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CpcBaseDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java new file mode 100644 index 0000000000..4912171860 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; +import com.epmet.entity.evaluationindex.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); + + /** + * 返回当前客户下,未匹配到的组织信息 + * @param customerId 客户id + * @param agencyIds 组织id集合 + * @return java.util.List + * @Author zhangyong + * @Date 14:38 2020-09-04 + **/ + List selectListMismatcAgencyInfo(@Param("customerId")String customerId, @Param("agencyIds") String[] agencyIds); + + /** + * 根据客户id,查询区/街道 组织名称、id + * + * @param customerId 客户id + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListAgencyInfo(@Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java new file mode 100644 index 0000000000..53a5fcf042 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CustomerDeptFormDTO; +import com.epmet.entity.evaluationindex.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); + + /** + * @param customerId + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity + * @author yinzuomei + * @description 查询部门所属组织id + * @Date 2020/9/3 16:32 + **/ + ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId); + + /** + * 返回当前客户下,未匹配到的区直部门信息 + * + * @param customerId + * @param deptIds + * @return java.util.List + * @Author zhangyong + * @Date 10:45 2020-09-04 + **/ + List selectListMismatchDeptInfo(@Param("customerId") String customerId, + @Param("deptIds") String[] deptIds); + + /** + * 根据客户id 查询部门 信息 + * @param customerId 客户id + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListDeptInfo(@Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java new file mode 100644 index 0000000000..005f69289b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.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.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.screencoll.form.CustomerGridFormDTO; +import com.epmet.entity.evaluationindex.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); + + /** + * @return java.lang.Integer + * @param customerId + * @author yinzuomei + * @description 查询客户下网格总数 + * @Date 2020/8/26 15:33 + **/ + Integer selectCountByCustomerId(@Param("customerId") String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询客户下网格信息 + * @Date 2020/8/26 15:33 + **/ + List selectListByCustomerId(@Param("customerId")String customerId); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:42 + **/ + List pageListByCustomerId(PageQueryGridFormDTO formDTO); + + /** + * @param customerId 客户id + * @param gridId 网格id + * @return java.lang.String + * @author yinzuomei + * @description 查询网格所属的组织id + * @Date 2020/8/31 12:35 + **/ + ScreenCustomerGridDTO selectParentAgencyId(@Param("customerId") String customerId, @Param("gridId") String gridId); + + /** + * 返回当前客户下,未匹配到的网格信息 + * + * @param customerId + * @param gridIds + * @return java.util.List + * @Author zhangyong + * @Date 10:45 2020-09-04 + **/ + List selectListMismatchGridInfo(@Param("customerId") String customerId, + @Param("gridIds") String[] gridIds); + + /** + * 根据客户id 查询网格(党支部)详细信息 + * @param customerId + * @return java.util.List + * @Author zhangyong + * @Date 16:57 2020-09-03 + **/ + List selectListGridInfo(@Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java new file mode 100644 index 0000000000..412ab70225 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.DifficultyDataDetailFormDTO; +import com.epmet.dto.screencoll.form.DifficultyDataFormDTO; +import com.epmet.entity.evaluationindex.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 一 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteDifficultyData(@Param("customerId")String customerId); + + /** + * 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/evaluationindex/screen/ScreenEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java new file mode 100644 index 0000000000..14c0153f62 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.EventDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenEventImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java new file mode 100644 index 0000000000..835b1f112d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java new file mode 100644 index 0000000000..3dca5cc281 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.GovernRankDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java new file mode 100644 index 0000000000..4ebfc825e4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; +import com.epmet.entity.evaluationindex.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); + + /** + * 获取今年的各月份的平均值 + * @param customerId + * @param yearId + * @param month 做除法运算 + * @return java.util.List + * @Author zhangyong + * @Date 15:51 2020-09-04 + **/ + List selectListIndexDataMonthlyByYear(@Param("customerId") String customerId, + @Param("yearId") String yearId, @Param("month") String month); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java new file mode 100644 index 0000000000..bb2a5eeb6e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenOrgRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java new file mode 100644 index 0000000000..00b4599fe4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.OrgRankDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java new file mode 100644 index 0000000000..3f2de14703 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java new file mode 100644 index 0000000000..931c05c6bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java new file mode 100644 index 0000000000..e1f527f47d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyUserRankDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPioneerDataDao.java new file mode 100644 index 0000000000..b50d74b1a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PioneerDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java new file mode 100644 index 0000000000..5bc9ea4130 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PublicPartiTotalDataFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; +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-24 + */ +@Mapper +public interface ScreenPublicPartiTotalDataDao extends BaseDao { + + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-25 + **/ + void deletePublicPartiTotalData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 18、公众参与各类总数 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-25 + **/ + void batchInsertPublicPartiTotalData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java new file mode 100644 index 0000000000..a620008b22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java new file mode 100644 index 0000000000..5595259af6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.UserTotalDataFormDTO; +import com.epmet.entity.evaluationindex.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/evaluationindex/indexcal/AgencyScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencyScoreEntity.java new file mode 100644 index 0000000000..879018ac99 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencyScoreEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +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-09-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_agency_score") +public class AgencyScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id(eg:社区或者街道id) + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; + + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java new file mode 100644 index 0000000000..0b21c5de92 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +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-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_cpc_score") +public class CpcScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + + /** + * 年维度Id: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 指标code + */ + private String indexCode; + + /** + * 是否是总分 1是0不是 + */ + private String isTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java new file mode 100644 index 0000000000..29857fdc2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +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-09-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_dept_score") +public class DeptScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门所属的组织id + */ + private String agencyId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 治理能力:zhilinengli; + */ + private String indexCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java new file mode 100644 index 0000000000..781dca54bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +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-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_grid_score") +public class GridScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java new file mode 100644 index 0000000000..47501f13f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.evaluationindex.indexcoll; + +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-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/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..7b0c61a9fd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.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.entity.evaluationindex.indexcoll; + +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-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 issueToProjectRatio; + + /** + * 网格总项目数 + */ + 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/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..e23472c6a4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.evaluationindex.indexcoll; + +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-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; + + /** + * 数据类型 district:全区;street:街道;community:社区;grid:网格 + */ + private String dataType; + + /** + * 被吹哨次数 + */ + private Integer transferedCount; + + /** + * 办结项目数 + */ + private Integer closedProjectCount; + + /** + * 项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 办结项目率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 社区超期项目率,dataTyp=commnuity有值 + */ + private BigDecimal overdueProjectRatio; + + /** + * 街道办结项目的处理效率, data_type=street时有值 + */ + private BigDecimal handleProjectRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java new file mode 100644 index 0000000000..550a5ce8a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcoll; + +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-24 + */ +@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; + + /** + * agency_id的上级组织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; + + /** + * 党员自建群活跃群众人数(08-24) + */ + private Integer groupActiveUserCount; + + /** + * 党员自建群活跃度——话题数 + */ + private Integer groupTopicCount; + + /** + * 自建群活跃度——议题转项目率 + */ + private BigDecimal topicToIssueRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..b38d4c4d7a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java @@ -0,0 +1,135 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.evaluationindex.indexcoll; + +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-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/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..80bcce0819 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcoll; + +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-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; + + /** + * 数据类型 district:全区;community:社区;street:街道 + */ + private String dataType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..fedcaf1637 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcoll; + +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-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/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..a93c7fbae4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcoll; + +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-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; + + /** + * 数据类型 district:全区;street:街道;community:社区;grid:网格 + */ + private String dataType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java new file mode 100644 index 0000000000..40a112d6d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityFiveScoreEntity.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_five_score") +public class FactIndexCommunityFiveScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 指标ID + */ + private String indexId; + + /** + * 分数 + */ + private BigDecimal score; + + /** + * 发文数量:publish_article + */ + private String type; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java new file mode 100644 index 0000000000..d99cd7b506 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_community_score") +public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 社区上一级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan + */ + private String indexCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexGridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexGridScoreEntity.java new file mode 100644 index 0000000000..05ab819f20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexGridScoreEntity.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_grid_score") +public class FactIndexGridScoreEntity 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; + + /** + * 总指数分值 + */ + private BigDecimal totalScore; + + /** + * 党建能力分值 + */ + private BigDecimal partyAblityScore; + + /** + * 治理能力分值 + */ + private BigDecimal govrnAblityScore; + + /** + * 服务能力分值 + */ + private BigDecimal serviceAblityScore; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexCodeFieldReEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexCodeFieldReEntity.java new file mode 100644 index 0000000000..042508eae6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexCodeFieldReEntity.java @@ -0,0 +1,21 @@ +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_code_field_re") +public class IndexCodeFieldReEntity extends BaseEpmetEntity { + /** + * 指标code + */ + private String indexCode; + + /** + * 字段名 + */ + private String fieldId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java new file mode 100644 index 0000000000..e0932daeef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.evaluationindex.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; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java new file mode 100644 index 0000000000..8a1b94fb3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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; + + /** + * 指标code + */ + private String indexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 阈值 如果是百分比 则为除以100以后的值 + */ + private BigDecimal threshold; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java new file mode 100644 index 0000000000..0d06fe6955 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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; + + /** + * 指标code + */ + private String indexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 阈值 如果是百分比 则为除以100以后的值 + */ + private BigDecimal threshold; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java new file mode 100644 index 0000000000..dfe57f7d8d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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; + + /** + * 指标code + */ + private String indexCode; + + /** + * 是否启用:启用: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/evaluationindex/screen/IndexGroupTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java new file mode 100644 index 0000000000..e22f7e6f2f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.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.evaluationindex.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; + + /** + * 指标code + */ + private String indexCode; + + /** + * 是否启用:启用: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/evaluationindex/screen/ScreenCpcBaseDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCpcBaseDataEntity.java new file mode 100644 index 0000000000..fa70f90897 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCpcBaseDataEntity.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.evaluationindex.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-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/evaluationindex/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java new file mode 100644 index 0000000000..e06907ca84 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.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.evaluationindex.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-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/evaluationindex/screen/ScreenCustomerDeptEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java new file mode 100644 index 0000000000..6fdb38f4b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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/evaluationindex/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java new file mode 100644 index 0000000000..19fdd132be --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java new file mode 100644 index 0000000000..35f4ca3ee4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventDataEntity.java new file mode 100644 index 0000000000..ea8b52cd3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventDataEntity.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.entity.evaluationindex.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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java new file mode 100644 index 0000000000..8609b4f1b9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.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.evaluationindex.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-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/evaluationindex/screen/ScreenGovernRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataEntity.java new file mode 100644 index 0000000000..f60c612d9e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataEntity.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.entity.evaluationindex.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-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/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java new file mode 100644 index 0000000000..e8d16e858d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.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.entity.evaluationindex.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-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/evaluationindex/screen/ScreenIndexDataYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataYearlyEntity.java new file mode 100644 index 0000000000..3c6b62b0e4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataYearlyEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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/evaluationindex/screen/ScreenOrgRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenOrgRankDataEntity.java new file mode 100644 index 0000000000..1c1a893327 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenOrgRankDataEntity.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyBranchDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyBranchDataEntity.java new file mode 100644 index 0000000000..34ecdac955 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyBranchDataEntity.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.evaluationindex.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-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/evaluationindex/screen/ScreenPartyLinkMassesDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyLinkMassesDataEntity.java new file mode 100644 index 0000000000..0a8d768127 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyLinkMassesDataEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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/evaluationindex/screen/ScreenPartyUserRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.java new file mode 100644 index 0000000000..4d70bf29ff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPartyUserRankDataEntity.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.evaluationindex.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-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; + + /** + * 所有上级ID,用英文逗号分开(8.26新增) + */ + private String allParentIds; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java new file mode 100644 index 0000000000..a51b8b6449 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java new file mode 100644 index 0000000000..3f38146cc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_public_parti_total_data") +public class ScreenPublicPartiTotalDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;网格:grid;部门:department; + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id,如果是网格,传入网格所属组织id + */ + private String parentId; + + /** + * 组织名称,也可能是网格名称 + */ + private String orgName; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 注册人数 + */ + private Integer regUserTotal; + + /** + * 参与人数 + */ + private Integer joinUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java new file mode 100644 index 0000000000..75668a1215 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserJoinEntity.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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/evaluationindex/screen/ScreenUserTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java new file mode 100644 index 0000000000..c41ef72cc3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenUserTotalDataEntity.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.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-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; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java new file mode 100644 index 0000000000..a49d1a1e13 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java @@ -0,0 +1,69 @@ +package com.epmet.eum; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + +/** + * 需要计算指标code枚举类 + * + * @author jianjun liu + * @date 2020-08-26 11:14 + **/ +public enum IndexCodeEnum { + DANG_YUAN_XIANG_GUAN("dangyuanxiangguan", "党员相关", 1), + WANG_GE_XIANG_GUAN("wanggexiangguan", "网格相关", 1), + SHE_QU_XIANG_GUAN("shequxiangguan", "社区相关", 1), + JIE_DAO_XIANG_GUAN("jiedaoxiangguan", "街道相关", 1), + QU_ZHI_BU_MEN("quzhibumen", "区直部门", 1), + QUAN_QU_XIANG_GUAN("quanquxiangguan", "全区相关", 1), + + DANG_JIAN_NENG_LI("dangjiannengli", "党建能力", 2), + ZHI_LI_NENG_LI("zhilinengli", "治理能力", 2), + FU_WU_NENG_LI("fuwunengli", "服务能力", 2), + + CAN_YU_YI_SHI("canyuyishi", "参与议事", 4), + DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4), + LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4), + ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5), + ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5), + XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz","下属所有网格的党建能力(平均值)",5), + SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz","社区下属所有网格治理能力汇总(平均值)",5), + SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz","社区下级所有网格服务能力得分(平均值) ",5), + JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ("jiedaoxiashusysqdjnlhzpjz","街道下属所有社区党建能力汇总(平均值)",5), + JIE_DAO_XIA_SHU_SYSQZLNLHZ("jiedaoxiashusysqzlnlhz","街道下属所有社区治理能力汇总 (平均值) ",5), + JIE_DAO_XIA_SHU_SQFWNLDFPYZ("jiedaoxiashusqfwnldfpjz","街道下属社区服务能力得分 (平均值) ",5), + QU_XIA_SHU_JIE_DFWNLHZPJZ("quxiashujiedfwnlhzpjz","区下属街道服务能力汇总(平均值)",5), + QU_XIA_JI_JIE_DDJNLHZPJZ("quxiajijieddjnlhzpjz","区下级街道党建能力汇总(平均值)",5), + SUO_YOU_JIE_DAO_ZLNLPJZ("suoyoujiedaozlnlpjz","所有街道治理能力(平均值)",5), + SUO_YOU_ZHI_SHU_BMZLNLPJZ("suoyouzhishubmzlnlpjz","所有直属部门治理能力(平均值)",5), + ; + + private String code; + private String name; + private Integer level; + + + IndexCodeEnum(String code, String name, Integer level) { + this.code = code; + this.name = name; + this.level = level; + } + + public static IndexCodeEnum getEnum(String code) { + IndexCodeEnum[] values = IndexCodeEnum.values(); + for (IndexCodeEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} 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..3fec1a9132 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -0,0 +1,326 @@ +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.constant.StrConstant; +import com.epmet.commons.tools.utils.UniqueIdGenerator; +import com.epmet.entity.evaluationindex.screen.IndexDictEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; +import com.epmet.service.evaluationindex.screen.IndexDictService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailTemplateService; +import com.epmet.service.evaluationindex.screen.IndexGroupTemplateService; +import com.epmet.support.normalizing.Correlation; +import com.epmet.util.Pinyin4jUtil; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +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)); + if (StringUtils.isNotBlank(data.getThreshold())) { + String threshold = data.getThreshold(); + if ("无".equals(data.getThreshold())) { + threshold = "-1"; + } else if (data.getThreshold().contains("%")) { + String thresholdStr = data.getThreshold().replace("%", ""); + threshold = new BigDecimal(thresholdStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP).toString(); + } + data.setThreshold(threshold); + } + if (StringUtils.isNotBlank(data.getCorrelation())) { + if (Correlation.NEGATIVE.getDesc().equals(data.getCorrelation())) { + data.setCorrelation(Correlation.NEGATIVE.getCode()); + } else { + data.setCorrelation(Correlation.POSITIVE.getCode()); + } + } + + 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()); + IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); + if (group1 == null) { + group1 = new IndexGroupTemplateEntity(); + group1.setIndexId(indexDictEntity.getId()); + group1.setParentIndexGroupId("0"); + group1.setId(UniqueIdGenerator.generate()); + group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), true, 4)); + indexGroupMap.put(index.getLevel1Index(), group1); + } + StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); + String level4Index = index.getLevel4Index(); + indexDictEntity = indexDicMap.get(level4Index); + + String level4IndexDetailKey = index.getLevel1Index() + index.getLevel2Index() + level4Index; + IndexGroupTemplateEntity group2 = indexGroupMap.get(level4IndexDetailKey); + IndexGroupDetailTemplateEntity templateEntity = null; + if (group2 == null) { + group2 = new IndexGroupTemplateEntity(); + group2.setIndexId(indexDictEntity.getId()); + group2.setParentIndexGroupId(group1.getId()); + group2.setId(UniqueIdGenerator.generate()); + group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + indexGroupMap.put(level4IndexDetailKey, group2); + //构建 分组明细 + templateEntity = indexGroupDetailMap.get(index.getLevel1Index() + level4Index); + if (templateEntity == null) { + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group1.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); + indexGroupDetailMap.put(index.getLevel1Index() + level4Index, templateEntity); + } + } + indexDictEntity = indexDicMap.get(index.getLevel5Index()); + + String level5IndexDetailKey = index.getLevel1Index() + index.getLevel2Index() + index.getLevel5Index(); + allIndexCodeSb.append(StrConstant.COLON); + allIndexCodeSb.append(group2.getIndexCode()); + templateEntity = indexGroupDetailMap.get(level5IndexDetailKey); + if (templateEntity == null) { + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); + indexGroupDetailMap.put(level5IndexDetailKey, templateEntity); + } + } else { + //todo 测试完去掉 + //if ("街道相关".equals(index.getLevel1Index())) { + IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); + IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); + if (group1 == null) { + group1 = new IndexGroupTemplateEntity(); + group1.setIndexId(indexDictEntity.getId()); + group1.setParentIndexGroupId("0"); + group1.setId(UniqueIdGenerator.generate()); + group1.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + indexGroupMap.put(index.getLevel1Index(), group1); + } + StringBuilder allIndexCodeSb = new StringBuilder(group1.getIndexCode()); + String level2Index = index.getLevel2Index(); + indexDictEntity = indexDicMap.get(level2Index); + String level2IndexGroupKey = index.getLevel1Index() + level2Index; + IndexGroupTemplateEntity group2 = indexGroupMap.get(level2IndexGroupKey); + IndexGroupDetailTemplateEntity templateEntity = null; + if (group2 == null) { + group2 = new IndexGroupTemplateEntity(); + group2.setIndexId(indexDictEntity.getId()); + group2.setParentIndexGroupId(group1.getId()); + group2.setId(UniqueIdGenerator.generate()); + group2.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + + indexGroupMap.put(level2IndexGroupKey, group2); + //构建 分组明细 + templateEntity = indexGroupDetailMap.get(level2IndexGroupKey); + if (templateEntity == null) { + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 2); + indexGroupDetailMap.put(level2IndexGroupKey, templateEntity); + } + } + indexDictEntity = indexDicMap.get(index.getLevel5Index()); + allIndexCodeSb.append(StrConstant.COLON); + allIndexCodeSb.append(group2.getIndexCode()); + String level5IndexGroupKey = index.getLevel1Index() + index.getLevel2Index() + index.getLevel5Index(); + templateEntity = indexGroupDetailMap.get(level5IndexGroupKey); + if (templateEntity == null) { + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(group2.getId()); + templateEntity.setIndexId(indexDictEntity.getId()); + templateEntity.setAllParentIndexCode(allIndexCodeSb.toString()); + templateEntity.setId(UniqueIdGenerator.generate()); + templateEntity.setCorrelation(index.getCorrelation()); + buildIndexGroupDetail(templateEntity, indexDictEntity, index, 5); + indexGroupDetailMap.put(level5IndexGroupKey, templateEntity); + } + } + //} + }); + LOGGER.info("所有指标分组数据解析完成:{}", JSON.toJSONString(indexGroupMap.values())); + LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values())); + } + + private void buildIndexGroupDetail(IndexGroupDetailTemplateEntity templateEntity, IndexDictEntity indexDictEntity, IndexModel index, Integer level) { + if (level == 5) { + templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(index.getLevel5Index(), false, 4)); + String level5WeightStr = index.getLevel5Weight().replace("%", ""); + templateEntity.setWeight(new BigDecimal(level5WeightStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); + } else { + templateEntity.setIndexCode(Pinyin4jUtil.getSpellPinYin(indexDictEntity.getIndexName(), false, 4)); + templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); + } + templateEntity.setThreshold(new BigDecimal(index.getThreshold())); + templateEntity.setCorrelation(index.getCorrelation()); + } + + 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.setCorrelation(data.getCorrelation()); + entity.setLevel("1"); + indexDicMap.put(data.getLevel1Index(), entity); + } + if (!indexDicMap.containsKey(data.getLevel2Index())) { + entity2.setId(UniqueIdGenerator.generate()); + entity2.setIndexName(data.getLevel2Index()); + entity2.setCorrelation(data.getCorrelation()); + entity2.setLevel("2"); + indexDicMap.put(data.getLevel2Index(), entity2); + } + if (!indexDicMap.containsKey(data.getLevel3Index())) { + entity3.setId(UniqueIdGenerator.generate()); + entity3.setIndexName(data.getLevel3Index()); + entity3.setCorrelation(data.getCorrelation()); + entity3.setLevel("3"); + indexDicMap.put(data.getLevel3Index(), entity3); + } + if (!indexDicMap.containsKey(data.getLevel4Index())) { + entity4.setId(UniqueIdGenerator.generate()); + entity4.setIndexName(data.getLevel4Index()); + entity4.setCorrelation(data.getCorrelation()); + entity4.setLevel("4"); + indexDicMap.put(data.getLevel4Index(), entity4); + } + if (!indexDicMap.containsKey(data.getLevel5Index())) { + entity5.setId(UniqueIdGenerator.generate()); + entity5.setIndexName(data.getLevel5Index()); + entity5.setCorrelation(data.getCorrelation()); + 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..77a0fd3138 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -0,0 +1,32 @@ +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; + /** + * 正相关:positive;负相关:negative + */ + @ExcelProperty(value = "相关性") + private String correlation; +} 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/redis/IndexCodeFieldReRedis.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.java new file mode 100644 index 0000000000..8a99d62890 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/redis/IndexCodeFieldReRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.Map; +import java.util.concurrent.TimeUnit; + +@Slf4j +@Component +public class IndexCodeFieldReRedis { + @Autowired + private RedisTemplate redisTemplate; + + + /** + * @Description 获取指标code和字段Id的关系 + */ + public Map getIndexCodeFiledReMap() { + HashOperations hashOperations = redisTemplate.opsForHash(); + Map values = hashOperations.entries(RedisKeys.getIndexCodeFieldReKey()); + return values; + } + + /** + * @Description 存入指标code和字段Id的关系 + */ + public void setIndexCodeFiledReMap(Map records) { + HashOperations hashOperations = redisTemplate.opsForHash(); + hashOperations.putAll(RedisKeys.getIndexCodeFieldReKey(), records); + redisTemplate.expire(RedisKeys.getIndexCodeFieldReKey(), 1, TimeUnit.DAYS); + } + + /** + * desc:删除指标字段关系缓存 + * @return + */ + public Boolean deleteIndexCodeFromRedis() { + return redisTemplate.delete(RedisKeys.getIndexCodeFieldReKey()); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/AgencyScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/AgencyScoreService.java new file mode 100644 index 0000000000..0805622937 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/AgencyScoreService.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.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; + +import java.util.List; +import java.util.Map; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +public interface AgencyScoreService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-02 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-02 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AgencyScoreDTO + * @author generator + * @date 2020-09-02 + */ + AgencyScoreDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-02 + */ + void save(AgencyScoreDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-02 + */ + void update(AgencyScoreDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-02 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java new file mode 100644 index 0000000000..3cd66eccf5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/CpcIndexCalculateService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcal; + +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + +/** + * 党员指标计算service + * + * @author liujianjun@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface CpcIndexCalculateService { + /** + * desc:计算党员相关指标 + * @param formDTO + * @return + */ + Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/DeptScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/DeptScoreService.java new file mode 100644 index 0000000000..afb6bc40bc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/DeptScoreService.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.service.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +public interface DeptScoreService extends BaseService { + /** + * @return java.lang.Boolean + * @param formDTO + * @author yinzuomei + * @description 区直部门,分值计算 + * @Date 2020/8/26 10:51 + **/ + Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java new file mode 100644 index 0000000000..a93697ce12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java @@ -0,0 +1,56 @@ +package com.epmet.service.evaluationindex.indexcal; + +import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.support.normalizing.batch.IndexInputVO; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 网格相关指标计算 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:34 + */ +public interface GridCorreLationService { + + /** + * @return java.lang.Boolean + * @param formDTO + * @author yinzuomei + * @description 网格相关,分值计算 + * @Date 2020/8/26 10:51 + **/ + Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO); + + /** + * @return java.util.List> + * @param formDTO + * @author yinzuomei + * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/27 14:48 + **/ + List> queryListPartyAblityGrid(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:48 + **/ + List pageGridList(PageQueryGridFormDTO formDTO); + + /** + * @return java.util.HashMap + * @param indexMap + * @author yinzuomei + * @description 通用计算方法 + * @Date 2020/9/3 16:07 + **/ + HashMap calculate(Map> indexMap); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java new file mode 100644 index 0000000000..09d344dd47 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java @@ -0,0 +1,17 @@ +package com.epmet.service.evaluationindex.indexcal; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:33 上午 + */ +public interface IndexCalculateCommunityService { + + /** + * @Description 计算社区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/1 4:12 下午 + */ + Boolean calCommunityAll(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java new file mode 100644 index 0000000000..0e8ce09ccf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcal; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:03 上午 + */ +public interface IndexCalculateDistrictService { + + /** + * @Description 计算全区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + Boolean calDistrictAll(String customerId, String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java new file mode 100644 index 0000000000..a1ab0ad1bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcal; + +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 + * @return + */ + Boolean indexCalculate(IndexCalculateForm formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java new file mode 100644 index 0000000000..c27b6db508 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcal; + +/** + * @Author zxc + * @DateTime 2020/9/2 3:11 下午 + */ +public interface IndexCalculateStreetService { + + /** + * @Description 计算街道相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + Boolean calStreetAll(String customerId, String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCodeFieldReService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCodeFieldReService.java new file mode 100644 index 0000000000..d2804d1dec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCodeFieldReService.java @@ -0,0 +1,24 @@ +package com.epmet.service.evaluationindex.indexcal; + +import java.util.Map; + +/** + * 党员指标计算service + * + * @author liujianjun@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface IndexCodeFieldReService { + /** + * desc:获取指标code对应的字段值 + * @return + */ + Map getIndexCodeFieldReMap(); + + /** + * desc:根据指标code获取 对应的字段 + * @param indexCode + * @return + */ + String getFieldNameByIndexCode(String indexCode); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/AgencyScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/AgencyScoreServiceImpl.java new file mode 100644 index 0000000000..17f56e6895 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/AgencyScoreServiceImpl.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.indexcal.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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import com.epmet.service.evaluationindex.indexcal.AgencyScoreService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class AgencyScoreServiceImpl extends BaseServiceImpl implements AgencyScoreService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AgencyScoreDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AgencyScoreDTO.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 AgencyScoreDTO get(String id) { + AgencyScoreEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AgencyScoreDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AgencyScoreDTO dto) { + AgencyScoreEntity entity = ConvertUtils.sourceToTarget(dto, AgencyScoreEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AgencyScoreDTO dto) { + AgencyScoreEntity entity = ConvertUtils.sourceToTarget(dto, AgencyScoreEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java new file mode 100644 index 0000000000..52cb4e3fc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -0,0 +1,348 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private IndexGroupDetailService getDetailListByParentCode; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private CpcScoreDao cpcScoreDao; + + @Override + public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { + calculatePartScore(formDTO); + calculateTotalScore(formDTO); + return true; + } + + /** + * desc: 计算总分 + * + * @param formDTO + */ + private void calculateTotalScore(CalculateCommonFormDTO formDTO) { + //获取指标权重 + List parentIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(parentIndexDetails)) { + log.warn("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【党员相关】指标权重信息不存在"); + } + Map cpcScoreTotalMap = new HashMap<>(); + Map indexWeightMap = parentIndexDetails.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o)); + + //获取数据 + List list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(list)) { + log.error("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); + throw new RenException("客户四级指标分值记录不存在"); + } + Map> userGroupMap = list.stream().collect(Collectors.groupingBy(CpcScoreEntity::getUserId)); + userGroupMap.forEach((userId, partScoreList) -> { + CpcScoreEntity totalEntity = null; + for (CpcScoreEntity part : partScoreList) { + IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode()); + if (totalEntity == null) { + totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); + totalEntity.setIsTotal(NumConstant.ONE_STR); + totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + totalEntity.setScore(new BigDecimal(0)); + cpcScoreTotalMap.put(userId, totalEntity); + } + //自建群活跃度——议题转项目率 有阈值 >60%按60%算 + BigDecimal total = part.getScore().multiply(indexGroupDetailEntity.getWeight()); + log.info("userId:{},分数:{},权重:{},total:{}", userId, part.getScore(), indexGroupDetailEntity.getWeight(), total); + totalEntity.setScore(totalEntity.getScore().add(total)); + } + }); + deleteAndInsertBatch(formDTO, cpcScoreTotalMap.values().stream().collect(Collectors.toList()), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); + } + + /** + * @param formDTO + * @param indexCode + * @param stringObjectMap + * @return void + * @author yinzuomei + * @description 只有一条事实记录时,分值默认赋50 + * @Date 2020/9/2 14:35 + **/ + private CpcScoreEntity handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode, Map stringObjectMap) { + FactIndexPartyAblityCpcMonthlyEntity factCpc = JSON.parseObject(JSON.toJSONString(stringObjectMap), FactIndexPartyAblityCpcMonthlyEntity.class); + // 保存中间表 + CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); + cpcScoreEntity.setCustomerId(factCpc.getCustomerId()); + cpcScoreEntity.setAgencyId(factCpc.getAgencyId()); + cpcScoreEntity.setGridId(factCpc.getGridId()); + cpcScoreEntity.setYearId(factCpc.getYearId()); + cpcScoreEntity.setMonthId(factCpc.getMonthId()); + cpcScoreEntity.setUserId(factCpc.getUserId()); + cpcScoreEntity.setScore(new BigDecimal(NumConstant.FIFTY_STR)); + cpcScoreEntity.setIndexCode(indexCode); + cpcScoreEntity.setIsTotal(NumConstant.ZERO_STR); + return cpcScoreEntity; + } + + /** + * desc:根据客户id和月份Id 指标code 非必填 删除数据 + * + * @param formDTO + * @param indexCode 指标code 非必填 + * @param values + */ + private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection values, String indexCode) { + cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); + cpcScoreDao.insertBatch(values); + } + + private void calculatePartScore(CalculateCommonFormDTO formDTO) { + //计算最大最小值 + Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.error("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); + throw new RenException("指标原始数据记录不存在"); + } + //指标集合 + Map> groupIndexDetailsMap = getIndexDetailMap(formDTO); + if (groupIndexDetailsMap == null) { + log.error("calculatePartScore"); + return; + } + + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_THOUSAND; + //分页查询 要计算的原始数据 + List> list = null; + do { + list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + if (!CollectionUtils.isEmpty(list)) { + //如果是第一页且仅有一条数据 则直接给50分 + if (pageNo == NumConstant.ONE && list.size() == NumConstant.ONE) { + List insertList = new ArrayList<>(); + for (String parentIndexCode : groupIndexDetailsMap.keySet()) { + insertList.add(handleOneGridScene(formDTO, parentIndexCode, list.get(0))); + } + if (CollectionUtils.isEmpty(insertList)) { + deleteAndInsertBatch(formDTO, insertList, null); + } + } else { + //遍历指标分组 计算分数 + for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { + String parentIndexCode = entry.getKey(); + List details = entry.getValue(); + calculateScore(formDTO, details, list, minAndMaxMap, parentIndexCode); + } + } + } + pageNo++; + } while (!CollectionUtils.isEmpty(list) && list.size() == pageSize); + } + + /** + * desc:计算并保存中间结果 + * + * @param formDTO + * @param indexDetailList + * @param finalList + * @param minAndMaxMap + * @param parentIndexCode remark:1.遍历指标和原始数据;2.构建指标归一算法计算器,计算分值;3.将分值保存到中间表 + */ + private void calculateScore(CalculateCommonFormDTO formDTO, List indexDetailList, List> finalList, Map minAndMaxMap, String parentIndexCode) { + Map> indexMap = buildIndexInputVO(indexDetailList, minAndMaxMap); + Map scoreEntityMap = new HashMap<>(); + //遍历指标 进行计算 + for (Map.Entry> entry : indexMap.entrySet()) { + String indexCode = entry.getKey(); + IndexInputVO value = entry.getValue(); + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(indexCode); + if (StringUtils.isBlank(fieldName)) { + log.error("calculateScore indexCode:{} get fieldName return blank", indexCode); + continue; + } + + for (Map cpcCount : finalList) { + //对应的数值 + String userId = String.valueOf(cpcCount.get(IndexCalConstant.USER_ID)); + BigDecimal sampleValue = new BigDecimal(String.valueOf(cpcCount.get(fieldName))); + + CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); + cpcScoreEntity.setYearId(String.valueOf(cpcCount.get(IndexCalConstant.YEAR_ID))); + cpcScoreEntity.setCustomerId(formDTO.getCustomerId()); + cpcScoreEntity.setAgencyId(String.valueOf(cpcCount.get(IndexCalConstant.AGENCY_ID))); + cpcScoreEntity.setGridId(String.valueOf(cpcCount.get(IndexCalConstant.GRID_ID))); + cpcScoreEntity.setUserId(userId); + cpcScoreEntity.setIsTotal(NumConstant.ZERO_STR); + cpcScoreEntity.setMonthId(formDTO.getMonthId()); + cpcScoreEntity.setScore(new BigDecimal(0)); + cpcScoreEntity.setIndexCode(parentIndexCode); + + scoreEntityMap.put(userId, cpcScoreEntity); + + //构造样本值对象 + SampleValue currentUserIndexValue = new SampleValue(userId, sampleValue); + value.getIndexValueVOs().add(currentUserIndexValue); + } + } + log.info("计算的参数:{}", JSON.toJSONString(indexMap)); + HashMap result = calculateScore(indexMap); + log.info("计算的结果:{}", result); + + //处理结果 + if (CollectionUtils.isEmpty(result)) { + log.error("calculateScore calculateScore return empty"); + return; + } + saveCpcScore(formDTO, scoreEntityMap, parentIndexCode, result); + } + + /** + * desc:保存分值 到中间表 + * + * @param formDTO + * @param indexDetails + * @param parentIndexCode + * @param result + */ + @Transactional(rollbackFor = Exception.class) + public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { + + List list = new ArrayList<>(); + result.forEach((userId, score) -> { + CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); + cpcScoreEntity.setScore(score); + list.add(cpcScoreEntity); + }); + this.deleteAndInsertBatch(formDTO, list, parentIndexCode); + } + + + /** + * desc:构建分值计算器 + * + * @param indexList 指标集合 + * @param minAndMaxMap 最大值最小值集合 + * @return java.util.Map + * @author yinzuomei + * @description + * @Date 2020/8/30 15:56 + **/ + private Map> buildIndexInputVO(List indexList, Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (IndexGroupDetailEntity index : indexList) { + BigDecimal minValue = null; + BigDecimal maxValue = null; + + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + if (StringUtils.isBlank(fieldName)) { + continue; + } + //最小值key + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + //最大值key + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + //如果最大值超过阈值 则最大值为阈值 + if (new BigDecimal(NumConstant.ONE_NEG).compareTo(index.getThreshold()) != NumConstant.ZERO + && maxValue.compareTo(new BigDecimal(NumConstant.ONE_NEG)) == NumConstant.ONE) { + maxValue = index.getThreshold(); + } + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); + map.put(index.getIndexCode(), indexInputVO); + } + return map; + } + + /** + * desc:调用计算器计算每个人的分数值 + * + * @param indexMap + * @return + */ + private HashMap calculateScore(Map> indexMap) { + //构造入参 + List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + } + + + /** + * desc:构建党员相关4级指标明细map + * + * @param formDTO + * @return + */ + private Map> getIndexDetailMap(CalculateCommonFormDTO formDTO) { + //获取指标权重信息 -参与议事 + List canyuyishiIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.CAN_YU_YI_SHI.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return null; + } + List dangwuhongdongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_WU_HUO_DONG.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return null; + } + List lianxiqunzhongIndexDetails = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode(), IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode()); + if (CollectionUtils.isEmpty(canyuyishiIndexDetails)) { + log.error("cpcIndexCalculate customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + return null; + } + + Map> groupIndexDetailsMap = new HashMap<>(); + groupIndexDetailsMap.put(IndexCodeEnum.CAN_YU_YI_SHI.getCode(), canyuyishiIndexDetails); + groupIndexDetailsMap.put(IndexCodeEnum.DANG_WU_HUO_DONG.getCode(), dangwuhongdongIndexDetails); + groupIndexDetailsMap.put(IndexCodeEnum.LIAN_XI_QUN_ZHONG.getCode(), lianxiqunzhongIndexDetails); + return groupIndexDetailsMap; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java new file mode 100644 index 0000000000..959f3caa64 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -0,0 +1,262 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.evaluationindex.indexcal.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerDeptDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.DeptScoreService; +import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Slf4j +@Service +public class DeptScoreServiceImpl extends BaseServiceImpl implements DeptScoreService { + @Autowired + private IndexGroupDetailService getDetailListByParentCode; + @Autowired + private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private GridCorreLationService gridCorreLationService; + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + @Autowired + private DeptScoreDao deptScoreDao; + + /** + * @param formDTO + * @return java.lang.Boolean + * @author yinzuomei + * @description 区直部门,分值计算 + * @Date 2020/8/26 10:51 + **/ + @Override + public Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO) { + //获取指标权重 + List indexGroupDetailEntityList = getDetailListByParentCode.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.QU_ZHI_BU_MEN.getCode(), + IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexGroupDetailEntityList)) { + log.warn("calculateDeptCorreLation customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【区直部门:治理能力】指标权重信息不存在"); + } + log.info(JSON.toJSONString(indexGroupDetailEntityList)); + + //1、查询总记录数 + int total = factIndexGovrnAblityDeptMonthlyDao.selectCount(formDTO); + if (NumConstant.ZERO == total) { + log.warn(String.format("customerId=%s,monthId=%s,fact_index_govrn_ablity_dept_monthly have not any fact record", formDTO.getCustomerId(), formDTO.getMonthId())); + return Boolean.FALSE; + } else if (NumConstant.ONE == total) { + //只有一个网格时 + log.warn(String.format("customerId:%s,monthId:%s,only one fact_index_govrn_ablity_dept_monthly record", formDTO.getCustomerId(), formDTO.getMonthId())); + this.handleOneGridScene(formDTO); + return Boolean.TRUE; + } + + //2、计算最大最小值 + Map minAndMaxMap = factIndexGovrnAblityDeptMonthlyDao.selectExtremeValue(formDTO); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.warn("calculateDeptCorreLation getExtremeValue customerId:{} fact_index_govrn_ablity_dept_monthly have not any fact record", formDTO.getCustomerId()); + throw new RenException("【区直部门:治理能力】指标原始数据记录不存在"); + } + //3、构造入参 指标集合 + Map> indexMap = buildDeptCorrelationIndexInputVO(indexGroupDetailEntityList, minAndMaxMap); + //4、分批计算 + int pageNo = NumConstant.ONE; + int pageSize = IndexCalConstant.PAGE_SIZE; + //分页查询 要计算的原始数据 + List> list = null; + do { + list = factIndexGovrnAblityDeptMonthlyDao.selectListByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + if (!CollectionUtils.isEmpty(list)) { + //遍历指标分组 计算分数 + List> crrentFactRecordList = list; + calculateScore(formDTO,indexMap,crrentFactRecordList); + } + } while (!CollectionUtils.isEmpty(list) && pageNo++ > 0); + return true; + } + + /** + * @return void + * @param formDTO + * @param indexMap + * @author yinzuomei + * @description 计算分值并保存结果 + * @Date 2020/9/3 11:14 + **/ + private void calculateScore(CalculateCommonFormDTO formDTO, Map> indexMap,List> recordList) { + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, indexInputVO) -> { + if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr =String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.DEPT_ID), new BigDecimal(sampleValueStr)); + indexInputVO.getIndexValueVOs().add(currentGridIndexValue); + + } + }); + + }); + HashMap resultMap = gridCorreLationService.calculate(indexMap); + //保存中间表记录 + this.saveDeptScoreEntity(formDTO,resultMap); + } + + /** + * @return void + * @param formDTO + * @param resultMap + * @author yinzuomei + * @description fact_index_dept_score + * @Date 2020/9/3 16:11 + **/ + @Transactional(rollbackFor = Exception.class) + public void saveDeptScoreEntity(CalculateCommonFormDTO formDTO, HashMap resultMap) { + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + resultMap.forEach((deptId, governAblityScore) -> { + DeptScoreEntity deptScoreEntity = new DeptScoreEntity(); + deptScoreEntity.setCustomerId(formDTO.getCustomerId()); + deptScoreEntity.setDeptId(deptId); + deptScoreEntity.setIsTotal(NumConstant.ZERO_STR); + deptScoreEntity.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + ScreenCustomerDeptEntity deptEntity = screenCustomerDeptDao.selectParentAgencyId(formDTO.getCustomerId(), deptId); + if (null != deptEntity) { + if(StringUtils.isNotBlank(deptEntity.getParentAgencyId())){ + deptScoreEntity.setAgencyId(deptEntity.getParentAgencyId()); + } + } + deptScoreEntity.setQuarterId(quarterId); + deptScoreEntity.setYearId(yearId); + deptScoreEntity.setMonthId(formDTO.getMonthId()); + deptScoreEntity.setScore(governAblityScore); + deptScoreDao.deleteByDeptIdAndMonthId(formDTO.getCustomerId(),formDTO.getMonthId(),deptId); + deptScoreDao.insert(deptScoreEntity); + }); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description + * @Date 2020/9/3 9:35 + **/ + private void handleOneGridScene(CalculateCommonFormDTO formDTO) { + FactIndexGovrnAblityDeptMonthlyEntity entity = factIndexGovrnAblityDeptMonthlyDao.selectOneRecord(formDTO.getCustomerId(), formDTO.getMonthId()); + HashMap resultMap = new HashMap<>(); + resultMap.put(entity.getDeptId(), new BigDecimal(NumConstant.FIFTY_STR)); + this.saveDeptScoreEntity(formDTO, resultMap); + } + + /** + * @param indexList + * @param minAndMaxMap + * @return java.util.Map> + * @author yinzuomei + * @description + * @Date 2020/9/3 9:31 + **/ + private Map> buildDeptCorrelationIndexInputVO(List indexList, + Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (IndexGroupDetailEntity index : indexList) { + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + if (StringUtils.isBlank(fieldName)) { + log.error("index_code:{} not find field_name", index.getIndexCode()); + continue; + } + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + BigDecimal minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + BigDecimal maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + //有阈值,且最大值>阈值,则最大值赋值为阈值 + if (new BigDecimal(NumConstant.ONE_NEG_STR).compareTo(index.getThreshold()) != NumConstant.ZERO + && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) { + maxValue = index.getThreshold(); + } + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + List> sampleValueList = new ArrayList<>(); + IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + sampleValueList, + index.getThreshold(), +// new BigDecimal("-1"), //FOR TEST + index.getWeight(), + scoreCalculator); + map.put(index.getIndexCode(), indexInputVO1); + } + return map; + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java new file mode 100644 index 0000000000..abbe326a81 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -0,0 +1,751 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; +import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.indexcal.*; +import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.IndexOutputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 网格相关service + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/26 10:35 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class GridCorreLationServiceImpl implements GridCorreLationService { + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private CpcScoreDao cpcScoreDao; + @Autowired + private GridScoreDao gridScoreDao; + + + /** + * @param formDTO + * @return java.lang.Boolean + * @author yinzuomei + * @description 网格相关,分值计算 + * @Date 2020/8/26 10:51 + **/ + @Override + public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { + boolean resultFlag = false; + //1、计算网格相关-党建能力 + List dangJianNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(dangJianNengLiList)) { + log.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); + } + calculateGridDangJian(formDTO, dangJianNengLiList); + //2、计算网格相关-治理能力 + List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(zhiLiNengLiList)) { + log.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); + } + calculateGridZhiLi(formDTO, zhiLiNengLiList); + //3、计算网格相关-服务能力 + List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(fuWuNengLiList)) { + log.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); + } + calculateGridFuWu(formDTO, fuWuNengLiList); + //4、计算网格相关总分 + List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(wgxgList)) { + log.warn("calculateGridTotal customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } + calculateGridTotal(formDTO, wgxgList, IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + + resultFlag = true; + return resultFlag; + } + + /** + * @param formDTO + * @param indexList + * @return void + * @author yinzuomei + * @description 计算网格相关-党建能力 + * @Date 2020/8/26 16:47 + **/ + @Transactional(rollbackFor = Exception.class) + public void calculateGridDangJian(CalculateCommonFormDTO formDTO, List indexList) { + //查询总记录数 + int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); + if (NumConstant.ZERO == total) { + log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); + return; + } else if (NumConstant.ONE == total) { + //只有一个网格时 + log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_party_ablity_grid_monthly record",IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); + this.handleOneGridScene(formDTO,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } + //总页数,进行批量查询,批量计算 + int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,key:code_MIN/MAX + Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.error("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + return; + } + //指标集合 + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListPartyAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + log.info("index_code :{}",key); + if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) { + //组织内党员的联系群众能力考评分(平均值) +// log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); + //网格内党员的联系群众能力考评分(平均值) + String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); + BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); + value.getIndexValueVOs().add(contactMassesAblityValue); + }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } + }); + }); + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); + } + // 保存中间表 + saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), NumConstant.ZERO_STR); + } + + /** + * @param formDTO + * @param indexCode + * @return void + * @author yinzuomei + * @description 只有一条事实记录时,分值默认赋50 + * @Date 2020/9/2 14:35 + **/ + private void handleOneGridScene(CalculateCommonFormDTO formDTO, String indexCode) { + List> resultMapList = new ArrayList<>(); + HashMap resultMap = new HashMap<>(); + String gridId =null; + if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexPartyAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } else if (IndexCodeEnum.ZHI_LI_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexGovrnAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } else if (IndexCodeEnum.FU_WU_NENG_LI.getCode().equals(indexCode)) { + gridId = factIndexServiceAblityGridMonthlyDao.selectTheOneGrid(formDTO); + } + resultMap.put(gridId, new BigDecimal(NumConstant.FIFTY_STR)); + resultMapList.add(resultMap); + // 保存中间表 + saveGridCorreLationResult(formDTO, resultMapList, indexCode, NumConstant.ZERO_STR); + } + + /** + * @param calculateCommonFormDTO + * @return java.util.Map + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 + * @Date 2020/8/31 9:51 + **/ + private Map getContactMassesAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { + Map map = new HashMap<>(); + List list = cpcScoreDao.selectListGridContactMassesAvgValue(calculateCommonFormDTO); + if (!CollectionUtils.isEmpty(list)) { + BigDecimal minValue = Collections.min(list); + BigDecimal maxValue = Collections.max(list); + map.put(StrConstant.MIN, minValue); + map.put(StrConstant.MAX, maxValue); + return map; + } + map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + //FOR TEST + /*map.put(StrConstant.MIN, new BigDecimal("24.35")); + map.put(StrConstant.MAX, new BigDecimal("46.13"));*/ + return map; + } + + /** + * @param calculateCommonFormDTO + * @param gridId 网格id + * @return java.math.BigDecimal + * @author yinzuomei + * @description 获取网格(组织)内党员的联系群众能力考评分(平均值) + * @Date 2020/8/31 9:50 + **/ + private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { + BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + if (null == result) { + return new BigDecimal(NumConstant.ZERO_STR); + } + //FOR TEST + /*BigDecimal result=null; + if(IndexCalConstant.S1_C1_G1.equals(gridId)){ + result= new BigDecimal("24.43"); + }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ + result=new BigDecimal("46.13"); + }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ + result=new BigDecimal("24.35"); + }*/ + return result; + } + + /** + * @param formDTO + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 组织内党员的参与议事能力考评分(平均值) + * @Date 2020/8/31 15:51 + **/ + private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { + BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + if (null == result) { + return new BigDecimal(NumConstant.ZERO_STR); + } + //FOR TEST + /*BigDecimal result=null; + if(IndexCalConstant.S1_C1_G1.equals(gridId)){ + result= new BigDecimal("29.40"); + }else if(IndexCalConstant.S1_C1_G2.equals(gridId)){ + result=new BigDecimal("18.30"); + }else if(IndexCalConstant.S1_C2_G1.equals(gridId)){ + result=new BigDecimal("9.15"); + }*/ + return result; + } + + /** + * @param calculateCommonFormDTO + * @return java.util.Map + * @author yinzuomei + * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 + * @Date 2020/8/31 14:41 + **/ + private Map getJoinIssueAblityMap(CalculateCommonFormDTO calculateCommonFormDTO) { + Map map = new HashMap<>(); + List list = cpcScoreDao.selectListJoinIssueAvgValue(calculateCommonFormDTO); + if (!CollectionUtils.isEmpty(list)) { + BigDecimal minValue = Collections.min(list); + BigDecimal maxValue = Collections.max(list); + map.put(StrConstant.MIN, minValue); + map.put(StrConstant.MAX, maxValue); + return map; + } + map.put(StrConstant.MIN, new BigDecimal(NumConstant.ZERO_STR)); + map.put(StrConstant.MAX, new BigDecimal(NumConstant.ZERO_STR)); + // FOR TEST + /*map.put(StrConstant.MIN, new BigDecimal("9.15")); + map.put(StrConstant.MAX, new BigDecimal("29.4"));*/ + return map; + } + + /** + * @param formDTO 客户id 月份id: yyyyMM + * @param resultMapList + * @param indexCode 指标编码: 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; + * @param isTotal 1:总分;0不是 + * @return void + * @author yinzuomei + * @description 保存网格相关三大能力值 + * @Date 2020/8/30 22:50 + **/ + private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO, + List> resultMapList, + String indexCode, + String isTotal) { + List gridScoreEntityList = new ArrayList<>(); + String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); + String yearId = DateUtils.getYearId(formDTO.getMonthId()); + for (HashMap resultMap : resultMapList) { + resultMap.forEach((gridId, partyAblityScore) -> { + log.info("网格id:" + gridId + ";index_Code:"+indexCode+";分值:" + partyAblityScore); + GridScoreEntity gridScoreEntity = new GridScoreEntity(); + gridScoreEntity.setCustomerId(formDTO.getCustomerId()); + gridScoreEntity.setGridId(gridId); + gridScoreEntity.setIsTotal(isTotal); + gridScoreEntity.setIndexCode(indexCode); + ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId); + if (null != screenCustomerGridDTO) { + if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){ + gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); + } + if(StringUtils.isNotBlank(screenCustomerGridDTO.getAllParentIds())){ + gridScoreEntity.setAllParentIds(screenCustomerGridDTO.getAllParentIds()); + } + } + gridScoreEntity.setQuarterId(quarterId); + gridScoreEntity.setYearId(yearId); + gridScoreEntity.setMonthId(formDTO.getMonthId()); + gridScoreEntity.setScore(partyAblityScore); + gridScoreEntityList.add(gridScoreEntity); + }); + } + if (!CollectionUtils.isEmpty(gridScoreEntityList)) { + gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, isTotal); + gridScoreDao.insertBatches(gridScoreEntityList); + } + } + + /** + * @param indexMap + * @return java.util.List + * @author yinzuomei + * @description 调用计算器计算每个指标下,各个网格的总分 + * @Date 2020/8/30 21:40 + **/ + @Override + public HashMap calculate(Map> indexMap) { + //构造入参 + List indexInputVOS = this.getIndexInputVOList(indexMap); + log.info("计算的参数"+JSON.toJSONString(indexInputVOS)); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + + //如果想看每一个指标的分值调用下面的方法 + List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + log.info("计算的结果(List)"+JSON.toJSONString(listTemp)); + + HashMap resultMap = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + log.info("计算的结果{}", resultMap); + return resultMap; + } + + /** + * @param indexMap + * @return java.util.List + * @author yinzuomei + * @description map遍历,转为List + * @Date 2020/8/30 18:34 + **/ + private List getIndexInputVOList(Map> indexMap) { + List list = new ArrayList<>(); + //遍历所有的指标 + indexMap.forEach((key, indexInputVO) -> { + list.add(indexInputVO); + }); + return list; + } + + + /** + * @param indexList 指标集合 + * @param minAndMaxMap 最大值最小值集合 + * @return java.util.Map + * @author yinzuomei + * @description 构造网格相关 指标计算参数 + * @Date 2020/8/30 15:56 + **/ + private Map> buildGridCorrelationIndexInputVO(CalculateCommonFormDTO formDTO, List indexList, Map minAndMaxMap) { + Map> map = new HashMap<>(); + for (IndexGroupDetailEntity index : indexList) { + BigDecimal minValue = null; + BigDecimal maxValue = null; + if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) { + //组织内党员的联系群众能力考评分(平均值) 获取最大值,最小值 +// log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); + Map contactMassesAblityMap = this.getContactMassesAblityMap(formDTO); + minValue = contactMassesAblityMap.get(StrConstant.MIN); + maxValue = contactMassesAblityMap.get(StrConstant.MAX); + } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())) { +// log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); + Map joinIssueAblityMap = this.getJoinIssueAblityMap(formDTO); + minValue = joinIssueAblityMap.get(StrConstant.MIN); + maxValue = joinIssueAblityMap.get(StrConstant.MAX); + } else { + //获取指标对应的列名 + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode()); + if (StringUtils.isBlank(fieldName)) { + log.error("index_code:{} not find field_name",index.getIndexCode()); + continue; + } +// log.info("index_code2:{} ,field_name:{}",index.getIndexCode(),fieldName); + String minValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MIN); + String maxValueKey = fieldName.concat(StrConstant.UNDER_LINE).concat(StrConstant.MAX); + minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); + maxValue = new BigDecimal(String.valueOf(minAndMaxMap.get(maxValueKey))); + } + //有阈值,且最大值>阈值,则最大值赋值为阈值 + if (new BigDecimal(NumConstant.ONE_NEG_STR).compareTo(index.getThreshold()) != NumConstant.ZERO + && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) { + maxValue = index.getThreshold(); + } + //分值计算器 + ScoreCalculator scoreCalculator = new BigDecimalScoreCalculator(minValue, + maxValue, + ScoreConstants.MIN_SCORE, + ScoreConstants.MAX_SCORE, + Correlation.getCorrelation(index.getCorrelation()) + ); + List> sampleValueList = new ArrayList<>(); + IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + sampleValueList, + index.getThreshold(), +// new BigDecimal("-1"),//FOR TEST + index.getWeight(), + scoreCalculator); + map.put(index.getIndexCode(), indexInputVO1); + } + return map; + } + + /** + * @param formDTO + * @param indexList + * @return void + * @author yinzuomei + * @description 计算网格相关-治理能力 + * @Date 2020/8/26 16:47 + **/ + private void calculateGridZhiLi(CalculateCommonFormDTO formDTO, List indexList) { + //查询总记录数 + int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); + if (NumConstant.ZERO == total) { + log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); + return; + }else if (NumConstant.ONE == total) { + //只有一个网格时 + log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_govrn_ablity_grid_monthly record",IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); + this.handleOneGridScene(formDTO,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + } + //总页数,进行批量查询,批量计算 + int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,key:code_MIN/MAX + Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.error("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + return; + } + //指标集合 + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListGovrnAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { +// log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); + String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); + BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); + value.getIndexValueVOs().add(contactMassesAblityValue); + }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } + }); + }); + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); + } + // 保存中间表 + saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), NumConstant.ZERO_STR); + } + + + /** + * @param formDTO + * @param indexList + * @return void + * @author yinzuomei + * @description 计算网格相关-服务能力 + * @Date 2020/8/26 16:48 + **/ + private void calculateGridFuWu(CalculateCommonFormDTO formDTO, List indexList) { + //查询总记录数 + int total = factIndexServiceAblityGridMonthlyDao.selectCount(formDTO); + if (NumConstant.ZERO == total) { + log.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); + return; + }else if (NumConstant.ONE == total) { + //只有一个网格时 + log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_service_ablity_grid_monthly record",IndexCodeEnum.FU_WU_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); + this.handleOneGridScene(formDTO,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + } + //总页数,进行批量查询,批量计算 + int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); + log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); + //每一组指标的最大值,key:code_MIN/MAX + Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(minAndMaxMap)) { + log.error("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); + return; + } + //指标集合 + Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); + List> resultMapList = new ArrayList<>(); + //分页查询采集记录 + for (int pageNo = 1; pageNo <= totalPage; pageNo++) { + int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; + //前10条 + List> recordList = queryListServiceAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), + formDTO.getMonthId(), + pageIndex, + pageNo, + IndexCalConstant.PAGE_SIZE)); + //遍历每一个网格的记录 + recordList.forEach(recordMap -> { + //遍历所有的指标 + indexMap.forEach((key, value) -> { + if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { + //对应的数值 + String sampleValueStr = String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key))); + //构造样本值对象 + SampleValue currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr)); + value.getIndexValueVOs().add(currentGridIndexValue); + } else { + log.error("index_code:" + key + " not find field_name"); + } + }); + }); + HashMap resultMap = calculate(indexMap); + resultMapList.add(resultMap); + } + // 保存中间表 + saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.FU_WU_NENG_LI.getCode(), NumConstant.ZERO_STR); + } + + /** + * @param formDTO + * @param indexList + * @return void + * @author yinzuomei + * @description 计算网格相关总分 + * @Date 2020/8/26 16:50 + **/ + private void calculateGridTotal(CalculateCommonFormDTO formDTO, List indexList, String indexCode) { + //查询总记录数 + List gridScoreDTOList = gridScoreDao.selectList(formDTO); + if(CollectionUtils.isEmpty(gridScoreDTOList)){ + log.error("calculateGridTotal gridScoreDao.selectList return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); + throw new RenException("客户一级指标分值记录不存在"); + } + Map indexMap = indexList.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, Function.identity())); + List gridScoreEntityList = new ArrayList<>(); + for (GridScoreDTO gridScoreDTO : gridScoreDTOList) { + GridScoreEntity gridScoreEntity = ConvertUtils.sourceToTarget(gridScoreDTO, GridScoreEntity.class); + gridScoreEntity.setIsTotal(NumConstant.ONE_STR); + gridScoreEntity.setIndexCode(indexCode); + gridScoreEntity.setScore(BigDecimal.ZERO); + if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { + log.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); + continue; + } + for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) { + BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); + gridScoreEntity.setScore(gridScoreEntity.getScore().add(indexScore)); + } + gridScoreEntityList.add(gridScoreEntity); + } + if (!CollectionUtils.isEmpty(gridScoreEntityList)) { + gridScoreDao.deleteByCusAndMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode, NumConstant.ONE_STR); + gridScoreDao.insertBatches(gridScoreEntityList); + } + } + + /** + * @param customerId + * @return com.epmet.dto.indexcal.CustomerGridInfoDTO + * @author yinzuomei + * @description 查询客户下网格信息 + * @Date 2020/8/26 15:37 + **/ + public CustomerGridInfoDTO queryCustomerGridInfo(String customerId) { + CustomerGridInfoDTO customerGridInfoDTO = new CustomerGridInfoDTO(); + customerGridInfoDTO.setTotal(screenCustomerGridDao.selectCountByCustomerId(customerId)); + customerGridInfoDTO.setGridList(screenCustomerGridDao.selectListByCustomerId(customerId)); + return customerGridInfoDTO; + } + + /** + * @param formDTO + * @return + * @author yinzuomei + * @description 分页查询网格列表 + * @Date 2020/8/27 14:42 + **/ + @Override + public List pageGridList(PageQueryGridFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageIndex(pageIndex); + return screenCustomerGridDao.pageListByCustomerId(formDTO); + } + + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 党建能力-网格相关事实表 当前客户下,所有网格的党建能力相关五级指标 + * @Date 2020/8/26 15:52 + **/ + @Override + public List> queryListPartyAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexPartyAblityGridMonthlyDao.selectListPartyAblityGrid(formDTO); + } + + /*网格群众用户数 + 网格党员用户数 + 网格活跃群众用户数 + 网格活跃党员用户数 + 网格党员人均提出话题数 + 网格群众人均提出话题数 + 网格党员人均提出的议题转项目数 + 网格群众人均提出的议题转项目数 + 建群党员数 + 组织内党员的联系群众能力考评分(平均值) + 网格的发文数量 + 网格议题转项目率 + 组织“三会一课”次数 + 党员参加“三会一课”人次*/ + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 查询党建能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:47 + **/ + public Map queryPartyAblityGridMinAndMax(String customerId, String monthId) { + return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId, monthId); + } + + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的治理能力相关五级指标 + * @Date 2020/8/26 15:55 + **/ + public List> queryListGovrnAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexGovrnAblityGridMonthlyDao.selectListGovrnAblityGrid(formDTO); + } + + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 查询治理能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:48 + **/ + public Map queryGovrnAblityGridMinAndMax(String customerId, String monthId) { + return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(customerId, monthId); + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 当前客户下,所有网格的服务能力相关五级指标 + * @Date 2020/8/26 15:55 + **/ + public List> queryListServiceAblityGrid(PageQueryGridFormDTO formDTO) { + return factIndexServiceAblityGridMonthlyDao.selectListServiceAblityGrid(formDTO); + } + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 + * @Date 2020/8/27 12:50 + **/ + public Map queryServiceAblityGridMinAndMax(String customerId, String monthId) { + return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(customerId, monthId); + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java new file mode 100644 index 0000000000..f25e27deb6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -0,0 +1,456 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.druid.util.StringUtils; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; +import com.epmet.dao.evaluationindex.screen.FactIndexGridScoreDao; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; +import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.dto.screen.result.SubGridAvgResultDTO; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +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.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/8/26 10:34 上午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommunityService { + + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + @Autowired + private FactIndexGridScoreDao factIndexGridScoreDao; + + /** + * @param customerId + * @Description 社区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean communityPartyCalculate(String customerId, String monthId) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //下属所有网格的党建能力平均值 + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { + List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { + log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); + return; + }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ + pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexEnd = NumConstant.TEN; + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd); + subPartyAvgList.forEach( party -> { + List index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 社区名义发文数量 + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); + if (CollectionUtils.isEmpty(publishArticleCountList)) { + log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); + return; + } + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + }else if (publishArticleCountList.size() == NumConstant.ONE){ + pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (publishArticleCountList.size() > NumConstant.ONE) { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach( publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 社区治理能力 + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean communityGovernAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.error("社区下级治理能力平均分集合为空"); + return; + } + if (subGridGovernAvg.size() == NumConstant.ONE) { + pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (subGridGovernAvg.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); + if (CollectionUtils.isEmpty(communityGovernAbility)){ + log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); + return; + }else if (communityGovernAbility.size() == NumConstant.ONE) { + pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (communityGovernAbility.size() > NumConstant.ONE) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); + governAbilityList.forEach(governAbility -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 社区服务能力 + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean communityServiceAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { + List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (subGridServiceAvg.size() == NumConstant.ONE) { + pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + return; + } else if (subGridServiceAvg.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); + if (CollectionUtils.isEmpty(communityActivityCountList)) { + log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); + return; + }else if (communityActivityCountList.size() == NumConstant.ONE) { + pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + return; + } else if (communityActivityCountList.size() > NumConstant.ONE) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); + communityActivityList.forEach(communityActivity -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + communityActivity.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 社区相关计算 + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + public Boolean communityRelate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfo(customerId, monthId); + detailListByParentCode.forEach(detail -> { + factIndexCommunityScoreEntities.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = factIndexCommunityScoreEntities.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); + value.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); + }); + result.add(score); + }); + deleteAndInsert(customerId, monthId, IndexCalConstant.COMMUNITY_RELATE, result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 计算社区相关总分 + * @author zxc + * @date 2020/9/1 4:12 下午 + */ + public Boolean calCommunityAll(String customerId, String monthId) { + Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate community-party-ability failure ......"); + } + Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate community-govern-ability failure ......"); + } + Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate community-service-ability failure ......"); + } + Boolean dBoolean = communityRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate community-all insert failure ......"); + } + return true; + } + + /** + * @param list + * @Description BigDecimal类型获取最大数和最小数 + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @param customerId + * @param monthId + * @param indexCode + * @param subAllGridList + * @Description 先删除记录,在插入 + * @author zxc + * @date 2020/9/1 4:24 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllGridList) { + if (!CollectionUtils.isEmpty(subAllGridList)) { + factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); + factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); + } + } + + /** + * @Description + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @author zxc + * @date 2020/9/2 2:37 下午 + */ + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + List result = new ArrayList<>(); + scoreCountOfSampleId.forEach((k, v) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); + result.add(score); + }); + return result; + } + + /** + * @Description 当查询结果为一条时,调用此方法 + * @param agencyId + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 2:40 下午 + */ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + HashMap scoreCountOfSampleId = new HashMap<>(); + scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + deleteAndInsert(customerId, monthId, indexCode, result); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java new file mode 100644 index 0000000000..9baa63df36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -0,0 +1,405 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.druid.util.StringUtils; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateDistrictService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +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.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/4 9:03 上午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrictService { + + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private AgencyScoreDao agencyScoreDao; + @Autowired + private DeptScoreDao deptScoreDao; + + /** + * @Description 计算全区相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + @Override + public Boolean calDistrictAll(String customerId, String monthId) { + Boolean aBoolean = districtPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate district-party-ability failure ......"); + } + Boolean bBoolean = districtGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate district-govern-ability failure ......"); + } + Boolean cBoolean = districtServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate district-service-ability failure ......"); + } + Boolean dBoolean = districtRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate district-all insert failure ......"); + } + return true; + } + + /** + * @param customerId + * @Description 全区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean districtPartyCalculate(String customerId, String monthId) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexDetailList)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //党建能力平均值 + indexDetailList.forEach(detail -> { + if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { + log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); + return; + }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ + pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); + subPartyAvgList.forEach( party -> { + List index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 区名义发文数量 + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); + if (CollectionUtils.isEmpty(publishArticleCountList)) { + log.error(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); + return; + } + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + }else if (publishArticleCountList.size() == NumConstant.ONE){ + pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (publishArticleCountList.size() > NumConstant.ONE) { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach( publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 全区治理能力 + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean districtGovernAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + if (districtGovernAvgList.size() == NumConstant.ONE) { + pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (districtGovernAvgList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + indexInputVOS.add(index1VO); + }); + } + } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (deptScoreAvgList.size() == NumConstant.ONE) { + pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),deptScoreAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (deptScoreAvgList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + indexInputVOS.add(index1VO); + }); + } + }else{ + // TODO 治理能力暂无自身级别 + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 全区服务能力 + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean districtServiceAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + if (subStreetAvgList.size() == NumConstant.ONE) { + pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId()); + sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + return; + } else if (subStreetAvgList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + // todo 暂时没有自身级别 + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + return true; + } + + /** + * @param customerId + * @param monthId + * @Description 区相关计算 + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + public Boolean districtRelate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfo(customerId, monthId, IndexCalConstant.DISTRICT_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + value.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); + }); + result.add(score); + }); + deleteAndInsert(customerId, monthId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), result); + return true; + } + + /** + * @param list + * @Description BigDecimal类型获取最大数和最小数 + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @param customerId + * @param monthId + * @param indexCode + * @param subAllDistrict + * @Description 先删除记录,在插入 + * @author zxc + * @date 2020/9/1 4:24 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllDistrict) { + if (!CollectionUtils.isEmpty(subAllDistrict)) { + agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL); + agencyScoreDao.insertStreetRecord(subAllDistrict); + } + } + + /** + * @Description + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @author zxc + * @date 2020/9/2 2:37 下午 + */ + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + List result = new ArrayList<>(); + scoreCountOfSampleId.forEach((k, v) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); + result.add(score); + }); + return result; + } + + /** + * @Description 当查询结果为一条时,调用此方法 + * @param agencyId + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 2:40 下午 + */ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + HashMap scoreCountOfSampleId = new HashMap<>(); + scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + deleteAndInsert(customerId, monthId, indexCode, result); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java new file mode 100644 index 0000000000..9385c1f121 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -0,0 +1,130 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.redis.IndexCodeFieldReRedis; +import com.epmet.service.evaluationindex.indexcal.*; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.List; + +/** + * @author liujianjun + * 指标计算service + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateServiceImpl implements IndexCalculateService { + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private GridCorreLationService gridCorreLationService; + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; + @Autowired + private IndexCodeFieldReRedis indexCodeFieldReRedis; + @Autowired + private IndexCalculateCommunityService indexCalculateCommunityService; + @Autowired + private IndexCalculateStreetService indexCalculateStreetService; + @Autowired + private IndexCalculateDistrictService indexCalculateDistrictService; + @Autowired + private DeptScoreService deptScoreService; + + @Override + public Boolean indexCalculate(IndexCalculateForm formDTO) { + try { + if (StringUtils.isBlank(formDTO.getMonthId())) { + //默认 当前月份-1 + formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); + } + //按照客户分组 + if (CollectionUtils.isEmpty(formDTO.getCustomerIds())) { + Result> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); + if (!externalCustomerIdsResult.success()) { + log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); + return false; + } + formDTO.setCustomerIds(externalCustomerIdsResult.getData()); + } + Boolean flag = false; + for (String customerId : formDTO.getCustomerIds()) { + CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); + //计算党员相关的 + try { + CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); + flag = cpcIndexCalculateService.cpcIndexCalculate(param); + log.info("indexCalculate cpcIndexCalculate return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate cpcIndexCalculate exception", e); + break; + } + + //计算网格 + try { + flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); + log.info("indexCalculate calculateGridCorreLation return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calculateGridCorreLation exception", e); + break; + } + //计算社区 + try { + indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + + //计算街道 + try { + indexCalculateStreetService.calStreetAll(customerId,formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + + //计算区直属 + try { + deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + + //计算全区 + try { + indexCalculateDistrictService.calDistrictAll(customerId,formDTO.getMonthId()); + log.info("indexCalculate calAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calAll exception", e); + break; + } + } + return flag; + } catch (Exception e) { + log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); + } finally { + //清除缓存 + indexCodeFieldReRedis.deleteIndexCodeFromRedis(); + } + return false; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java new file mode 100644 index 0000000000..e18de69bb2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -0,0 +1,448 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.alibaba.druid.util.StringUtils; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; +import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcal.IndexCalculateStreetService; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import com.epmet.support.normalizing.BigDecimalScoreCalculator; +import com.epmet.support.normalizing.Correlation; +import com.epmet.support.normalizing.ScoreCalculator; +import com.epmet.support.normalizing.ScoreConstants; +import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +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.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/2 3:11 下午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetService { + + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private IndexGroupDetailService indexGroupDetailService; + @Autowired + private IndexCodeFieldReService indexCodeFieldReService; + @Autowired + private FactIndexCommunityScoreDao communityScoreDao; + @Autowired + private AgencyScoreDao agencyScoreDao; + + /** + * @Description 计算街道相关总分 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 3:12 下午 + */ + @Override + public Boolean calStreetAll(String customerId, String monthId) { + Boolean aBoolean = streetPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate street-party-ability failure ......"); + } + Boolean bBoolean = streetGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate street-govern-ability failure ......"); + } + Boolean cBoolean = streetServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate street-service-ability failure ......"); + } + Boolean dBoolean = streetRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate street-all insert failure ......"); + } + return true; + } + + /** + * @param customerId + * @Description 社区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean streetPartyCalculate(String customerId, String monthId) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //下属所有社区的党建能力平均值 + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { + log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); + return; + }else if (subCommPartyAvgScore.size() == NumConstant.ONE){ + pid.put(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subCommPartyAvgScore.get(NumConstant.ZERO).getParentId()); + sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (subCommPartyAvgScore.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexEnd = NumConstant.TEN; + List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); + partition.forEach(publish -> { + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 街道名义发文数量 + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL); + if (CollectionUtils.isEmpty(mapList)) { + log.error(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); + return; + } + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldName)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + }else if (mapList.size() == NumConstant.ONE){ + pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + return; + }else if (mapList.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); + List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + return true; + } + + /** + * @Description 街道治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean streetGovernAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { + List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (subGridGovernAvg.size() == NumConstant.ONE) { + pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (subGridGovernAvg.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL); + if (CollectionUtils.isEmpty(communityGovernAbility)){ + log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); + return; + }else if (communityGovernAbility.size() == NumConstant.ONE) { + pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + return; + } else if (communityGovernAbility.size() > NumConstant.ONE) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); + governAbilityList.forEach(governAbility -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + System.err.println(detail.getCorrelation()); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + return true; + } + + /** + * @Description 街道服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean streetServiceAbilityCalculate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return false; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { + List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (subCommServiceAvg.size() == NumConstant.ONE) { + pid.put(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),subCommServiceAvg.get(NumConstant.ZERO).getParentId()); + sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + return; + } else if (subCommServiceAvg.size() > NumConstant.ONE) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL); + if (CollectionUtils.isEmpty(communityActivityCountList)) { + log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); + return; + }else if (communityActivityCountList.size() == NumConstant.ONE) { + pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + return; + } else if (communityActivityCountList.size() > NumConstant.ONE) { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); + communityActivityList.forEach(communityActivity -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + communityActivity.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid + ); + deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + return true; + } + + /** + * @Description 街道相关计算 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/3 9:21 上午 + */ + public Boolean streetRelate(String customerId, String monthId) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfo(customerId, monthId, IndexCalConstant.STREET_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + score.setDataType(IndexCalConstant.STREET_LEVEL); + value.forEach(street -> { + score.setScore(score.getScore().add(street.getScore())); + score.setParentAgencyId(street.getParentAgencyId()); + }); + result.add(score); + }); + deleteAndInsert(customerId, monthId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), result); + return true; + } + + /** + * @param list + * @Description BigDecimal类型获取最大数和最小数 + * @author zxc + * @date 2020/8/27 1:30 下午 + */ + public MaxAndMinBigDecimalResultDTO getMaxAndMinBigDecimal(List list) { + BigDecimal max = Collections.max(list); + BigDecimal min = Collections.min(list); + MaxAndMinBigDecimalResultDTO result = new MaxAndMinBigDecimalResultDTO(); + result.setMax(max); + result.setMin(min); + return result; + } + + /** + * @param customerId + * @param monthId + * @param indexCode + * @param subAllCommunityList + * @Description 先删除记录,在插入 + * @author zxc + * @date 2020/9/1 4:24 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllCommunityList) { + if (!CollectionUtils.isEmpty(subAllCommunityList)) { + agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.STREET_LEVEL); + agencyScoreDao.insertStreetRecord(subAllCommunityList); + } + } + + /** + * @Description + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 + * @author zxc + * @date 2020/9/2 2:37 下午 + */ + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + List result = new ArrayList<>(); + scoreCountOfSampleId.forEach((k, v) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + score.setScore(v); + pid.forEach((agency,parentAgency) -> { + if (k.equals(agency)){ + score.setParentAgencyId(parentAgency); + } + }); + result.add(score); + }); + return result; + } + + /** + * @Description 当查询结果为一条时,调用此方法 + * @param agencyId + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/2 2:40 下午 + */ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + HashMap scoreCountOfSample = new HashMap<>(); + scoreCountOfSample.put(agencyId,new BigDecimal(NumConstant.FIFTY)); + List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + deleteAndInsert(customerId, monthId, indexCode, result); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java new file mode 100644 index 0000000000..3e89bee003 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCodeFieldReServiceImpl.java @@ -0,0 +1,56 @@ +package com.epmet.service.evaluationindex.indexcal.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexCodeFieldReDao; +import com.epmet.entity.evaluationindex.screen.IndexCodeFieldReEntity; +import com.epmet.redis.IndexCodeFieldReRedis; +import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCodeFieldReServiceImpl implements IndexCodeFieldReService { + @Autowired + private IndexCodeFieldReDao indexCodeFieldReDao; + + @Autowired + private IndexCodeFieldReRedis indexCodeFieldReRedis; + + @Override + public Map getIndexCodeFieldReMap() { + Map indexCodeFiledReMap = indexCodeFieldReRedis.getIndexCodeFiledReMap(); + if (CollectionUtils.isEmpty(indexCodeFiledReMap)) { + List allData = indexCodeFieldReDao.getAllData(); + if (CollectionUtils.isEmpty(allData)){ + return new HashMap<>(); + } + indexCodeFiledReMap = allData.stream().collect(Collectors.toMap(IndexCodeFieldReEntity::getIndexCode, o -> o.getFieldId())); + indexCodeFieldReRedis.setIndexCodeFiledReMap(indexCodeFiledReMap); + } + return indexCodeFiledReMap; + } + + @Override + public String getFieldNameByIndexCode(String indexCode) { + Map indexCodeFieldReMap = this.getIndexCodeFieldReMap(); + if (CollectionUtils.isEmpty(indexCodeFieldReMap)) { + return null; + } + String fieldName = indexCodeFieldReMap.get(indexCode); + if (StringUtils.isEmpty(fieldName)){ + log.error("indexCode:{} 在index_code_re表中不存在记录",indexCode); + } + return fieldName; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java new file mode 100644 index 0000000000..e88e5d55a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java @@ -0,0 +1,120 @@ +package com.epmet.service.evaluationindex.indexcoll; + +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(GridPartyMemberDataFormDTO 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); + + /** + * 将网格、社区、区直部门、区/街道分支记录表中的数据,抽取到 指数-指数数据(每月数值) 指数-指数数据(按年统计) + * @param monthId 2020-8 + * @param customerId + * @return void + * @Author zhangyong + * @Date 10:29 2020-09-03 + **/ + void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java new file mode 100644 index 0000000000..2d6a2c48ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -0,0 +1,910 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; +import com.epmet.dao.evaluationindex.indexcoll.*; +import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.DeptScoreDTO; +import com.epmet.dto.indexcollect.form.*; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; +import com.epmet.dto.screen.FactIndexGridScoreDTO; +import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; +import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; +import com.epmet.eum.IndexCodeEnum; +import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; +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 org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Auther: zhangyong + * @Date: 2020-08-20 10:05 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexCollectServiceImpl implements FactIndexCollectService { + private static final Logger log = LoggerFactory.getLogger(FactIndexCollectServiceImpl.class); + + @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; + @Autowired + private FactIndexGridScoreDao factIndexGridScoreDao; + @Autowired + private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + @Autowired + private DeptScoreDao deptScoreDao; + @Autowired + private AgencyScoreDao agencyScoreDaol; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridPartyMemberData(GridPartyMemberDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + //删除这个客户这个月的数据 + int deleteNum; + do { + deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getPartyMemberDataList())) { + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getPartyMemberDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { + if (NumConstant.SIX != monthId.length()){ + throw new RuntimeException("入参monthId格式不正确:monthId =" + monthId); + } + // 开始处理 网格相关分值表 + this.startHandleIndexGridScore(monthId, customerId); + // 开始处理 社区相关分值表 + this.startHandleIndexCommunityScore(monthId, customerId); + // 开始处理 区直部门分值表 + this.startHandleIndexDeptScore(monthId, customerId); + // 开始处理 区/街道相关分数表 + this.startHandleIndexAgencyScore(monthId, customerId); + + // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly + this.insertIndexDataYear(monthId, customerId); + } + + /** + * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,在插入网格相关分值表。 一对四 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexGridScore(String monthId, String customerId){ + // 查询网格相关分值记录 表已经存在的网格id + List indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); + if (indexGridIds.size() > NumConstant.ZERO){ + // 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询。 + String[] gridIds = new String[indexGridIds.size()]; + for (int i = NumConstant.ZERO; i < indexGridIds.size(); i++){ + gridIds[i] = indexGridIds.get(i); + } + // 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 + List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); + // 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 + if (mismatchGridList.size() > NumConstant.ZERO){ + this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); + } + } else { + // 将所有的网格按照 4种类型,各赋一遍默认值 + List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); + this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); + } + // 开始处理实际分数 + // fact_index_grid_score 网格相关分值记录表 grid + List gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); + this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS); + } + + /** + * 将网格相关分值记录表 数据 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param gridScoreDTOS 网格相关分值记录表 当前客户所属月份数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 + Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); + // 查询网格的 上级组织id 和 组织名称 + List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); + String[] orgIds = new String[collect.size()]; + int j = 0; + for(Map.Entry> gridScore : collect.entrySet()){ + IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); + // 网格id + orgIds[j] = gridScore.getKey(); + j++; + // 给4个指数 赋默认值 + monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); + for ( int i = 0; i < gridScore.getValue().size(); i++){ + if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())){ + // 是总分 + if (IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode().equals(gridScore.getValue().get(i).getIndexCode())){ + // 总指数 = 网格相关 + monthlyFormDTO.setIndexTotal(gridScore.getValue().get(i).getScore()); + } + } else { + // 赋实际值 党建能力、治理能力、服务能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(gridScore.getValue().get(i).getIndexCode(), + gridScore.getValue().get(i).getScore(), + monthlyFormDTO); + } + } + // 匹配网格的 上级组织id 和 组织名称 + String parentAgencyId = ""; + String gridName = ""; + for (ScreenCustomerGridDTO gridDTO : parentGridList){ + if (gridScore.getKey().equals(gridDTO.getGridId())){ + parentAgencyId = gridDTO.getParentAgencyId(); + gridName = gridDTO.getGridName(); + } + } + if ("".equals(parentAgencyId)){ + throw new RuntimeException("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey()); + } + // 补充表中其他字段 + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScore.getKey(), + parentAgencyId, gridName, monthlyFormDTO); + monthlyFormDTOList.add(monthlyFormDTO); + } + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + } + + /** + * 目标:将社区的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入社区相关分值表。 一对四 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexCommunityScore(String monthId, String customerId){ + // 查询社区相关分值记录id + List indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); + if (indexCommunityIds.size() > NumConstant.ZERO){ + // 根据社区相关分值表 中查询到的社区id,去 组织机构信息 进行不匹配查询。 + String[] communityIds = new String[indexCommunityIds.size()]; + for (int i = NumConstant.ZERO; i < indexCommunityIds.size(); i++){ + communityIds[i] = indexCommunityIds.get(i); + } + // 进行不匹配查询(即返回社区相关分值表 中不存在的社区信息)。 + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); + // 将 社区相关分数表 中,本月份没有的社区信息,按照 4种类型,各新增一遍,赋默认值 0 + if (mismatchAgencyList.size() > NumConstant.ZERO){ + this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); + } + } else { + // 将所有的社区按照 4种类型,各赋一遍默认值 + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); + } + // 开始处理实际分数 + // fact_index_community_score 社区相关分数表 agency + // 查询社区相关分值记录 + List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); + this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS); + } + + /** + * 社区相关分数表 数据 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param communityScoreDTOS 社区相关分数表 当前客户所属月份数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + // 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据 + Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + // 根据客户id,查询区/街道 组织名称、id + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); + String[] orgIds = new String[collect.size()]; + int j = 0; + for(Map.Entry> communityScore : collect.entrySet()){ + IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); + // 组织id + orgIds[j] = communityScore.getKey(); + j++; + // 给4个指数 赋默认值 + monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); + for ( int i = 0; i < communityScore.getValue().size(); i++){ + if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())){ + // 是总分 + if (IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode().equals(communityScore.getValue().get(i).getIndexCode())){ + // 总指数 = 社区相关 + monthlyFormDTO.setIndexTotal(communityScore.getValue().get(i).getScore()); + } + } else { + // 赋值 党建能力、治理能力、服务能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(communityScore.getValue().get(i).getIndexCode(), + communityScore.getValue().get(i).getScore(), + monthlyFormDTO); + } + } + + // 当前组织 的上级组织id + String parentAgencyId = communityScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); + // 获取 组织名称 + String agencyName = ""; + for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) { + if (communityScore.getKey().equals(agencyScoreDTO.getAgencyId())) { + agencyName = agencyScoreDTO.getAgencyName(); + } + } + if ("".equals(agencyName)){ + throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); + } + // 补充表中其他字段 + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScore.getKey(), + parentAgencyId, agencyName, monthlyFormDTO); + // 补充表中其他字段 + monthlyFormDTOList.add(monthlyFormDTO); + } + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + } + + /** + * 目标:将区直部门的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 区直部门分值表。 一对四 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexDeptScore(String monthId, String customerId){ + // 查询社 区直部门分值表 + List indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); + if (indexDeptIds.size() > NumConstant.ZERO){ + String[] depeIds = new String[indexDeptIds.size()]; + for (int i = NumConstant.ZERO; i < indexDeptIds.size(); i++){ + depeIds[i] = indexDeptIds.get(i); + } + List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); + if (mismatchDeptList.size() > NumConstant.ZERO){ + this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); + } + } else { + List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); + this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); + } + // 开始处理实际分数 + // fact_index_dept_score 区直部门分值表 department + // 查询社 区直部门分值表 + List deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); + this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS); + } + + /** + * 将区直部门分值表 数据 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param deptScoreDTOS 区直部门分值表 当前客户所属月份数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexDataMonthlyByDeptScore(String monthId, String customerId, List deptScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + // 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据 + Map> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); + List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId); + String[] orgIds = new String[collect.size()]; + int j = 0; + for(Map.Entry> deptScore : collect.entrySet()){ + IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); + // 部门id + orgIds[j] = deptScore.getKey(); + j++; + // 给4个指数 赋默认值 + monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); + for ( int i = 0; i < deptScore.getValue().size(); i++){ + // 区直街道的总分 就是 治理能力 + monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore()); + // 赋值 治理能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(deptScore.getValue().get(i).getIndexCode(), + deptScore.getValue().get(i).getScore(), + monthlyFormDTO); + } + // 查询网格的 上级组织id 和 组织名称 + String parentAgencyId = ""; + String deptName = ""; + for (ScreenCustomerDeptEntity deptEntity : parentDeptList) { + if (deptScore.getKey().equals(deptEntity.getDeptId())) { + parentAgencyId = deptEntity.getParentAgencyId(); + deptName = deptEntity.getDeptName(); + } + } + if ("".equals(parentAgencyId)){ + throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey()); + } + // 补充表中其他字段 + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScore.getKey(), + parentAgencyId, deptName, monthlyFormDTO); + monthlyFormDTOList.add(monthlyFormDTO); + } + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + } + + /** + * 目标:将 区/街道的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) + * 如果 区/街道相关分数表 中的组织数量不全,需要从 组织机构信息 中,先查询到缺少的组织信息,赋上默认值后,在插入 区/街道相关分数表。 一对四 + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 13:44 2020-09-04 + **/ + private void startHandleIndexAgencyScore(String monthId, String customerId){ + List indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId); + if (indexAgencyIds.size() > NumConstant.ZERO){ + String[] agencyIds = new String[indexAgencyIds.size()]; + for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){ + agencyIds[i] = indexAgencyIds.get(i); + } + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencyIds); + if (mismatchAgencyList.size() > NumConstant.ZERO){ + this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + } else { + List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + } + // 开始处理实际分数 + // fact_index_agency_score 区/街道相关分数表 agency + List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); + this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS); + } + + /** + * 将区/街道相关分数表 数据 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param agencyScoreDTOS 区/街道相关分数表 当前客户所属月份数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 + Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); + String[] orgIds = new String[collect.size()]; + int j = 0; + for(Map.Entry> agencyScore : collect.entrySet()){ + IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); + // 组织id(eg:社区或者街道id) + orgIds[j] = agencyScore.getKey(); + j++; + // 给4个指数 赋默认值 + monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); + for ( int i = 0; i < agencyScore.getValue().size(); i++){ + if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())){ + // 是总分 总指数 = IS_TOTAL = 1 + monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore()); + } else { + // 赋值 党建能力、治理能力、服务能力 + monthlyFormDTO = this.setValueAbilityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(), + agencyScore.getValue().get(i).getScore(), + monthlyFormDTO); + } + } + // 当前组织 的上级组织id + String parentAgencyId = agencyScore.getValue().get(NumConstant.ZERO).getParentAgencyId(); + // 查询 组织名称 + String agencyName = ""; + for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) { + if (agencyScore.getKey().equals(agencyScoreDTO.getAgencyId())) { + agencyName = agencyScoreDTO.getAgencyName(); + } + } + if ("".equals(agencyName)){ + throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); + } + // 补充表中其他字段 + monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, agencyScore.getKey(), + parentAgencyId, agencyName, monthlyFormDTO); + monthlyFormDTOList.add(monthlyFormDTO); + } + if (monthlyFormDTOList.size() > NumConstant.ZERO){ + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + } + + /** + * 指数-指数数据(每月数值) 表 字段补全,待新增 + * @param monthId 202008 + * @param orgType 组织类别 agency:组织;部门:department;网格:grid + * @param orgId 组织Id 可以为网格,机关id + * @param parentId 上级组织id + * @param orgName 组织名称 + * @param monthlyFormDTO 待新增的DTO + * @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO + * @Author zhangyong + * @Date 15:29 2020-09-03 + **/ + private IndexDataMonthlyFormDTO supplementIndexDataMonthlyTable(String monthId, String orgType, String orgId, String parentId, + String orgName, IndexDataMonthlyFormDTO monthlyFormDTO){ + monthlyFormDTO.setYearId(getYearStr(monthId)); + monthlyFormDTO.setMonthId(monthId); + monthlyFormDTO.setOrgType(orgType); + monthlyFormDTO.setOrgId(orgId); + // 根据网格id,查询其上级组织id、组织名称 + monthlyFormDTO.setParentId(parentId); + monthlyFormDTO.setOrgName(orgName); + return monthlyFormDTO; + } + + /** + * 赋实际值 党建能力、治理能力、服务能力 + * @param IndexCode 组织类别 + * @param Score 分数 + * @param monthlyFormDTO 待保存的数据 + * @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO + * @Author zhangyong + * @Date 09:26 2020-09-04 + **/ + private IndexDataMonthlyFormDTO setValueAbilityMonthlyFor(String IndexCode, BigDecimal Score, IndexDataMonthlyFormDTO monthlyFormDTO){ + // 赋实际值 + if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(IndexCode)){ + // 党建能力 + monthlyFormDTO.setPartyDevAblity(Score); + } else if (IndexCodeEnum.ZHI_LI_NENG_LI.getCode().equals(IndexCode)){ + // 治理能力 + monthlyFormDTO.setGovernAblity(Score); + } else if (IndexCodeEnum.FU_WU_NENG_LI.getCode().equals(IndexCode)){ + // 服务能力 + monthlyFormDTO.setServiceAblity(Score); + } + return monthlyFormDTO; + } + + /** + * 设置 指数-指数数据(月、年) 表 + * 总指数、党建能力指数、治理能力、服务能力 默认值 0 + * @param monthlyFormDTO + * @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO + * @Author zhangyong + * @Date 11:01 2020-09-04 + **/ + private IndexDataMonthlyFormDTO setIndexDefaultValueFor(IndexDataMonthlyFormDTO monthlyFormDTO){ + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + monthlyFormDTO.setIndexTotal(zero); + monthlyFormDTO.setPartyDevAblity(zero); + monthlyFormDTO.setGovernAblity(zero); + monthlyFormDTO.setServiceAblity(zero); + return monthlyFormDTO; + } + + /** + * 新增 网格相关分值记录表 默认值,一条网格,按照组织类别的不同 需要插入4次 + * + * @param monthId 例:202008 + * @param customerId + * @param mismatchGridList 网格相关分值记录表 中缺少的网格集合 + * @return void + * @Author zhangyong + * @Date 14:02 2020-09-04 + **/ + private void insertIndexGridScoreDefaultValue(String monthId, String customerId, List mismatchGridList){ + List insertIndexGridScoreDTOS = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + for (ScreenCustomerGridDTO gridDTO : mismatchGridList){ + FactIndexGridScoreDTO indexGridScoreDTO = new FactIndexGridScoreDTO(); + // 赋默认值 - 党建能力指数 + indexGridScoreDTO.setGridId(gridDTO.getGridId()); + indexGridScoreDTO.setAgencyId(gridDTO.getParentAgencyId()); + indexGridScoreDTO.setAllParentIds(gridDTO.getAllParentIds()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + indexGridScoreDTO.setQuarterId(DateUtils.getQuarterId(monthId)); + indexGridScoreDTO.setYearId(getYearStr(monthId)); + indexGridScoreDTO.setMonthId(monthId); + // 0 or 1 + indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR); + indexGridScoreDTO.setScore(zero); + indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR); + insertIndexGridScoreDTOS.add(indexGridScoreDTO); + + FactIndexGridScoreDTO indexGridScoreDTO1 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); + // 赋默认值 - 治理能力 + indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + insertIndexGridScoreDTOS.add(indexGridScoreDTO1); + + FactIndexGridScoreDTO indexGridScoreDTO2 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); + // 赋默认值 - 服务能力 + indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); + insertIndexGridScoreDTOS.add(indexGridScoreDTO2); + + FactIndexGridScoreDTO indexGridScoreDTO3 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); + indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR); + // 赋默认值 - 网格相关 + indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + insertIndexGridScoreDTOS.add(indexGridScoreDTO3); + } + factIndexGridScoreDao.batchInsertGridScoreData(insertIndexGridScoreDTOS, customerId); + } + + /** + * 新增 社区相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 + * + * @param monthId + * @param customerId + * @param mismatchAgencyList + * @return void + * @Author zhangyong + * @Date 14:02 2020-09-04 + **/ + private void insertIndexCommunityScoreDefaultValue(String monthId, String customerId, List mismatchAgencyList){ + List insertIndexCommunityScore = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ + FactIndexCommunityScoreEntity communityScore1 = new FactIndexCommunityScoreEntity(); + // 赋默认值 - 党建能力指数 + communityScore1.setAgencyId(agencyDTO.getAgencyId()); + communityScore1.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + communityScore1.setQuarterId(DateUtils.getQuarterId(monthId)); + communityScore1.setYearId(getYearStr(monthId)); + communityScore1.setMonthId(monthId); + // 0 or 1 + communityScore1.setIsTotal(NumConstant.ZERO_STR); + communityScore1.setScore(zero); + communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + insertIndexCommunityScore.add(communityScore1); + + // 赋默认值 - 治理能力 + FactIndexCommunityScoreEntity communityScore2 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); + communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + insertIndexCommunityScore.add(communityScore2); + + // 赋默认值 - 服务能力 + FactIndexCommunityScoreEntity communityScore3 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); + communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); + insertIndexCommunityScore.add(communityScore3); + + // 赋默认值 - 社区相关 + FactIndexCommunityScoreEntity communityScore4 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); + communityScore4.setIsTotal(NumConstant.ONE_STR); + communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + insertIndexCommunityScore.add(communityScore4); + } + factIndexCommunityScoreDao.batchInsertCommunityScoreData(insertIndexCommunityScore, customerId); + } + + /** + * 新增 区直部门分值表 默认值,一条部门id,按照组织类别的不同 需要插入1次 + * + * @param monthId + * @param customerId + * @param mismatchDeptList + * @return void + * @Author zhangyong + * @Date 14:02 2020-09-04 + **/ + private void insertIndexDeptScoreDefaultValueFor(String monthId, String customerId, List mismatchDeptList){ + List insertIndexDeptScore = new ArrayList<>(); + for (ScreenCustomerDeptEntity deptDTO : mismatchDeptList){ + DeptScoreEntity deptScore2 = new DeptScoreEntity(); + // 赋默认值 - 治理能力 + deptScore2.setDeptId(deptDTO.getDeptId()); + deptScore2.setAgencyId(deptDTO.getParentAgencyId()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + deptScore2.setQuarterId(DateUtils.getQuarterId(monthId)); + deptScore2.setYearId(getYearStr(monthId)); + deptScore2.setMonthId(monthId); + deptScore2.setIsTotal(NumConstant.ZERO_STR); + deptScore2.setScore(new BigDecimal(NumConstant.ZERO)); + deptScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + deptScore2.setDelFlag(NumConstant.ZERO_STR); + insertIndexDeptScore.add(deptScore2); + } + deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId); + } + + /** + * 新增 区/街道相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 + * + * @param monthId + * @param customerId + * @param mismatchAgencyList + * @return void + * @Author zhangyong + * @Date 14:02 2020-09-04 + **/ + private void insertIndexAgencyScoreDefaultValueFor(String monthId, String customerId, List mismatchAgencyList){ + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + List insertIndexAgencyScore = new ArrayList<>(); + for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ + if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel()) || OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) + || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ + AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); + // 赋默认值 - 党建能力指数 + agencyScore1.setAgencyId(agencyDTO.getAgencyId()); + agencyScore1.setParentAgencyId(agencyDTO.getPid()); + //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId)); + agencyScore1.setYearId(getYearStr(monthId)); + agencyScore1.setMonthId(monthId); + // 0 or 1 + agencyScore1.setIsTotal(NumConstant.ZERO_STR); + agencyScore1.setScore(zero); + agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + + AgencyScoreEntity agencyScore2 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); + // 赋默认值 - 治理能力 + agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + + AgencyScoreEntity agencyScore3 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); + // 赋默认值 - 服务能力 + agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); + + AgencyScoreEntity agencyScore4 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); + agencyScore4.setIsTotal(NumConstant.ONE_STR); + if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel())){ + // 赋默认值 - 全区相关 + agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + agencyScore4.setDataType(OrgTypeConstant.DISTRICT); + agencyScore1.setDataType(OrgTypeConstant.DISTRICT); + agencyScore2.setDataType(OrgTypeConstant.DISTRICT); + agencyScore3.setDataType(OrgTypeConstant.DISTRICT); + } else if (OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ + // 赋默认值 - 街道相关 + agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + agencyScore4.setDataType(OrgTypeConstant.STREET); + agencyScore1.setDataType(OrgTypeConstant.STREET); + agencyScore2.setDataType(OrgTypeConstant.STREET); + agencyScore3.setDataType(OrgTypeConstant.STREET); + } + insertIndexAgencyScore.add(agencyScore1); + insertIndexAgencyScore.add(agencyScore2); + insertIndexAgencyScore.add(agencyScore3); + insertIndexAgencyScore.add(agencyScore4); + } + } + agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId); + } + + /** + * 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly + * + * @param monthId + * @param customerId + * @return void + * @Author zhangyong + * @Date 22:06 2020-09-04 + **/ + private void insertIndexDataYear(String monthId, String customerId){ + List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), getMonthStr(monthId)); + String[] orgIds = new String[monthlyFormList.size()]; + for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){ + orgIds[i] = monthlyFormList.get(i).getOrgId(); + } + if (monthlyFormList.size() > NumConstant.ZERO){ + screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId), orgIds); + List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); + screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); + } + } + + /** + * 将月份id,拆分成 年份 + * + * @param monthId 202008 + * @return java.lang.String + * @Author zhangyong + * @Date 13:39 2020-09-04 + **/ + private String getYearStr(String monthId){ + return monthId.substring(NumConstant.ZERO, NumConstant.FOUR); + } + + + /** + * 将月份id,拆分成 月份 + * + * @param monthId 202008 + * @return java.lang.String + * @Author zhangyong + * @Date 13:39 2020-09-04 + **/ + private String getMonthStr(String monthId){ + return monthId.substring(NumConstant.FOUR, NumConstant.SIX); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexDictService.java new file mode 100644 index 0000000000..8a259c5255 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java new file mode 100644 index 0000000000..f202beca1b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; + +import java.util.List; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupDetailService extends BaseService { + /** + * desc:根据all_parent_index_code 获取指标明细 + * @param customerId + * @param indexCode + */ + List getDetailListByParentCode(String customerId,String... indexCode); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailTemplateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailTemplateService.java new file mode 100644 index 0000000000..d82fa93de8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/IndexGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupService.java new file mode 100644 index 0000000000..56b53dbed2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/IndexGroupTemplateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupTemplateService.java new file mode 100644 index 0000000000..fd72ef8279 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/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.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.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/evaluationindex/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java new file mode 100644 index 0000000000..1e6dca0080 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java @@ -0,0 +1,234 @@ +package com.epmet.service.evaluationindex.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(DifficultyDataFormDTO 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); + + /** + * 18、公众参与各类总数 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * @param formDTO + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:44 2020-08-25 + **/ + void insertPublicPartiTotalData(List formDTO, String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java new file mode 100644 index 0000000000..759270bf09 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexDictServiceImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexDictDao; +import com.epmet.entity.evaluationindex.screen.IndexDictEntity; +import com.epmet.service.evaluationindex.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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java new file mode 100644 index 0000000000..7a8935bd02 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService { + + + @Override + public List getDetailListByParentCode(String customerId,String... indexCode) { + if (indexCode == null || indexCode.length == 0){ + throw new RenException("参数错误"); + } + StringBuilder sb = new StringBuilder(); + for (String code:indexCode){ + sb.append(code).append(StrConstant.COLON); + } + return baseDao.getDetailListByParentCode(customerId,sb.deleteCharAt(sb.length()-1).toString()); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java new file mode 100644 index 0000000000..dd0d811cfd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailTemplateServiceImpl.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailTemplateDao; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; +import com.epmet.service.evaluationindex.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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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/evaluationindex/screen/impl/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.java new file mode 100644 index 0000000000..e455120eef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupServiceImpl.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.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +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.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexGroupDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupDetailTemplateDao; +import com.epmet.dao.evaluationindex.screen.IndexGroupTemplateDao; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupEntity; +import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; +import com.epmet.service.evaluationindex.screen.IndexGroupService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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("没有需要初始化的数据"); + } + Map groupMap = groupTempList.stream().collect(Collectors.toMap(IndexGroupTemplateEntity::getId, o -> o)); + Map groupEntityMap = new HashMap<>(); + Map groupNewIdMap = new HashMap<>(); + + List insertGroupList = new ArrayList<>(); + groupMap.forEach((oldGroupTempId,o)->{ + IndexGroupEntity newGroupEntity = ConvertUtils.sourceToTarget(o, IndexGroupEntity.class); + String newGroupId = UniqueIdGenerator.generate(); + newGroupEntity.setId(newGroupId); + newGroupEntity.setCustomerId(customerId); + String oldPid = newGroupEntity.getParentIndexGroupId(); + String newPid = groupNewIdMap.get(oldPid); + /*if (StringUtils.isBlank(newPid)){ + newPid = UniqueIdGenerator.generate(); + groupNewIdMap.put(oldPid,newPid); + }*/ + //newGroupEntity.setParentIndexGroupId(newPid); + groupNewIdMap.put(oldGroupTempId,newGroupId); + //groupEntityMap.put(newGroupId,newGroupEntity); + insertGroupList.add(newGroupEntity); + }); + insertGroupList.forEach(o-> { + String parentIndexGroupId = groupNewIdMap.get(o.getParentIndexGroupId()); + if (StringUtils.isBlank(parentIndexGroupId)){ + parentIndexGroupId = "0"; + } + o.setParentIndexGroupId(parentIndexGroupId); + }); + groupDetailTempList.forEach(groupDetailTemp->{ + String oldIndexGroupId = groupDetailTemp.getIndexGroupId(); + System.out.println(oldIndexGroupId); + + + IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupDetailTemp, IndexGroupDetailEntity.class); + entity.setId(UniqueIdGenerator.generate()); + String newGroupId = groupNewIdMap.get(oldIndexGroupId); + if (StringUtils.isBlank(newGroupId)){ + log.error("新旧id映射关系有误"); + return; + } + entity.setIndexGroupId(newGroupId); + entity.setCustomerId(customerId); + indexGroupDetailDao.insert(entity); + }); + this.insertBatch(insertGroupList,10); + + + /* 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()); + + groupEntityList.forEach(group->{ + + }); + + 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/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java new file mode 100644 index 0000000000..868e422b02 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupTemplateServiceImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.IndexGroupTemplateDao; +import com.epmet.entity.evaluationindex.screen.IndexGroupTemplateEntity; +import com.epmet.service.evaluationindex.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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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/evaluationindex/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java new file mode 100644 index 0000000000..6018622deb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java @@ -0,0 +1,470 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.evaluationindex.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.CompareConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dto.screencoll.form.*; +import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; +import com.epmet.service.evaluationindex.screen.ScreenCollService; +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.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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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; + @Autowired + private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId) { + if(formDTO.getIsFirst()){ + //直接删除当前客户下所有的数据 + screenDifficultyDataDao.deleteDifficultyData(customerId); + } + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDiffcultyDataList())){ + screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDiffcultyDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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.EVALUATION_INDEX, 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(); + // 获取上个月的基本数据 + String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; + List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, + lastMonth[NumConstant.ZERO], + moneth, + 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){ + if (NumConstant.ZERO == old){ + return new BigDecimal(now * NumConstant.ONE_HUNDRED); + } + 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.EVALUATION_INDEX, 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); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPublicPartiTotalData(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(); + } + screenPublicPartiTotalDataDao.deletePublicPartiTotalData(customerId, orgIds); + + screenPublicPartiTotalDataDao.batchInsertPublicPartiTotalData(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..d24fec3ee8 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.constant.FieldConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.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/BigDecimalScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java new file mode 100644 index 0000000000..4f884c3e34 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/BigDecimalScoreCalculator.java @@ -0,0 +1,98 @@ +package com.epmet.support.normalizing; + +import com.alibaba.fastjson.JSON; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; + +/** + * BigDecimal的分值计算 + * 每一种数据类型的计算都要继承ScoreCalculator并且实现其抽象方法,实现数据类型的转换 + */ +public class BigDecimalScoreCalculator extends ScoreCalculator { + + /* *//** + * 初始化基于原数组的整数分值计算 + * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ + * @param sourceArray 源数据完整数组 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + *//* + public BigDecimalScoreCalculator(BigDecimal[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray.clone(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + *//** + * 初始化基于原数组的整数分值计算 + * @param sourceList 源数据完整列表 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + *//* + public BigDecimalScoreCalculator(List sourceList, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceList.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + }*/ + + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public BigDecimalScoreCalculator(BigDecimal minSourceValue, BigDecimal maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValue; + this.maxValue = maxSourceValue; + this.correlation = correlation; + prepare4BoundaryValue(); + System.out.println("归一区间最小值:"+minScore+";归一区间最大值:"+maxScore+";样本最小值:"+minSourceValue+";样本最大值:"+maxSourceValue); + } + + @Override + public BigDecimal getMaxFromSourceArray() { + if (this.sourceArrary == null){ + return null; + } + BigDecimal[] intSourceArrary = (BigDecimal[]) this.sourceArrary; + return intSourceArrary[intSourceArrary.length - 1]; + } + + @Override + public BigDecimal getMinFromSourceArray() { + if (this.sourceArrary == null){ + return null; + } + BigDecimal[] intSourceArrary = (BigDecimal[]) this.sourceArrary; + return intSourceArrary[0]; + } + + @Override + public BigDecimal convertValue2BigDecimal(Object sourceValue) { + return (BigDecimal) sourceValue; + } + + public static void main(String[] args) { + BigDecimal minScore = new BigDecimal(0); + BigDecimal maxScore = new BigDecimal(100); + ScoreCalculator sc = new BigDecimalScoreCalculator(new BigDecimal("0.1"),new BigDecimal("1"), minScore, maxScore, Correlation.POSITIVE); + List ts = Arrays.asList(new BigDecimal("0.1"),new BigDecimal("1")); + List normalize = sc.normalize(ts); + System.out.println(JSON.toJSONString(normalize)); + } +} 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..acacce6f1a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java @@ -0,0 +1,46 @@ +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; + } + + public static Correlation getCorrelation(String code){ + if (code == null) { + return Correlation.POSITIVE; + } + Correlation[] values = Correlation.values(); + for (Correlation correlation : values) { + if (code.equals(correlation.getCode())) { + return correlation; + } + } + return Correlation.POSITIVE; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/epmet-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..d919b2470f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java @@ -0,0 +1,73 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 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.clone(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare4SourceArray(); + } + + public DoubleScoreCalculator(List sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare4SourceArray(); + } + + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public DoubleScoreCalculator(Double minSourceValue, Double maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + BigDecimal minSourceValueBD = new BigDecimal(minSourceValue); + BigDecimal maxSourceValueBD = new BigDecimal(maxSourceValue); + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValueBD; + this.maxValue = maxSourceValueBD; + this.correlation = correlation; + prepare4BoundaryValue(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + @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..2114eee59e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java @@ -0,0 +1,82 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 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.clone(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + /** + * 初始化基于原数组的整数分值计算 + * @param sourceList 源数据完整列表 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public IntegerScoreCalculator(List sourceList, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceList.toArray(); + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + prepare4SourceArray(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + } + + /** + * 初始化基于边界值的整数分值计算 + * @param minSourceValue 左边界值 + * @param maxSourceValue 右边界值 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public IntegerScoreCalculator(Integer minSourceValue, Integer maxSourceValue, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + BigDecimal minSourceValueBD = new BigDecimal(minSourceValue); + BigDecimal maxSourceValueBD = new BigDecimal(maxSourceValue); + + this.minScore = minScore; + this.maxScore = maxScore; + this.minValue = minSourceValueBD; + this.maxValue = maxSourceValueBD; + this.correlation = correlation; + prepare4BoundaryValue(); + 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..07407d5032 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -0,0 +1,201 @@ +package com.epmet.support.normalizing; + +import lombok.Data; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 所有数据类型计算器的父类,实现算法骨架,数据类型转换方法则由子类实现 + * ☆☆☆ 如果需要保持传入的数组元素顺序不变,请在实现类的构造方法中将传入数组进行克隆 ☆☆☆ + * @param 数据类型泛型 + */ +@Data +public abstract class ScoreCalculator { + + /** + * 源数据的数组 + */ + protected T[] sourceArrary; + + /** + * 最大最小分 + */ + protected BigDecimal minScore; + protected BigDecimal maxScore; + + /** + * 相关性 + */ + protected Correlation correlation; + + /** + * 系数 + */ + private BigDecimal coefficient; + + /** + * 最大最小值 + */ + protected BigDecimal maxValue; + protected BigDecimal minValue; + + /** + * 计算准备(基于sourceArray方式的) + */ + public void prepare4SourceArray() { + // 校验数组 + if (!validSourceArray(sourceArrary)) { + throw new RuntimeException("入参数组错误:请设置非空数组"); + } + Arrays.sort(sourceArrary); + maxValue = getMaxFromSourceArray(); + minValue = getMinFromSourceArray(); + //计算系数 + coefficient = calcuteCoefficient(minValue, maxValue); + //System.out.println("最小分值:"+minScore+";最大分值:"+maxScore+";系数:"+coefficient); + } + + /** + * 计算准备(基于边界值的) + */ + public void prepare4BoundaryValue() { + coefficient = calcuteCoefficient(minValue, maxValue); + } + + /** + * 单值归一算法 + * @return + */ + public BigDecimal normalize(T sourceValue) { + + if (sourceValue == null) { + throw new RuntimeException("入参数组错误:请设置sourceValue"); + } + + if (correlation == Correlation.POSITIVE) { + // 正相关 + BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); + BigDecimal score = minScore.add(x); + 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 sourceValue + * @param weight + * @return + */ + public BigDecimal normalize(T sourceValue, BigDecimal weight) { + return normalize(sourceValue).multiply(weight); + } + + /** + * 批量归一算法 + * @param sourceValues + * @return + */ + public BigDecimal[] normalize(T[] sourceValues) { + + BigDecimal[] scores = new BigDecimal[sourceValues.length]; + + for (int i=0;i normalize(List sourceValues) { + return sourceValues.stream().map(s -> normalize(s)).collect(Collectors.toList()); + } + + /** + * 批量归一算法,带权重 + * @param sourceValues + * @param weight + * @return + */ + public BigDecimal[] normalize(T[] sourceValues, BigDecimal weight) { + + BigDecimal[] scores = new BigDecimal[sourceValues.length]; + + for (int i=0;i normalize(List sourceValues, BigDecimal weight) { + return sourceValues.stream().map(s -> normalize(s).multiply(weight)).collect(Collectors.toList()); + } + + /** + * 校验数组 + * @param sourceArray + * @param + * @return + */ + protected boolean validSourceArray(T[] sourceArray) { + if (sourceArray == null || sourceArray.length == 0) { + return false; + } + return true; + } + + /** + * 计算系数 + * @return + */ + protected BigDecimal calcuteCoefficient(BigDecimal min, BigDecimal max) { + BigDecimal fenmu = max.subtract(min); + if (fenmu.compareTo(BigDecimal.ZERO)==0)return new BigDecimal(0); + BigDecimal fenzi = maxScore.subtract(minScore); + BigDecimal divide = fenzi.divide(fenmu, MathContext.DECIMAL32); + 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/support/normalizing/ScoreConstants.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java new file mode 100644 index 0000000000..1eecc8cf36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreConstants.java @@ -0,0 +1,13 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; + +/** + * 分值常量 + */ +public class ScoreConstants { + + public static final BigDecimal MIN_SCORE = new BigDecimal(0); + public static final BigDecimal MAX_SCORE = new BigDecimal(100); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java new file mode 100644 index 0000000000..1ede9a4aae --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -0,0 +1,86 @@ +package com.epmet.support.normalizing.batch; + +import com.epmet.support.normalizing.ScoreCalculator; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; + +public class BatchScoreCalculator { + + /** + * 执行计算,每个指标中每个样本的得分明细 + * @return 每一条都是一个指标的,所有样本对应的,得分值 + */ + public List getScoreDetailOfIndexId(List indexInputVOS) { + + return indexInputVOS.stream().map(i -> { + // 每个指标循环一次 + String indexId = i.getIndexId(); + List indexValueVOs = i.getIndexValueVOs(); + BigDecimal weight = i.getWeight(); + ScoreCalculator scoreCalculator = i.getScoreCalculator(); + BigDecimal threshold = i.getThreshold(); + + // 循环同一个指标内的多个样本值的SampleValue列表 + List scores4OneIndex = indexValueVOs.stream().map(vo -> { + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP);; + return new SampleScore(vo.getSampleId(), score); + }).collect(Collectors.toList()); + + return new IndexOutputVO(indexId, scores4OneIndex); + }).collect(Collectors.toList()); + } + + /** + * 执行计算,以样本的所有指标总得分 + * @param indexInputVOS + * @return + */ + public HashMap getScoreCountOfSampleId(List indexInputVOS) { + + // 每个样本的总得分 + HashMap scoreCountOfSamples = new HashMap<>(); + + for (IndexInputVO idx : indexInputVOS) { + // 每个指标循环一次 + List indexValueVOs = idx.getIndexValueVOs(); + BigDecimal weight = idx.getWeight(); + ScoreCalculator scoreCalculator = idx.getScoreCalculator(); + BigDecimal threshold = idx.getThreshold(); + + for (SampleValue vo : indexValueVOs) { + String sampleId = vo.getSampleId(); + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight); + if (scoreCountOfSamples.containsKey(sampleId)) { + BigDecimal newScore = scoreCountOfSamples.get(sampleId).add(score).setScale(6, RoundingMode.HALF_UP); + scoreCountOfSamples.put(sampleId, newScore); + } else { + score.setScale(6, RoundingMode.HALF_UP); + scoreCountOfSamples.put(sampleId, score); + } + } + } + + return scoreCountOfSamples; + } + + /** + * 获取最终样本值 + * @param realValue + * @param threshold + * @return + */ + public BigDecimal getFinalSampleValue(Object realValue, BigDecimal threshold) { + BigDecimal bdRealValue = new BigDecimal(realValue.toString()); + if (threshold.compareTo(new BigDecimal(-1)) == 0) { + // -1表示不使用阈值 + return bdRealValue; + } + return (bdRealValue.compareTo(threshold) < 0) || (bdRealValue.equals(threshold)) + ? bdRealValue + : threshold ; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java new file mode 100644 index 0000000000..57c6fbc396 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java @@ -0,0 +1,38 @@ +package com.epmet.support.normalizing.batch; + +import com.epmet.support.normalizing.ScoreCalculator; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +@AllArgsConstructor +public class IndexInputVO implements Serializable { + + private static final long serialVersionUID = -4855313801481921595L; + /** + * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code + * 非必填 + */ + private String indexId; + + /** + * 指标的样本值 + */ + private List> indexValueVOs; + + /** + * 样本阈值 + */ + private BigDecimal threshold; + + /** + * 权重 + */ + private BigDecimal weight; + + private ScoreCalculator scoreCalculator; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java new file mode 100644 index 0000000000..fdf0a3dea9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexOutputVO.java @@ -0,0 +1,23 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@AllArgsConstructor +public class IndexOutputVO { + + /** + * 指标标记,由使用者传入,用以标记该条指标的独有特性,一般用id或者code + * 非必填 + */ + private String indexId; + + /** + * 指标的样本值 + */ + private List indexScoreVOs; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java new file mode 100644 index 0000000000..bd677fc861 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleScore.java @@ -0,0 +1,19 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 样本得分对象 + */ +@Data +@AllArgsConstructor +public class SampleScore { + + private String sampleId; + + private BigDecimal sampleScore; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java new file mode 100644 index 0000000000..5a42508e64 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/SampleValue.java @@ -0,0 +1,20 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +/** + * 样本值对象 + */ +@Data +@AllArgsConstructor +public class SampleValue implements Serializable { + + private static final long serialVersionUID = 8661385412757324539L; + private String sampleId; + + private T sampleValue; + +} 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/Pinyin4jUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java new file mode 100644 index 0000000000..8d392a2c21 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java @@ -0,0 +1,203 @@ +package com.epmet.util; + +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + + +/** + * @author liujianjun + */ +public class Pinyin4jUtil { + private static Map duoyinMap; + static { + duoyinMap = new HashMap<>(); + duoyinMap.put('区',new String[]{"qu"}); + duoyinMap.put('系',new String[]{"xi"}); + duoyinMap.put('率',new String[]{"lv"}); + duoyinMap.put('员',new String[]{"yuan"}); + duoyinMap.put('提',new String[]{"ti"}); + duoyinMap.put('被',new String[]{"bei"}); + duoyinMap.put('期',new String[]{"qi"}); + duoyinMap.put('参',new String[]{"can"}); + duoyinMap.put('均',new String[]{"jun"}); + duoyinMap.put('会', new String[]{"hui"}); + duoyinMap.put('属', new String[]{"shu"}); + } + + /** + * getFirstSpellPinYin:(多音字的时候获取第一个).
+ * + * @param src 传入的拼音字符串,以逗号隔开 + * @param isFullSpell 是否全拼,true:全拼,false:第一个汉字全拼(其它汉字取首字母) + * @return 第一个拼音 + */ + public static String getFirstSpellPinYin(String src, boolean isFullSpell) { + String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, 1)); + System.out.println(targetStr); + String[] split = targetStr.split(","); + if (split.length > 1) { + targetStr = split[0]; + } + return targetStr; + } + + /** + * getFirstSpellPinYin:(多音字的时候获取第一个).
+ * + * @param src 传入的拼音字符串,以逗号隔开 + * @param isFullSpell 是否全拼,true:全拼,false:第一个汉字全拼(其它汉字取首字母) + * @return 第一个拼音 + */ + public static String getSpellPinYin(String src, boolean isFullSpell,Integer preFont) { + String targetStr = Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(src, isFullSpell, preFont)); + System.out.println(targetStr); + String[] split = targetStr.split(","); + if (split.length > 1) { + targetStr = split[0]; + } + return targetStr; + } + + /** + * makeStringByStringSet:(拼音字符串集合转换字符串(逗号分隔)).
+ * + * @param stringSet 拼音集合 + * @return 带逗号字符串 + */ + public static String makeStringByStringSet(Set stringSet) { + StringBuilder str = new StringBuilder(); + int i = 0; + if (stringSet.size() > 0) { + for (String s : stringSet) { + if (i == stringSet.size() - 1) { + str.append(s); + } else { + str.append(s + ","); + } + i++; + } + } + return str.toString().toLowerCase(); + } + + /** + * getPinyin:(获取汉字拼音).
+ * + * @param src 汉字 + * @param isFullSpell 是否全拼,如果为true:全拼,false:首字全拼 + * @param preFont isFullSpell =true时,前几个字全拼 + * @return + */ + public static Set getPinyin(String src, boolean isFullSpell, int preFont) { + if (src != null && !src.trim().equalsIgnoreCase("")) { + char[] srcChar; + srcChar = src.toCharArray(); + // 汉语拼音格式输出类 + HanyuPinyinOutputFormat hanYuPinOutputFormat = new HanyuPinyinOutputFormat(); + + // 输出设置,大小写,音标方式等 + hanYuPinOutputFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); + hanYuPinOutputFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + hanYuPinOutputFormat.setVCharType(HanyuPinyinVCharType.WITH_V); + + String[][] temp = new String[src.length()][]; + for (int i = 0; i < srcChar.length; i++) { + char c = srcChar[i]; + if (String.valueOf(c).matches("[\\u4E00-\\u9FA5]+")) {//中文 + try { + String[] py = duoyinMap.get(c); + if (py != null){ + temp[i] = py; + }else{ + temp[i] = PinyinHelper.toHanyuPinyinStringArray(srcChar[i], hanYuPinOutputFormat); + } + + if (!isFullSpell) { + if (i < preFont) { + temp[i] = temp[i]; + } else { + String[] tTemps = new String[temp[i].length]; + for (int j = 0; j < temp[i].length; j++) { + char t = temp[i][j].charAt(0); + tTemps[j] = Character.toString(t); + } + temp[i] = tTemps; + } + } + } catch (BadHanyuPinyinOutputFormatCombination e) { + e.printStackTrace(); + } + } else if (((int) c >= 65 && (int) c <= 90) + || ((int) c >= 97 && (int) c <= 122)) {//英文 + temp[i] = new String[]{String.valueOf(srcChar[i])}; + } else { + temp[i] = new String[]{""}; + } + } + String[] pingyinArray = exchange(temp); + Set pinyinSet = new HashSet(); + for (int i = 0; i < pingyinArray.length; i++) { + pinyinSet.add(pingyinArray[i]); + } + return pinyinSet; + } + return null; + } + + /** + * 递归 + * + * @param strJaggedArray + * @return + */ + public static String[] exchange(String[][] strJaggedArray) { + String[][] temp = doExchange(strJaggedArray); + return temp[0]; + } + + /** + * 递归 + * + * @param strJaggedArray + * @return + */ + private static String[][] doExchange(String[][] strJaggedArray) { + int len = strJaggedArray.length; + if (len >= 2) { + int len1 = strJaggedArray[0].length; + int len2 = strJaggedArray[1].length; + int newlen = len1 * len2; + String[] temp = new String[newlen]; + int Index = 0; + for (int i = 0; i < len1; i++) { + for (int j = 0; j < len2; j++) { + temp[Index] = strJaggedArray[0][i] + strJaggedArray[1][j]; + Index++; + } + } + String[][] newArray = new String[len - 1][]; + for (int i = 2; i < len; i++) { + newArray[i - 1] = strJaggedArray[i]; + } + newArray[0] = temp; + return doExchange(newArray); + } else { + return strJaggedArray; + } + } + + public static void main(String[] args) { + System.out.println(getFirstSpellPinYin("区直部门",false)); + System.out.println(getSpellPinYin("党员提出话题数",false,4)); + System.out.println(getSpellPinYin("社区超期项目数",false,4)); + } +} 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..c2b2f726f4 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,21 @@ 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@ + evaluationIndex: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.evaluationIndex.url@ + username: @datasource.druid.evaluationIndex.username@ + password: @datasource.druid.evaluationIndex.password@ thread: # 线程池配置 @@ -167,4 +182,4 @@ thread: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql new file mode 100644 index 0000000000..4374c4cd09 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/2020-09-02_add_screen_table.sql @@ -0,0 +1,514 @@ +/* + Navicat Premium Data Transfer + + Source Server : 测试 + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306 + Source Schema : epmet_evaluation_index + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 02/09/2020 17:57:39 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for screen_cpc_base_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_cpc_base_data`; +CREATE TABLE `screen_cpc_base_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `REGISTER_USER_COUNT` int(11) DEFAULT '0' COMMENT '注册用户数', + `RESI_TOTAL` int(11) DEFAULT '0' COMMENT '群众用户数', + `PARTY_MEMBER_COUNT` int(11) DEFAULT '0' COMMENT '注册党员数', + `AGE_LEVEL_1` int(11) DEFAULT '0' COMMENT '小于20岁的党员总人数', + `AGE_LEVEL_2` int(11) DEFAULT '0' COMMENT '20-30岁的党员总人数', + `AGE_LEVEL_3` int(11) DEFAULT '0' COMMENT '31-40岁的党员总人数', + `AGE_LEVEL_4` int(11) DEFAULT '0' COMMENT '41-50岁的党员总人数', + `AGE_LEVEL_5` int(11) DEFAULT '0' COMMENT '51-60岁的党员总人数', + `AGE_LEVEL_6` int(11) DEFAULT '0' COMMENT '60+岁的党员总人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层党建-党员基本情况'; + +-- ---------------------------- +-- Table structure for screen_customer_agency +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_agency`; +CREATE TABLE `screen_customer_agency` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', + `AGENCY_NAME` varchar(255) NOT NULL COMMENT '组织名称', + `PID` varchar(64) NOT NULL COMMENT '父级id ,顶级,此列为0', + `PIDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用逗号(英文)分开', + `ALL_PARENT_NAMES` varchar(512) DEFAULT NULL COMMENT '所有组织名称以-链接', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `PARTY_MARK` varchar(255) DEFAULT NULL COMMENT '党工委或者党委的位置,目前此阶段为预留字段', + `LEVEL` varchar(32) NOT NULL COMMENT '机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `AREA_CODE` varchar(30) DEFAULT NULL COMMENT '行政地区编码', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织机构信息'; + +-- ---------------------------- +-- Table structure for screen_customer_dept +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_dept`; +CREATE TABLE `screen_customer_dept` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DEPT_ID` varchar(64) NOT NULL COMMENT '部门id', + `DEPT_NAME` varchar(255) NOT NULL COMMENT '部门名称', + `PARENT_AGENCY_ID` varchar(64) NOT NULL COMMENT '部门所属组织id', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `DEPT_MARK` varchar(255) DEFAULT NULL COMMENT '部门所在位置(目前预留此字段)', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='部门信息'; + +-- ---------------------------- +-- Table structure for screen_customer_grid +-- ---------------------------- +DROP TABLE IF EXISTS `screen_customer_grid`; +CREATE TABLE `screen_customer_grid` ( + `ID` varchar(64) NOT NULL COMMENT '主键ID 主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', + `GRID_NAME` varchar(255) NOT NULL COMMENT '组织名称', + `PARENT_AGENCY_ID` varchar(64) NOT NULL COMMENT '网格所属组织id', + `AREA_MARKS` text COMMENT '坐标区域', + `CENTER_MARK` varchar(255) DEFAULT NULL COMMENT '中心点位', + `PARTY_MARK` varchar(255) DEFAULT NULL COMMENT '党支部(=网格)的位置', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网格(党支部)信息'; + +-- ---------------------------- +-- Table structure for screen_difficulty_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_difficulty_data`; +CREATE TABLE `screen_difficulty_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `EVENT_ID` varchar(64) NOT NULL COMMENT '事件原Id', + `EVENT_IMG_URL` varchar(512) DEFAULT NULL COMMENT '事件图片', + `EVENT_SOURCE` varchar(64) DEFAULT NULL COMMENT '事件来源 XX街道-社区-网格', + `EVENT_CONTENT` varchar(512) DEFAULT NULL COMMENT '事件内容', + `EVENT_COST_TIME` int(11) DEFAULT '0' COMMENT '事件耗时 单位:分钟', + `EVENT_RE_ORG` int(11) DEFAULT '0' COMMENT '事件涉及部门数', + `EVENT_HANDLED_COUNT` int(11) NOT NULL COMMENT '事件被处理次数(08-21新增)', + `EVENT_CATEGORY_CODE` varchar(32) DEFAULT NULL COMMENT '事件类别编码', + `EVENT_CATEGORY_NAME` varchar(128) DEFAULT NULL COMMENT '事件类别名称', + `EVENT_STATUS_CODE` varchar(32) DEFAULT NULL COMMENT '事件状态key', + `EVENT_STATUS_DESC` varchar(64) DEFAULT NULL COMMENT '事件状态描述', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `LATEST_OPERATE_DESC` varchar(64) NOT NULL COMMENT '最近一次操作说明', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-难点堵点(耗时最长|设计部门最多|处理次数)'; + +-- ---------------------------- +-- Table structure for screen_event_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_event_data`; +CREATE TABLE `screen_event_data` ( + `ID` varchar(256) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `EVENT_ID` varchar(64) NOT NULL COMMENT '原始事件Id', + `EVENT_TITLE` varchar(256) DEFAULT '0' COMMENT '事件名称', + `EVENT_CREATE_TIME` datetime DEFAULT NULL COMMENT '事件时间', + `LINK_MOBILE` varchar(32) DEFAULT NULL COMMENT '联系人 联系人', + `EVENT_CONTENT` varchar(1024) DEFAULT '0' COMMENT '事件描述', + `EVENT_IMG_URL` varchar(512) DEFAULT NULL COMMENT '事件图片', + `EVENT_LEVEL` varchar(32) DEFAULT '0' COMMENT '事件待处理级别 red:红;yellow:黄;绿色:green', + `EVENT_ADDRESS` varchar(512) DEFAULT NULL COMMENT '事件地址', + `LONGITUDE` decimal(32,8) DEFAULT '0.00000000' COMMENT '事件所在经度', + `LATITUDE` decimal(32,8) DEFAULT '0.00000000' COMMENT '事件所在维度', + `LAST_PROCESS_DEPT` varchar(128) DEFAULT '0' COMMENT '最后处理组织', + `LAST_PROCESS_DATE` datetime DEFAULT '0000-00-00 00:00:00' COMMENT '最后处理时间', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `EVENT_STATUS_CODE` varchar(32) DEFAULT NULL COMMENT '事件状态key', + `EVENT_STATUS_DESC` varchar(64) DEFAULT NULL COMMENT '事件状态描述', + `LATEST_OPERATE_DESC` varchar(64) DEFAULT NULL COMMENT '最近一次操作说明', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyMM|yyyyMMdd', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='中央区-事件数据'; + +-- ---------------------------- +-- Table structure for screen_event_img_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_event_img_data`; +CREATE TABLE `screen_event_img_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `EVENT_ID` varchar(64) NOT NULL COMMENT '原始事件Id', + `EVENT_IMG_URL` varchar(512) NOT NULL COMMENT '图片图片地址', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='中央区-事件数据图片数据'; + +-- ---------------------------- +-- Table structure for screen_govern_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_govern_rank_data`; +CREATE TABLE `screen_govern_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称', + `RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率', + `RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率', + `GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率', + `SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-治理能力排行数据(按月统计)'; + +-- ---------------------------- +-- Table structure for screen_index_data_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `screen_index_data_monthly`; +CREATE TABLE `screen_index_data_monthly` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id: yyyy', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id yyyyMM', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `INDEX_TOTAL` decimal(10,6) DEFAULT NULL COMMENT '总指数', + `PARTY_DEV_ABLITY` decimal(10,6) DEFAULT NULL COMMENT '党建能力指数', + `SERVICE_ABLITY` decimal(10,6) DEFAULT NULL COMMENT '服务能力指数', + `GOVERN_ABLITY` decimal(10,6) DEFAULT NULL COMMENT '治理能力指数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指数-指数数据(每月数值)'; + +-- ---------------------------- +-- Table structure for screen_index_data_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `screen_index_data_yearly`; +CREATE TABLE `screen_index_data_yearly` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id: yyyy', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `INDEX_TOTAL` decimal(10,6) NOT NULL COMMENT '总指数', + `PARTY_DEV_ABLITY` decimal(10,6) NOT NULL COMMENT '党建能力指数', + `SERVICE_ABLITY` decimal(10,6) NOT NULL COMMENT '服务能力指数', + `GOVERN_ABLITY` decimal(10,6) NOT NULL COMMENT '治理能力指数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指数-指数数据(按年统计)'; + +-- ---------------------------- +-- Table structure for screen_org_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_org_rank_data`; +CREATE TABLE `screen_org_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `PARTY_TOTAL` int(11) DEFAULT '0' COMMENT '党员总数', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '小组(支部建设)总数', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '项目总数', + `CLOSE_PROJECT_RATIO` decimal(10,6) DEFAULT NULL COMMENT '结案率', + `SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-组织先进排行榜'; + +-- ---------------------------- +-- Table structure for screen_party_branch_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_branch_data`; +CREATE TABLE `screen_party_branch_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `TYPE` varchar(32) NOT NULL DEFAULT 'party' COMMENT '数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `MEET_CATEGORY_ID` varchar(32) DEFAULT '0' COMMENT '会议分类Id', + `MEET_CATEGORY_NAME` varchar(64) DEFAULT '0' COMMENT '会议分类名称(三会党课、主题党日.....等等)', + `ORGANIZE_COUNT` int(11) DEFAULT '0' COMMENT '组织次数', + `JOIN_USER_COUNT` int(11) DEFAULT '0' COMMENT '参加人数', + `AVERAGE_JOIN_USER_COUNT` int(11) DEFAULT NULL COMMENT '平均参加人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层党建-建设情况数据(支部,联建,志愿服务)按月'; + +-- ---------------------------- +-- Table structure for screen_party_link_masses_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_link_masses_data`; +CREATE TABLE `screen_party_link_masses_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `CREATE_GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '党员建群总数', + `GROUP_USER_TOTAL` int(11) DEFAULT '0' COMMENT '群成员总数', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-党员联系群众数据'; + +-- ---------------------------- +-- Table structure for screen_party_user_rank_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_party_user_rank_data`; +CREATE TABLE `screen_party_user_rank_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `GRID_ID` varchar(64) NOT NULL COMMENT '用户所属网格id', + `GRID_NAME` varchar(128) NOT NULL COMMENT '用户所属网格名称', + `ORG_ID` varchar(64) NOT NULL COMMENT '网格所属的组织id', + `ORG_NAME` varchar(255) NOT NULL COMMENT '网格所属的组织名称', + `PARTY_FLAG` tinyint(1) NOT NULL COMMENT '是否是党员标志:1是。0不是党员', + `USER_ID` varchar(64) NOT NULL COMMENT '用户Id', + `SURNAME` varchar(32) DEFAULT NULL COMMENT '姓', + `NAME` varchar(32) DEFAULT NULL COMMENT '名', + `USER_NAME` varchar(32) NOT NULL COMMENT '姓名', + `POINT_TOTAL` int(11) DEFAULT '0' COMMENT '用户积分', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `ALL_PARENT_IDS` varchar(512) DEFAULT NULL COMMENT '所有上级ID,用英文逗号分开', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领|基层治理-市民(党员)积分排行榜'; + +-- ---------------------------- +-- Table structure for screen_pioneer_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_pioneer_data`; +CREATE TABLE `screen_pioneer_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '党员参与议事', + `ISSUE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员参与议事占比', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '党员发布话题', + `TOPIC_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员发布话题占比', + `PUBLISH_ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '党员发布议题', + `PUBLISH_ISSUE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '党员发布议题占比', + `SHIFT_PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '议题转项目数', + `SHIFT_PROJECT_RATIO` decimal(10,6) DEFAULT NULL COMMENT '议题转项目占比', + `RESOLVED_PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '解决项目总数', + `RESOLVED_PROJECT_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决项目总数占比', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党建引领-先锋模范数据'; + +-- ---------------------------- +-- Table structure for screen_public_parti_total_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_public_parti_total_data`; +CREATE TABLE `screen_public_parti_total_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;网格:grid;部门:department;', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id,如果是网格,传入网格所属组织id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称,也可能是网格名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `TOPIC_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '项目总数', + `REG_USER_TOTAL` int(11) NOT NULL COMMENT '注册人数', + `JOIN_USER_TOTAL` int(11) NOT NULL COMMENT '参与人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公众参与-各类(话题|议题|项目|注册人数|参与人数)总数'; + +-- ---------------------------- +-- Table structure for screen_user_join +-- ---------------------------- +DROP TABLE IF EXISTS `screen_user_join`; +CREATE TABLE `screen_user_join` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称', + `YEAR_ID` varchar(32) NOT NULL COMMENT '数据更新至 年Id: yyyy', + `MONTH_ID` varchar(32) NOT NULL COMMENT '数据更新至 :月份Id :yyyyMM', + `JOIN_TOTAL` int(11) DEFAULT '0' COMMENT '总的参与次数', + `JOIN_TOTAL_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '总的参与次数较上月增长率(采集的时候后台自己计算)', + `JOIN_TOTAL_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `AVG_ISSUE` int(11) DEFAULT '0' COMMENT '人均议题', + `AVG_ISSUE_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '人均议题较上月增长率(采集的时候后台自己计算)', + `AVG_ISSUE_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `AVG_JOIN` int(11) DEFAULT '0' COMMENT '平均参与度', + `AGVG_JOIN_UP_RATE` decimal(30,6) DEFAULT NULL COMMENT '平均参与度较上月增长率(采集的时候后台自己计算)', + `AGVG_JOIN_UP_FLAG` varchar(10) DEFAULT NULL COMMENT '增长:incr;下降:decr; 相等 :eq;默认:空', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-公众参与'; + +-- ---------------------------- +-- Table structure for screen_user_total_data +-- ---------------------------- +DROP TABLE IF EXISTS `screen_user_total_data`; +CREATE TABLE `screen_user_total_data` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;网格:grid;部门:department;', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(128) NOT NULL COMMENT '组织名称,也可能是网格名称', + `DATA_END_TIME` varchar(32) NOT NULL COMMENT '数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)', + `USER_TOTAL` int(11) DEFAULT '0' COMMENT '用户总数', + `PARTY_TOTAL` int(11) DEFAULT '0' COMMENT '注册党总数', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '小组(党群)总数', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '议题总数', + `PROJECT_TOTAL` int(11) DEFAULT '0' COMMENT '项目总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='中央区-各类(用户|党员|党群|话题|议题|项目)总数'; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql index 9f1554015e..541d0d7307 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql @@ -1 +1,2 @@ -ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等'; \ No newline at end of file +/*ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等';*/ +select 1; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml new file mode 100644 index 0000000000..211e573c3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -0,0 +1,165 @@ + + + + + + + + INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.dataType}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_agency_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + AND index_code = #{indexCode} + AND data_type = #{dataType} + + + + + + + + + + + insert into fact_index_agency_score + ( + ID, + CUSTOMER_ID, + + AGENCY_ID, + PARENT_AGENCY_ID, + YEAR_ID, + QUARTER_ID, + MONTH_ID, + DATA_TYPE, + IS_TOTAL, + SCORE, + INDEX_CODE, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.dataType}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml new file mode 100644 index 0000000000..3c6fb2ea55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -0,0 +1,142 @@ + + + + + + + delete from fact_index_cpc_score + where + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + + and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO `fact_index_cpc_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `YEAR_ID`, + `MONTH_ID`, + `USER_ID`, + `IS_TOTAL`, + `SCORE`, + `INDEX_CODE`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.yearId}, + #{item.monthId}, + #{item.userId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml new file mode 100644 index 0000000000..077c6a7430 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + insert into fact_index_dept_score + ( + ID, + CUSTOMER_ID, + DEPT_ID, + AGENCY_ID, + QUARTER_ID, + YEAR_ID, + MONTH_ID, + IS_TOTAL, + SCORE, + INDEX_CODE, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.deptId}, + #{item.agencyId}, + #{item.quarterId}, + #{item.yearId}, + + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + delete from fact_index_dept_score where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + and DEPT_ID=#{deptId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml new file mode 100644 index 0000000000..e45dcb04ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + fact_index_grid_score + WHERE + CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND INDEX_CODE = #{indexCode} + and IS_TOTAL=#{isTotal} + + + + INSERT INTO `fact_index_grid_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `ALL_PARENT_IDS`, + `QUARTER_ID`, + `YEAR_ID`, + `MONTH_ID`, + `IS_TOTAL`, + `SCORE`, + `INDEX_CODE`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml new file mode 100644 index 0000000000..67165f1bf7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..870e2596ec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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, + ISSUE_TO_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.issueToProjectRatio}, + #{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/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..a703174aee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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, + HANDLE_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}, + #{item.handleProjectRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml new file mode 100644 index 0000000000..8336f33e9a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -0,0 +1,127 @@ + + + + + + + delete from fact_index_party_ablity_cpc_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + limit 1000 + + + + insert into fact_index_party_ablity_cpc_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + GRID_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, + GROUP_ACTIVE_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + USER_ID + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.createTopicCount}, + #{item.joinTopicCount}, + #{item.shiftIssueCount}, + #{item.shiftProjectCount}, + #{item.joinThreeMeetsCount}, + #{item.groupUserCount}, + #{item.groupTopicCount}, + #{item.topicToIssueRatio}, + #{item.groupActiveUserCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.userId} + ) + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..2d8b199022 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..df7e750147 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 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/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..467bba7667 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 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/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..03bc8a2b10 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 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/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml new file mode 100644 index 0000000000..7978db5eee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml @@ -0,0 +1,160 @@ + + + + + + + + INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE(UUID(),'-',''), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_community_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + AND index_code = #{indexCode} + + + + + + + + + + + + insert into fact_index_community_score + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_AGENCY_ID, + YEAR_ID, + QUARTER_ID, + MONTH_ID, + IS_TOTAL, + SCORE, + INDEX_CODE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml new file mode 100644 index 0000000000..010ac06798 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + insert into fact_index_grid_score + ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + ALL_PARENT_IDS, + QUARTER_ID, + YEAR_ID, + MONTH_ID, + IS_TOTAL, + SCORE, + INDEX_CODE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + + #{item.yearId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexCodeFieIdReDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexCodeFieIdReDao.xml new file mode 100644 index 0000000000..5fbd64673a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexCodeFieIdReDao.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexDictDao.xml new file mode 100644 index 0000000000..146fddddb2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/IndexGroupDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDao.xml new file mode 100644 index 0000000000..668ba89e2d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml new file mode 100644 index 0000000000..c2ab3e07c6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml new file mode 100644 index 0000000000..a8e5f55a2e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/IndexGroupTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupTemplateDao.xml new file mode 100644 index 0000000000..92067e3247 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml new file mode 100644 index 0000000000..1059fe5518 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml new file mode 100644 index 0000000000..36ac049262 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -0,0 +1,93 @@ + + + + + + + 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/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml new file mode 100644 index 0000000000..31717d6dd2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -0,0 +1,97 @@ + + + + + + + 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/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml new file mode 100644 index 0000000000..c85dc0af60 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -0,0 +1,139 @@ + + + + + + + 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, + ALL_PARENT_IDS + ) 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}, + #{item.allParentIds} + ) + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml new file mode 100644 index 0000000000..051f14cbcf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -0,0 +1,73 @@ + + + + + + + delete from screen_difficulty_data + where CUSTOMER_ID = #{customerId} + + + + 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, + ALL_PARENT_IDS + ) 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}, + #{item.allParentIds} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml new file mode 100644 index 0000000000..fa22c8ad79 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml @@ -0,0 +1,79 @@ + + + + + + + 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, + ALL_PARENT_IDS + ) 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}, + #{item.allParentIds} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml new file mode 100644 index 0000000000..9623ede0b9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml new file mode 100644 index 0000000000..9a8da4e40e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml new file mode 100644 index 0000000000..4c8369dd0a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml @@ -0,0 +1,81 @@ + + + + + + + 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/evaluationindex/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml new file mode 100644 index 0000000000..75eb13d280 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml new file mode 100644 index 0000000000..64c79965e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml @@ -0,0 +1,69 @@ + + + + + + + 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, + ALL_PARENT_IDS + ) 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(), + #{item.allParentIds} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml new file mode 100644 index 0000000000..12bc3a4755 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml new file mode 100644 index 0000000000..c9e4e65e5f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml new file mode 100644 index 0000000000..fe88da6d76 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml @@ -0,0 +1,61 @@ + + + + + + + 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, + ALL_PARENT_IDS + ) 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}, + #{item.allParentIds} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml new file mode 100644 index 0000000000..ceff6812fb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml new file mode 100644 index 0000000000..69701d3f17 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_public_parti_total_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_public_parti_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + 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.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/evaluationindex/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml new file mode 100644 index 0000000000..678b2b960c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/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/evaluationindex/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml new file mode 100644 index 0000000000..032739c71c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -0,0 +1,63 @@ + + + + + + + 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, + 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}, + 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..6e0e7823ec --- /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.evaluationindex.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/normalizing/DemoScoreCal.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java new file mode 100644 index 0000000000..d573765b6b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java @@ -0,0 +1,249 @@ +package com.epmet.stats.test.normalizing; + +import com.epmet.support.normalizing.*; +import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.IndexInputVO; +import com.epmet.support.normalizing.batch.IndexOutputVO; +import com.epmet.support.normalizing.batch.SampleValue; +import org.junit.Test; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +public class DemoScoreCal { + + public static void main(String[] args) { + //demoInteger(); + //demoIntegerPartical(); + //demoDouble(); + } + + /** + * 整数类型,完整源数据列表的归一算法 + */ + @Test + public void demoInteger() { + Integer[] iArray = {4, 8, 1, 3, 2}; + + ScoreCalculator sc = new IntegerScoreCalculator(iArray, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + BigDecimal[] scores = sc.normalize(iArray); + Arrays.stream(scores).forEach(s -> System.out.println(s)); + } + + /** + * 整数类型,基于边界值的部分列表的的归一算法 + */ + @Test + public void demoIntegerPartical() { + Integer[] iArray = {4, 1, 8}; + + ScoreCalculator sc = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + BigDecimal[] scores = sc.normalize(iArray);// 此处也可以直接使用list参数的重载方法,计算阶段没有任何区别,区别在于new IntegerScoreCalculator()阶段 + Arrays.stream(scores).forEach(s -> System.out.println(s)); + } + + /** + * double类型归一算法 + */ + public static void demoDouble() { + Double[] iArray = {1.9, 8.9, 1.0, 3.0, 2.0}; + BigDecimal minScore = new BigDecimal(5); + BigDecimal maxScore = new BigDecimal(10); + + ScoreCalculator sc = new DoubleScoreCalculator(iArray, minScore, maxScore, Correlation.POSITIVE); + BigDecimal normalize = sc.normalize(3.0); + System.out.println(normalize); + + /** + * 同一组数据内,只有被计算值变了的话,不需要重新new对象,直接重复调用即可 + */ + BigDecimal normalize2 = sc.normalize(2.0); + System.out.println(normalize2); + } + + /** + * 批量计算demo + */ + @Test + public void testBatchCalculate() throws InterruptedException { + //{4,8,1,3,2} + + // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + ScoreCalculator sc2 = new IntegerScoreCalculator(1, 8, ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + + List> index1SampleValues = Arrays.asList(new SampleValue<>("id1", 4), new SampleValue<>("id2", 1), new SampleValue<>("id3", 8)); + List> index2SampleValues = Arrays.asList(new SampleValue<>("id1", 1), new SampleValue<>("id2", 8), new SampleValue<>("id3", 3)); + + // 每个指标的信息,包括样本列表,权重,指标标记 + IndexInputVO index1VO = new IndexInputVO<>("aaa", index1SampleValues, new BigDecimal(10), new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", index2SampleValues, new BigDecimal(10), new BigDecimal(1), sc2); + + List indexInputVOS = Arrays.asList(index1VO, index2VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + + System.err.println("--------------------------------"); + result.stream().forEach(r -> System.out.println(r)); + Thread.sleep(10); + System.err.println("--------------------------------"); + } + + @Test + public void testBigDecimalBatchCalculate() throws InterruptedException { + //{4,8,1,3,2} + + // 每个指标需要单独的分支计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(1), new BigDecimal(8), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.NEGATIVE); + + List index1SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(4)), new SampleValue<>("id2", new BigDecimal(1)), new SampleValue<>("id3", new BigDecimal(8))); + List index2SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(1)), new SampleValue<>("id2", new BigDecimal(8)), new SampleValue<>("id3", new BigDecimal(3))); + + // 每个指标的信息,包括样本列表,权重,指标标记 + IndexInputVO index1VO = new IndexInputVO("aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO("bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), sc2); + + List indexInputVOS = Arrays.asList(index1VO, index2VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + List result = batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + + System.err.println("--------------------------------"); + result.stream().forEach(r -> System.out.println(r)); + Thread.sleep(10); + System.err.println("--------------------------------"); + } + + @Test + public void testBigDecimalBatchCalculateGroupBySampleId() throws InterruptedException { + //{4,8,1,3,2} + + //分值计算器 每个指标需要单独的分值计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(50), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(20), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc3 = new BigDecimalScoreCalculator(new BigDecimal(20), new BigDecimal(40), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc4 = new BigDecimalScoreCalculator(new BigDecimal(10), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + + //每个指标的数值 比如 a指标里有5条数据 + List index1SampleValues = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(100)), + new SampleValue<>("id2", new BigDecimal(50)), + new SampleValue<>("id3", new BigDecimal(60)), + new SampleValue<>("id4", new BigDecimal(80)), + new SampleValue<>("id5", new BigDecimal(80)) + ); + + List index1SampleValues2 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(100)), + new SampleValue<>("id2", new BigDecimal(80)), + new SampleValue<>("id3", new BigDecimal(80)), + new SampleValue<>("id4", new BigDecimal(20)), + new SampleValue<>("id5", new BigDecimal(20)) + ); + + List index1SampleValues3 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(40)), + new SampleValue<>("id2", new BigDecimal(20)), + new SampleValue<>("id3", new BigDecimal(40)), + new SampleValue<>("id4", new BigDecimal(30)), + new SampleValue<>("id5", new BigDecimal(20)) + ); + + List index1SampleValues4 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(20)), + new SampleValue<>("id2", new BigDecimal(100)), + new SampleValue<>("id3", new BigDecimal(10)), + new SampleValue<>("id4", new BigDecimal(50)), + new SampleValue<>("id5", new BigDecimal(20)) + ); + + + // 每个指标的信息,包括样本列表,权重,指标标记 + IndexInputVO index1VO = new IndexInputVO("aaa1", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), sc4); + + + List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + + System.err.println("----------------1----------------"); + result.forEach((key, value) -> { + System.out.println(key.concat("的得分为:").concat(value.toString())); + }); + System.err.println("-----------------2---------------"); + } + + + @Test + public void testCpc() throws InterruptedException { + //{4,8,1,3,2} + + //分值计算器 每个指标需要单独的分值计算器,因为每个指标的最大最小值是不同的 + ScoreCalculator sc1 = new BigDecimalScoreCalculator(new BigDecimal(10), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc2 = new BigDecimalScoreCalculator(new BigDecimal(20), new BigDecimal(80), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc3 = new BigDecimalScoreCalculator(new BigDecimal(10), new BigDecimal(100), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + ScoreCalculator sc4 = new BigDecimalScoreCalculator(new BigDecimal(0.1), new BigDecimal(0.6), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); + + //每个指标的数值 比如 a指标里有5条数据 + List index1SampleValues = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(80)), + new SampleValue<>("id2", new BigDecimal(10)), + new SampleValue<>("id3", new BigDecimal(100)), + new SampleValue<>("id4", new BigDecimal(50)), + new SampleValue<>("id5", new BigDecimal(40)) + ); + + List index1SampleValues2 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(20)), + new SampleValue<>("id2", new BigDecimal(50)), + new SampleValue<>("id3", new BigDecimal(40)), + new SampleValue<>("id4", new BigDecimal(35)), + new SampleValue<>("id5", new BigDecimal(80)) + ); + + List index1SampleValues3 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(100)), + new SampleValue<>("id2", new BigDecimal(70)), + new SampleValue<>("id3", new BigDecimal(50)), + new SampleValue<>("id4", new BigDecimal(55)), + new SampleValue<>("id5", new BigDecimal(10)) + ); + + List index1SampleValues4 = Arrays.asList( + new SampleValue<>("id1", new BigDecimal(1)), + new SampleValue<>("id2", new BigDecimal(0.1)), + new SampleValue<>("id3", new BigDecimal(1)), + new SampleValue<>("id4", new BigDecimal(0.3)), + new SampleValue<>("id5", new BigDecimal(1)) + ); + + + // 每个指标的信息,包括样本列表,权重,指标标记 + IndexInputVO index1VO = new IndexInputVO("aaa1", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.3), sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.2), sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.2), sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", index1SampleValues4, new BigDecimal(0.6), new BigDecimal(0.3), sc4); + + + List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + + System.err.println("----------------1----------------"); + result.forEach((key, value) -> { + System.out.println(key.concat("的得分为:").concat(value.toString())); + }); + System.err.println("-----------------2---------------"); + } + + +} 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-activiti/epmet-activiti-server/pom.xml b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml index 5a4cf59cab..06d167aab2 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml @@ -158,12 +158,41 @@ dev + + 8086 + dev + + + + + + epmet_activiti_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8086 - dev + local 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-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index d23de0c0e2..caa9bd6301 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -39,4 +39,11 @@ public interface EpmetCommonServiceOpenFeignClient { */ @PostMapping("/commonservice/externalapp/auth") Result externalAppAuth(@RequestBody ExternalAppAuthFormDTO formDTO); + + /** + * 获取外部应用客户Id + * @return + */ + @PostMapping("/commonservice/externalapp/getcustomerids") + Result> getExternalCustomerIds(); } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java index 555e502062..f21808fc8c 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -29,4 +29,9 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer public Result externalAppAuth(ExternalAppAuthFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "externalAppAuth", formDTO); } + + @Override + public Result> getExternalCustomerIds() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getExternalCustomerIds", null); + } } diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml index 5f9878a727..1a43e02ffb 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.9 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.17 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 1c8581eb13..3988353e35 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.16 + 0.3.17 com.epmet epmet-common-service @@ -92,9 +92,6 @@ dev - - true - 8103 dev @@ -129,6 +126,45 @@ 52d9d9b0e7d0eb5b8b81c205b579e07c + + local + + true + + + 8103 + local + + + + + + + + epmet_common_service_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + + test + + update external_app_secret + set SECRET=#{secret} + where ID = #{appId} + + + diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index 3b0c5fcbf5..eddc655426 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -107,12 +107,44 @@ dev + + 8084 + dev + + + + + + epmet_job_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8084 - dev + local @@ -126,7 +158,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index deea95460a..1322ad2243 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -124,12 +124,41 @@ dev + + 8085 + dev + + + + + + epmet_message_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8085 - dev + local @@ -143,7 +172,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index 8fc5bc1d67..b73264233b 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -120,12 +120,41 @@ dev + + 8083 + dev + + + + + + epmet_oss_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8083 - dev + local @@ -139,7 +168,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index c67cf5c997..f0add3faf1 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -115,12 +115,44 @@ dev + + 8112 + dev + + + + + + epmet_point_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8112 - dev + local @@ -134,7 +166,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java index 910ded04de..afcedffee0 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java @@ -58,6 +58,11 @@ public class CodeAuditResultDTO implements Serializable { */ private String result; + /** + * 是否加急 + */ + private Boolean isSpeed; + /** * 原因 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java index 9c2f1c506f..a16d0c8d6c 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java @@ -25,6 +25,11 @@ public class SubmitAuditFormDTO implements Serializable { */ private Boolean isSpeed; + /** + * isSpeed=true时,是否是审核失败后的反馈提审 + */ + private Boolean isRepeat; + /** * 小程序版本说明和功能解释 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java index b1b367c457..74b1bb54d4 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CodeVersionInfoResultDTO.java @@ -71,6 +71,10 @@ public class CodeVersionInfoResultDTO implements Serializable { * */ private String status; + /** + * + */ + private Boolean isSpeed; } @Data diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index d4706c5733..d9ab7469c0 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.134 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.141 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index a2a223a704..7d3cbbf9c4 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.135 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.141 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml index e368b27eda..9b72f3c260 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.131 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.132 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index bf1f32b69b..f85185fb9b 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.136 + 0.0.141 com.epmet @@ -183,12 +183,41 @@ dev + + 8110 + dev + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8110 - dev + local @@ -202,7 +231,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java index 164b8a97bb..488fa876a0 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java @@ -58,6 +58,11 @@ public class CodeAuditResultEntity extends BaseEpmetEntity { */ private String result; + /** + * 是否加急 + */ + private Boolean isSpeed; + /** * 原因 */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index 020dcf8782..09f5f5a276 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -183,6 +183,7 @@ public class CodeServiceImpl implements CodeService { //审核版本 CodeCustomerDTO audit = codeCustomerService.getAuditInfo(formDTO.getCustomerId(), formDTO.getClientType()); if(null != audit) { + CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(audit.getId()); CodeVersionInfoResultDTO.AuditBean auditBean = new CodeVersionInfoResultDTO.AuditBean(); auditBean.setCodeId(audit.getId()); auditBean.setVersion(audit.getUserVersion()); @@ -191,7 +192,6 @@ public class CodeServiceImpl implements CodeService { //获取小程序调用令牌 AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); //获取审核结果信息 - CodeAuditResultDTO auditResult = codeAuditResultService.getAuditResultByCodeId(audit.getId()); //调用微信API获取最新审核状态 WxMaCodeAuditStatusReq request = new WxMaCodeAuditStatusReq(); request.setAuditId(auditResult.getAuditId()); @@ -222,6 +222,7 @@ public class CodeServiceImpl implements CodeService { } } auditBean.setStatus(audit.getStatus()); + auditBean.setIsSpeed(auditResult.getIsSpeed()); auditBean.setCommitTime(DateUtils.format(audit.getCommitTime(), DateUtils.DATE_TIME_PATTERN)); auditBean.setAuditTime(DateUtils.format(audit.getAuditTime(), DateUtils.DATE_TIME_PATTERN)); resultDTO.setAudit(auditBean); @@ -283,6 +284,7 @@ public class CodeServiceImpl implements CodeService { codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxResult.getErrorMsg()); throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); } + boolean speedSuccess = false; if(formDTO.getIsSpeed()) { //调用微信API 加急审核 WxMaSpeedUpAuditReq speedRequest = new WxMaSpeedUpAuditReq(); @@ -291,8 +293,9 @@ public class CodeServiceImpl implements CodeService { if (!wxSpeedResult.success()) { saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType(), codeCustomerDTO.getId(), codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxSpeedResult.getErrorMsg()); - throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg()); + log.error(wxSpeedResult.getErrorMsg()); } + speedSuccess = wxSpeedResult.success(); } //获取审核结果信息 CodeAuditResultDTO codeAuditResultDTO = codeAuditResultService.getAuditResultByCodeId(formDTO.getCodeId()); @@ -302,18 +305,24 @@ public class CodeServiceImpl implements CodeService { codeAuditResultDTO.setCustomerId(codeCustomerDTO.getCustomerId()); codeAuditResultDTO.setCodeId(codeCustomerDTO.getId()); codeAuditResultDTO.setAuditId(wxResult.getData()); + codeAuditResultDTO.setIsSpeed(speedSuccess); codeAuditResultDTO.setResult(CodeConstant.AUDITING); codeAuditResultService.save(codeAuditResultDTO); } else { - codeAuditResultDTO.setFeedbackInfo(formDTO.getFeedbackInfo()); - codeAuditResultDTO.setFeedbackStuff(formDTO.getFeedbackStuff()); codeAuditResultService.update(codeAuditResultDTO); codeAuditResultService.deleteById(codeAuditResultDTO.getId()); codeAuditResultDTO = new CodeAuditResultDTO(); + codeAuditResultDTO.setFeedbackInfo(formDTO.getFeedbackInfo()); + codeAuditResultDTO.setFeedbackStuff(formDTO.getFeedbackStuff()); codeAuditResultDTO.setCustomerId(codeCustomerDTO.getCustomerId()); codeAuditResultDTO.setCodeId(codeCustomerDTO.getId()); codeAuditResultDTO.setAuditId(wxResult.getData()); codeAuditResultDTO.setResult(CodeConstant.AUDITING); + if (formDTO.getIsRepeat()) { + codeAuditResultDTO.setIsSpeed(true); + } else { + codeAuditResultDTO.setIsSpeed(speedSuccess); + } codeAuditResultService.save(codeAuditResultDTO); } //更新代码表状态 @@ -575,12 +584,12 @@ public class CodeServiceImpl implements CodeService { //设置服务器域名 WxResult modifyDomain = wxMaCodeService.modifyDomain(authInfo.getAuthorizerAccessToken(), "set"); if (!modifyDomain.success()) { - throw new RenException(modifyDomain.getErrorCode(), modifyDomain.getErrorMsg()); + log.error(modifyDomain.getErrorMsg()); } //设置业务域名 WxResult setWebviewDomain = wxMaCodeService.setWebviewDomain(authInfo.getAuthorizerAccessToken(), "set"); if (!setWebviewDomain.success()) { - throw new RenException(setWebviewDomain.getErrorCode(), setWebviewDomain.getErrorMsg()); + log.error(modifyDomain.getErrorMsg()); } }); } @@ -656,6 +665,8 @@ public class CodeServiceImpl implements CodeService { codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, wxSpeedResult.getErrorMsg()); throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg()); } + codeAuditResultDTO.setIsSpeed(true); + codeAuditResultService.update(codeAuditResultDTO); } @Override diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index 08f17ae49a..c0d11dca5b 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -44,7 +44,7 @@ public interface WxMaCodeConstant { * 下面注释url为按钮形式 */ String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s"; -// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s#wechat_redirect"; +// String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/safe/bindcomponent?action=bindcomponent&auth_type=3&no_scan=1&component_appid=%s&pre_auth_code=%s&redirect_uri=%s&auth_type=3#wechat_redirect"; /** * 创建开放平台帐号并绑定公众号/小程序 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml index d52b94a564..4a3e82e619 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml @@ -123,6 +123,14 @@ third: - https://epmet-dev.elinkservice.cn - https://epmet-test.elinkservice.cn webviewDomain: - - udp://epmet-cloud.elinkservice.cn - - udp://epmet-dev.elinkservice.cn - - udp://epmet-test.elinkservice.cn \ No newline at end of file + - https://epmet-ext.elinkservice.cn + - https://epmet-ext1.elinkservice.cn + - https://epmet-ext2.elinkservice.cn + - https://epmet-ext3.elinkservice.cn + - https://epmet-ext4.elinkservice.cn + - https://epmet-ext5.elinkservice.cn + - https://epmet-ext6.elinkservice.cn + - https://epmet-ext7.elinkservice.cn + - https://epmet-ext8.elinkservice.cn + - https://epmet-ext9.elinkservice.cn + - https://epmet-ext10.elinkservice.cn \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql new file mode 100644 index 0000000000..9e7d638917 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.9__thirdUpdate.sql @@ -0,0 +1 @@ +ALTER TABLE code_audit_result ADD COLUMN IS_SPEED tinyint NULL DEFAULT 0 COMMENT '是否加急' AFTER RESULT; \ No newline at end of file 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/deploy/docker-compose-dev.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml index 0f0fd6fe31..6f7c7fe6d8 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.38 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.40 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml index 7a5133aacd..72ebb1216f 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-access-server:0.3.38 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-access-server:0.3.39 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index b69fce8298..9c0b30d5c1 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.38 + 0.3.40 gov-access com.epmet @@ -101,12 +101,42 @@ dev + + 8099 + dev + + + + + + epmet_gov_access_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + + local true 8099 - dev + local @@ -120,7 +150,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index c5bf66fd08..494a417395 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -93,12 +93,35 @@ dev + + 8097 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8097 - dev + local 0 @@ -106,7 +129,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index a90b43312d..93d9f0334c 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -119,12 +119,46 @@ dev + + 8101 + dev + + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local true 8101 - dev + local @@ -138,7 +172,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml index 70b7b9f4c1..7c1d15c36f 100644 --- a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-mine-server: container_name: gov-mine-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-mine-server:0.3.33 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-mine-server:0.3.34 ports: - "8098:8098" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 7d2e118675..54f3b8e225 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.33 + 0.3.34 com.epmet gov-mine @@ -119,12 +119,33 @@ dev + + 8098 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8098 - dev + local 0 @@ -132,7 +153,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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..4d59daef61 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.88 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml index 006b14bdff..9418cc9ef2 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.83 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.88 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..94f959ad2b 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.88 com.epmet gov-org @@ -89,6 +89,12 @@ 2.0.0 compile + + com.epmet + epmet-heart-client + 2.0.0 + compile + @@ -119,12 +125,41 @@ dev + + 8092 + dev + + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8092 - dev + local @@ -138,7 +173,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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..c51ef0b513 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,69 @@ public class StaffServiceImpl implements StaffService { } return result; } + + @Override + @Transactional(rollbackFor = Exception.class) + public void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO) { + if (tokenDto.getUserId().equals(fromDTO.getStaffId())) { + throw new RenException(EpmetErrorCode.CAN_NOT_SELF.getCode()); + } + //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/deploy/docker-compose-prod.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml index 0c08e7e115..e7aae13868 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.40 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.43 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 163ea7921d..2c45f4a53f 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -119,12 +119,42 @@ dev + + 8102 + dev + + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8102 - dev + local @@ -138,7 +168,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 17268c4fe4..1c80814b41 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -106,12 +106,42 @@ dev + + 8105 + dev + + + + + + epmet_gov_voice_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8105 - dev + local @@ -125,7 +155,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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..1c81fdec99 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.18 ports: - "8093:8093" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml index 8552999645..6c6bd28509 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-access-server:0.3.15 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-access-server:0.3.18 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..f78794d104 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.18 oper-access com.epmet @@ -94,12 +94,41 @@ dev + + 8093 + dev + + + + + + epmet_oper_access_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8093 - dev + local @@ -113,7 +142,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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/deploy/docker-compose-prod.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml index 9a7eb3e9b9..a75df6848f 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.66 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.71 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 283ae60811..8535f16485 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.70 + 0.3.71 com.epmet oper-crm @@ -115,12 +115,41 @@ dev + + 8090 + dev + + + + + + epmet_oper_crm_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8090 - dev + local @@ -134,7 +163,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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.47 com.epmet oper-customize @@ -92,12 +92,41 @@ dev + + 8089 + dev + + + + + + epmet_oper_customize_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8089 - dev + local @@ -111,7 +140,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index c07b96ad77..9cf3e5ec43 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -122,12 +122,42 @@ dev + + 8095 + dev + + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + local true 8095 - dev + local @@ -141,7 +171,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index 4aefd4cbe1..04ba4c1d3e 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -115,12 +115,41 @@ dev + + 8091 + dev + + + + + + epmet_resi_guide_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8091 - dev + local @@ -134,7 +163,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-hall/resi-hall-server/pom.xml b/epmet-module/resi-hall/resi-hall-server/pom.xml index a81bf919dc..a44a834c35 100644 --- a/epmet-module/resi-hall/resi-hall-server/pom.xml +++ b/epmet-module/resi-hall/resi-hall-server/pom.xml @@ -79,12 +79,35 @@ dev + + 8100 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8100 - dev + local 0 @@ -92,7 +115,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index f6eebaaad7..d43f84aaa6 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -99,12 +99,33 @@ dev + + 8104 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8104 - dev + local 0 @@ -112,7 +133,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml index a2a9ae18df..3c154c7eec 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.38 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.40 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 35d2c0edda..1cf70149cc 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.38 + 0.3.40 com.epmet resi-mine @@ -124,19 +124,39 @@ dev + + 8094 + dev + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8094 - dev + local 0 192.168.1.130 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml index 21e9579a03..65ad6ccbc8 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-partymember-server:0.3.56 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-partymember-server:0.3.57 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index a202858016..d35830cc69 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.56 + 0.3.57 com.epmet resi-partymember @@ -121,12 +121,41 @@ dev + + 8096 + dev + + + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8096 - dev + local @@ -140,7 +169,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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-module/resi-voice/resi-voice-server/pom.xml b/epmet-module/resi-voice/resi-voice-server/pom.xml index 5c087281de..9985f3c6a5 100644 --- a/epmet-module/resi-voice/resi-voice-server/pom.xml +++ b/epmet-module/resi-voice/resi-voice-server/pom.xml @@ -85,12 +85,33 @@ dev + + 8106 + dev + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true 8106 - dev + local 0 @@ -98,7 +119,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml index 46532a144e..c77bafe339 100644 --- a/epmet-openapi/epmet-openapi-scan/pom.xml +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -86,6 +86,28 @@ dev + + 8107 + dev + + + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + + local true @@ -100,7 +122,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 @@ -111,9 +133,6 @@ test - 8107 test 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..e1af81c0ce 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.124 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index a9847b773c..183968322f 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.118 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.124 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 6f2eaf76ef..b6872595d0 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.121 + 0.3.124 com.epmet epmet-user @@ -130,12 +130,41 @@ dev + + 8087 + dev + + + + + + epmet_user_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + local true 8087 - dev + local @@ -149,7 +178,7 @@ 6379 123456 - true + false 192.168.1.130:8848 6ceab336-d004-4acf-89c6-e121d06f4988 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 @@ -295,4 +294,42 @@ AND r.DEL_FLAG = '0' AND S.DEL_FLAG = '0' - \ 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 + + +