diff --git a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java index 86fc44aa18..6413ffb82b 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.SsoEnteOrgFormDTO; import com.epmet.dto.form.SsoLoginFormDTO; +import com.epmet.dto.form.SsoLoginOperFormDTO; import com.epmet.dto.result.SsoLoginResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.SsoService; @@ -30,19 +31,31 @@ public class SsoController { private JcetApiService jcetApiService; /** - * @Description 0、入口:得到token + * @Description 0、泸州app登陆入口:得到token * @Param formDTO * @author zxc * @date 2021/1/18 下午4:59 */ @PostMapping("resi/login") - public Result ssoLogin(@RequestBody SsoLoginFormDTO formDTO){ + public Result ssoLogin(@RequestBody SsoLoginFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, SsoLoginFormDTO.SsoLoginForm.class); return new Result().ok(ssoService.ssoLogin(formDTO)); } + /** + * @Description 0、第三方系统跳转至 运营平台登陆接口 + * @Param formDTO + * @author zxc + * @date 2021/1/18 下午4:59 + */ + @PostMapping("oper/third/login") + public Result thirdLoginOper(@RequestBody SsoLoginOperFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SsoLoginOperFormDTO.ThirdPlatformLoginForm.class); + return new Result().ok(ssoService.thirdLoginOperWork(formDTO)); + } + @PostMapping("test") - public Result testssoLogin(){ + public Result testssoLogin() { ThirdPlatUserInfo userInfoByTicket = null; try { userInfoByTicket = jcetApiService.getUserInfoByTicket("ssoTicket-vYtMRuXAQZri3wpA2vyq5D8n3Q9oO7ui"); diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginFormDTO.java index eea5394ed5..0e2ee7cf40 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginFormDTO.java @@ -19,7 +19,7 @@ public class SsoLoginFormDTO implements Serializable { /** * sso票据,有效期为300秒 */ - @NotBlank(message = "sso票据不能为空",groups = SsoLoginForm.class) + @NotBlank(message = "sso票据不能为空", groups = {SsoLoginForm.class}) private String ticket; /** @@ -31,12 +31,12 @@ public class SsoLoginFormDTO implements Serializable { /** * app类型 resi;居民段,gov:工作端 */ - @NotBlank(message = "app不能为空",groups = SsoLoginForm.class) + @NotBlank(message = "app不能为空", groups = SsoLoginForm.class) private String app; /** * app;居民段,app:工作端 */ - @NotBlank(message = "client不能为空",groups = SsoLoginForm.class) + @NotBlank(message = "client不能为空", groups = SsoLoginForm.class) private String client; } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java new file mode 100644 index 0000000000..2084287984 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午4:43 + */ +@Data +public class SsoLoginOperFormDTO extends LoginCommonFormDTO { + + private static final long serialVersionUID = -4215746830030486659L; + + public interface ThirdPlatformLoginForm { + } + + /** + * 上游系统token + */ + @NotBlank(message = "token不能为空", groups = {ThirdPlatformLoginForm.class}) + private String thirdToken; + + /** + * 上游系统标识 + * + * @see com.epmet.enums.ThirdPlatformEnum + */ + @NotBlank(message = "平台标识不能为空", groups = {ThirdPlatformLoginForm.class}) + private String platform; +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ThirdPlatFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdPlatFormDTO.java new file mode 100644 index 0000000000..ea97c2c685 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdPlatFormDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午4:43 + */ +@Data +public class ThirdPlatFormDTO implements Serializable { + + private static final long serialVersionUID = -6543952487970013031L; + + public interface SsoLoginForm { + } + + public interface ThirdPlatformLoginForm { + } + + /** + * sso票据,有效期为300秒 + */ + @NotBlank(message = "sso票据不能为空", groups = {SsoLoginForm.class, ThirdPlatformLoginForm.class}) + private String ticket; + + /** + * 三方平台应用AppId + */ + @NotBlank(message = "三方平台应用AppId不能为空", groups = SsoLoginForm.class) + private String appId; + + /** + * app类型 resi;居民段,work:工作端 + */ + @NotBlank(message = "app不能为空", groups = SsoLoginForm.class) + private String app; + + @NotBlank(message = "client不能为空", groups = SsoLoginForm.class) + private String client; + + /** + * 上游系统token + */ + @NotBlank(message = "token不能为空", groups = {ThirdPlatformLoginForm.class}) + private String thirdToken; + + /** + * 上游系统token + * + * @see com.epmet.enums.ThirdPlatformEnum + */ + @NotBlank(message = "token不能为空", groups = {ThirdPlatformLoginForm.class}) + private String platform; +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java index 8e4b715422..c7ce124a75 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java @@ -17,4 +17,5 @@ public class UserTokenResultDTO implements Serializable { * 令牌 */ private String token; + private String customerId; } diff --git a/epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java b/epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java new file mode 100644 index 0000000000..d64df0fd1a --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java @@ -0,0 +1,50 @@ +package com.epmet.enums; + +/** + * 系统环境变量枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum ThirdPlatformEnum { + /** + * 平阴联动指挥平台 + */ + PINGYIN_LIANDONG("pyld", "平阴联动指挥平台", "pyldApiService"), + ; + + private String code; + private String name; + private String apiService; + + + ThirdPlatformEnum(String code, String name, String apiService) { + this.code = code; + this.name = name; + this.apiService = apiService; + } + + public static ThirdPlatformEnum getEnum(String code) { + ThirdPlatformEnum[] values = ThirdPlatformEnum.values(); + for (ThirdPlatformEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public String getApiService() { + return apiService; + } +} diff --git a/epmet-auth/src/main/java/com/epmet/service/SsoService.java b/epmet-auth/src/main/java/com/epmet/service/SsoService.java index a2986482ab..4514230228 100644 --- a/epmet-auth/src/main/java/com/epmet/service/SsoService.java +++ b/epmet-auth/src/main/java/com/epmet/service/SsoService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.dto.form.SsoEnteOrgFormDTO; import com.epmet.dto.form.SsoLoginFormDTO; +import com.epmet.dto.form.SsoLoginOperFormDTO; import com.epmet.dto.result.SsoLoginResultDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -12,7 +13,7 @@ import com.epmet.dto.result.UserTokenResultDTO; public interface SsoService { /** - * @Description 0、入口:得到token + * @Description 0、入口:得到token * @Param formDTO * @author zxc * @date 2021/1/18 下午4:59 @@ -32,4 +33,14 @@ public interface SsoService { * @Description 4、自动进入组织-返回token **/ UserTokenResultDTO enterOrg(SsoEnteOrgFormDTO formDTO); + + /** + * desc: sso登陆运营端 + * + * @param formDTO + * @return com.epmet.dto.result.UserTokenResultDTO + * @author LiuJanJun + * @date 2021/2/24 1:28 下午 + */ + UserTokenResultDTO thirdLoginOperWork(SsoLoginOperFormDTO 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 index 9631436b98..bf0689b2b7 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -10,10 +10,7 @@ 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; @@ -65,7 +62,7 @@ public class GovWebServiceImpl implements GovWebService { //2.验证码校验 boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); if (!flag) { - logger.error(String.format("用户%s登录,验证码输入错误,暂时放行", formDTO.getPhone())); + logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone())); //开启验证码校验 throw new RenException(EpmetErrorCode.ERR10019.getCode()); } @@ -84,7 +81,7 @@ public class GovWebServiceImpl implements GovWebService { //4.密码是否正确 //密码错误 if (!PasswordUtils.matches(formDTO.getPassword(), resultDTO.getPassWord())) { - logger.error("登陆密码错误"); + logger.warn("登陆密码错误"); throw new RenException(EpmetErrorCode.ERR10004.getCode()); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index adadb9b626..27f7e71fe5 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -293,9 +293,9 @@ public class LoginServiceImpl implements LoginService { //1、验证码是否正确 boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); if (!flag) { - logger.error(String.format("用户%s登录,验证码输入错误,暂时放行",formDTO.getPhone())); - //2020-05-21去除验证码校验 TODO - //return new Result().error(EpmetErrorCode.ERR10019.getCode()); + logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone())); + //2020-05-21去除验证码校验 + return new Result().error(EpmetErrorCode.ERR10019.getCode()); } //2、账号是否存在 //获取用户信息 diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java index 67d00ea4e6..c05df9f3a2 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.thirdplat.apiservice.AbstractApiService; import com.epmet.commons.thirdplat.bean.ThirdPlatUserInfo; +import com.epmet.commons.thirdplat.constants.PyldConstants; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -14,6 +15,8 @@ import com.epmet.commons.tools.utils.*; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.enums.ThirdPlatformEnum; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; @@ -22,6 +25,7 @@ import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.SsoRedis; import com.epmet.service.SsoService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -66,8 +71,11 @@ public class SsoServiceImpl implements SsoService { @Autowired private CpUserDetailRedis cpUserDetailRedis; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + /** - * @Description 0、入口:得到token + * @Description 0、入口:得到token * @Param formDTO * @author zxc * @date 2021/1/18 下午4:59 @@ -114,18 +122,66 @@ public class SsoServiceImpl implements SsoService { throw new RenException("【SSO登录】userId为空,生成token失败"); } //生成业务token - String token = this.generateToken(formDTO.getApp(),formDTO.getClient(), userId); + String token = this.generateToken(formDTO.getApp(), formDTO.getClient(), userId); //存放Redis - if (StringUtils.isBlank(customerId)){ + if (StringUtils.isBlank(customerId)) { throw new RenException("【SSO登录】customerId为空,缓存放置token失败"); } - this.disposeTokenDto(formDTO, userId, token, customerId); + this.disposeTokenDto(formDTO.getApp(), formDTO.getClient(), userId, token, customerId); return new SsoLoginResultDTO(token); } + @Override + public UserTokenResultDTO thirdLoginOperWork(SsoLoginOperFormDTO formDTO) { + ThirdPlatUserInfo thirdUser; + try { + ThirdPlatformEnum platformEnum = ThirdPlatformEnum.getEnum(formDTO.getPlatform()); + String apiService = platformEnum.getApiService(); + AbstractApiService apiServiceImpl = (AbstractApiService) SpringContextUtils.getBean(apiService); + thirdUser = apiServiceImpl.getUserInfoByTicket(formDTO.getThirdToken()); + } catch (RenException e) { + throw new RenException(e.getCode(), e.getMessage()); + } catch (Exception e) { + throw new RenException(e.getMessage()); + } + if (thirdUser == null) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), PyldConstants.REPONSE_USER_NOT_LOGIN); + } + //获取用户信息 + GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO(); + form.setCustomerId(thirdUser.getCustomerId()); + form.setMobile(thirdUser.getMobile()); + Result result = epmetUserFeignClient.getStaffIdAndPwd(form); + //todo userId 写死测试 3f7f852ce22c511aa67ecb695395295d start + GovWebOperLoginResultDTO demo = new GovWebOperLoginResultDTO(); + demo.setUserId("3f7f852ce22c511aa67ecb695395295d"); + result = new Result<>(); + result.ok(demo); + //test end + + if (!result.success() || null == result.getData() || null == result.getData().getUserId()) { + logger.error("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在"); + throw new RenException(EpmetErrorCode.ERR10003.getCode()); + } + + //4、生成token返回,且将TokenDto存到redis + //生成业务token + GovWebOperLoginResultDTO epmetUser = result.getData(); + + + String token = this.generateToken(formDTO.getApp(), formDTO.getClient(), epmetUser.getUserId()); + //存放Redis + + this.disposeTokenDto(formDTO.getApp(), formDTO.getClient(), epmetUser.getUserId(), token, thirdUser.getCustomerId()); + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + userTokenResultDTO.setCustomerId(thirdUser.getCustomerId()); + return userTokenResultDTO; + } + /** - * @Description token放缓存 + * @Description token放缓存 * @Param formDTO * @Param userId * @Param token @@ -133,12 +189,12 @@ public class SsoServiceImpl implements SsoService { * @author zxc * @date 2021/1/18 下午5:32 */ - public void disposeTokenDto(SsoLoginFormDTO formDTO, String userId, String token, String customerId){ + public void disposeTokenDto(String app, String client, String userId, String token, String customerId) { int expire = jwtTokenProperties.getExpire(); TokenDto tokenDto = new TokenDto(); tokenDto.setCustomerId(customerId); - tokenDto.setApp(formDTO.getApp()); - tokenDto.setClient(formDTO.getClient()); + tokenDto.setApp(app); + tokenDto.setClient(client); tokenDto.setUserId(userId); tokenDto.setToken(token); tokenDto.setUpdateTime(System.currentTimeMillis()); @@ -155,7 +211,7 @@ public class SsoServiceImpl implements SsoService { * @author zxc * @date 2021/1/18 下午5:14 */ - private String generateToken(String app,String client, String userId) { + private String generateToken(String app, String client, String userId) { Map map = new HashMap<>(16); map.put("app", app); map.put("client", client); @@ -466,4 +522,25 @@ public class SsoServiceImpl implements SsoService { return userTokenResultDTO; } + + public static void main(String[] args) { + String url = "https://epmet-ext9.elinkservice.cn/platform/unifiedAuth/loginCheck"; + String platformToken = "1348803062424166401_dd08e23b0d524879a5c67e7f2ffd1468"; + String appId = "7a5aec009ba4eba8e254ee64fe3775e1"; + String appKey = "14faef9af508d1c253b720ea5a43f9de"; + String appSecret = "38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595"; + long ts = System.currentTimeMillis(); + String message = appId + appKey + appSecret + ts; + String accessToken = DigestUtils.md5Hex(message.getBytes(StandardCharsets.UTF_8)); + //ThirdPlatformEnum platformEnum = ThirdPlatformEnum.getEnum("pyld"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("platformToken", platformToken); + + Map headerMap = new HashMap<>(4); + headerMap.put("AppKey", appKey); + headerMap.put("Timestamp", ts); + headerMap.put("AccessToken", accessToken); + Result stringResult = HttpClientManager.getInstance().sendPost(url, url.startsWith("https://"), jsonObject.toJSONString(), headerMap); + System.out.println(stringResult); + } } diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 6efee6a635..412dba2dc3 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -138,4 +138,9 @@ thirdplat: jcet: domain: @thirdplat.jcet.domain@ appkey: @thirdplat.jcet.appkey@ - appsecret: @thirdplat.jcet.appsecret@ \ No newline at end of file + appsecret: @thirdplat.jcet.appsecret@ + pyld: + domain: https://epmet-ext9.elinkservice.cn/platform + appId: 7a5aec009ba4eba8e254ee64fe3775e1 + appKey: 14faef9af508d1c253b720ea5a43f9de + appSecret: 38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595 diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/AbstractApiService.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/AbstractApiService.java index fbf0f7781e..150d99b2da 100644 --- a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/AbstractApiService.java +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/AbstractApiService.java @@ -32,7 +32,6 @@ public abstract class AbstractApiService { throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(thResult.getInternalMsg())); } - JcetResult jcetResult = JSON.parseObject(thResult.getData(), JcetResult.class); if (!jcetResult.isSuccess()) { throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/jcet/JcetApiService.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/jcet/JcetApiService.java index c5f0753f47..7dd811425d 100644 --- a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/jcet/JcetApiService.java +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/jcet/JcetApiService.java @@ -13,11 +13,14 @@ import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; +@Service public class JcetApiService extends AbstractApiService { Logger logger = LoggerFactory.getLogger(getClass()); @@ -35,6 +38,7 @@ public class JcetApiService extends AbstractApiService { * @author wxz * @date 2021.01.19 10:26 */ + @Override public ThirdPlatUserInfo getUserInfoByTicket(String ticket) throws UnsupportedEncodingException { logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); @@ -98,10 +102,10 @@ public class JcetApiService extends AbstractApiService { * @return * @throws UnsupportedEncodingException */ - private Map getHeaders(Object contentObject) throws UnsupportedEncodingException { - int bodyLength = JSON.toJSONString(contentObject).getBytes("utf-8").length; + private Map getHeaders(Object contentObject) throws UnsupportedEncodingException { + int bodyLength = JSON.toJSONString(contentObject).getBytes(StandardCharsets.UTF_8).length; - Map headers = new HashMap(); + Map headers = new HashMap(); long timestamp = System.currentTimeMillis(); headers.put(JcetConstants.PLAT_HEADER_OPEN_TIMESTAMP, String.valueOf(timestamp)); headers.put(JcetConstants.PLAT_HEADER_OPEN_APP_ID, jcetThirdplatProps.getAppkey()); diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java new file mode 100644 index 0000000000..958fd8b1bb --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java @@ -0,0 +1,123 @@ +package com.epmet.commons.thirdplat.apiservice.pyld; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.thirdplat.apiservice.AbstractApiService; +import com.epmet.commons.thirdplat.bean.ThirdPlatUserInfo; +import com.epmet.commons.thirdplat.constants.PyldConstants; +import com.epmet.commons.thirdplat.dto.result.jcet.PyldUserInfoResultDTO; +import com.epmet.commons.thirdplat.properties.PyldThirdplatProps; +import com.epmet.commons.thirdplat.properties.ThirdplatProps; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +/** + * desc: 平阴联动指挥平台sso登陆服务类 接入文档:http://note.youdao.com/noteshare?id=167ad65365f9eccf7925e8c2629d2021&sub=555AE50510344CB5AACD5C06B9AA3B3B + * + * @author LiuJanJun + * @date 2021/2/25 1:43 下午 + */ +@Service +public class PyldApiService extends AbstractApiService { + + Logger logger = LoggerFactory.getLogger(getClass()); + + private PyldThirdplatProps pyldThirdplatProps; + + public PyldApiService(ThirdplatProps props) { + this.thirdplatProps = props; + pyldThirdplatProps = props.getPyld(); + } + + /** + * @return + * @Description 通过第三方平台ticket获取用户信息 + * @author wxz + * @date 2021.01.19 10:26 + */ + @Override + public ThirdPlatUserInfo getUserInfoByTicket(String platformToken) { + + logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); + logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口入参 platformToken:{}", platformToken); + + + JSONObject jsonParam = new JSONObject(); + jsonParam.put(PyldConstants.PLAT_PARAM_TOKEN, platformToken); + jsonParam.put(PyldConstants.PLAT_PARAM_MANAGEMENTKEY, PyldConstants.PLAT_PARAM_MANAGEMENTKEY_VALUE); + + String domain = pyldThirdplatProps.getDomain(); + Result result = HttpClientManager.getInstance().sendPost( + domain.concat(PyldConstants.METHOD_CHECK_LOGIN), + domain.startsWith("https://"), + jsonParam.toJSONString(), + buildHeaders()); + + logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); + logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<"); + PyldUserInfoResultDTO resultDTO = this.parseResult(result); + + ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo(); + userInfo.setMobile(resultDTO.getMobile()); + userInfo.setCustomerId(resultDTO.getReserved()); + return userInfo; + + } + + /** + * 构建请求头信息 + * + * @return + */ + private Map buildHeaders() { + Map headers = new HashMap(); + long timestamp = System.currentTimeMillis(); + headers.put(PyldConstants.PLAT_HEADER_TIMESTAMP, timestamp); + headers.put(PyldConstants.PLAT_HEADER_APP_KEY, pyldThirdplatProps.getAppkey()); + String encryptContent = pyldThirdplatProps.getAppId() + pyldThirdplatProps.getAppkey() + pyldThirdplatProps.getAppSecret() + timestamp; + headers.put(PyldConstants.PLAT_HEADER_ACCESS_TOKEN, DigestUtils.md5Hex(encryptContent.getBytes(StandardCharsets.UTF_8))); + return headers; + } + + /** + * desc: 解析结果 + * + * @param thResult + * @return com.epmet.commons.thirdplat.dto.result.jcet.JcetUserInfoResultDTO + * @author LiuJanJun + * @date 2021/2/24 10:11 上午 + */ + private PyldUserInfoResultDTO parseResult(Result thResult) { + if (!thResult.success()) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), + EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(thResult.getInternalMsg())); + } + JSONObject jcetResult = JSON.parseObject(thResult.getData()); + Integer code = jcetResult.getInteger("code"); + String msg = jcetResult.getString("msg"); + if (code == null || code != 0) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), msg.concat(",错误码:") + code); + } + JSONObject data = jcetResult.getJSONObject("data"); + if (data == null) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), + EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(PyldConstants.REPONSE_USER_NOT_LOGIN)); + } + PyldUserInfoResultDTO userInfo = data.getObject("userInfo", PyldUserInfoResultDTO.class); + if (userInfo == null || StringUtils.isBlank(userInfo.getMobile()) || StringUtils.isBlank(userInfo.getReserved())) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), PyldConstants.REPONSE_USER_NOT_LOGIN); + } + return userInfo; + } +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java index f1539efba7..7d9fa4aabf 100644 --- a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java @@ -7,4 +7,5 @@ public class ThirdPlatUserInfo { private String openId; private String name; private String mobile; + private String customerId; } diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java new file mode 100644 index 0000000000..ffb6dbde97 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java @@ -0,0 +1,18 @@ +package com.epmet.commons.thirdplat.constants; + +public interface PyldConstants { + + String METHOD_CHECK_LOGIN = "/unifiedAuth/loginCheck"; + + + String PLAT_HEADER_TIMESTAMP = "timestamp"; + String PLAT_HEADER_APP_KEY = "appkey"; + String PLAT_HEADER_ACCESS_TOKEN = "accessToken"; + + + String PLAT_PARAM_TOKEN = "platformToken"; + String PLAT_PARAM_MANAGEMENTKEY = "managementKey"; + String PLAT_PARAM_MANAGEMENTKEY_VALUE = "epmet_work"; + + String REPONSE_USER_NOT_LOGIN = "token失效,请重新登陆"; +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/PyldUserInfoResultDTO.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/PyldUserInfoResultDTO.java new file mode 100644 index 0000000000..a7892d8820 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/PyldUserInfoResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.commons.thirdplat.dto.result.jcet; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PyldUserInfoResultDTO implements Serializable { + private static final long serialVersionUID = 6176427074670949388L; + /** + * 手机号 + */ + private String mobile; + /** + * 客户Id + */ + private String reserved; +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/PyldThirdplatProps.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/PyldThirdplatProps.java new file mode 100644 index 0000000000..03f9882532 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/PyldThirdplatProps.java @@ -0,0 +1,14 @@ +package com.epmet.commons.thirdplat.properties; + +import lombok.Data; + +/** + * 酒城e通三方平台配置 + */ +@Data +public class PyldThirdplatProps { + private String domain; + private String appId; + private String appkey; + private String appSecret; +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/ThirdplatProps.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/ThirdplatProps.java index 07c4919bd9..4c9b46b9e0 100644 --- a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/ThirdplatProps.java +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/ThirdplatProps.java @@ -6,7 +6,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @Data @ConfigurationProperties(prefix = "thirdplat") public class ThirdplatProps { - + /** + * 泸州 酒城e通 + */ private JcetThirdplatProps jcet; + /** + * 平阴联动指挥平台 + */ + private PyldThirdplatProps pyld; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java index 3b5858b805..da3cab475e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java @@ -11,9 +11,6 @@ package com.epmet.commons.tools.aspect; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.constant.ThreadLocalConstant; import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; -import com.epmet.commons.tools.dto.form.RoleOpeScopeResultDTO; import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -30,11 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - /** * 每次请求,过滤Api中配置的权限key出来,并且判断是否具有该功能权限 * @Author wxz @@ -89,8 +81,9 @@ public class RequirePermissionAspect { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } Boolean data = result.getData(); + if (data == null || !data) { - log.error("操作权限不足"); + log.warn("操作权限不足,key:{}", requirePermission); throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } } 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 d0df724665..31d5faaa34 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 @@ -11,11 +11,14 @@ import org.springframework.core.env.Environment; * @date 2020-07-03 11:14 **/ public enum EnvEnum { - LOCAL("local", "本地环境","http://localhost:8080/api/"), - DEV("dev", "开发环境","http://192.168.1.130:8080/api/"), - TEST("test", "体验环境","https://epmet-dev.elinkservice.cn/api/"), - PROD("prod", "生产环境","https://epmet-cloud.elinkservice.cn/api/"), - UN_KNOWN("un_known", "未知","https://epmet-dev.elinkservice.cn/api/"), + /** + * 环境变量枚举 + */ + LOCAL("local", "本地环境", "http://localhost:8080/api/"), + DEV("dev", "开发环境", "http://192.168.1.130:8080/api/"), + TEST("test", "体验环境", "https://epmet-dev.elinkservice.cn/api/"), + PROD("prod", "生产环境", "https://epmet-cloud.elinkservice.cn/api/"), + UN_KNOWN("un_known", "未知", "https://epmet-dev.elinkservice.cn/api/"), ; private String code; @@ -33,7 +36,7 @@ public enum EnvEnum { public static EnvEnum getEnum(String code) { EnvEnum[] values = EnvEnum.values(); for (EnvEnum value : values) { - if (code != null && value.getCode().equals(code)) { + if (value.getCode().equals(code)) { return value; } } @@ -44,7 +47,7 @@ public enum EnvEnum { try { Environment environment = SpringContextUtils.getBean(Environment.class); String[] activeProfiles = environment.getActiveProfiles(); - if (activeProfiles != null && activeProfiles.length > 0) { + if (activeProfiles.length > 0) { return getEnum(activeProfiles[0]); } } catch (Exception e) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 0c83bfdede..fe48e711e7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -188,15 +188,16 @@ public class HttpClientManager { } - public Result sendPost(String url, boolean isHttps, String jsonStrParam,Map headerMap) { + public Result sendPost(String url, boolean isHttps, String jsonStrParam, Map headerMap) { try { HttpPost httppost = new HttpPost(url); httppost.setConfig(requestConfig); httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); - if (null != headerMap){ - headerMap.forEach((k,v) -> { - httppost.addHeader(k,v); + if (null != headerMap) { + headerMap.forEach((k, v) -> { + if (v != null) + httppost.addHeader(k, v.toString()); }); } if (StringUtils.isNotEmpty(jsonStrParam)) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java index 08a96295ac..1f44eb4333 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java @@ -35,14 +35,14 @@ public class IdCardNoValidatorUtils { try { //判断号码的长度 15位或18位 if (idCardNo.length() != 15 && idCardNo.length() != 18) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位")); return false; } if (idCardNo.length() == 18) { String lastStr = idCardNo.substring(idCardNo.length() - 1); if (!Character.isDigit(lastStr.charAt(0))) { if (Character.isLowerCase(lastStr.charAt(0))) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写")); return false; } } else { @@ -55,7 +55,7 @@ public class IdCardNoValidatorUtils { iDCardNo = idCardNo.substring(0, 6) + "19" + idCardNo.substring(6, 15); } if (isStrNum(iDCardNo) == false) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字")); return false; } //判断出生年月 @@ -63,27 +63,27 @@ public class IdCardNoValidatorUtils { String strMonth = iDCardNo.substring(10, 12);// 月份 String strDay = iDCardNo.substring(12, 14);// 月份 if (isStrDate(strYear + "-" + strMonth + "-" + strDay) == false) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效")); return false; } GregorianCalendar gc = new GregorianCalendar(); SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); if ((gc.get(Calendar.YEAR) - Integer.parseInt(strYear)) > 150 || (gc.getTime().getTime() - s.parse(strYear + "-" + strMonth + "-" + strDay).getTime()) < 0) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围")); return false; } if (Integer.parseInt(strMonth) > 12 || Integer.parseInt(strMonth) == 0) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效")); return false; } if (Integer.parseInt(strDay) > 31 || Integer.parseInt(strDay) == 0) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效")); return false; } //判断地区码 Hashtable h = GetAreaCode(); if (h.get(iDCardNo.substring(0, 2)) == null) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误")); return false; } //判断最后一位 @@ -96,12 +96,12 @@ public class IdCardNoValidatorUtils { iDCardNo = iDCardNo + strVerifyCode; if (idCardNo.length() == 18 && !iDCardNo.equals(idCardNo)) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码")); return false; } } catch (Exception e) { - logger.error(String.format("校验身份证号方法异常")); + logger.warn(String.format("校验身份证号方法异常")); e.printStackTrace(); } return true; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java new file mode 100644 index 0000000000..04d4896995 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/27 17:52 + */ +@Data +public class AgencyInfoDTO implements Serializable { + private String agencyId; + private String areaCode; + private List subAgencyIds; + private List subGridIds; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java new file mode 100644 index 0000000000..b9cd6657b6 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.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; + +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 2021-02-23 + */ +@Data +public class ScreenProjectCategoryGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + + /** + * 删除标识 + */ + 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-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java new file mode 100644 index 0000000000..1507a1f88a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java @@ -0,0 +1,147 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectCategoryOrgDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + + /** + * 删除标识 + */ + 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-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java new file mode 100644 index 0000000000..b39dadb41b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form.screen; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/2/23 15:26 + */ +@Data +public class CategoryAnalysisFormDTO implements Serializable { + private static final long serialVersionUID = -3088762710988337423L; + + public interface CategoryAnalysis{} + + @NotBlank(message = "组织ID不能为空",groups = {CategoryAnalysis.class}) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java new file mode 100644 index 0000000000..da023e6c0b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/2/23 15:28 + */ +@NoArgsConstructor +@Data +public class CategoryAnalysisResultDTO implements Serializable { + + private static final long serialVersionUID = 4500337306142206855L; + /** + * 类别名称 + */ + private String categoryName; + /** + * 项目总数 + */ + private Integer projectTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java index cd31c9688b..9410dda13a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java @@ -25,4 +25,9 @@ public class AgencyAndNumFormDTO implements Serializable { * */ @NotBlank(message = "机关Id不能为空" , groups = AgencyFormDTO.CommonAgencyIdGroup.class) private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124 + */ + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java index 9e2e3c74a9..6dc17c3e48 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java @@ -32,4 +32,9 @@ public class AgencyNumTypeParamFormDTO implements Serializable { @NotBlank(message = "类型不能为空", groups = AgencyNumTypeParamGroup.class) private String type; + /** + * 地区编码 + */ + private String areaCode; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java index c2deeac60b..b696426a2e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java @@ -21,4 +21,9 @@ public class ContactMassLineChartFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {ContactMassLineChart.class}) private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124 + */ + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java index 5ed5b9fc1a..542c2e5b48 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java index fdf525f37b..15b3e36477 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java @@ -21,4 +21,9 @@ public class ParymemberFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {Parymember.class}) private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124 + */ + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java new file mode 100644 index 0000000000..be3585067d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 16:12 + */ +@Data +public class ScreenProjectDetailFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "projectId不能为空") + private String projectId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java new file mode 100644 index 0000000000..69da09b886 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 15:22 + */ +@Data +public class ScreenProjectDistributionFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String areaCode; + + private String level; + + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java index b1ffd9243d..18fdae844f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java @@ -35,4 +35,9 @@ public class SubAgencyIndexRankFormDTO implements Serializable { * area_code升级,新增此参数,来源于当前token */ private String customerId; + + /** + * 行政区域编码 + */ + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java new file mode 100644 index 0000000000..f437e1a5b4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/28 14:29 + */ +@Data +public class SubAgencyIndexRankPyFormDTO implements Serializable { + private static final long serialVersionUID = 8930332375421099186L; + /** + * 当前组织,平阴大屏,默认传跟组织 + * */ + @NotBlank(message = "agencyId不能为空") + private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124 + * */ + @NotBlank(message = "areaCode不能为空;平阴默认传:370124") + private String areaCode; + + /** + * 默认查询前10条 + * */ + @NotNull(message = "topNum不能为空") + private Integer topNum; + + @NotBlank(message = "type不能为空,街道:street;网格:grid") + private String type; + + @NotBlank(message = "customerId不能为空") + private String customerId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java index 95ab00a382..e749c0e218 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java @@ -44,4 +44,6 @@ public class GovernCapacityResultDTO implements Serializable { * 当前agencyName的上一级组织名称 */ private String parentAgencyName; + + private String orgId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java new file mode 100644 index 0000000000..7ec31acd09 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java @@ -0,0 +1,124 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 16:15 + */ +@Data +public class ScreenProjectDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 项目id + */ + private String projectId; + /** + * 议题内容,其实就是项目内容 + */ + private String projectContent; + /** + * 上报时间,对应的是立项时间;格式:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private String reportTime; + /** + * 所属类别名称 + */ + private String categoryName; + /** + * 上报人名 + */ + private String reportUserName; + /** + * 上报人电话 + */ + private String mobile; + /** + * 上报位置 + */ + private String reportAddress; + /** + * 图片列表 + */ + private List imgList; + /** + * 处理进展列表(返回的是按时间升序的集合) + */ + private List processList; + + @Data + public static class processDTO{ + @JsonIgnore + private String processId; + /** + * 处理部门名称 + */ + private String handleDeptName; + /** + * 公开处理意见 + */ + private String suggestion; + /** + * 处理时间:yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reponseTime; + /** + * 关闭:close; 回应 response,结案closed_case,退回return,部门流转transfer,创建项目created + */ + private String operation; + /** + * 被吹哨部门;如果是多个以逗号隔开返给前端。 + */ + private String whistleDeptName; + + private List attachments; + + @Data + public static class AttachmentDTO{ + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件名 + */ + private String fileName; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 附件大小 字节为单位 + */ + private String attachmentSize; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV) + */ + private String attachmentFormat; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + /** + * url地址 + */ + private String attachmentUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 语音或视频时长,秒 + */ + private String duration; + } + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java new file mode 100644 index 0000000000..839870a4ab --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 15:26 + */ +@Data +public class ScreenProjectDistributionResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键id + */ + private String id; + /** + * 项目标题 + */ + private String projectTitle; + /** + * 项目等级 1:红色事件;2:黄色事件;3:绿色事件 + */ + private String level; + /** + * 经纬度 + */ + private String longitude; + private String latitude; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/VoluntaryServiceTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/VoluntaryServiceTrendFormDTO.java new file mode 100644 index 0000000000..63fdbc4571 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/VoluntaryServiceTrendFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.plugins.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 7、【工作日志】党员志愿者服务近12月趋势图 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/27 19:53 + */ +@Data +public class VoluntaryServiceTrendFormDTO { + /** + * 当前组织id + */ + @NotBlank(message = "agencyId不能为空") + private String agencyId; + + @NotBlank(message = "目前只有平阴在传,默认赋值:370124") + private String areaCode; + + @NotBlank(message = "customerId不能为空") + private String customerId; + + /** + * 截止到某月格式:yyyyMM;目前没有让大屏前端赋值,代码默认为为上个月 + */ + private String endMonthId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java index 3bbcb2973b..a4e5e0b9f4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java @@ -35,4 +35,7 @@ public class WorkRecordRankFormDTO implements Serializable { @NotBlank(message = "customerId不能为空") private String customerId; + + @NotBlank(message = "areaCode不能为空,目前只有平阴在传,默认赋值:370124") + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java new file mode 100644 index 0000000000..db2184bdc1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.plugins.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 6、【工作日志】近12月趋势图 + * + * @author sun + */ +@Data +public class WorkRecordTrendFormDTO implements Serializable { + private static final long serialVersionUID = -2934835714413031036L; + /** + * party:支部建设; union:联建共建;党员志愿服务:voluntaryservice + */ + @NotBlank(message = "dataType不能为空;可选值:party:支部建设; union:联建共建") + private String dataType; + + /** + * 当前组织id + */ + @NotBlank(message = "agencyId不能为空") + private String agencyId; + + /** + * 组织次数:organize;参与人数:joinuser;平均参与人数:avguser + */ + @NotBlank(message = "type不能为空") + private String type; + + @NotBlank(message = "customerId不能为空") + private String customerId; + + /** + * 查询数据起始月份Id + */ + private String startMonth; + + /** + * 查询数据结束月份Id + */ + private String endMonth; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java new file mode 100644 index 0000000000..49e79a19de --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java @@ -0,0 +1,30 @@ +package com.epmet.plugins.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 7、【工作日志】党员志愿者服务近12月趋势图 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/28 13:41 + */ +@Data +public class VoluntaryServiceTrendDTO implements Serializable { + private String monthId; + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java new file mode 100644 index 0000000000..ad5a204aef --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.plugins.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 7、【工作日志】党员志愿者服务近12月趋势图 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/27 19:55 + */ +@Data +public class VoluntaryServiceTrendResultDTO implements Serializable { + private static final long serialVersionUID = -560895826884970305L; + private List xAxis=new ArrayList<>(); + //组织次数:organize;参与人数:joinuser;平均参与人数:avguser + private List organizeList=new ArrayList<>(); + private List joinUserList=new ArrayList<>(); + private List avgUserList=new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java index 08c8df3ff2..4ca6521cce 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -29,4 +30,10 @@ public class WorkRecordRankResultDTO implements Serializable { *下级排行列表 */ private List subRankList; + + public WorkRecordRankResultDTO() { + this.participateTotal=0; + this.participateUserTotal=0; + this.subRankList=new ArrayList<>(); + } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java new file mode 100644 index 0000000000..eb5df34e99 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.plugins.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 6、【工作日志】近12月趋势图 + * + * @author sun + */ +@Data +public class WorkRecordTrendResultDTO implements Serializable { + /** + * 横轴 过去十二个月份 + * ['1月', '2月', '3月', '4月', '5月','6月','7月','8月','9月','10月','11月','12月'] + */ + private List xAxis = new ArrayList<>(); + /** + * 资源标签名 + * ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀'] + */ + private List legend = new ArrayList<>(); + + /** + *各项资源对应数据对象 + */ + private List series = new ArrayList<>(); + + @Data + public static class SeriesResultDTO { + /** + * 资源标签名 + * ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀'] + */ + private String name; + /** + * 各项资源对应12月份数据 + */ + private List data = new ArrayList<>(); + /** + * 数据对应的月份Id + */ + @JsonIgnore + private String monthId; + /** + * 各项资源对应某一月份数据 + */ + @JsonIgnore + private Integer value; + } + +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index e53e3b0643..8cb39e2c6b 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -39,6 +39,11 @@ common-service-client 2.0.0 + + com.epmet + oper-crm-client + 2.0.0 + org.springframework.boot spring-boot-starter-web diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java index 77c11404d5..0e903b9120 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java @@ -3,8 +3,14 @@ package com.epmet.datareport.controller.plugins; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService; +import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO; import com.epmet.plugins.form.WorkRecordRankFormDTO; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; +import com.epmet.plugins.result.VoluntaryServiceTrendResultDTO; import com.epmet.plugins.result.WorkRecordRankResultDTO; +import com.epmet.plugins.result.WorkRecordTrendResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -14,17 +20,16 @@ import org.springframework.web.bind.annotation.*; * @author yinzuomei@elink-cn.com * @date 2021/2/21 19:51 */ +@Slf4j @RestController -@RequestMapping("plugins/workrecord") +@RequestMapping("screen/plugins/workrecord") public class WorkRecordController { @Autowired private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService; - //todo 工作日志是否要添加area_code、parent_area_code、orgType;插件是否可以提供;也可以采集的时候赋值 //5、【工作日志】本机及下级排名 //NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348966 //返参中的当前组织的参与人数、组织次数 直接sum所有下级的值; //下级根据当前组织的areaCode查询下级列表,再去查询screen_work_record_org_daily - //legend来源于screen_customer_work_record_dict表 level=2,dataType=party @PostMapping("ranklist") public Result rankList(@RequestHeader("CustomerId")String customerId, @RequestBody WorkRecordRankFormDTO formDTO){ @@ -37,4 +42,31 @@ public class WorkRecordController { //6、【工作日志】近12月趋势图 //NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348967 //可以下级组织+下级网格 orgId 直接 in + /** + * @Description 6、【工作日志】近12月趋势图 + * @author sun + */ + @PostMapping("trend") + public Result trend(@RequestHeader("CustomerId")String customerId, @RequestBody WorkRecordTrendFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(screenWorkRecordOrgDailyService.trend(formDTO)); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 7、【工作日志】党员志愿者服务近12月趋势图 + * @Date 2021/2/27 19:56 + **/ + @PostMapping("voluntaryservicetrend") + public Result voluntaryServiceTrend(@RequestHeader("CustomerId")String customerId, @RequestBody VoluntaryServiceTrendFormDTO formDTO){ + formDTO.setCustomerId(customerId); + if (StringUtils.isBlank(formDTO.getEndMonthId())) { + formDTO.setEndMonthId(com.epmet.commons.tools.utils.DateUtils.getCurrentTimeBeforeMonthId()); + } + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(screenWorkRecordOrgDailyService.voluntaryServiceTrend(formDTO)); + } } 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 index 4cec62dc66..f3c2a545c5 100644 --- 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 @@ -8,10 +8,7 @@ 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 org.springframework.web.bind.annotation.*; import java.util.List; 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 index f7273b3da8..6d2a49cbe7 100644 --- 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 @@ -10,11 +10,9 @@ 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 lombok.extern.slf4j.Slf4j; 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 org.springframework.web.bind.annotation.*; /** * 基层党建相关各指标查询 @@ -22,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:11 */ +@Slf4j @RestController @RequestMapping("/screen/grassrootspartydev") public class GrassrootsPartyDevController { @@ -52,9 +51,10 @@ public class GrassrootsPartyDevController { * @date 2020.08.18 17:54 **/ @PostMapping("ageinfo") - public Result ageInfo(@RequestBody ParymemberFormDTO param){ + public Result ageInfo(@RequestBody ParymemberFormDTO param,@RequestHeader("CustomerId") String customerId){ + log.info("CustomerId"+customerId); ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); - return new Result().ok(grassrootsPartyDevService.partymemberAgeDistribution(param)); + return new Result().ok(grassrootsPartyDevService.partymemberAgeDistribution(param,customerId)); } /** 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 index 5ebeef980d..cb851647af 100644 --- 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 @@ -150,5 +150,16 @@ public class IndexController { return new Result>().ok(indexService.advancedBranchRank(formDTO)); } - + /** + * @param formDTO + * @author yinzuomei + * @description 8、平阴大屏-下级街道or网格指数排行 + * @Date 2021/2/28 14:33 + **/ + @PostMapping("subagencyindexrank-py") + Result> subAgencyIndexRankPy(@RequestHeader("CustomerId") String customerId,@RequestBody SubAgencyIndexRankPyFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(indexService.subAgencyIndexRankPy(formDTO)); + } } 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 index ca1104f534..bbd0039e71 100644 --- 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 @@ -6,10 +6,7 @@ import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadServic 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 org.springframework.web.bind.annotation.*; import java.util.List; 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 index 483e3edcc1..cc7a55528e 100644 --- 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 @@ -2,14 +2,27 @@ 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.ScreenProjectOrgDailyService; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; +import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO; +import com.epmet.dto.form.screen.ScreenCommonFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import lombok.extern.slf4j.Slf4j; +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 org.springframework.web.bind.annotation.*; + +import java.util.List; /** * 项目 @@ -17,13 +30,17 @@ import org.springframework.web.bind.annotation.RestController; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:16 */ +@Slf4j @RestController @RequestMapping("/screen/project") public class ScreenProjectController { @Autowired private ScreenProjectService screenProjectService; - + @Autowired + private ScreenProjectOrgDailyService projectOrgDailyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; /** * @Description 3、项目详情 * @param projectDetailFormDTO @@ -36,4 +53,77 @@ public class ScreenProjectController { return new Result().ok(screenProjectService.projectDetail(projectDetailFormDTO)); } + /** + * @Description 中央区事件分析-项目分布 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/24 16:10 + */ + @PostMapping("projectdistribution") + public Result projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){ + if (StringUtils.isBlank(formDTO.getAreaCode()) && StringUtils.isBlank(formDTO.getAgencyId())){ + formDTO.setAreaCode("370124"); + } + return screenProjectService.projectDistribution(formDTO); + } + + @PostMapping("projectdetailv2") + public Result projectDetail(@RequestBody ScreenProjectDetailFormDTO formDTO){ + return screenProjectService.projectDistributionDetail(formDTO); + } + /** + * 【事件分析】类型分析 + * @author zhaoqifeng + * @date 2021/2/23 15:37 + * @param customerId + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("category-analysis") + public Result> categoryAnalysis(@RequestHeader("CustomerId") String customerId, + @RequestBody CategoryAnalysisFormDTO formDTO) { + log.info("===================customerId"+customerId); + ValidatorUtils.validateEntity(formDTO, CategoryAnalysisFormDTO.CategoryAnalysis.class); + return new Result>().ok(screenProjectService.categoryAnalysis(customerId, formDTO)); + } + + + /** + * @param customerId + * @param formDTO + * @description 【事件分析】数量统计查询 平阴大屏 + **/ + @PostMapping("queryquantity") + public Result queryQuantity(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCommonFormDTO formDTO){ + formDTO.setCustomerId(customerId); + return new Result().ok(projectOrgDailyService.queryQuantity(formDTO)); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 近12个月【事件分析】月度数量分析 平阴大屏 + **/ + @PostMapping("queryquantity-monthly") + public Result queryQuantityMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody QueryQuantityMonthlyFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(projectQuantityOrgMonthlyService.queryQuantityMonthly(formDTO)); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【事件分析】效率分析 平阴大屏 + **/ + @PostMapping("efficiency-analysis") + public Result> efficiencyAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody EfficiencyAnalysisFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(projectOrgDailyService.efficiencyAnalysis(formDTO)); + } + } 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 index e752fe40dd..effc1dce93 100644 --- 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 @@ -39,6 +39,7 @@ public interface ScreenCpcBaseDataDao{ * @date 2020.08.18 17:47 **/ PartymemberAgeDistributionResultDTO selectPartymemberAgeDistribution(@Param("agencyId") String agencyId); + PartymemberAgeDistributionResultDTO selectPartymemberAgeDistributionNew(@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 index af4b0b7af2..498f57309c 100644 --- 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 @@ -150,4 +150,7 @@ public interface ScreenCustomerAgencyDao { **/ List selectGridList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + List getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); + + List selectSubAgencyIds(@Param("areaCode")String areaCode,@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/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index a024d60791..e0484794e6 100644 --- 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 @@ -80,5 +80,6 @@ public interface ScreenCustomerGridDao { * @date 2020/8/26 5:29 下午 */ List selectGridInfo(@Param("agencyId")String agencyId); - + + List selectSubGridIds(@Param("areaCode")String areaCode, @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 index 5a0a566342..801f8d5026 100644 --- 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 @@ -42,6 +42,14 @@ public interface ScreenDifficultyDataDao { **/ List selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type); + /** + * @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数【new】 + * @Param type + * @author zxc + * @date 2021/2/25 下午6:41 + */ + List selectDifficultyByAreaCode(@Param("areaCode")String areaCode,@Param("type")String type); + ProjectDetailResultDTO projectDetail(@Param("eventId")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 index e973aa85f3..405144008a 100644 --- 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 @@ -41,4 +41,13 @@ public interface ScreenGovernRankDataDao{ * @date 2020.08.20 17:34 **/ List selectGovernCapacityRatio(@Param("monthId") String monthId,@Param("agencyId") String agencyId); + + /** + * @Description 查询政府治理能力各项指标【new】 + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2021/2/26 上午9:22 + */ + List selectGovernCapacityRatioNew(@Param("monthId") String monthId,@Param("orgIds") List orgIds); } \ 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 index f9965876db..f502b0f471 100644 --- 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 @@ -56,6 +56,7 @@ public interface ScreenIndexDataMonthlyDao{ * @date 2020/8/20 10:04 上午 */ List selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); + List selectSubAgencyIndexRankNew(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); /** * 5、下级部门指数排行(安宁数据段用) - 月(上一个月) @@ -102,4 +103,26 @@ public interface ScreenIndexDataMonthlyDao{ * @author sun */ List getSingleIndexRank(SubSingleIndexRankFormDTO formDTO); + + /** + * @param yearId + * @param areaCode + * @Description 根据areaCode查询下级指数 + * @author yinzuomei + */ + List selectSubStreetByAreaCode(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("areaCode") String areaCode, + @Param("topNum") int topNum); + + /** + * @param yearId + * @param areaCode + * @Description 根据areaCode查询网格指数 + * @author yinzuomei + */ + List selectSubGridByAreaCode(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("areaCode") String areaCode, + @Param("topNum") int topNum); } 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 index 2b9bdba497..1e9a5efe09 100644 --- 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 @@ -42,4 +42,6 @@ public interface ScreenOrgRankDataDao{ **/ List selectGridDataMonthly(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + List selectGridDataMonthlyAreaCode(@Param("monthId") String monthId, + @Param("areaCode")String areaCode); } \ 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 index 1ca974982f..30094b7225 100644 --- 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 @@ -39,5 +39,6 @@ public interface ScreenPartyLinkMassesDataDao { * @date 2020/8/20 2:48 下午 */ List selectContactMassLineChart(@Param("agencyId")String agencyId); - + + List selectContactMassLineChartByAgencyIds(@Param("agencyIdList")List agencyIdList); } \ 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 index 0f442931b5..fe5adc1a77 100644 --- 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 @@ -71,4 +71,8 @@ public interface ScreenPartyUserRankDataDao{ * @author sun */ List selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO); + + List selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode); + + List selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode); } \ 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 index 92177ec52c..5bc3077e85 100644 --- 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 @@ -21,6 +21,8 @@ import com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 党建引领-先锋模范数据 * @@ -37,5 +39,16 @@ public interface ScreenPioneerDataDao{ * @date 2020/8/20 5:22 下午 */ FineExampleResultDTO selectFineExample(@Param("agencyId")String agencyId); + + /** + * @Description 根据地区码查询先锋模范 + * @param areaCode + * @param customerId + * @param customerIds - 子级客户列表 + * @return com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO + * @author wangc + * @date 2021.02.24 15:39 + */ + FineExampleResultDTO selectFineExampleByAreaCode(@Param("areaCode")String areaCode,@Param("customerId")String customerId,@Param("list") List customerIds); } \ 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/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java new file mode 100644 index 0000000000..c3b90ff1c7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.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.dto.result.screen.CategoryAnalysisResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectCategoryOrgDailyDao { + /** + * 类型分析 + * @author zhaoqifeng + * @date 2021/2/23 16:47 + * @param agencyId + * @return java.util.List + */ + List selectCategoryAnalysis(@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/ScreenProjectDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java new file mode 100644 index 0000000000..6ac5ef48ea --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -0,0 +1,24 @@ +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface ScreenProjectDataDao { + + List projectDistribution(@Param("agencyId") String agencyId, @Param("ids") List ids, @Param("level") String level); + + List selectIdsByAreaCode(@Param("areaCode") String areaCode); + + List projectDistributionDetail(@Param("projectId") String projectId); + + List selectProjectImgs(@Param("projectId") String projectId); + + List selectProjectProcess(@Param("projectId") String projectId); + + List selectProjectProcessAttachments(@Param("processId") String processId); +} 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 index 88c2aa0e77..6feb784626 100644 --- 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 @@ -39,4 +39,14 @@ public interface ScreenPublicPartiTotalDataDao{ * @date 2020.08.20 16:00 **/ List selectPublicPartiTotal(@Param("agencyId") String agencyId); + + + /** + * @Description 根据areaCode查询公众参与各类总数 + * @param areaCode + * @return + * @author wangc + * @date 2020.08.20 16:00 + **/ + List selectPublicPartiTotalByAreaCode(@Param("areaCode") String areaCode); } \ 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 index 962691f625..39a16db7bf 100644 --- 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 @@ -42,6 +42,16 @@ public interface ScreenUserJoinDao { **/ UserJoinIndicatorGrowthRateResultDTO selectUserJoinData(@Param("agencyId") String agencyId, @Param("monthId")String monthId); + /** + * @Description 根据地区码查询用户参与数据 + * @param areaCode + * @return + * @author wangc + * @date 2020.08.20 15:07 + **/ + UserJoinIndicatorGrowthRateResultDTO selectUserJoinDataByAreaCode(@Param("areaCode") String areaCode, @Param("monthId")String monthId); + + /** * @Description 查询月度用户参与数据 * @param agencyId 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 index 653cf3f606..8de5eaadfc 100644 --- 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 @@ -22,6 +22,8 @@ import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 * @@ -56,5 +58,6 @@ public interface ScreenUserTotalDataDao { * @date 2020.08.20 14:54 **/ int selectAvgIssue(@Param("agencyId")String agencyId); - + + PartymemberPercentResultDTO selectAgencyPartymemberPercentByIds(@Param("orgIds") List orgIds); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java index 5ee450d32c..7b2bf609c7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java @@ -20,6 +20,9 @@ package com.epmet.datareport.dao.plugins; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作日志资源字典表 @@ -29,5 +32,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ScreenCustomerWorkRecordDictDao extends BaseDao { - + + List selectListByDataType(@Param("customerId") String customerId, @Param("dataType") String dataType); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java index ca0bc02fda..d27a4eee75 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java @@ -19,7 +19,6 @@ package com.epmet.datareport.dao.plugins; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity; -import com.epmet.plugins.result.WorkRecordRankResultDTO; import com.epmet.plugins.result.WorkRecordSubRank; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -35,23 +34,37 @@ import java.util.List; @Mapper public interface ScreenWorkRecordOrgDailyDao extends BaseDao { /** - * @param areaCode 当前组织对应的areaCode; - * @param dataType - * @param topRow * @return com.epmet.plugins.result.WorkRecordRankResultDTO * @author yinzuomei - * @description 5、【工作日志】本机及下级排名 + * @description 5、【工作日志】本机及下级排名- 下级组织 * @Date 2021/2/23 23:37 **/ - List selectSubList(@Param("areaCode") String areaCode, - @Param("agencyId") String agencyId, - @Param("dataType") String dataType, - @Param("topRow") Integer topRow, + List selectSubList(@Param("subAgencyIds") List subAgencyIds, + @Param("dataType")String dataType, + @Param("customerId")String customerId, @Param("dateId")String dateId); - String selectLatestDateId(String customerId); + /** + * @param subGridIds 当前组织的指数网格ids + * @author yinzuomei + * @description + * @Date 2021/2/27 19:31 + **/ + List selectSubGridList(@Param("subGridIds")List subGridIds, + @Param("dataType")String dataType, + @Param("customerId")String customerId, + @Param("dateId")String dateId); + + /** + * @param customerIds 当前客户+所有子客户 列表 + * @author yinzuomei + * @description 查询最近一次上传的日期 + * @Date 2021/2/27 19:31 + **/ + String selectLatestDateId(@Param("customerIds")List customerIds); - WorkRecordRankResultDTO selectCurrentAgency(@Param("areaCode") String areaCode, - @Param("dataType") String dataType, + List selectCurrentAgency(@Param("agencyId") String agencyId, + @Param("dataType")String dataType, + @Param("customerId")String customerId, @Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java index 5146beb59e..10e5fd88c3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java @@ -19,7 +19,13 @@ package com.epmet.datareport.dao.plugins; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; +import com.epmet.plugins.result.VoluntaryServiceTrendDTO; +import com.epmet.plugins.result.WorkRecordTrendResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作日志-组织按月统计(增量) @@ -29,5 +35,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao { - + + /** + * @Description 按组织查询某项数据近12月趋势图 + * @author sun + */ + List selectMonthList(WorkRecordTrendFormDTO formDTO); + + List selectVoluntaryServiceTrendDTO(@Param("customerId")String customerId, + @Param("orgIds") List orgIds, + @Param("startMonth")String startMonth, + @Param("endMonth")String endMonth); } \ No newline at end of file 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 index 8e265fb34b..4f11f160ab 100644 --- 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 @@ -1,5 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.dto.AgencyInfoDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; @@ -61,4 +62,15 @@ public interface AgencyService { AgencyNodeDTO queryStaffAgencyTree(String agencyId); ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId); + + /** + * @return java.util.List + * @param agencyId + * @author yinzuomei + * @description 获取当前组织的下级组织集合 + * @Date 2021/2/25 16:52 + **/ + List getNextAgencyIds(String areaCode,String agencyId); + + AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId); } 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 index 41c8fafc28..09e94717b6 100644 --- 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 @@ -34,7 +34,7 @@ public interface GrassrootsPartyDevService { * @author wangc * @date 2020.08.18 17:54 **/ - PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param); + PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId); /** * @Description 3、支部建设情况|联建共建情况-折线图 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 index 0dc99d37bc..bfbf7a9d41 100644 --- 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 @@ -86,4 +86,12 @@ public interface IndexService { * @date 2020/10/22 10:58 上午 */ List getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 8、平阴大屏-下级街道or网格指数排行 + * @Date 2021/2/28 14:33 + **/ + List subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO); } 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 index aea908ff15..b4b0fe8725 100644 --- 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 @@ -1,8 +1,15 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.commons.tools.utils.Result; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import java.util.List; + /** * 项目 * @@ -19,4 +26,17 @@ public interface ScreenProjectService { */ ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO); + /** + * 【事件分析】类型分析 + * @author zhaoqifeng + * @date 2021/2/23 15:37 + * @param customerId + * @param formDTO + * @return java.util.List + */ + List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO); + + Result projectDistribution(ScreenProjectDistributionFormDTO formDTO); + + Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO); } 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 index 23d960354f..bf3f8dbdcc 100644 --- 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 @@ -10,6 +10,7 @@ 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.dto.AgencyInfoDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; @@ -297,4 +298,28 @@ public class AgencyServiceImpl implements AgencyService { public ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId) { return screenCustomerAgencyDao.selectByAgencyId(agencyId); } + + /** + * @param agencyId + * @return java.util.List + * @author yinzuomei + * @description 获取当前组织的下级组织集合 + * @Date 2021/2/25 16:52 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public List getNextAgencyIds(String areaCode,String agencyId) { + return screenCustomerAgencyDao.getNextAgencyIds(areaCode,agencyId); + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId) { + AgencyInfoDTO agencyInfoDTO=new AgencyInfoDTO(); + agencyInfoDTO.setAgencyId(agencyId); + agencyInfoDTO.setAreaCode(areaCode); + agencyInfoDTO.setSubAgencyIds(screenCustomerAgencyDao.selectSubAgencyIds(areaCode,agencyId)); + agencyInfoDTO.setSubGridIds(screenCustomerGridDao.selectSubGridIds(areaCode,agencyId)); + return agencyInfoDTO; + } } 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 index afdbf95f82..e427ad9e3b 100644 --- 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 @@ -3,17 +3,23 @@ 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.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; 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.epmet.feign.OperCrmOpenFeignClient; import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -32,6 +38,7 @@ import java.util.stream.Collectors; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:20 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @@ -48,6 +55,13 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { private ScreenGovernRankDataDao screenGovernRankDataDao; @Autowired private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + @Autowired + private OperCrmOpenFeignClient crmClient; + @Autowired + private ScreenCustomerAgencyDao agencyDao; + @Autowired + private AgencyService screenCustomerAgencyService; + /** * @Description 1、热心市民积分排行 @@ -65,7 +79,13 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { param.setTopNum(NumConstant.FIVE); } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List userPointList = screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId()); + List userPointList = new ArrayList<>(); + if(StringUtils.isNotBlank(param.getAreaCode())){ + log.info("热心市民积分排行按照areaCode查询"+param.getAreaCode()); + userPointList=screenPartyUserRankDataDao.selectUserPointOrderByAreaCode(param.getAreaCode()); + }else{ + 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())); @@ -84,11 +104,16 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List difficultProject(AgencyNumTypeParamFormDTO param) { + List result = new ArrayList<>(); if(null == param.getTopNum()){ param.setTopNum(NumConstant.TWO); } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); + if (StringUtils.isNotEmpty(param.getAreaCode())){ + result = screenDifficultyDataDao.selectDifficultyByAreaCode(param.getAreaCode(),param.getType()); + }else { + result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); + } for(DifficultProjectResultDTO resultDTO:result){ if (StringUtils.isNotBlank(resultDTO.getImgUrl()) && !resultDTO.getImgUrl().contains("http")) { resultDTO.setImgUrl(StrConstant.EPMETY_STR); @@ -110,15 +135,24 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) { + ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); + Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); + List subCustomers; + if(null == crmResp || !crmResp.success()|| org.apache.commons.collections4.CollectionUtils.isEmpty(crmResp.getData())) {subCustomers = null ;} + else {subCustomers = crmResp.getData();} String monthId = dateUtils.getCurrentMonthId(); - UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + UserJoinIndicatorGrowthRateResultDTO latest = CollectionUtils.isEmpty(subCustomers) ||StringUtils.isBlank(agencyInfo.getAreaCode())? + screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); //保证获取公众参与概率数据的最大可能性 int time = NumConstant.TWELVE; while (null == latest && time > NumConstant.ONE) { time--; monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); - latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + latest = CollectionUtils.isEmpty(subCustomers)||StringUtils.isBlank(agencyInfo.getAreaCode()) ? + screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); } if (null == latest) return new PublicPartiProfileResultDTO(); @@ -137,18 +171,30 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 15:32 **/ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override public List publicPartiRank(AgencyAndNumFormDTO param) { - if(null == param.getTopNum()){ + if (null == param.getTopNum()) { param.setTopNum(NumConstant.TWO); } - if(NumConstant.ZERO == param.getTopNum()){ + if (NumConstant.ZERO == param.getTopNum()) { param.setTopNum(NumConstant.MAX); } - PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()); - if(null == result) { + + ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); + List subCustomers; + Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); + if (null == crmResp || !crmResp.success() || CollectionUtils.isEmpty(crmResp.getData())) { + subCustomers = null; + } else { + subCustomers = crmResp.getData(); + } + PageHelper.startPage(NumConstant.ONE, param.getTopNum()); + List result = + CollectionUtils.isEmpty(subCustomers) || StringUtils.isBlank(agencyInfo.getAreaCode()) ? + screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()) + : screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode()); + if (null == result) { return new ArrayList<>(); } return result; @@ -165,19 +211,33 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List governCapacityRank(AgencyAndNumFormDTO param) { + List orderList = new ArrayList<>(); 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 (StringUtils.isNotEmpty(param.getAreaCode())){ + List nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); + if (CollectionUtils.isEmpty(nextAgencyIds)){ + return new ArrayList<>(); + } + orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds); + 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.selectGovernCapacityRatioNew(monthId,nextAgencyIds); + } + }else { + 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<>(); @@ -207,7 +267,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { 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())); + result.setXAxis(new ArrayList<>(Xaxis.values())); List defaultData = new LinkedList<>(); for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){ defaultData.add(NumConstant.ZERO); @@ -222,17 +282,17 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { result.setJoinUserNumList(new ArrayList<>()); result.setAverageJoinNumList(new ArrayList<>()); Map> dataMap = monthlyData.stream().collect(Collectors.groupingBy(UserJoinMonthlyResultDTO :: getMonthId)); - Xaxis.keySet().stream().forEach(monthId -> { + Xaxis.keySet().forEach(monthId -> { List data = dataMap.get(monthId); - if(null == data || data.isEmpty()){ + if (null == data || data.isEmpty()) { result.getOrganizeNumList().add(NumConstant.ZERO); result.getJoinUserNumList().add(NumConstant.ZERO); result.getAverageJoinNumList().add(NumConstant.ZERO); - }else{ + } else { Integer o = NumConstant.ZERO; Integer j = NumConstant.ZERO; Integer a = NumConstant.ZERO; - for(UserJoinMonthlyResultDTO unit : data){ + 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(); @@ -254,6 +314,18 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); } + /** + * @Description 通过agencyId获取机关信息 + * @param agencyId + * @return java.lang.String + * @author wangc + * @date 2021.02.25 13:46 + */ + private ScreenCustomerAgencyDTO agencyInfo(String agencyId){ + ScreenCustomerAgencyDTO agencyInfo = agencyDao.selectByAgencyId(agencyId); + if(null == agencyInfo) throw new RenException("获取Agency信息失败"); + return agencyInfo; + } } 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 index 73ebfc5c14..333c129f87 100644 --- 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 @@ -2,17 +2,22 @@ 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.exception.RenException; +import com.epmet.commons.tools.utils.Result; 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.AgencyService; 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.constant.ScreenConstant; 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.epmet.feign.OperCrmOpenFeignClient; import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -45,7 +50,10 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private ScreenPartyBranchDataDao screenPartyBranchDataDao; @Autowired private DateUtils dateUtils; - + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private AgencyService screenCustomerAgencyService; /** * @Description 1、党员基本情况-饼状图概况 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324 @@ -57,10 +65,29 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { - + if(StringUtils.isNotBlank(param.getAreaCode())){ + logger.info(String.format("党员基本情况-饼状图概况按照areaCode查询:%s",param.getAreaCode())); + List ids=screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(),param.getAgencyId()); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(ids)){ + PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercentByIds(ids); + if(null == result){ + logger.warn("selectAgencyPartymemberPercentByIds is null"); + result = new PartymemberPercentResultDTO(); + result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); + return result; + } + if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){ + result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); + }else{ + result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal())); + } + return result; + } + logger.warn("当前组织没有下级getNextAgencyIds is empty"); + return new PartymemberPercentResultDTO(); + } 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)); @@ -70,11 +97,21 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService 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())))); + result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal())); } return result; } + public String getRatio(Integer partyMemberTotal, Integer platFormTotal){ + if (null == partyMemberTotal || null == platFormTotal || partyMemberTotal == NumConstant.ZERO || platFormTotal == NumConstant.ZERO){ + return "0.00%"; + } + BigDecimal aDecimal = new BigDecimal(partyMemberTotal); + BigDecimal bDecimal = new BigDecimal(platFormTotal); + BigDecimal result = aDecimal.divide(bDecimal, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP); + return result.multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.TWO,BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO); + } + /** * @Description 2、党员基本情况-年龄分布 * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 @@ -85,8 +122,17 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService **/ @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) { - PartymemberAgeDistributionResultDTO ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId) { + Result> result = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); + if (!result.success()){ + throw new RenException("select subCustomerIds failure"); + } + PartymemberAgeDistributionResultDTO ageInfo = new PartymemberAgeDistributionResultDTO(); + if (!CollectionUtils.isEmpty(result.getData())) { + ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistributionNew(param.getAgencyId()); + }else { + ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + } if(null == ageInfo){ ageInfo = new PartymemberAgeDistributionResultDTO(); } @@ -231,7 +277,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private String convertPercentStr(BigDecimal percent){ - if(null == percent || BigDecimal.ZERO == percent) return "0.00%"; + if (null == percent || BigDecimal.ZERO.equals(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 index 179c13a282..831aa3ae36 100644 --- 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 @@ -3,6 +3,7 @@ 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.enums.CommonOperateTypeEnum; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; @@ -230,7 +231,12 @@ public class IndexServiceImpl implements IndexService { LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); int yearId = now.getYear(); subAgencyIndexRankFormDTO.setYearId(String.valueOf(yearId)); - List subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO); + List subAgencyIndexRankResultDTOS = new ArrayList<>(); + if (StringUtils.isNotEmpty(subAgencyIndexRankFormDTO.getAreaCode())){ + subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRankNew(subAgencyIndexRankFormDTO); + }else { + subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO); + } if (CollectionUtils.isEmpty(subAgencyIndexRankResultDTOS)){ return new ArrayList<>(); } @@ -380,4 +386,40 @@ public class IndexServiceImpl implements IndexService { return list; } + /** + * @param formDTO + * @author yinzuomei + * @description 8、平阴大屏-下级街道or网格指数排行 + * @Date 2021/2/28 14:33 + **/ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO) { + if (!"street".equals(formDTO.getType()) && !"grid".equals(formDTO.getType())) { + throw new RenException("type传参错误,街道:street;网格:grid"); + } + LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); + String yearId = String.valueOf(now.getYear()); + if("street".equals(formDTO.getType())){ + List streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum()); + // 小数四舍五入 + streetList.forEach(indexRank -> { + indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); + indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); + indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); + indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); + }); + return streetList; + } + List gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum()); + // 小数四舍五入 + gridList.forEach(indexRank -> { + indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); + indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); + indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); + indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); + }); + return gridList; + } + } 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 index 941a294e49..fce388ec23 100644 --- 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 @@ -1,19 +1,25 @@ package com.epmet.datareport.service.evaluationindex.screen.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.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; 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.epmet.feign.OperCrmOpenFeignClient; import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -48,6 +54,12 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { private DateUtils dateUtils; @Autowired private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private AgencyService screenCustomerAgencyService; /** * @Description 1、先锋模范 @@ -58,17 +70,33 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @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())); - fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio()))); - return fineExampleResultDTO; + ScreenCustomerAgencyDTO agencyInfo = customerAgencyDao.selectByAgencyId(fineExampleFormDTO.getAgencyId()); + if(null == agencyInfo) throw new RenException("未找到对应的机关"); + String customerId = agencyInfo.getCustomerId(); + String areaCode = agencyInfo.getAreaCode(); + + Result> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); + List subCustomers; + if(null == crmResponse || !crmResponse.success()) + {subCustomers = null;} + else + {subCustomers = crmResponse.getData();} + FineExampleResultDTO fineExampleResultDTO; + if(CollectionUtils.isEmpty(subCustomers)) + fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); + else + fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(areaCode,customerId,subCustomers); + + 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())); + fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio()))); + return fineExampleResultDTO; } /** @@ -91,8 +119,14 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) { + + List subAgencyIdorGridIdList=screenCustomerAgencyService.getNextAgencyIds(contactMassLineChartFormDTO.getAreaCode(),contactMassLineChartFormDTO.getAgencyId()); + log.info("当前组织的下级id:"+JSON.toJSONString(subAgencyIdorGridIdList)); + ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); - List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + // List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + //多客户版修改如下: + List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChartByAgencyIds(subAgencyIdorGridIdList); if (contactMassLineChartResults.size() == NumConstant.ZERO){ result.setXAxis(new ArrayList<>()); result.setGroupMemberData(new ArrayList<>()); @@ -221,6 +255,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List advancedBranchRank(AgencyAndNumFormDTO param) { + List result = new LinkedList<>(); if(null == param.getTopNum()){ param.setTopNum(NumConstant.FIVE); }else if(NumConstant.ZERO == param.getTopNum()){ @@ -228,24 +263,43 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { } 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); + if(StringUtils.isNotBlank(param.getAreaCode())){ + log.info("先进排行榜单-先进支部排行入参"+JSON.toJSONString(param)); + //areaCode不为空,按照areaCode查询 + List gridData = + screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode()); + 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.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode()); + } + 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); + }); + }else{ + 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); + } + 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); + }); } - 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; } @@ -262,14 +316,20 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { 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()); + List result=new ArrayList<>(); + if(StringUtils.isNotBlank(param.getAreaCode())){ + log.info("先进排行榜单-先进党员排行按照areaCode查询入参:"+param.getAreaCode()); + result=screenPartyUserRankDataDao.selectPartymemberPointOrderByAreaCode(param.getAreaCode()); + }else{ + 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%"; + if (null == percent || BigDecimal.ZERO.equals(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/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java index 1e4855604d..72cc5f40cc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -32,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -74,20 +71,27 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl implements ScreenProject Map dtoMap = new HashMap<>(); if (!CollectionUtils.isEmpty(dtoList)) { dtoMap = dtoList.stream().collect(Collectors.toMap(ScreenProjectQuantityOrgMonthlyDTO::getMonthId, Function.identity(), (key1, key2) -> key2)); + List blank = dtoMap.keySet().stream().filter(query -> !monthIdList.contains(query)).collect(Collectors.toList()); + if(!CollectionUtils.isEmpty(blank)){ + for(int i = NumConstant.ZERO; i < blank.size(); i++){dtoMap.put(blank.get(i),null);} + } + }else{ + for(int i = NumConstant.ZERO; i < monthIdList.size(); i++){dtoMap.put(monthIdList.get(i),null);} } for (String monthId : monthIdList) { //202101=>01月 xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH)); if (!CollectionUtils.isEmpty(dtoList)) { + ScreenProjectQuantityOrgMonthlyDTO en = dtoMap.get(monthId); if ("incr".equals(formDTO.getType())) { - yAxis.add(dtoMap.get(monthId).getProjectIncr()); + yAxis.add( null == en ? NumConstant.ZERO : en.getProjectIncr()); } else if ("sum".equals(formDTO.getType())) { - yAxis.add(dtoMap.get(monthId).getProjectTotal()); + yAxis.add( null == en ? NumConstant.ZERO : en.getProjectTotal() ); } continue; } //没有数据默认赋值0 - yAxis.add(0); + //yAxis.add(0); } resultDTO.setXAxis(xAxis); resultDTO.setYAxis(yAxis); 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 index 2cf288cae9..f8832532b1 100644 --- 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 @@ -1,12 +1,22 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.utils.Result; 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.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -26,6 +36,11 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { private ScreenEventDataDao screenEventDataDao; @Autowired private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenProjectDataDao screenProjectDataDao; + + @Autowired + private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; /** * @Description 3、项目详情 @@ -44,4 +59,56 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { projectDetailResultDTO.setImgList(imgList); return projectDetailResultDTO; } -} \ No newline at end of file + + /** + * @Description 中央区事件分析-项目分布 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/24 15:25 + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) { + List areaIds = null; + if (StringUtils.isNotBlank(formDTO.getAreaCode())){ + areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode()); + } + List resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel()); + return new Result().ok(resultDTOS); + } + + @Override + public Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO) { + List resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId()); + resultDTOS.forEach(item -> { + //项目图片 + List imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId()); + item.setImgList(imgList); + //项目处理流程 + List processDTOS = screenProjectDataDao.selectProjectProcess(formDTO.getProjectId()); + //流程附件 + processDTOS.forEach(processDTO -> { + List attachmentDTOS = screenProjectDataDao.selectProjectProcessAttachments(processDTO.getProcessId()); + processDTO.setAttachments(attachmentDTOS); + }); + item.setProcessList(processDTOS); + }); + return new Result().ok(resultDTOS); + } + + /** + * 【事件分析】类型分析 + * + * @param customerId + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/2/23 15:37 + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO) { + return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId()); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java index cd528a5f50..0991305f4f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java @@ -21,8 +21,12 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity; import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO; +import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO; import com.epmet.plugins.form.WorkRecordRankFormDTO; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; +import com.epmet.plugins.result.VoluntaryServiceTrendResultDTO; import com.epmet.plugins.result.WorkRecordRankResultDTO; +import com.epmet.plugins.result.WorkRecordTrendResultDTO; import java.util.List; import java.util.Map; @@ -96,4 +100,19 @@ public interface ScreenWorkRecordOrgDailyService extends BaseService queryBidList(String customerId) { return screenBidInfoDao.selectList(customerId); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java index 47e4b8bb3e..39380cd9d4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java @@ -19,10 +19,12 @@ package com.epmet.datareport.service.plugins.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.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao; import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity; import com.epmet.datareport.service.plugins.ScreenCustomerWorkRecordDictService; @@ -44,6 +46,7 @@ import java.util.Map; */ @Slf4j @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenCustomerWorkRecordDictServiceImpl extends BaseServiceImpl implements ScreenCustomerWorkRecordDictService { @Override diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java index 692989e278..0474d32f2e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java @@ -17,31 +17,45 @@ package com.epmet.datareport.service.plugins.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.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.RenException; +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.utils.Result; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao; import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao; +import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao; import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService; -import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.dto.AgencyInfoDTO; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO; +import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO; import com.epmet.plugins.form.WorkRecordRankFormDTO; -import com.epmet.plugins.result.WorkRecordRankResultDTO; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; +import com.epmet.plugins.result.*; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 工作日志-组织按日统计(累计值) @@ -51,10 +65,18 @@ import java.util.Map; */ @Slf4j @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgDailyService { @Autowired private AgencyService agencyService; - + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenCustomerWorkRecordDictDao screenCustomerWorkRecordDictDao; + @Autowired + private ScreenWorkRecordOrgMonthlyDao screenWorkRecordOrgMonthlyDao; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -107,25 +129,174 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl customerIds=new ArrayList<>(); + Result> result=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + // log.info("result: "+JSON.toJSONString(result)); + if (result.success() && CollectionUtils.isNotEmpty(result.getData())) { + customerIds.addAll(result.getData()); + } + customerIds.add(formDTO.getCustomerId()); + String dateId= baseDao.selectLatestDateId(customerIds); + if(StringUtils.isBlank(dateId)){ + log.warn("selectLatestDateId dateId is null customerIds" + JSON.toJSONString(customerIds)); } - String dateId = baseDao.selectLatestDateId(formDTO.getCustomerId()); - log.info(String.format("最近一次上传dateId:%s", dateId)); - if (agencyDTO.getLevel().equals("community")) { - log.warn("【工作日志】本机及下级排名接口待完善"); - //todo - return new WorkRecordRankResultDTO(0, 0, new ArrayList<>()); - } else { - //非社区的 - WorkRecordRankResultDTO resultDTO = baseDao.selectCurrentAgency(agencyDTO.getAreaCode(), formDTO.getDataType(), dateId); - resultDTO.setSubRankList(baseDao.selectSubList(agencyDTO.getAreaCode(), agencyDTO.getAgencyId(), formDTO.getDataType(), formDTO.getTopRow(), dateId)); + WorkRecordRankResultDTO returnDto = new WorkRecordRankResultDTO(); + AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId()); + // log.info("agencyInfoDTO: "+JSON.toJSONString(agencyInfoDTO)); + //当前组织的自身的数据 + List currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId); + //下级所有组织 + List subAgencyRankList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? baseDao.selectSubList( + agencyInfoDTO.getSubAgencyIds(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId) : new ArrayList<>(); + //直属网格 + List subGridList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubGridIds()) ? baseDao.selectSubGridList( + agencyInfoDTO.getSubGridIds(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId) : new ArrayList<>(); + + returnDto.getSubRankList().addAll(subAgencyRankList); + returnDto.getSubRankList().addAll(subGridList); + int participateUserTotal = 0; + int participateTotal = 0; + for (WorkRecordSubRank subAgency : returnDto.getSubRankList()) { + participateUserTotal += subAgency.getParticipateUserTotal(); + participateTotal += subAgency.getParticipateTotal(); + } + if (CollectionUtils.isNotEmpty(currentAgency)) { + for (WorkRecordSubRank m : currentAgency) { + participateUserTotal += m.getParticipateUserTotal(); + participateTotal += m.getParticipateTotal(); + } + } + returnDto.setParticipateTotal(participateTotal); + returnDto.setParticipateUserTotal(participateUserTotal); + returnDto.setSubRankList(CollectionUtils.isNotEmpty(returnDto.getSubRankList()) && returnDto.getSubRankList().size() >= formDTO.getTopRow() ? + returnDto.getSubRankList().subList(NumConstant.ZERO, formDTO.getTopRow()) : returnDto.getSubRankList()); + return returnDto; + } + + /** + * @Description 6、【工作日志】近12月趋势图 + * 查询当前组织及所有下级某项数据(组织次数、参与人数、平均参与人数)的某个资源(支部建设、联建共建、党员志愿服务)对应的每个类型的指标过去12个月的汇总数据,某个月份没数据的补0 + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + public WorkRecordTrendResultDTO trend(WorkRecordTrendFormDTO formDTO) { + WorkRecordTrendResultDTO resultDTO = new WorkRecordTrendResultDTO(); + + //1.根据资源编码查询资源名称集合,按sort升序 + List legendList = screenCustomerWorkRecordDictDao.selectListByDataType(formDTO.getCustomerId(), formDTO.getDataType()); + resultDTO.setLegend(legendList); + if (null == legendList || legendList.size() < NumConstant.ONE) { return resultDTO; } + + //2.查询当前月过去12个月份 + Map map = dateUtils.getXpro(); + resultDTO.setXAxis(map.values().stream().collect(Collectors.toList())); + List monthIdList = map.keySet().stream().collect(Collectors.toList()); + + //3-1.查询当前组织及所有下级过去12个月份某项数据所有资源的统计数据 + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMM"); + LocalDate today = LocalDate.now(); + formDTO.setStartMonth(today.minusMonths(NumConstant.TWELVE).format(fmt)); + formDTO.setEndMonth(today.minusMonths(NumConstant.ZERO).format(fmt)); + List list = screenWorkRecordOrgMonthlyDao.selectMonthList(formDTO); + + //3-2.遍历封装数据并返回 + LinkedList seriesList = new LinkedList<>(); + //按资源类型封装每一个资源类型对应的过去12个月的汇总数据,某个月份没有数据的补0 + legendList.forEach(le -> { + WorkRecordTrendResultDTO.SeriesResultDTO dto = new WorkRecordTrendResultDTO.SeriesResultDTO(); + dto.setName(le); + LinkedList dataList = new LinkedList<>(); + monthIdList.forEach(m->{ + AtomicInteger num = new AtomicInteger(0); + list.forEach(l -> { + if (m.equals(l.getMonthId())&&le.equals(l.getName())) { + //dataList.add(l.getValue()); + num.set(l.getValue()); + } + }); + dataList.add(num.get()); + }); + dto.setData(dataList); + seriesList.add(dto); + }); + + resultDTO.setSeries(seriesList); + return resultDTO; + } + + /** + * @param formDTO + * @return com.epmet.plugins.result.VoluntaryServiceTrendResultDTO + * @author yinzuomei + * @description 7、【工作日志】党员志愿者服务近12月趋势图 + * @Date 2021/2/27 19:56 + **/ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + public VoluntaryServiceTrendResultDTO voluntaryServiceTrend(VoluntaryServiceTrendFormDTO formDTO) { + VoluntaryServiceTrendResultDTO resultDTO = new VoluntaryServiceTrendResultDTO(); + //近12个月的monthId集合,["202002","202003","202004","202005","202006","202007","202008","202009","202010","202011","202012","202101"] + List monthIdList = com.epmet.commons.tools.utils.DateUtils.getMonthIdList(formDTO.getEndMonthId(), NumConstant.ELEVEN); + // log.info(JSON.toJSONString(monthIdList)); + + AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId()); + List orgIds = new ArrayList<>(); + orgIds.addAll(agencyInfoDTO.getSubAgencyIds()); + orgIds.add(agencyInfoDTO.getAgencyId()); + orgIds.addAll(agencyInfoDTO.getSubGridIds()); + List list = screenWorkRecordOrgMonthlyDao.selectVoluntaryServiceTrendDTO(formDTO.getCustomerId(), + orgIds, + monthIdList.get(NumConstant.ZERO), + monthIdList.get(NumConstant.ELEVEN)); + Map dtoMap = new HashMap<>(); + if (!org.springframework.util.CollectionUtils.isEmpty(list)) { + dtoMap = list.stream().collect(Collectors.toMap(VoluntaryServiceTrendDTO::getMonthId, Function.identity(), (key1, key2) -> key2)); + } + + //要返回的横坐标:["02月","03月","04月","05月","06月","07月","08月","09月","10月","11月","12月","01月"] + List xAxis = new ArrayList<>(); + List organizeList = new ArrayList<>(); + List joinUserList = new ArrayList<>(); + List avgUserList = new ArrayList<>(); + + for (String monthId : monthIdList) { + xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH)); + if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getOrganizeTotal()) { + organizeList.add(dtoMap.get(monthId).getOrganizeTotal()); + } else { + organizeList.add(NumConstant.ZERO); + } + if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getParticipateUserTotal()) { + joinUserList.add(dtoMap.get(monthId).getParticipateUserTotal()); + } else { + joinUserList.add(NumConstant.ZERO); + } + if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getAvgParticipateUserTotal()) { + avgUserList.add(dtoMap.get(monthId).getAvgParticipateUserTotal()); + } else { + avgUserList.add(NumConstant.ZERO); + } + } + resultDTO.setXAxis(xAxis); + resultDTO.setOrganizeList(organizeList); + resultDTO.setJoinUserList(joinUserList); + resultDTO.setAvgUserList(avgUserList); + return resultDTO; } } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java index 66f8eab095..533bf00c18 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java @@ -19,10 +19,12 @@ package com.epmet.datareport.service.plugins.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.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao; import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgMonthlyService; @@ -44,6 +46,7 @@ import java.util.Map; */ @Slf4j @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgMonthlyService { @Override diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 6eadda5d8f..f095fb0666 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -209,17 +209,16 @@ public class ProjectServiceImpl implements ProjectService { return new ProjectDetailResultDTO(); }*/ ProjectDetailResultDTO projectDetailResultDTO=new ProjectDetailResultDTO(); - //todo Result result=govProjectOpenFeignClient.queryProjectInfoByProjectId(processListFormDTO.getProjectId()); - if(result.success()&&null!=result.getData()){ - ProjectInfoDTO projectInfoDTO=result.getData(); - projectDetailResultDTO.setImgUrlList(projectInfoDTO.getImgUrlList()); - projectDetailResultDTO.setEventSource(projectInfoDTO.getGridName()); - projectDetailResultDTO.setEventTitle(projectInfoDTO.getEventTitle()); - projectDetailResultDTO.setEventContent(projectInfoDTO.getEventContent()); - }else{ - log.warn(String.format("项目信息查询失败,projectId:%s",processListFormDTO.getProjectId())); + if(!result.success()||null==result.getData()){ + log.warn(String.format("项目信息查询失败(该接口目前只支持e事通内的客户),projectId:%s", processListFormDTO.getProjectId())); + return projectDetailResultDTO; } + ProjectInfoDTO projectInfoDTO=result.getData(); + projectDetailResultDTO.setImgUrlList(projectInfoDTO.getImgUrlList()); + projectDetailResultDTO.setEventSource(projectInfoDTO.getGridName()); + projectDetailResultDTO.setEventTitle(projectInfoDTO.getEventTitle()); + projectDetailResultDTO.setEventContent(projectInfoDTO.getEventContent()); Result processList = govProjectOpenFeignClient.getProcessList(processListFormDTO); if (!processList.success()) { throw new RenException(ProjectConstant.PROCESS_FAILURE); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml index 10159b1a1b..4c68253adb 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml @@ -2,27 +2,18 @@ - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml index 647ff94bd4..7da320609b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml @@ -3,15 +3,19 @@ \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml index f09b5f3f51..3f43d05337 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml @@ -3,51 +3,121 @@ - SELECT max( m.DATE_ID ) AS maxDateId FROM screen_work_record_org_daily m WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID = #{customerId} + AND m.CUSTOMER_ID in + + #{customerId} + - - SELECT - IFNULL( sum( m.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal, - IFNULL( sum( m.ORGANIZE_TOTAL ), 0 ) AS participateTotal + scg.GRID_ID AS orgId, + scg.GRID_NAME AS `NAME`, + IFNULL( sum( temp.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal, + IFNULL( sum( temp.ORGANIZE_TOTAL ), 0 ) AS participateTotal FROM - screen_customer_agency sca - inner JOIN screen_work_record_org_daily m ON ( sca.AGENCY_ID = m.ORG_ID AND m.DEL_FLAG = '0' AND m.DATE_ID = #{dateId} ) - inner JOIN screen_customer_work_record_dict dict ON ( m.TYPE_CODE = dict.RESOURCE_CODE AND dict.DEL_FLAG = '0' AND dict.DATA_TYPE = #{dataType} ) + screen_customer_grid scg + left join ( + select m.* from screen_work_record_org_daily m + where m.DEL_FLAG = '0' + AND m.DATE_ID = #{dateId} + and m.TYPE_CODE in( + select distinct dict.RESOURCE_CODE + from screen_customer_work_record_dict dict + where dict.DEL_FLAG = '0' + and dict.`LEVEL`='1' + AND dict.DATA_TYPE =#{dataType} + and dict.CUSTOMER_ID=#{customerId} + ) + and org_id in + + #{gridId} + + )temp on(scg.GRID_ID = temp.ORG_ID) WHERE - sca.DEL_FLAG = '0' - AND sca.PARENT_AREA_CODE like concat( #{areaCode},'%') + scg.DEL_FLAG = '0' + AND scg.GRID_ID in + + #{gridId} + + group by scg.GRID_ID,scg.GRID_NAME + ORDER BY + participateUserTotal DESC, + participateTotal DESC + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml index 4e37ffe47e..f50a6b3e06 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml @@ -3,6 +3,65 @@ + - + \ No newline at end of file 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 index 06e501b713..e08a490372 100644 --- 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 @@ -18,5 +18,20 @@ DEL_FLAG = '0' AND ORG_ID = #{agencyId} + \ 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 index cf3b1a7631..fba3b96602 100644 --- 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 @@ -272,4 +272,51 @@ and grid.PARENT_AGENCY_ID=#{agencyId} + + + 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 index 0262675182..2d9f8e5deb 100644 --- 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 @@ -122,4 +122,19 @@ GROUP BY scg.PARENT_AGENCY_ID + \ 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 index dc1320fa4d..7f30a13cac 100644 --- 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 @@ -52,4 +52,30 @@ AND dd.EVENT_ID = #{eventId} + + + \ 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 index a1766981cc..5cd4094e36 100644 --- 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 @@ -6,6 +6,7 @@ + + + \ 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 index dedfb2d276..ec417cbf50 100644 --- 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 @@ -265,4 +265,63 @@ ${sort} LIMIT #{topNum} + + + + + 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 index bc1fa8f0aa..5d2be597be 100644 --- 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 @@ -34,4 +34,36 @@ + \ 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 index 7f4520f8ff..2a5f09786e 100644 --- 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 @@ -19,4 +19,41 @@ AND md.ORG_TYPE = CASE WHEN sca.LEVEL = 'community' THEN 'grid' ELSE 'agency' END + + \ 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 index ed4cf4c4d1..30fb7bd125 100644 --- 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 @@ -98,4 +98,37 @@ LIMIT #{topNum} + + + \ 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 index c1a5570113..6534512f8a 100644 --- 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 @@ -26,4 +26,41 @@ ORDER BY data_end_time DESC LIMIT 1 + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml new file mode 100644 index 0000000000..5816def044 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml new file mode 100644 index 0000000000..b59665f53e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml index f050e5dd1b..27d91a7f2a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml @@ -43,7 +43,7 @@ INNER JOIN screen_customer_agency a ON ( m.ORG_ID = a.AGENCY_ID AND a.DEL_FLAG = '0' ) WHERE m.DEL_FLAG = '0' - AND a.AREA_CODE LIKE concat( #{areaCode}, '%') + AND a.PARENT_AREA_CODE=#{areaCode} AND M.DATE_ID=( select t1.DATE_ID from screen_project_org_daily t1 where t1.DEL_FLAG='0' 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 index 277e6c17dc..1f3e4623c0 100644 --- 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 @@ -31,4 +31,37 @@ totalData.PROJECT_TOTAL desc + + + + + + + \ 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 index 42f6d5753c..88ea0c6d44 100644 --- 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 @@ -5,25 +5,59 @@ + + + + + + + \ 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 index 0ce20b42dd..6ba1ac05cf 100644 --- 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 @@ -141,7 +141,6 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fias.AGENCY_ID WHERE fias.del_flag = 0 - AND CHAR_LENGTH(sca.AREA_CODE) >= #{areaCodeLength} AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND fias.MONTH_ID = #{monthId} AND fias.data_type = #{dataType} @@ -167,7 +166,6 @@ WHERE fics.del_flag = '0' AND sca.level = 'district' - AND CHAR_LENGTH(sca.AREA_CODE) >= 6 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index b028814062..2ba5e4ef54 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -139,7 +139,6 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = cs.AGENCY_ID WHERE cs.del_flag = 0 - AND CHAR_LENGTH(sca.AREA_CODE) >= 12 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND cs.MONTH_ID = #{monthId} AND cs.IS_TOTAL = "0" @@ -164,7 +163,6 @@ WHERE fics.del_flag = '0' AND sca.DEL_FLAG = 0 - AND CHAR_LENGTH(sca.AREA_CODE) >= 9 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} 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 index 05f3193d0c..d5f2e9b8a0 100644 --- 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 @@ -167,7 +167,6 @@ WHERE fidc.del_flag = '0' AND fidc.IS_TOTAL = '0' - AND CHAR_LENGTH(sca.AREA_CODE) >= 6 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND fidc.month_id = #{monthId} AND fidc.index_code = #{indexCode} 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 index 51a1600474..87992f8ee7 100644 --- 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 @@ -197,7 +197,6 @@ AND sca.DEL_FLAG = 0 AND figc.month_id = #{monthId} AND figc.index_code = #{indexCode} - AND CHAR_LENGTH(sca.AREA_CODE) >= 12 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') GROUP BY figc.agency_id 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 index 7cb270630c..8f93aa364b 100644 --- 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 @@ -171,7 +171,6 @@ WHERE gm.del_flag = '0' AND gm.month_id = #{monthId} - AND CHAR_LENGTH(sca.AREA_CODE) >= 12 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') 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 index 7454e9d0cd..26974bd968 100644 --- 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 @@ -128,7 +128,6 @@ WHERE fm.del_flag = '0' AND fm.month_id = #{monthId} - AND CHAR_LENGTH(sca.AREA_CODE) >= 12 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') @@ -147,7 +146,6 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pm.AGENCY_ID WHERE pm.del_flag = '0' - AND CHAR_LENGTH(sca.AREA_CODE) >= #{areaCode} AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND pm.month_id = #{monthId} 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 index f4b85f33cc..9bf7bc2570 100644 --- 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 @@ -127,7 +127,6 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sm.AGENCY_ID WHERE sm.del_flag = '0' - AND CHAR_LENGTH(sca.AREA_CODE) >= 12 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sm.month_id = #{monthId} 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 index 31d45d2e3c..dbc3146388 100644 --- 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 @@ -377,4 +377,17 @@ WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml new file mode 100644 index 0000000000..bc84c6b2df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_category_grid_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml new file mode 100644 index 0000000000..5d8cd9a73a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_category_org_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml new file mode 100644 index 0000000000..82e0587dc5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_data + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + limit 1000 + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml new file mode 100644 index 0000000000..3604a5df25 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml index 6bf6208ce0..ace5879e53 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml @@ -121,7 +121,7 @@ LEFT JOIN screen_customer_grid cg ON cg.GRID_ID = g.GRID_ID WHERE g.DEL_FLAG = 0 AND cg.AREA_CODE LIKE CONCAT(#{a.areaCode},'%') - AND g.DATE_ID #{dateId} + AND g.DATE_ID #{dateId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml new file mode 100644 index 0000000000..8560281d3b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml new file mode 100644 index 0000000000..06023e11b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml @@ -0,0 +1,13 @@ + + + + + + + delete from screen_project_process + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + limit 1000 + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml index a1a946f7ab..70fe070738 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml @@ -123,7 +123,7 @@ LEFT JOIN screen_customer_grid cg ON cg.GRID_ID = g.GRID_ID WHERE g.DEL_FLAG = 0 AND cg.AREA_CODE LIKE CONCAT(#{a.areaCode},'%') - AND g.MONTH_ID #{monthId} + AND g.MONTH_ID #{monthId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 945fd7b0e3..bd307d1d78 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -159,11 +159,10 @@ i.GRID_ID AS "gridId" FROM issue i - INNER JOIN issue_project_relation ipr ON i.ID = ipr.ISSUE_ID + INNER JOIN issue_project_relation ipr ON (i.ID = ipr.ISSUE_ID AND ipr.DEL_FLAG = '0') WHERE i.DEL_FLAG = '0' - AND ipr.DEL_FLAG = '0' - AND CUSTOMER_ID = #{customerId} + AND i.CUSTOMER_ID = #{customerId} + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueSuggestionDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueSuggestionDao.java index a39aeef521..dadf15338c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueSuggestionDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueSuggestionDao.java @@ -23,6 +23,7 @@ import com.epmet.dto.form.UserIssueSuggestionFormDTO; import com.epmet.dto.result.IssueSuggestionResDTO; import com.epmet.entity.IssueSuggestionEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -51,4 +52,6 @@ public interface IssueSuggestionDao extends BaseDao { * @Date 2020/11/18 14:27 **/ List selectListIssueSugByIssueId(String issueId); + + IssueSuggestionEntity selectByUserIdAndIssueId(@Param("userId") String createdBy, @Param("issueId") String issueId); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java index bbf037ea80..20e2d01e6e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java @@ -121,11 +121,20 @@ public class IssueSuggestionServiceImpl extends BaseServiceImpl @@ -33,4 +34,11 @@ ORDER BY ig.CREATED_TIME DESC + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index d2a6616069..b66a9a248c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -1933,7 +1933,7 @@ public class ProjectServiceImpl extends BaseServiceImpl issueDTOResult=govIssueOpenFeignClient.queryIssueDetail(formDTO); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupCodeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupCodeServiceImpl.java index 6615ca4bb1..55a15a3a39 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupCodeServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupCodeServiceImpl.java @@ -160,7 +160,7 @@ public class ResiGroupCodeServiceImpl extends BaseServiceImpl