From 8be404bf4c2119f581f3f59052968eb75fc16ffa Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 23 Feb 2021 16:36:35 +0800 Subject: [PATCH 01/77] =?UTF-8?q?=E5=85=AC=E7=94=A8DTO=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/form/ExtractDailyFormDTO.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ExtractDailyFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ExtractDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ExtractDailyFormDTO.java new file mode 100644 index 0000000000..25d480b900 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ExtractDailyFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.screen.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/2/23 下午4:30 + */ +@Data +public class ExtractDailyFormDTO implements Serializable { + + private static final long serialVersionUID = -3379342328836218599L; + + public interface ExtractDailyForm extends CustomerClientShowGroup {} + + /** + * 日期id: yyyyMMdd + */ + private String dateId; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = { ExtractDailyForm.class }) + private String customerId; + + /** + * 当前客户所属的地区编码 + */ + private String customerAreaCode = ""; + + /** + * 当前客户下的需要汇聚的子客户列表 + * 暂不使用 + */ + private List subCustomerIds = new ArrayList<>(); +} From 2a7ed4a1aad26e138a9375f7797f4a2d1de2d6cf Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 24 Feb 2021 15:08:36 +0800 Subject: [PATCH 02/77] =?UTF-8?q?crm=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-report/data-report-server/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index d81526df81..4d702728f5 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 From 951bb3522831d8d698c2b5984b6a836838f87e2c Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Feb 2021 15:15:58 +0800 Subject: [PATCH 03/77] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E8=81=94=E5=8A=A8?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=20=E7=99=BB=E9=99=86pc=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/SsoController.java | 20 ++- .../com/epmet/dto/form/SsoLoginFormDTO.java | 26 +++- .../epmet/dto/form/SsoLoginOperFormDTO.java | 34 +++++ .../com/epmet/dto/form/ThirdPlatFormDTO.java | 57 ++++++++ .../com/epmet/enums/ThirdPlatformEnum.java | 50 +++++++ .../java/com/epmet/service/SsoService.java | 13 +- .../epmet/service/impl/SsoServiceImpl.java | 94 +++++++++++-- epmet-auth/src/main/resources/bootstrap.yml | 7 +- .../apiservice/AbstractApiService.java | 1 - .../apiservice/jcet/JcetApiService.java | 10 +- .../apiservice/pyld/PyldApiService.java | 126 ++++++++++++++++++ .../thirdplat/bean/ThirdPlatUserInfo.java | 1 + .../thirdplat/constants/PyldConstants.java | 18 +++ .../result/jcet/PyldUserInfoResultDTO.java | 18 +++ .../properties/PyldThirdplatProps.java | 14 ++ .../thirdplat/properties/ThirdplatProps.java | 8 +- .../epmet/commons/tools/enums/EnvEnum.java | 2 +- .../tools/utils/HttpClientManager.java | 9 +- 18 files changed, 477 insertions(+), 31 deletions(-) create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/ThirdPlatFormDTO.java create mode 100644 epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java create mode 100644 epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java create mode 100644 epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java create mode 100644 epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/PyldUserInfoResultDTO.java create mode 100644 epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/PyldThirdplatProps.java 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 6d17e1a9a0..283f4bab04 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java @@ -5,7 +5,9 @@ import com.epmet.commons.thirdplat.bean.ThirdPlatUserInfo; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; 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; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -28,19 +30,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.thirdLoginOper(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 b50818d3cc..e18da7fdf2 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 @@ -14,12 +14,16 @@ public class SsoLoginFormDTO implements Serializable { private static final long serialVersionUID = -6543952487970013031L; - public interface SsoLoginForm{} + public interface SsoLoginForm { + } + + public interface ThirdPlatformLoginForm { + } /** * sso票据,有效期为300秒 */ - @NotBlank(message = "sso票据不能为空",groups = SsoLoginForm.class) + @NotBlank(message = "sso票据不能为空", groups = {SsoLoginForm.class, ThirdPlatformLoginForm.class}) private String ticket; /** @@ -31,9 +35,23 @@ public class SsoLoginFormDTO implements Serializable { /** * app类型 resi;居民段,work:工作端 */ - @NotBlank(message = "app不能为空",groups = SsoLoginForm.class) + @NotBlank(message = "app不能为空", groups = SsoLoginForm.class) private String app; - @NotBlank(message = "client不能为空",groups = SsoLoginForm.class) + @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/form/SsoLoginOperFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java new file mode 100644 index 0000000000..fb960bcfce --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java @@ -0,0 +1,34 @@ +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 SsoLoginOperFormDTO extends LoginCommonFormDTO implements Serializable { + + + private static final long serialVersionUID = 8711491709544498082L; + + public interface ThirdPlatformLoginForm { + } + + /** + * 上游系统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/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/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 3cbd2b9af2..0e2537c247 100644 --- a/epmet-auth/src/main/java/com/epmet/service/SsoService.java +++ b/epmet-auth/src/main/java/com/epmet/service/SsoService.java @@ -1,7 +1,9 @@ package com.epmet.service; import com.epmet.dto.form.SsoLoginFormDTO; +import com.epmet.dto.form.SsoLoginOperFormDTO; import com.epmet.dto.result.SsoLoginResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; /** * @Author zxc @@ -10,11 +12,20 @@ import com.epmet.dto.result.SsoLoginResultDTO; public interface SsoService { /** - * @Description 0、入口:得到token + * @Description 0、入口:得到token * @Param formDTO * @author zxc * @date 2021/1/18 下午4:59 */ SsoLoginResultDTO ssoLogin(SsoLoginFormDTO formDTO); + /** + * desc: sso登陆运营端 + * + * @param formDTO + * @return com.epmet.dto.result.UserTokenResultDTO + * @author LiuJanJun + * @date 2021/2/24 1:28 下午 + */ + UserTokenResultDTO thirdLoginOper(SsoLoginOperFormDTO formDTO); } 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 ede5acd988..5607cca1b5 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 @@ -10,11 +10,13 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; import com.epmet.dto.PaCustomerDTO; import com.epmet.dto.UserDTO; -import com.epmet.dto.form.ApiServiceFormDTO; -import com.epmet.dto.form.SsoLoginFormDTO; -import com.epmet.dto.form.UserInfoFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.GovWebOperLoginResultDTO; import com.epmet.dto.result.SsoLoginResultDTO; import com.epmet.dto.result.ThirdplatApiserviceResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.enums.ThirdPlatformEnum; +import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.jwt.JwtTokenProperties; @@ -22,12 +24,14 @@ 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; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; @@ -56,8 +60,11 @@ public class SsoServiceImpl implements SsoService { @Autowired private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + /** - * @Description 0、入口:得到token + * @Description 0、入口:得到token * @Param formDTO * @author zxc * @date 2021/1/18 下午4:59 @@ -104,18 +111,60 @@ 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 thirdLoginOper(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 (Exception e) { + throw new RenException(e.getMessage()); + } + //获取用户信息 + 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); + return userTokenResultDTO; + } + /** - * @Description token放缓存 + * @Description token放缓存 * @Param formDTO * @Param userId * @Param token @@ -123,12 +172,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()); @@ -145,7 +194,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); @@ -182,4 +231,25 @@ public class SsoServiceImpl implements SsoService { log.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->" + customer); return customer.getId(); } + + 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..ee148fb8e0 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java @@ -0,0 +1,126 @@ +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; + +@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); + + try { + 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; + } catch (Exception e) { + logger.error("getUserInfoByTicket exception", e); + } + return null; + } + + + /** + * 构建请求头信息 + * + * @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(), + EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(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..1844b2e66d --- /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 = "用户未登陆"; +} 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/enums/EnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java index d0df724665..8cbf23061d 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 @@ -33,7 +33,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; } } 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)) { From e267762ee496930d7bf97f9fd18c59fb1a6887b0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Feb 2021 15:40:31 +0800 Subject: [PATCH 04/77] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/SsoLoginFormDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0201ff38d5..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, ThirdPlatformLoginForm.class}) + @NotBlank(message = "sso票据不能为空", groups = {SsoLoginForm.class}) private String ticket; /** From 293dbe25c55922b852f01bb5798b7732494b665f Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Feb 2021 15:40:57 +0800 Subject: [PATCH 05/77] =?UTF-8?q?=E3=80=90=E4=BA=8B=E4=BB=B6=E5=88=86?= =?UTF-8?q?=E6=9E=90=E3=80=91=E7=B1=BB=E5=9E=8B=E5=88=86=E6=9E=90=20?= =?UTF-8?q?=E3=80=90=E4=BA=8B=E4=BB=B6/=E9=A1=B9=E7=9B=AE=E5=88=86?= =?UTF-8?q?=E6=9E=90=E3=80=91=E6=8C=89=E7=B1=BB=E5=88=AB=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScreenProjectCategoryGridDailyDTO.java | 142 +++++++++++++++++ .../dto/ScreenProjectCategoryOrgDailyDTO.java | 147 +++++++++++++++++ .../form/screen/CategoryAnalysisFormDTO.java | 21 +++ .../screen/CategoryAnalysisResultDTO.java | 26 +++ .../screen/ScreenProjectController.java | 24 ++- .../ScreenProjectCategoryOrgDailyDao.java | 42 +++++ .../screen/ScreenProjectService.java | 14 ++ .../screen/impl/ScreenProjectServiceImpl.java | 22 +++ .../ScreenProjectCategoryOrgDailyDao.xml | 16 ++ .../ScreenProjectCategoryGridDailyDTO.java | 144 +++++++++++++++++ .../ScreenProjectCategoryOrgDailyDTO.java | 149 ++++++++++++++++++ .../ScreenProjectDataCollController.java | 40 ++++- .../ScreenProjectCategoryGridDailyDao.java | 42 +++++ .../ScreenProjectCategoryOrgDailyDao.java | 42 +++++ .../ScreenProjectCategoryGridDailyEntity.java | 114 ++++++++++++++ .../ScreenProjectCategoryOrgDailyEntity.java | 119 ++++++++++++++ ...ScreenProjectCategoryGridDailyService.java | 106 +++++++++++++ .../ScreenProjectCategoryOrgDailyService.java | 106 +++++++++++++ ...enProjectCategoryGridDailyServiceImpl.java | 134 ++++++++++++++++ ...eenProjectCategoryOrgDailyServiceImpl.java | 135 ++++++++++++++++ .../ScreenProjectCategoryGridDailyDao.xml | 37 +++++ .../ScreenProjectCategoryOrgDailyDao.xml | 37 +++++ 22 files changed, 1653 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml 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-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..8d00c29f2f 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 @@ -3,13 +3,14 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.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 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; /** * 项目 @@ -36,4 +37,19 @@ public class ScreenProjectController { return new Result().ok(screenProjectService.projectDetail(projectDetailFormDTO)); } + /** + * 【事件分析】类型分析 + * @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) { + ValidatorUtils.validateEntity(formDTO, CategoryAnalysisFormDTO.CategoryAnalysis.class); + return new Result>().ok(screenProjectService.categoryAnalysis(customerId, formDTO)); + } + } 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..3d00e19932 --- /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, @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/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..aa39e9345a 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,12 @@ package com.epmet.datareport.service.evaluationindex.screen; +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 +23,14 @@ 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); + } 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..63111dd7f0 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,15 +1,20 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.utils.DateUtils; 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.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.result.ProjectDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.List; /** @@ -26,6 +31,8 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { private ScreenEventDataDao screenEventDataDao; @Autowired private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; /** * @Description 3、项目详情 @@ -44,4 +51,19 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { projectDetailResultDTO.setImgList(imgList); return projectDetailResultDTO; } + + /** + * 【事件分析】类型分析 + * + * @param customerId + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/2/23 15:37 + */ + @Override + public List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO) { + String dateId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId(), dateId); + } } \ No newline at end of file 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..06f7919bd1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java new file mode 100644 index 0000000000..50afc350ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java @@ -0,0 +1,144 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 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 String epmetCategoryName; + + /** + * 该分类下所有项目总数 + */ + 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-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java new file mode 100644 index 0000000000..49c85be67e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 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 String epmetCategoryName; + + /** + * 该分类下所有项目总数 + */ + 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-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java index 2efc866c87..ce5b55a305 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -33,6 +33,10 @@ public class ScreenProjectDataCollController { private ScreenProjectQuantityGridMonthlyService projectQuantityGridMonthlyService; @Autowired private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; + @Autowired + private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; + @Autowired + private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; /** * @author wangc @@ -86,7 +90,39 @@ public class ScreenProjectDataCollController { return new Result(); } - //todo 【事件/项目分析】按类别统计-网格 - //todo 【事件/项目分析】按类别统计-组织 + /** + *【事件/项目分析】按类别统计-网格 + * + * @author zhaoqifeng + * @date 2021/2/24 10:11 + * @param customerId + * @param param + * @return com.epmet.commons.tools.utils.Result + */ + @RequestMapping("category-grid-daily") + public Result categoryGridDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectCategoryGridDailyService.collect(customerId, param); + return new Result(); + } + + /** + * 【事件/项目分析】按类别统计-组织 + * @author zhaoqifeng + * @date 2021/2/24 10:13 + * @param customerId + * @param param + * @return com.epmet.commons.tools.utils.Result + */ + @RequestMapping("category-org-daily") + public Result categoryOrgDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectCategoryOrgDailyService.collect(customerId, param); + return new Result(); + } //上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算 } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java new file mode 100644 index 0000000000..5b96c10067 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectCategoryGridDailyDao extends BaseDao { + /** + * 按客户日期删除数据 + * @author zhaoqifeng + * @date 2021/2/24 10:27 + * @param customerId + * @param dateId + * @return int + */ + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java new file mode 100644 index 0000000000..c87d8bec0f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/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.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectCategoryOrgDailyDao extends BaseDao { + /** + * 按客户日期删除数据 + * @author zhaoqifeng + * @date 2021/2/24 10:27 + * @param customerId + * @param dateId + * @return int + */ + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java new file mode 100644 index 0000000000..ef91f696c2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_category_grid_daily") +public class ScreenProjectCategoryGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户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 String epmetCategoryName; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java new file mode 100644 index 0000000000..1ac6c76145 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_category_org_daily") +public class ScreenProjectCategoryOrgDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户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 String epmetCategoryName; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java new file mode 100644 index 0000000000..5306e7f73b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectCategoryGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectCategoryGridDailyDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectCategoryGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectCategoryGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectCategoryGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + /** + * 【事件/项目分析】按类别统计-网格 + * @author zhaoqifeng + * @date 2021/2/24 10:16 + * @param customerId + * @param param + * @return void + */ + void collect(String customerId, ScreenCollFormDTO param); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java new file mode 100644 index 0000000000..005232d59a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectCategoryOrgDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectCategoryOrgDailyDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectCategoryOrgDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectCategoryOrgDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectCategoryOrgDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + /** + * 【事件/项目分析】按类别统计-组织 + * @author zhaoqifeng + * @date 2021/2/24 10:17 + * @param customerId + * @param param + * @return void + */ + void collect(String customerId, ScreenCollFormDTO param); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java new file mode 100644 index 0000000000..70ce72a036 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.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.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao; +import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryGridDailyService; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl implements ScreenProjectCategoryGridDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectCategoryGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectCategoryGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectCategoryGridDailyDTO get(String id) { + ScreenProjectCategoryGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectCategoryGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectCategoryGridDailyDTO dto) { + ScreenProjectCategoryGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectCategoryGridDailyDTO dto) { + ScreenProjectCategoryGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 【事件/项目分析】按类别统计-网格 + * + * @param customerId + * @param param + * @return void + * @author zhaoqifeng + * @date 2021/2/24 10:16 + */ + @Override + public void collect(String customerId, ScreenCollFormDTO param) { + if(param.getIsFirst()){ + int deleteNum; + do { + deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(param.getDataList())) { + param.getDataList().forEach(item -> { + item.setCustomerId(customerId); + item.setDateId(param.getDateId()); + }); + insertBatch(ConvertUtils.sourceToTarget(param.getDataList(), ScreenProjectCategoryGridDailyEntity.class)); + } + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java new file mode 100644 index 0000000000..290b30cf74 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.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.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; +import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryOrgDailyService; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl implements ScreenProjectCategoryOrgDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectCategoryOrgDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectCategoryOrgDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectCategoryOrgDailyDTO get(String id) { + ScreenProjectCategoryOrgDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectCategoryOrgDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectCategoryOrgDailyDTO dto) { + ScreenProjectCategoryOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryOrgDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectCategoryOrgDailyDTO dto) { + ScreenProjectCategoryOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryOrgDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 【事件/项目分析】按类别统计-组织 + * + * @param customerId + * @param param + * @return void + * @author zhaoqifeng + * @date 2021/2/24 10:17 + */ + @Override + public void collect(String customerId, ScreenCollFormDTO param) { + if(param.getIsFirst()){ + int deleteNum; + do { + deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(param.getDataList())) { + param.getDataList().forEach(item -> { + item.setCustomerId(customerId); + item.setDateId(param.getDateId()); + }); + Lists.partition(param.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + insertBatch(ConvertUtils.sourceToTarget(list, ScreenProjectCategoryOrgDailyEntity.class)); + }); + } + } + +} \ No newline at end of file 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 From d7dfd41f5f6f8ed7a4ffc123804689242d8c942e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 24 Feb 2021 15:41:36 +0800 Subject: [PATCH 06/77] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=83=85=E5=86=B5-=E5=B9=B4=E9=BE=84=E5=88=86=E5=B8=83=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/GrassrootsPartyDevController.java | 9 +++------ .../screen/ScreenCpcBaseDataDao.java | 1 + .../screen/GrassrootsPartyDevService.java | 2 +- .../impl/GrassrootsPartyDevServiceImpl.java | 18 ++++++++++++++++-- .../mapper/screen/ScreenCpcBaseDataDao.xml | 15 +++++++++++++++ 5 files changed, 36 insertions(+), 9 deletions(-) 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..cc19d4cbb8 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 @@ -11,10 +11,7 @@ import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 基层党建相关各指标查询 @@ -52,9 +49,9 @@ 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){ 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/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/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/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..30e3d5d32e 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,6 +2,8 @@ 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; @@ -13,6 +15,7 @@ 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,6 +48,8 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private ScreenPartyBranchDataDao screenPartyBranchDataDao; @Autowired private DateUtils dateUtils; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; /** * @Description 1、党员基本情况-饼状图概况 @@ -85,8 +90,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(); } 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 From b1f02ebcd17e8b7cf3347ac48c387ca87c07bd99 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 24 Feb 2021 16:23:42 +0800 Subject: [PATCH 07/77] =?UTF-8?q?6=E3=80=81=E3=80=90=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E3=80=91=E8=BF=9112=E6=9C=88=E8=B6=8B?= =?UTF-8?q?=E5=8A=BF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/form/WorkRecordTrendFormDTO.java | 46 +++++++++++ .../result/WorkRecordTrendResultDTO.java | 56 ++++++++++++++ .../plugins/WorkRecordController.java | 14 +++- .../ScreenCustomerWorkRecordDictDao.java | 6 +- .../ScreenWorkRecordOrgMonthlyDao.java | 11 ++- .../ScreenWorkRecordOrgDailyService.java | 8 ++ .../ScreenWorkRecordOrgDailyServiceImpl.java | 76 ++++++++++++++++++- .../ScreenCustomerWorkRecordDictDao.xml | 33 +++----- .../plugins/ScreenWorkRecordOrgMonthlyDao.xml | 32 +++++++- 9 files changed, 253 insertions(+), 29 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java 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..448a32636c --- /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:联建共建;党员志愿服务:voluntaryservice") + 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/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..b456eb5326 --- /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.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +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; + /** + * 资源标签名 + * ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀'] + */ + private List legend; + + /** + *各项资源对应数据对象 + */ + private List series; + + @Data + public static class SeriesResultDTO { + /** + * 资源标签名 + * ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀'] + */ + private String name; + /** + * 各项资源对应12月份数据 + */ + private List data; + /** + * 数据对应的月份Id + */ + @JsonIgnore + private String monthId; + /** + * 各项资源对应某一月份数据 + */ + @JsonIgnore + private Integer value; + } + +} 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..592ea4ebc2 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 @@ -4,7 +4,9 @@ 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.WorkRecordRankFormDTO; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; import com.epmet.plugins.result.WorkRecordRankResultDTO; +import com.epmet.plugins.result.WorkRecordTrendResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -15,7 +17,7 @@ import org.springframework.web.bind.annotation.*; * @date 2021/2/21 19:51 */ @RestController -@RequestMapping("plugins/workrecord") +@RequestMapping("screen/plugins/workrecord") public class WorkRecordController { @Autowired private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService; @@ -37,4 +39,14 @@ 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)); + } } 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/ScreenWorkRecordOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java index 5146beb59e..6514c58fbf 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,8 +19,12 @@ 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.WorkRecordTrendResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 工作日志-组织按月统计(增量) * @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao { - + + /** + * @Description 按组织查询某项数据近12月趋势图 + * @author sun + */ + List selectMonthList(WorkRecordTrendFormDTO formDTO); } \ No newline at end of file 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..df795a2065 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 @@ -22,7 +22,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity; import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO; import com.epmet.plugins.form.WorkRecordRankFormDTO; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; import com.epmet.plugins.result.WorkRecordRankResultDTO; +import com.epmet.plugins.result.WorkRecordTrendResultDTO; import java.util.List; import java.util.Map; @@ -96,4 +98,10 @@ public interface ScreenWorkRecordOrgDailyService extends BaseService implements ScreenWorkRecordOrgDailyService { @Autowired private AgencyService agencyService; + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenCustomerWorkRecordDictDao screenCustomerWorkRecordDictDao; + @Autowired + private ScreenWorkRecordOrgMonthlyDao screenWorkRecordOrgMonthlyDao; @Override public PageData page(Map params) { @@ -128,4 +143,57 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl map = dateUtils.getXpro(); + resultDTO.setXAxis(map.values().stream().collect(Collectors.toList())); + List monthIdList = map.keySet().stream().collect(Collectors.toList()); + + //2.根据资源编码查询资源名称集合,按sort升序 + List legendList = screenCustomerWorkRecordDictDao.selectListByDataType(formDTO.getCustomerId(), formDTO.getDataType()); + resultDTO.setLegend(legendList); + if (null == legendList || legendList.size() < NumConstant.ONE) { + return resultDTO; + } + + //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; + } + } \ No newline at end of file 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..d6379ed76d 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 @@ -3,26 +3,17 @@ - - - - - - - - - - - - - - - - - - - - - + \ 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..8902fda9f0 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,36 @@ - + \ No newline at end of file From 7b30c2c7ae12b05e6af94bf1cdd2dd23653272f0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Feb 2021 16:43:42 +0800 Subject: [PATCH 08/77] =?UTF-8?q?=E6=8A=9B=E5=87=BA=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/SsoServiceImpl.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 681f2f77dd..fc45907a5c 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 @@ -14,13 +14,6 @@ import com.epmet.commons.tools.utils.*; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.dto.PaCustomerDTO; -import com.epmet.dto.UserDTO; -import com.epmet.dto.form.*; -import com.epmet.dto.result.GovWebOperLoginResultDTO; -import com.epmet.dto.result.SsoLoginResultDTO; -import com.epmet.dto.result.ThirdplatApiserviceResultDTO; -import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.enums.ThirdPlatformEnum; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -146,6 +139,8 @@ public class SsoServiceImpl implements SsoService { 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()); } From 3f90ce6e85b6668141f2bf4243d2e85df52f9c3d Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Feb 2021 17:03:57 +0800 Subject: [PATCH 09/77] =?UTF-8?q?=E6=8A=9B=E5=87=BA=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/SsoServiceImpl.java | 4 ++ .../apiservice/pyld/PyldApiService.java | 49 +++++++++---------- 2 files changed, 27 insertions(+), 26 deletions(-) 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 fc45907a5c..282108736d 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; @@ -144,6 +145,9 @@ public class SsoServiceImpl implements SsoService { } 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()); 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 index ee148fb8e0..c5bc39b88c 100644 --- 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 @@ -46,32 +46,29 @@ public class PyldApiService extends AbstractApiService { logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口入参 platformToken:{}", platformToken); - try { - 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; - } catch (Exception e) { - logger.error("getUserInfoByTicket exception", e); - } - return null; + + 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; + } From 39a40e6b1f6e1f6a41e378810d0a2f0b3ba1fba0 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 24 Feb 2021 17:22:40 +0800 Subject: [PATCH 10/77] =?UTF-8?q?=E5=85=88=E9=94=8B=E6=A8=A1=E8=8C=83?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/FineExampleFormDTO.java | 3 ++ .../screen/PartyMemberLeadController.java | 7 +-- .../screen/ScreenPioneerDataDao.java | 13 +++++ .../impl/PartyMemberLeadServiceImpl.java | 47 ++++++++++++++----- .../mapper/screen/ScreenPioneerDataDao.xml | 35 ++++++++++++++ 5 files changed, 89 insertions(+), 16 deletions(-) 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..938c15bdf4 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; /** @@ -21,4 +22,6 @@ public class FineExampleFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {FineExample.class}) private String agencyId; + + private String customerId; } 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..9a0d67f2b2 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; @@ -33,7 +30,7 @@ public class PartyMemberLeadController { * @date 2020/8/20 1:56 下午 */ @PostMapping("fineexample") - public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ + public Result fineExample(@RequestHeader("CustomerId") String customerId, @RequestBody FineExampleFormDTO fineExampleFormDTO){ ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); return new Result().ok(partyMemberLeadService.fineExample(fineExampleFormDTO)); } 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/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..2de292f6ea 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 @@ -2,18 +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.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.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,7 +52,10 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { private DateUtils dateUtils; @Autowired private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; - + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; /** * @Description 1、先锋模范 * @param fineExampleFormDTO @@ -58,17 +65,35 @@ 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(); + String customerId = fineExampleFormDTO.getCustomerId(); + String areaCode = null; + if(StringUtils.isBlank(customerId)){ + ScreenCustomerAgencyDTO agencyInfo = customerAgencyDao.selectByAgencyId(fineExampleFormDTO.getAgencyId()); + if(null == agencyInfo) throw new RenException("未找到对应的机关"); + customerId = agencyInfo.getCustomerId(); + areaCode = agencyInfo.getAreaCode(); } - 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; + Result> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); + if(null == crmResponse || !crmResponse.success()){ + throw new RenException("获取子客户列表失败"); + } + List 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; } /** 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..afbddb095b 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,39 @@ ORDER BY data_end_time DESC LIMIT 1 + + + + + + From c54fcacde80e90d9499446d0390c77c70d82c5b8 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 24 Feb 2021 17:29:22 +0800 Subject: [PATCH 11/77] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/result/WorkRecordTrendResultDTO.java | 10 +++++----- .../impl/ScreenWorkRecordOrgDailyServiceImpl.java | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) 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 index b456eb5326..eb5df34e99 100644 --- 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 @@ -1,10 +1,10 @@ package com.epmet.plugins.result; import com.fasterxml.jackson.annotation.JsonIgnore; -import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -18,17 +18,17 @@ public class WorkRecordTrendResultDTO implements Serializable { * 横轴 过去十二个月份 * ['1月', '2月', '3月', '4月', '5月','6月','7月','8月','9月','10月','11月','12月'] */ - private List xAxis; + private List xAxis = new ArrayList<>(); /** * 资源标签名 * ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀'] */ - private List legend; + private List legend = new ArrayList<>(); /** *各项资源对应数据对象 */ - private List series; + private List series = new ArrayList<>(); @Data public static class SeriesResultDTO { @@ -40,7 +40,7 @@ public class WorkRecordTrendResultDTO implements Serializable { /** * 各项资源对应12月份数据 */ - private List data; + private List data = new ArrayList<>(); /** * 数据对应的月份Id */ 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 635a03a5df..0d662c87e1 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 @@ -152,18 +152,19 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl map = dateUtils.getXpro(); - resultDTO.setXAxis(map.values().stream().collect(Collectors.toList())); - List monthIdList = map.keySet().stream().collect(Collectors.toList()); - //2.根据资源编码查询资源名称集合,按sort升序 + //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(); From 1f072c3e84fc911c1fd994fe7075ca62bc5d3380 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Wed, 24 Feb 2021 18:02:37 +0800 Subject: [PATCH 12/77] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=EF=BC=8C=E5=92=8C=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/ScreenProjectDetailFormDTO.java | 19 ++ .../ScreenProjectDistributionFormDTO.java | 21 ++ .../result/ScreenProjectDetailResultDTO.java | 124 ++++++++++ .../ScreenProjectDistributionResultDTO.java | 32 +++ .../screen/ScreenProjectController.java | 23 ++ .../screen/ScreenProjectDataDao.java | 24 ++ .../screen/ScreenProjectService.java | 6 + .../screen/impl/ScreenProjectServiceImpl.java | 49 +++- .../mapper/screen/ScreenProjectDataDao.xml | 87 +++++++ .../dto/screen/ScreenProjectDataDTO.java | 172 ++++++++++++++ .../dto/screen/ScreenProjectImgDataDTO.java | 91 +++++++ .../ScreenProjectProcessAttachmentDTO.java | 136 +++++++++++ .../dto/screen/ScreenProjectProcessDTO.java | 146 ++++++++++++ .../form/ScreenProjectDataInfoFormDTO.java | 112 +++++++++ .../form/ScreenProjectProcessFormDTO.java | 20 ++ .../ScreenProjectDataCollController.java | 37 +++ .../screen/ScreenProjectDataDao.java | 39 +++ .../screen/ScreenProjectImgDataDao.java | 33 +++ .../ScreenProjectProcessAttachmentDao.java | 33 +++ .../screen/ScreenProjectProcessDao.java | 35 +++ .../screen/ScreenProjectDataEntity.java | 142 +++++++++++ .../screen/ScreenProjectImgDataEntity.java | 61 +++++ .../ScreenProjectProcessAttachmentEntity.java | 106 +++++++++ .../screen/ScreenProjectProcessEntity.java | 110 +++++++++ .../screen/ScreenProjectDataService.java | 99 ++++++++ .../screen/ScreenProjectImgDataService.java | 96 ++++++++ ...ScreenProjectProcessAttachmentService.java | 95 ++++++++ .../screen/ScreenProjectProcessService.java | 99 ++++++++ .../impl/ScreenProjectDataServiceImpl.java | 222 ++++++++++++++++++ .../impl/ScreenProjectImgDataServiceImpl.java | 99 ++++++++ ...enProjectProcessAttachmentServiceImpl.java | 98 ++++++++ .../impl/ScreenProjectProcessServiceImpl.java | 156 ++++++++++++ .../screen/ScreenProjectDataDao.xml | 43 ++++ .../screen/ScreenProjectImgDataDao.xml | 21 ++ .../ScreenProjectProcessAttachmentDao.xml | 30 +++ .../screen/ScreenProjectProcessDao.xml | 13 + 36 files changed, 2728 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml 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/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-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 8d00c29f2f..6462fa61ec 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 @@ -3,10 +3,14 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.evaluationindex.screen.dto.form.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 oracle.jdbc.proxy.annotation.Post; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -37,6 +41,25 @@ 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("projectdetail") + public Result projectDetail(@RequestBody ScreenProjectDetailFormDTO formDTO){ + return screenProjectService.projectDistributionDetail(formDTO); + } /** * 【事件分析】类型分析 * @author zhaoqifeng 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/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 aa39e9345a..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,5 +1,8 @@ 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; @@ -33,4 +36,7 @@ public interface ScreenProjectService { */ 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/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index 63111dd7f0..780df28bd5 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,16 +1,23 @@ 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.commons.tools.utils.DateUtils; 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.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; 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; @@ -31,6 +38,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { private ScreenEventDataDao screenEventDataDao; @Autowired private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenProjectDataDao screenProjectDataDao; + @Autowired private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; @@ -52,6 +62,43 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { return projectDetailResultDTO; } + /** + * @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); + } + /** * 【事件分析】类型分析 * @@ -66,4 +113,4 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { String dateId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId(), dateId); } -} \ 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..ddf23a8bb0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java new file mode 100644 index 0000000000..b638f53197 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -0,0 +1,172 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 事件名称 + */ + private String projectTitle; + + /** + * 事件时间 + */ + private Date projectCreateTime; + + /** + * 上报人 + */ + private String linkName; + + /** + * 电话 + */ + private String linkMobile; + + /** + * 事件描述 + */ + private String projectContent; + + /** + * 事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + */ + private Integer projectLevel; + + /** + * 事件地址 + */ + private String projectAddress; + + /** + * 所有分类名,用 - 连接 + */ + private String allCategoryName; + + /** + * 事件所在经度 + */ + private BigDecimal longitude; + + /** + * 事件所在维度 + */ + private BigDecimal latitude; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 事件状态key pending:处理中 已结案:closed_case ;已关闭:closed + */ + private String projectStatusCode; + + /** + * 结案日期 + */ + private String closeCaseTime; + + /** + * 数据更新至: yyyy|yyyMM|yyyyMMdd + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java new file mode 100644 index 0000000000..b175d7a41d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectImgDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 图片图片地址 + */ + private String projectImgUrl; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java new file mode 100644 index 0000000000..7655456484 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectProcessAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 附件id + */ + private String attachmentId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表ID + */ + private String processId; + + /** + * 文件所属位置(内部备注: internal 公开答复:public) + */ + private String filePlace; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV) + */ + private String attachmentFormat; + + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * url地址 + */ + private String attachmentUrl; + + /** + * 排序(需求确定,按上传顺序排序) + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java new file mode 100644 index 0000000000..efb46d4387 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectProcessDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 处理进展id + */ + private String processId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 被流转的部门名称 + */ + private String transferDeptName; + + /** + * 被流转的部门名称 + */ + private String transferDeptIds; + + /** + * 处理者名称 + */ + private String handlerName; + + /** + * 处理者类型 未知unknown,机关agency,部门department,网格grid + */ + private String handlerType; + + /** + * 处理者ID + */ + private String handlerId; + + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 回应 response,结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 处理时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date processTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 数据截止日期 + */ + private String DataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java new file mode 100644 index 0000000000..2365ec57f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java @@ -0,0 +1,112 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/23 17:30 + */ +@Data +public class ScreenProjectDataInfoFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 事件名称 + */ + private String projectTitle; + + /** + * 事件时间 + */ + private String projectCreateTime; + + /** + * 上报人 + */ + private String linkName; + + /** + * 电话 + */ + private String linkMobile; + + /** + * 事件描述 + */ + private String projectContent; + + /** + * 事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + */ + private Integer projectLevel; + + /** + * 事件地址 + */ + private String projectAddress; + + /** + * 所有分类名,用 - 连接 + */ + private String allCategoryName; + + /** + * 事件所在经度 + */ + private BigDecimal longitude; + + /** + * 事件所在维度 + */ + private BigDecimal latitude; + + /** + * 事件状态key pending:处理中 已结案:closed_case ;已关闭:closed + */ + private String projectStatusCode; + + /** + * 结案日期 + */ + private String closeCaseTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 议题图片地址 + */ + private String[] projectImgUrl; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java new file mode 100644 index 0000000000..e8a72eadbd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.screen.form; + +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 14:06 + */ +@Data +public class ScreenProjectProcessFormDTO extends ScreenProjectProcessDTO implements Serializable{ + private static final long serialVersionUID = 1L; + + private List attachments; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java index ce5b55a305..cfb2a30536 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -3,6 +3,8 @@ package com.epmet.controller; import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screen.*; +import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; +import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.service.evaluationindex.screen.*; import lombok.extern.slf4j.Slf4j; @@ -37,6 +39,10 @@ public class ScreenProjectDataCollController { private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; @Autowired private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; + @Autowired + private ScreenProjectDataService projectDataService; + @Autowired + private ScreenProjectProcessService projectProcessService; /** * @author wangc @@ -125,4 +131,35 @@ public class ScreenProjectDataCollController { return new Result(); } //上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算 + + /** + * @Description 项目信息上报 + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/23 17:25 + */ + @RequestMapping("uploadprojectinfo") + public Result uploadProjectInfo(@RequestHeader("CustomerId") String customerId,@RequestBody ScreenCollFormDTO param){ + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectDataService.collect(customerId,param); + return new Result(); + } + + /** + * @Description 项目处理进展上报 + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/23 17:25 + */ + @RequestMapping("uploadprojectprocess") + public Result uploadProjectProcess(@RequestHeader("CustomerId") String customerId,@RequestBody ScreenCollFormDTO param){ + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectProcessService.collect(customerId,param); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java new file mode 100644 index 0000000000..b1cea20772 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectDataDao extends BaseDao { + + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java new file mode 100644 index 0000000000..2c4039af04 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectImgDataDao extends BaseDao { + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java new file mode 100644 index 0000000000..d4650815f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectProcessAttachmentDao extends BaseDao { + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java new file mode 100644 index 0000000000..4ad6a11e69 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectProcessDao extends BaseDao { + + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java new file mode 100644 index 0000000000..f58769cfe1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_data") +public class ScreenProjectDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 事件名称 + */ + private String projectTitle; + + /** + * 事件时间 + */ + private String projectCreateTime; + + /** + * 上报人 + */ + private String linkName; + + /** + * 电话 + */ + private String linkMobile; + + /** + * 事件描述 + */ + private String projectContent; + + /** + * 事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + */ + private Integer projectLevel; + + /** + * 事件地址 + */ + private String projectAddress; + + /** + * 所有分类名,用 - 连接 + */ + private String allCategoryName; + + /** + * 事件所在经度 + */ + private BigDecimal longitude; + + /** + * 事件所在维度 + */ + private BigDecimal latitude; + + /** + * 事件状态key + */ + private String projectStatusCode; + + /** + * 结案日期 + */ + private String closeCaseTime; + + /** + * 数据更新至: yyyy|yyyMM|yyyyMMdd + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java new file mode 100644 index 0000000000..dba5258e51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_img_data") +public class ScreenProjectImgDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 图片图片地址 + */ + private String projectImgUrl; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java new file mode 100644 index 0000000000..41e9313679 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_process_attachment") +public class ScreenProjectProcessAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 附件id + */ + private String attachmentId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表ID + */ + private String processId; + + /** + * 文件所属位置(内部备注: internal 公开答复:public) + */ + private String filePlace; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV) + */ + private String attachmentFormat; + + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * url地址 + */ + private String attachmentUrl; + + /** + * 排序(需求确定,按上传顺序排序) + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java new file mode 100644 index 0000000000..e8b3fbb134 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_process") +public class ScreenProjectProcessEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 处理进展id + */ + private String processId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 被流转的部门名称 + */ + private String transferDeptName; + + /** + * 被流转的部门名称 + */ + private String transferDeptIds; + + /** + * 处理者名称 + */ + private String handlerName; + + /** + * 处理者类型 未知unknown,机关agency,部门department,网格grid + */ + private String handlerType; + + /** + * 处理者ID + */ + private String handlerId; + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 回应 response,结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 处理时间 + */ + private Date processTime; + + /** + * 数据截止日期 + */ + private String DataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java new file mode 100644 index 0000000000..82d296a1a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectDataDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + void collect(String customerId, ScreenCollFormDTO param); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java new file mode 100644 index 0000000000..eba2c666d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectImgDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectImgDataDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectImgDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectImgDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectImgDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java new file mode 100644 index 0000000000..de086e33a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectProcessAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectProcessAttachmentDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectProcessAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectProcessAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectProcessAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java new file mode 100644 index 0000000000..f4b050fe13 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; + +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectProcessService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectProcessDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectProcessDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectProcessDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectProcessDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + void collect(String customerId, ScreenCollFormDTO param); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java new file mode 100644 index 0000000000..b826fd1f6e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -0,0 +1,222 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.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.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.*; +import com.epmet.service.evaluationindex.screen.*; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.ArrayUtils; +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 javax.annotation.Resource; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +public class ScreenProjectDataServiceImpl extends BaseServiceImpl implements ScreenProjectDataService { + + @Resource + private ScreenProjectImgDataDao screenProjectImgDataDao; + @Resource + private ScreenCustomerAgencyDao agencyDao; + @Resource + private ScreenCustomerDeptDao deptDao; + @Resource + private ScreenCustomerGridDao gridDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectDataDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectDataDTO get(String id) { + ScreenProjectDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectDataDTO dto) { + ScreenProjectDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectDataDTO dto) { + ScreenProjectDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectDataEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public void collect(String customerId, ScreenCollFormDTO param) { + if (param.getIsFirst()) { + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + } + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date today = new Date(); + param.getDataList().forEach(item -> { + String projectStatusCode = item.getProjectStatusCode(); + + //todo 动态获取超时时间 + //如果结案 结案时间立项时间; + if ("closed_case".equals(projectStatusCode)) { + try { + Date createTime = sdf.parse(item.getProjectCreateTime()); + Date closeCaseTime = sdf.parse(item.getCloseCaseTime()); + + if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) { + //如果结案时间-立项时间小于等于4天 未超期 level3 + item.setProjectLevel(3); + } else if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) { + //如果结案时间-立项时间大于4天小于5天 即将超期 level2 + item.setProjectLevel(2); + } else { + //大于5天 已超期 level1 + item.setProjectLevel(1); + } + } catch (ParseException e) { + e.printStackTrace(); + } + } else if ("pending".equals(projectStatusCode)) { + //如果处理中 当前时间-立项时间; + try { + Date createTime = sdf.parse(item.getProjectCreateTime()); + + if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) { + //如果当前时间-立项时间小于等于4天 未超期 level3 + item.setProjectLevel(3); + } else if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) { + //如果当前时间-立项时间大于4天小于5天 即将超期 level2 + item.setProjectLevel(2); + } else { + //大于5天 已超期 level1 + item.setProjectLevel(1); + } + } catch (ParseException e) { + e.printStackTrace(); + } + } + //先删除该projectId对应的旧数据 + QueryWrapper deleteWrapper = new QueryWrapper<>(); + deleteWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId); + baseDao.delete(deleteWrapper); + QueryWrapper screenProjectImgDataEntityQueryWrapper = new QueryWrapper<>(); + screenProjectImgDataEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId); + screenProjectImgDataDao.delete(screenProjectImgDataEntityQueryWrapper); + + //如果orgType未知,获取一下 +// if ("unknown".equals(item.getOrgType())){ +// ScreenCustomerAgencyEntity screenCustomerAgencyEntity = agencyDao.selectById(item.getOrgId()); +// if (screenCustomerAgencyEntity != null){ +// item.setOrgType("agency"); +// }else { +// ScreenCustomerDeptEntity screenCustomerDeptEntity = deptDao.selectById(item.getOrgId()); +// if (screenCustomerDeptEntity!=null){ +// item.setOrgType("department"); +// }else { +// ScreenCustomerGridEntity screenCustomerGridEntity = gridDao.selectById(item.getOrgId()); +// if (screenCustomerGridEntity != null){ +// item.setOrgType("grid"); +// } +// } +// } +// } + + //插入项目表 + ScreenProjectDataEntity screenProjectDataEntity = ConvertUtils.sourceToTarget(item, ScreenProjectDataEntity.class); + screenProjectDataEntity.setCustomerId(customerId); + screenProjectDataEntity.setDataEndTime(param.getDateId()); + baseDao.insert(screenProjectDataEntity); + //插入图片表 + String[] projectImgUrl = item.getProjectImgUrl(); + if (ArrayUtils.isNotEmpty(projectImgUrl)) { + for (int i = 0; i < projectImgUrl.length; i++) { + ScreenProjectImgDataEntity screenProjectImgDataEntity = new ScreenProjectImgDataEntity(); + screenProjectImgDataEntity.setCustomerId(customerId); + screenProjectImgDataEntity.setProjectId(item.getProjectId()); + screenProjectImgDataEntity.setProjectImgUrl(projectImgUrl[i]); + screenProjectImgDataEntity.setSort(i); + screenProjectImgDataDao.insert(screenProjectImgDataEntity); + } + } + }); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java new file mode 100644 index 0000000000..3b149b2d37 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.evaluationindex.screen.ScreenProjectImgDataDao; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectImgDataService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +public class ScreenProjectImgDataServiceImpl extends BaseServiceImpl implements ScreenProjectImgDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectImgDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectImgDataDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectImgDataDTO get(String id) { + ScreenProjectImgDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectImgDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectImgDataDTO dto) { + ScreenProjectImgDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectImgDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectImgDataDTO dto) { + ScreenProjectImgDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectImgDataEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java new file mode 100644 index 0000000000..7219b2ae21 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessAttachmentDao; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl implements ScreenProjectProcessAttachmentService { + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectProcessAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectProcessAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectProcessAttachmentDTO get(String id) { + ScreenProjectProcessAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectProcessAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectProcessAttachmentDTO dto) { + ScreenProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectProcessAttachmentDTO dto) { + ScreenProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java new file mode 100644 index 0000000000..1d18eb0b7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessAttachmentDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessDao; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +public class ScreenProjectProcessServiceImpl extends BaseServiceImpl implements ScreenProjectProcessService { + + @Resource + private ScreenProjectProcessAttachmentDao screenProjectProcessAttachmentDao; + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectProcessDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectProcessDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectProcessDTO get(String id) { + ScreenProjectProcessEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectProcessDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectProcessDTO dto) { + ScreenProjectProcessEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectProcessDTO dto) { + ScreenProjectProcessEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public void collect(String customerId, ScreenCollFormDTO param) { + if (param.getIsFirst()) { + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + } + } + param.getDataList().forEach(item -> { + //先删除旧数据 + QueryWrapper screenProjectProcessEntityQueryWrapper = new QueryWrapper<>(); + screenProjectProcessEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId) + .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); + baseDao.delete(screenProjectProcessEntityQueryWrapper); + + QueryWrapper screenProjectProcessAttachmentEntityQueryWrapper = new QueryWrapper<>(); + screenProjectProcessAttachmentEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId) + .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); + screenProjectProcessAttachmentDao.delete(screenProjectProcessAttachmentEntityQueryWrapper); + //插入 + ScreenProjectProcessEntity screenProjectProcessEntity = ConvertUtils.sourceToTarget(item, ScreenProjectProcessEntity.class); + screenProjectProcessEntity.setCustomerId(customerId); + screenProjectProcessEntity.setDataEndTime(param.getDateId()); + baseDao.insert(screenProjectProcessEntity); + + List attachments = item.getAttachments(); + if (!CollectionUtils.isEmpty(attachments)){ + for (int i = 0; i < attachments.size(); i++) { + ScreenProjectProcessAttachmentEntity attachmentEntity = ConvertUtils.sourceToTarget(attachments.get(i), ScreenProjectProcessAttachmentEntity.class); + attachmentEntity.setCustomerId(customerId); + attachmentEntity.setProcessId(item.getProcessId()); + attachmentEntity.setProjectId(item.getProjectId()); + if (attachmentEntity.getSort() == null) { + attachmentEntity.setSort(i); + } + screenProjectProcessAttachmentDao.insert(attachmentEntity); + } + } + }); + + } + +} 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/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 + + + From a1b269b67108ce5c23925881a8f5b6324c22a15f Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Feb 2021 18:37:19 +0800 Subject: [PATCH 13/77] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB?= =?UTF-8?q?=E9=99=86=E8=BF=94=E5=9B=9E=E5=AE=A2=E6=88=B7Id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/result/UserTokenResultDTO.java | 1 + .../src/main/java/com/epmet/service/impl/SsoServiceImpl.java | 1 + 2 files changed, 2 insertions(+) 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/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java index 282108736d..98702d2216 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 @@ -176,6 +176,7 @@ public class SsoServiceImpl implements SsoService { this.disposeTokenDto(formDTO.getApp(), formDTO.getClient(), epmetUser.getUserId(), token, thirdUser.getCustomerId()); UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(token); + userTokenResultDTO.setCustomerId(thirdUser.getCustomerId()); return userTokenResultDTO; } From 47b29d5bc486d9ecb71890373db4f604d799f3b1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 25 Feb 2021 09:26:01 +0800 Subject: [PATCH 14/77] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB?= =?UTF-8?q?=E9=99=86=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/thirdplat/apiservice/pyld/PyldApiService.java | 3 +-- .../com/epmet/commons/thirdplat/constants/PyldConstants.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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 index c5bc39b88c..c5f176b073 100644 --- 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 @@ -113,8 +113,7 @@ public class PyldApiService extends AbstractApiService { } 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(), - EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(PyldConstants.REPONSE_USER_NOT_LOGIN)); + 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/constants/PyldConstants.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java index 1844b2e66d..ffb6dbde97 100644 --- 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 @@ -14,5 +14,5 @@ public interface PyldConstants { String PLAT_PARAM_MANAGEMENTKEY = "managementKey"; String PLAT_PARAM_MANAGEMENTKEY_VALUE = "epmet_work"; - String REPONSE_USER_NOT_LOGIN = "用户未登陆"; + String REPONSE_USER_NOT_LOGIN = "token失效,请重新登陆"; } From b99b803b9d229c08238903e5d4ee4eebeea4f7bb Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Thu, 25 Feb 2021 10:14:32 +0800 Subject: [PATCH 15/77] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=EF=BC=8C=E5=92=8C=E6=9F=A5=E8=AF=A2=20?= =?UTF-8?q?=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenProjectDataDao.xml | 2 -- 1 file changed, 2 deletions(-) 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 index ddf23a8bb0..cf1743a6da 100644 --- 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 @@ -31,8 +31,6 @@ From 1b8869550f70aff16880bc6f1a86960ed2835117 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 11:10:40 +0800 Subject: [PATCH 16/77] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/screen/GrassrootsPartyDevController.java | 3 +++ .../controller/screen/ScreenProjectController.java | 8 +++++--- .../impl/ScreenCustomerWorkRecordDictServiceImpl.java | 3 +++ .../plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java | 4 +++- .../impl/ScreenWorkRecordOrgMonthlyServiceImpl.java | 3 +++ 5 files changed, 17 insertions(+), 4 deletions(-) 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 cc19d4cbb8..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,6 +10,7 @@ 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.*; @@ -19,6 +20,7 @@ import org.springframework.web.bind.annotation.*; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:11 */ +@Slf4j @RestController @RequestMapping("/screen/grassrootspartydev") public class GrassrootsPartyDevController { @@ -50,6 +52,7 @@ public class GrassrootsPartyDevController { **/ @PostMapping("ageinfo") 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,customerId)); } 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 6462fa61ec..2b5dea4b2d 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 @@ -3,13 +3,13 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; -import com.epmet.evaluationindex.screen.dto.form.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.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; -import oracle.jdbc.proxy.annotation.Post; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -22,6 +22,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:16 */ +@Slf4j @RestController @RequestMapping("/screen/project") public class ScreenProjectController { @@ -71,6 +72,7 @@ public class ScreenProjectController { @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)); } 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 0d662c87e1..84a5abbc36 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 @@ -60,6 +60,7 @@ import java.util.stream.Collectors; */ @Slf4j @Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgDailyService { @Autowired private AgencyService agencyService; @@ -122,6 +123,7 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgMonthlyService { @Override From 26b7cb51f41673ba39817d2fd4fad3f2dcc337a5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 13:17:41 +0800 Subject: [PATCH 17/77] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/WorkRecordRankResultDTO.java | 7 ++++ .../plugins/ScreenWorkRecordOrgDailyDao.java | 2 +- .../ScreenWorkRecordOrgDailyServiceImpl.java | 11 +++++-- .../plugins/ScreenWorkRecordOrgDailyDao.xml | 33 ++++++++++++++----- 4 files changed, 41 insertions(+), 12 deletions(-) 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-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..a8aee6c4ed 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 @@ -51,7 +51,7 @@ public interface ScreenWorkRecordOrgDailyDao extends BaseDao selectCurrentAgency(@Param("areaCode") String areaCode, @Param("dataType") String dataType, @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/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 84a5abbc36..3b3f424ed2 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 @@ -45,6 +45,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.time.format.DateTimeFormatter; @@ -139,10 +140,14 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl()); } else { //非社区的 - WorkRecordRankResultDTO resultDTO = baseDao.selectCurrentAgency(agencyDTO.getAreaCode(), formDTO.getDataType(), dateId); - resultDTO.setSubRankList(baseDao.selectSubList(agencyDTO.getAreaCode(), agencyDTO.getAgencyId(), formDTO.getDataType(), formDTO.getTopRow(), dateId)); - return resultDTO; + List resultDTOList = baseDao.selectCurrentAgency(agencyDTO.getAreaCode(), formDTO.getDataType(), dateId); + if(!CollectionUtils.isEmpty(resultDTOList)){ + WorkRecordRankResultDTO resultDTO=resultDTOList.get(0); + resultDTO.setSubRankList(baseDao.selectSubList(agencyDTO.getAreaCode(), agencyDTO.getAgencyId(), formDTO.getDataType(), formDTO.getTopRow(), dateId)); + return resultDTO; + } } + return new WorkRecordRankResultDTO(); } /** 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..d0eace34dc 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 @@ -18,16 +18,27 @@ SELECT sca.AGENCY_ID AS orgId, sca.AGENCY_NAME AS `NAME`, - IFNULL( sum( m.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal, - IFNULL( sum( m.ORGANIZE_TOTAL ), 0 ) AS participateTotal + IFNULL( sum( temp.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal, + IFNULL( sum( temp.ORGANIZE_TOTAL ), 0 ) AS participateTotal FROM screen_customer_agency sca - LEFT JOIN screen_work_record_org_daily m ON ( sca.AGENCY_ID = m.ORG_ID AND m.DEL_FLAG = '0' AND m.DATE_ID = #{dateId} ) - LEFT JOIN screen_customer_work_record_dict dict ON ( m.TYPE_CODE = dict.RESOURCE_CODE AND dict.DEL_FLAG = '0' AND dict.DATA_TYPE = #{dataType} ) + 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 dict. RESOURCE_CODE from screen_customer_work_record_dict dict + where dict.DEL_FLAG = '0' + AND dict.DATA_TYPE = #{dataType} + and dict.`LEVEL`='1' + ) + )temp on( + sca.AGENCY_ID = temp.ORG_ID AND temp.DEL_FLAG = '0' AND temp.DATE_ID =#{dateId} + ) WHERE sca.DEL_FLAG = '0' - AND sca.PARENT_AREA_CODE like concat( #{areaCode},'%') - and sca.AGENCY_ID !=#{agencyId} + AND sca.PARENT_AREA_CODE =#{areaCode} + AND sca.AGENCY_ID != #{agencyId} GROUP BY sca.AGENCY_ID, sca.AGENCY_NAME @@ -43,8 +54,14 @@ IFNULL( sum( m.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} ) + 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.`LEVEL`='1' + AND dict.DEL_FLAG = '0' + AND dict.DATA_TYPE = #{dataType} + ) WHERE sca.DEL_FLAG = '0' AND sca.PARENT_AREA_CODE like concat( #{areaCode},'%') From cbcd65cb08cf5fc89364fcc6a95979d14de84f17 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 25 Feb 2021 13:53:04 +0800 Subject: [PATCH 18/77] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB?= =?UTF-8?q?=E9=99=86=E4=BB=A3=E7=A0=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/SsoController.java | 2 +- .../java/com/epmet/dto/form/SsoLoginOperFormDTO.java | 10 ++++------ .../src/main/java/com/epmet/service/SsoService.java | 3 ++- .../java/com/epmet/service/impl/SsoServiceImpl.java | 2 +- .../thirdplat/apiservice/pyld/PyldApiService.java | 11 ++++++----- 5 files changed, 14 insertions(+), 14 deletions(-) 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 61468e9ea4..6413ffb82b 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java @@ -51,7 +51,7 @@ public class SsoController { @PostMapping("oper/third/login") public Result thirdLoginOper(@RequestBody SsoLoginOperFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, SsoLoginOperFormDTO.ThirdPlatformLoginForm.class); - return new Result().ok(ssoService.thirdLoginOper(formDTO)); + return new Result().ok(ssoService.thirdLoginOperWork(formDTO)); } @PostMapping("test") 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 index fb960bcfce..2084287984 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java @@ -3,17 +3,15 @@ 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 SsoLoginOperFormDTO extends LoginCommonFormDTO implements Serializable { +public class SsoLoginOperFormDTO extends LoginCommonFormDTO { - - private static final long serialVersionUID = 8711491709544498082L; + private static final long serialVersionUID = -4215746830030486659L; public interface ThirdPlatformLoginForm { } @@ -25,10 +23,10 @@ public class SsoLoginOperFormDTO extends LoginCommonFormDTO implements Serializa private String thirdToken; /** - * 上游系统token + * 上游系统标识 * * @see com.epmet.enums.ThirdPlatformEnum */ - @NotBlank(message = "token不能为空", groups = {ThirdPlatformLoginForm.class}) + @NotBlank(message = "平台标识不能为空", groups = {ThirdPlatformLoginForm.class}) private String platform; } 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 e9f9fac2b7..4514230228 100644 --- a/epmet-auth/src/main/java/com/epmet/service/SsoService.java +++ b/epmet-auth/src/main/java/com/epmet/service/SsoService.java @@ -33,6 +33,7 @@ public interface SsoService { * @Description 4、自动进入组织-返回token **/ UserTokenResultDTO enterOrg(SsoEnteOrgFormDTO formDTO); + /** * desc: sso登陆运营端 * @@ -41,5 +42,5 @@ public interface SsoService { * @author LiuJanJun * @date 2021/2/24 1:28 下午 */ - UserTokenResultDTO thirdLoginOper(SsoLoginOperFormDTO formDTO); + UserTokenResultDTO thirdLoginOperWork(SsoLoginOperFormDTO formDTO); } 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 98702d2216..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 @@ -133,7 +133,7 @@ public class SsoServiceImpl implements SsoService { } @Override - public UserTokenResultDTO thirdLoginOper(SsoLoginOperFormDTO formDTO) { + public UserTokenResultDTO thirdLoginOperWork(SsoLoginOperFormDTO formDTO) { ThirdPlatUserInfo thirdUser; try { ThirdPlatformEnum platformEnum = ThirdPlatformEnum.getEnum(formDTO.getPlatform()); 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 index c5f176b073..958fd8b1bb 100644 --- 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 @@ -22,6 +22,12 @@ 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 { @@ -59,9 +65,7 @@ public class PyldApiService extends AbstractApiService { buildHeaders()); logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); - logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<"); - PyldUserInfoResultDTO resultDTO = this.parseResult(result); ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo(); @@ -71,7 +75,6 @@ public class PyldApiService extends AbstractApiService { } - /** * 构建请求头信息 * @@ -117,6 +120,4 @@ public class PyldApiService extends AbstractApiService { } return userInfo; } - - } From aca279ee52455fb53501995fff834eee0f8524e3 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 25 Feb 2021 16:11:06 +0800 Subject: [PATCH 19/77] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E6=A6=82=E5=86=B5/=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9C=E6=A0=B9=E6=8D=AEareaCode=E6=A3=80?= =?UTF-8?q?=E7=B4=A2(=E6=9F=A5=E6=89=BE=E5=AD=90=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=BF=94=E5=9B=9E=E5=A4=B1=E8=B4=A5=E6=97=B6?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=B2=A1=E6=9C=89=E5=AD=90=E5=AE=A2=E6=88=B7?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/GrassRootsGovernController.java | 5 +- .../screen/ScreenPublicPartiTotalDataDao.java | 12 +++++ .../screen/ScreenUserJoinDao.java | 12 +++++ .../impl/GrassRootsGovernServiceImpl.java | 47 +++++++++++++++++-- .../impl/PartyMemberLeadServiceImpl.java | 9 ++-- .../mapper/screen/ScreenPioneerDataDao.xml | 8 ++-- .../screen/ScreenPublicPartiTotalDataDao.xml | 39 +++++++++++++++ .../mapper/screen/ScreenUserJoinDao.xml | 29 ++++++++++++ 8 files changed, 147 insertions(+), 14 deletions(-) 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/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..bca8a573bf 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,16 @@ 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, + @Param("customerId")String customerId, + @Param("list")List subCustomers); } \ 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..64d5eefc21 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,18 @@ 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, + @Param("list") List subCustomers, + @Param("customerId")String customerId); + + /** * @Description 查询月度用户参与数据 * @param agencyId 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..8dc27f6d18 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,16 +3,20 @@ 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.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 org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -48,6 +52,10 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { private ScreenGovernRankDataDao screenGovernRankDataDao; @Autowired private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + @Autowired + private OperCrmOpenFeignClient crmClient; + @Autowired + private ScreenCustomerAgencyDao agencyDao; /** * @Description 1、热心市民积分排行 @@ -110,15 +118,26 @@ 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()) {subCustomers = null ;} + else {subCustomers = crmResp.getData();} String monthId = dateUtils.getCurrentMonthId(); - UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + UserJoinIndicatorGrowthRateResultDTO latest = CollectionUtils.isEmpty(subCustomers) ? + screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId, + subCustomers,agencyInfo.getCustomerId()); //保证获取公众参与概率数据的最大可能性 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) ? + screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId, + subCustomers,agencyInfo.getCustomerId()); } if (null == latest) return new PublicPartiProfileResultDTO(); @@ -146,8 +165,18 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { if(NumConstant.ZERO == param.getTopNum()){ param.setTopNum(NumConstant.MAX); } + + ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()) ; + List subCustomers; + Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); + if(null == crmResp || !crmResp.success()) {subCustomers = null ;} + else {subCustomers = crmResp.getData();} PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()); + List result = + CollectionUtils.isEmpty(subCustomers) ? + screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()) + : screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode(),agencyInfo.getCustomerId(), + subCustomers); if(null == result) { return new ArrayList<>(); } @@ -254,6 +283,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/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 2de292f6ea..073f26ef94 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 @@ -74,10 +74,11 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { areaCode = agencyInfo.getAreaCode(); } Result> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); - if(null == crmResponse || !crmResponse.success()){ - throw new RenException("获取子客户列表失败"); - } - List subCustomers = crmResponse.getData(); + List subCustomers; + if(null == crmResponse || !crmResponse.success()) + {subCustomers = null;} + else + {subCustomers = crmResponse.getData();} FineExampleResultDTO fineExampleResultDTO; if(CollectionUtils.isEmpty(subCustomers)) fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); 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 afbddb095b..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 @@ -55,9 +55,11 @@ data.del_flag = '0' AND data.org_type = 'agency' AND agency.area_code LIKE concat(#{areaCode},'%') - - agency.customer_id = #{subId} - + + + data.customer_id = #{subId} + + ORDER BY data.data_end_time DESC LIMIT 1 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..04793de3ee 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,43 @@ 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..c954dc41d3 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 @@ -24,6 +24,35 @@ AND MONTH_ID = #{monthId} + + + + + \ No newline at end of file From a66c42e28c84bbbac15d44112298c1ee980e89fc Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 25 Feb 2021 16:34:04 +0800 Subject: [PATCH 21/77] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E6=83=85=E5=86=B5-=E9=A5=BC=E7=8A=B6=E5=9B=BE=E6=A6=82?= =?UTF-8?q?=E5=86=B5=20=E6=92=A4=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/ParymemberFormDTO.java | 5 ----- .../screen/ScreenUserTotalDataDao.java | 1 - .../screen/impl/GrassrootsPartyDevServiceImpl.java | 7 +------ .../mapper/screen/ScreenUserTotalDataDao.xml | 11 ----------- 4 files changed, 1 insertion(+), 23 deletions(-) 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 15b3e36477..fdf525f37b 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,9 +21,4 @@ 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-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 8a50ec4c61..653cf3f606 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 @@ -39,7 +39,6 @@ public interface ScreenUserTotalDataDao { * @date 2020.08.18 15:17 **/ PartymemberPercentResultDTO selectAgencyPartymemberPercent(@Param("agencyId")String agencyId); - PartymemberPercentResultDTO selectAgencyPartymemberPercentNew(@Param("agencyId")String agencyId); /** * @Description 查询top区概况 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 7905306f8c..30e3d5d32e 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 @@ -63,12 +63,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService @Override public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { - PartymemberPercentResultDTO result = new PartymemberPercentResultDTO(); - if (StringUtils.isEmpty(param.getAreaCode())) { - result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); - }else { - result = screenUserTotalDataDao.selectAgencyPartymemberPercentNew(param.getAgencyId()); - } + 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()); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index 986e077712..57b2959430 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -67,15 +67,4 @@ ISSUE_TOTAL desc, PROJECT_TOTAL desc - \ No newline at end of file From 0563e65ff9217c14475ed9e2110bd5d23b06d5a1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 17:50:05 +0800 Subject: [PATCH 22/77] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E7=BE=A4=E4=BC=97=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/ContactMassLineChartFormDTO.java | 5 +++ .../screen/ScreenCustomerAgencyDao.java | 1 + .../screen/ScreenPartyLinkMassesDataDao.java | 3 +- .../evaluationindex/screen/AgencyService.java | 9 +++++ .../screen/impl/AgencyServiceImpl.java | 13 ++++++++ .../impl/PartyMemberLeadServiceImpl.java | 13 +++++++- .../mapper/screen/ScreenCustomerAgencyDao.xml | 30 +++++++++++++++++ .../screen/ScreenPartyLinkMassesDataDao.xml | 33 +++++++++++++++++++ 8 files changed, 105 insertions(+), 2 deletions(-) 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-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..d0a4f459a6 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,5 @@ public interface ScreenCustomerAgencyDao { **/ List selectGridList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + List getNextAgencyIds(@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/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/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..f637a0e942 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 @@ -61,4 +61,13 @@ 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); } 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..9731353c92 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 @@ -297,4 +297,17 @@ 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); + } } 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 073f26ef94..67911d8185 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,5 +1,6 @@ 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; @@ -7,6 +8,7 @@ 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; @@ -56,6 +58,9 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { private ScreenCustomerAgencyDao customerAgencyDao; @Autowired private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private AgencyService screenCustomerAgencyService; + /** * @Description 1、先锋模范 * @param fineExampleFormDTO @@ -117,8 +122,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<>()); 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..04dabd6847 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,34 @@ and grid.PARENT_AGENCY_ID=#{agencyId} + 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..29c20cb493 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,37 @@ AND md.ORG_TYPE = CASE WHEN sca.LEVEL = 'community' THEN 'grid' ELSE 'agency' END + + \ No newline at end of file From c054afee8573d1694c5e9111c8d2c4456e06ca53 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 25 Feb 2021 18:25:30 +0800 Subject: [PATCH 23/77] =?UTF-8?q?screen/project=20=E6=9C=88=E5=BA=A6?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=88=86=E6=9E=90=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenProjectController.java | 51 ++++++++++++++++++- ...nProjectQuantityOrgMonthlyServiceImpl.java | 18 ++++--- 2 files changed, 61 insertions(+), 8 deletions(-) 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 2b5dea4b2d..2d2c1e79a0 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,9 +2,17 @@ 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; @@ -29,7 +37,10 @@ public class ScreenProjectController { @Autowired private ScreenProjectService screenProjectService; - + @Autowired + private ScreenProjectOrgDailyService projectOrgDailyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; /** * @Description 3、项目详情 * @param projectDetailFormDTO @@ -77,4 +88,42 @@ public class ScreenProjectController { 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/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); From 87a22641ffc6c3a70a169420833707507e8e7cd2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 18:34:03 +0800 Subject: [PATCH 24/77] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=94=AF=E9=83=A8?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/AgencyAndNumFormDTO.java | 5 ++ .../screen/ScreenOrgRankDataDao.java | 2 + .../impl/PartyMemberLeadServiceImpl.java | 54 +++++++++++++------ .../mapper/screen/ScreenOrgRankDataDao.xml | 32 +++++++++++ 4 files changed, 76 insertions(+), 17 deletions(-) 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-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/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 67911d8185..5a125e55cd 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 @@ -258,6 +258,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()){ @@ -265,24 +266,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; } 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 From b68d7062be16856cb2bd1edbed7fc7fec0939f72 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 18:46:04 +0800 Subject: [PATCH 25/77] =?UTF-8?q?=E5=85=88=E8=BF=9B=E5=85=9A=E5=91=98?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenPartyUserRankDataDao.java | 2 ++ .../screen/impl/PartyMemberLeadServiceImpl.java | 8 +++++++- .../mapper/screen/ScreenPartyUserRankDataDao.xml | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) 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..5a22e7511b 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,6 @@ public interface ScreenPartyUserRankDataDao{ * @author sun */ List selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO); + + List selectPartymemberPointOrderByAreaCode(@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/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 5a125e55cd..ce075165b6 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 @@ -319,7 +319,13 @@ 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; } 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..525d52f207 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,20 @@ LIMIT #{topNum} + \ No newline at end of file From 179e2d69a4c9d3b0691d86e757486ea727b7a765 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 25 Feb 2021 19:18:32 +0800 Subject: [PATCH 26/77] =?UTF-8?q?=E7=83=AD=E5=BF=83=E5=B8=82=E6=B0=91?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/ParymemberFormDTO.java | 5 ++++ .../screen/ScreenPartyUserRankDataDao.java | 2 ++ .../screen/ScreenUserTotalDataDao.java | 5 +++- .../impl/GrassRootsGovernServiceImpl.java | 10 ++++++- .../impl/GrassrootsPartyDevServiceImpl.java | 27 ++++++++++++++++--- .../screen/ScreenPartyLinkMassesDataDao.xml | 4 +++ .../screen/ScreenPartyUserRankDataDao.xml | 17 ++++++++++++ .../mapper/screen/ScreenUserTotalDataDao.xml | 15 +++++++++++ 8 files changed, 80 insertions(+), 5 deletions(-) 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-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 5a22e7511b..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 @@ -73,4 +73,6 @@ public interface ScreenPartyUserRankDataDao{ 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/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/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 8dc27f6d18..081f7aa28e 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 @@ -18,6 +18,7 @@ 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; @@ -36,6 +37,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 { @@ -73,7 +75,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())); 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 30e3d5d32e..6285e007f4 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 @@ -8,6 +8,7 @@ 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; @@ -50,7 +51,8 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService 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 @@ -62,10 +64,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(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue())))); + } + 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)); 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 29c20cb493..0db5e467e1 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 @@ -32,10 +32,12 @@ ON ( sca.agency_id = md.ORG_ID AND md.del_flag = '0' ) WHERE SCA.DEL_FLAG='0' AND sca.is_display = '1' + AND sca.agency_id in #{agencyId} + union SELECT scg.GRID_ID as orgId, @@ -47,9 +49,11 @@ LEFT JOIN screen_party_link_masses_data md ON ( scg.GRID_ID = md.ORG_ID AND md.del_flag = '0' ) WHERE scg.DEL_FLAG='0' + AND scg.GRID_ID in #{agencyId} + \ 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 525d52f207..f6d5c66ca4 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 @@ -114,4 +114,21 @@ ORDER BY m.POINT_TOTAL DESC + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index 57b2959430..d2040d3e13 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -15,6 +15,21 @@ AND PARENT_ID = #{agencyId} + \ No newline at end of file From 894a25826835f91090d0e47707f1e5c641adbda6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Feb 2021 09:02:12 +0800 Subject: [PATCH 28/77] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E5=A0=B5=E7=82=B9?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/AgencyNumTypeParamFormDTO.java | 5 ++++ .../screen/ScreenDifficultyDataDao.java | 9 +++++++ .../impl/GrassRootsGovernServiceImpl.java | 11 ++++++++- .../mapper/screen/ScreenDifficultyDataDao.xml | 24 +++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) 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-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..8041e34caa 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,15 @@ public interface ScreenDifficultyDataDao { **/ List selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type); + /** + * @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数【new】 + * @Param orgIds + * @Param type + * @author zxc + * @date 2021/2/25 下午6:41 + */ + List selectDifficultyNew(@Param("orgIds")List orgIds,@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/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 081f7aa28e..e6044d6aec 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 @@ -8,6 +8,7 @@ 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; @@ -58,6 +59,9 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { private OperCrmOpenFeignClient crmClient; @Autowired private ScreenCustomerAgencyDao agencyDao; + @Autowired + private AgencyService screenCustomerAgencyService; + /** * @Description 1、热心市民积分排行 @@ -100,11 +104,16 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List difficultProject(AgencyNumTypeParamFormDTO param) { + List nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); + if (CollectionUtils.isEmpty(nextAgencyIds)){ + return new ArrayList<>(); + } if(null == param.getTopNum()){ param.setTopNum(NumConstant.TWO); } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); +// List result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); + List result = screenDifficultyDataDao.selectDifficultyNew(nextAgencyIds,param.getType()); for(DifficultProjectResultDTO resultDTO:result){ if (StringUtils.isNotBlank(resultDTO.getImgUrl()) && !resultDTO.getImgUrl().contains("http")) { resultDTO.setImgUrl(StrConstant.EPMETY_STR); 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..59abb0b764 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,28 @@ AND dd.EVENT_ID = #{eventId} + + + \ No newline at end of file From 8af2c79a678da79af362f4364e744adb78cfe6ed Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Feb 2021 09:46:41 +0800 Subject: [PATCH 29/77] =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenGovernRankDataDao.java | 9 ++++ .../impl/GrassRootsGovernServiceImpl.java | 49 +++++++++++++------ .../mapper/screen/ScreenGovernRankDataDao.xml | 24 +++++++++ 3 files changed, 67 insertions(+), 15 deletions(-) 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/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 e6044d6aec..8dc4519b81 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 @@ -104,16 +104,21 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List difficultProject(AgencyNumTypeParamFormDTO param) { - List nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); - if (CollectionUtils.isEmpty(nextAgencyIds)){ - return new ArrayList<>(); - } + List nextAgencyIds = new ArrayList<>(); + 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()); - List result = screenDifficultyDataDao.selectDifficultyNew(nextAgencyIds,param.getType()); + if (StringUtils.isNotEmpty(param.getAreaCode())){ + nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); + if (CollectionUtils.isEmpty(nextAgencyIds)){ + return new ArrayList<>(); + } + result = screenDifficultyDataDao.selectDifficultyNew(nextAgencyIds,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); @@ -211,19 +216,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<>(); 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..00e91ae090 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 @@ -25,4 +25,28 @@ (rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC + + + \ No newline at end of file From 6ff7d414dd357e777433aea74ecf6ccc143f9815 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 26 Feb 2021 10:10:29 +0800 Subject: [PATCH 30/77] =?UTF-8?q?=E4=B8=AD=E5=A4=AE=E5=8C=BA=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=88=86=E5=B8=83=E6=8E=A5=E5=8F=A3sql=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=88=A4=E6=96=ADlevel=E4=B8=8D=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenProjectDataDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index cf1743a6da..b59665f53e 100644 --- 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 @@ -15,7 +15,7 @@ screen_project_data WHERE del_flag = '0' - + and project_level = #{level} From fe9170675b6fac23834617e4045b81c118b7bea5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Feb 2021 11:00:39 +0800 Subject: [PATCH 31/77] =?UTF-8?q?=E9=A1=B9=E7=9B=AE(=E4=BA=8B=E4=BB=B6)?= =?UTF-8?q?=E6=8A=BD=E5=8F=96=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScreenExtractServiceImpl.java | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 32958ebee3..1727e5ef69 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -11,6 +11,10 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; +import com.epmet.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.service.stats.DimCustomerService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -50,11 +54,19 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; @Autowired private IndexCalculateService indexCalculateService; - @Autowired private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; @Autowired private ScreenGrassrootsGovernDataAbsorptionService screenGrassrootsGovernDataAbsorptionService; + @Autowired + private ScreenProjectQuantityGridMonthlyService screenProjectQuantityGridMonthlyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService screenProjectQuantityOrgMonthlyService; + @Autowired + private ScreenProjectGridDailyService screenProjectGridDailyService; + @Autowired + private ScreenProjectOrgDailyService screenProjectOrgDailyService; + /** * @param extractOriginFormDTO * @Description 抽取数据到大屏【天】 @@ -171,6 +183,18 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { }catch (Exception e){ log.error("基层治理-难点赌点抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); } + try { + // 项目(事件)分析按网格_按天统计 + screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); + }catch (Exception e){ + log.error("项目(事件)分析按网格_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + try { + // 项目(事件)分析按组织_按天统计 + screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); + }catch (Exception e){ + log.error("项目(事件)分析按组织_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } log.info("===== extractDaily method end ======"); } @@ -247,6 +271,18 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { }catch(Exception e){ log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + JSON.toJSONString(formDTO), e); } + try { + // 项目(事件)数量分析按网格_按月统计 + screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId); + }catch (Exception e){ + log.error("项目(事件)数量分析按网格_按月统计失败,参数为{}" + JSON.toJSONString(formDTO),e); + } + try { + // 项目(事件)数量分析按组织_按月统计 + screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId, monthId); + }catch (Exception e){ + log.error("项目(事件)数量分析按组织_按月统计失败,参数为{}" + JSON.toJSONString(formDTO),e); + } //此方法保持在最后即可 计算指标分数 todo 优化 手动创建线程池 控制任务数量 ExecutorService pool = Executors.newSingleThreadExecutor(); pool.submit(() -> { From a19995fa918a359f3383961a7a985b1c77796df7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 26 Feb 2021 13:05:10 +0800 Subject: [PATCH 32/77] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScreenProjectCategoryOrgDailyDao.java | 2 +- .../screen/impl/ScreenProjectServiceImpl.java | 7 ++----- .../ScreenProjectCategoryOrgDailyDao.xml | 18 +++++++++++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) 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 index 3d00e19932..c3b90ff1c7 100644 --- 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 @@ -38,5 +38,5 @@ public interface ScreenProjectCategoryOrgDailyDao { * @param agencyId * @return java.util.List */ - List selectCategoryAnalysis(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + 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/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 780df28bd5..8f2369ea07 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 @@ -2,7 +2,6 @@ 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.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; @@ -11,9 +10,9 @@ 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.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; @@ -21,7 +20,6 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Date; import java.util.List; /** @@ -110,7 +108,6 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { */ @Override public List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO) { - String dateId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); - return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId(), dateId); + return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId()); } } 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 index 06f7919bd1..5816def044 100644 --- 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 @@ -6,11 +6,23 @@ \ No newline at end of file From feba9e2b3c69eedecda329d9c2586ec59df52719 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Feb 2021 16:10:12 +0800 Subject: [PATCH 33/77] =?UTF-8?q?areaCOde=E9=95=BF=E5=BA=A6=E9=99=90?= =?UTF-8?q?=E5=88=B6=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 2 -- .../mapper/evaluationindex/indexcal/CommunityScoreDao.xml | 2 -- .../resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml | 1 - .../resources/mapper/evaluationindex/indexcal/GridScoreDao.xml | 1 - .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml | 1 - .../indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml | 2 -- .../indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml | 1 - 7 files changed, 10 deletions(-) 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} From 6006100c766d7c8bb545977c7dc5c3a880975236 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 26 Feb 2021 17:22:31 +0800 Subject: [PATCH 34/77] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=86=E6=9E=90-?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B1=87=E6=80=BB=E6=B5=8B=E8=AF=95=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/DemoController.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 5d340fa7f3..4d9a22030a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -783,4 +783,16 @@ public class DemoController { screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId,monthId); return new Result(); } + + + @PostMapping("event-all") + public Result screenProjectQuantityOrgMonthly(@RequestParam("customerId") String customerId, + @RequestParam("dateId") String dateId, + @RequestParam("monthId") String monthId) { + screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); + screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); + screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId); + screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId, monthId); + return new Result(); + } } From 5e18916bb16211fd1ca668a464bcfe635fde8d48 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Feb 2021 17:46:47 +0800 Subject: [PATCH 35/77] =?UTF-8?q?=E4=B8=8B=E7=BA=A7=E7=BB=84=E7=BB=87/?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=8C=87=E6=95=B0=E6=8E=92=E8=A1=8C=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/SubAgencyIndexRankFormDTO.java | 5 +++++ .../screen/ScreenIndexDataMonthlyDao.java | 1 + .../screen/impl/IndexServiceImpl.java | 7 ++++++- .../mapper/screen/ScreenIndexDataMonthlyDao.xml | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) 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-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..a3a0fb5dcc 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、下级部门指数排行(安宁数据段用) - 月(上一个月) 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..5c89d256f6 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 @@ -230,7 +230,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<>(); } 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..dbbffe6165 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,21 @@ ${sort} LIMIT #{topNum} + From c7c04671eff8668bed41eb02009d6f4277d4ad15 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 26 Feb 2021 18:00:27 +0800 Subject: [PATCH 36/77] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=86=E6=9E=90?= =?UTF-8?q?=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/ScreenProjectGridDailyServiceImpl.java | 4 ++-- .../impl/ScreenProjectQuantityGridMonthlyServiceImpl.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java index c4ef3eb7d9..527c41624e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java @@ -23,7 +23,6 @@ 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.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; @@ -155,7 +154,8 @@ public class ScreenProjectGridDailyServiceImpl extends BaseServiceImpl gridInfos = gridDao.selectGridInfoByCustomerId(customerId); if (CollectionUtils.isEmpty(gridInfos)){ - throw new RenException(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + log.warn(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + return; } // 查询 项目总数 List projectTotal = projectMainDailyService.selectProjectTotal(customerId, dateId, null); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java index 405c5fc3a3..0457c180d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java @@ -23,7 +23,6 @@ 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.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; @@ -157,7 +156,8 @@ public class ScreenProjectQuantityGridMonthlyServiceImpl extends BaseServiceImpl // 查询客户下所有网格 List screenProjectGridDailyDTOS = gridDao.selectGridInfoByCustomerId(customerId); if (CollectionUtils.isEmpty(screenProjectGridDailyDTOS)){ - throw new RenException(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + log.warn(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + return; } List gridInfos = ConvertUtils.sourceToTarget(screenProjectGridDailyDTOS, ScreenProjectQuantityGridMonthlyDTO.class); From af5932ce2c4cdd870f2b01176e5fff2b9c1910b6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 27 Feb 2021 16:00:15 +0800 Subject: [PATCH 37/77] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86?= =?UTF-8?q?=EF=BC=9A=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E=E6=A6=82=E5=86=B5?= =?UTF-8?q?=E3=80=81=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E=E6=8E=92=E8=A1=8C?= =?UTF-8?q?=E3=80=81=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B=E6=A6=9C=E5=8D=95?= =?UTF-8?q?3=E4=B8=AA=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenPublicPartiTotalDataDao.java | 4 +- .../screen/ScreenUserJoinDao.java | 4 +- .../impl/GrassRootsGovernServiceImpl.java | 38 +++++++------- .../mapper/screen/ScreenGovernRankDataDao.xml | 35 ++++++------- .../screen/ScreenPublicPartiTotalDataDao.xml | 38 ++++++-------- .../mapper/screen/ScreenUserJoinDao.xml | 50 +++++++++++-------- 6 files changed, 83 insertions(+), 86 deletions(-) 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 bca8a573bf..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 @@ -48,7 +48,5 @@ public interface ScreenPublicPartiTotalDataDao{ * @author wangc * @date 2020.08.20 16:00 **/ - List selectPublicPartiTotalByAreaCode(@Param("areaCode") String areaCode, - @Param("customerId")String customerId, - @Param("list")List subCustomers); + 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 64d5eefc21..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 @@ -49,9 +49,7 @@ public interface ScreenUserJoinDao { * @author wangc * @date 2020.08.20 15:07 **/ - UserJoinIndicatorGrowthRateResultDTO selectUserJoinDataByAreaCode(@Param("areaCode") String areaCode, @Param("monthId")String monthId, - @Param("list") List subCustomers, - @Param("customerId")String customerId); + UserJoinIndicatorGrowthRateResultDTO selectUserJoinDataByAreaCode(@Param("areaCode") String areaCode, @Param("monthId")String monthId); /** 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 8dc4519b81..ec53c3c834 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 @@ -143,23 +143,21 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); List subCustomers; - if(null == crmResp || !crmResp.success()) {subCustomers = null ;} + 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 = CollectionUtils.isEmpty(subCustomers) ? + UserJoinIndicatorGrowthRateResultDTO latest = CollectionUtils.isEmpty(subCustomers) ||StringUtils.isBlank(agencyInfo.getAreaCode())? screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : - screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId, - subCustomers,agencyInfo.getCustomerId()); + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); //保证获取公众参与概率数据的最大可能性 int time = NumConstant.TWELVE; while (null == latest && time > NumConstant.ONE) { time--; monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); - latest = CollectionUtils.isEmpty(subCustomers) ? + latest = CollectionUtils.isEmpty(subCustomers)||StringUtils.isBlank(agencyInfo.getAreaCode()) ? screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : - screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId, - subCustomers,agencyInfo.getCustomerId()); + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); } if (null == latest) return new PublicPartiProfileResultDTO(); @@ -178,28 +176,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); } - ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()) ; + ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); List subCustomers; Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); - if(null == crmResp || !crmResp.success()) {subCustomers = null ;} - else {subCustomers = crmResp.getData();} - PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + 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) ? - screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()) - : screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode(),agencyInfo.getCustomerId(), - subCustomers); - if(null == result) { + CollectionUtils.isEmpty(subCustomers) || StringUtils.isBlank(agencyInfo.getAreaCode()) ? + screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()) + : screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode()); + if (null == result) { return new ArrayList<>(); } return result; 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 00e91ae090..f98257b0a0 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 @@ -25,28 +25,29 @@ (rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC - + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml index 04793de3ee..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 @@ -36,37 +36,31 @@ 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 c954dc41d3..749de01cef 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 @@ -26,30 +26,36 @@ From 30a704d32969d67985958a0ad9b039b271182cbb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 27 Feb 2021 19:26:07 +0800 Subject: [PATCH 38/77] =?UTF-8?q?5=E3=80=81=E3=80=90=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E3=80=91=E6=9C=AC=E6=9C=BA=E5=8F=8A=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E6=8E=92=E5=90=8D=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/AgencyInfoDTO.java | 20 ++++ .../plugins/form/WorkRecordRankFormDTO.java | 3 + .../screen/ScreenCustomerAgencyDao.java | 2 + .../screen/ScreenCustomerGridDao.java | 3 +- .../plugins/ScreenWorkRecordOrgDailyDao.java | 21 ++-- .../evaluationindex/screen/AgencyService.java | 3 + .../screen/impl/AgencyServiceImpl.java | 12 +++ .../ScreenWorkRecordOrgDailyServiceImpl.java | 66 ++++++++---- .../plugins/ScreenWorkRecordOrgDailyDao.xml | 102 +++++++++++++----- .../mapper/screen/ScreenCustomerAgencyDao.xml | 17 +++ .../mapper/screen/ScreenCustomerGridDao.xml | 15 +++ 11 files changed, 202 insertions(+), 62 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java 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/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-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 d0a4f459a6..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 @@ -151,4 +151,6 @@ 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/plugins/ScreenWorkRecordOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java index a8aee6c4ed..d88c5627b2 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 @@ -35,23 +35,26 @@ 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、【工作日志】本机及下级排名 * @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("subGridIds")List subGridIds, + @Param("dataType")String dataType, + @Param("customerId")String customerId, @Param("dateId")String dateId); - String selectLatestDateId(String customerId); + List selectSubGridList(@Param("subGridIds")List subGridIds, + @Param("dataType")String dataType, + @Param("customerId")String customerId, + @Param("dateId")String dateId); - List selectCurrentAgency(@Param("areaCode") String areaCode, + String selectLatestDateId(@Param("customerIds")List customerIds); + + WorkRecordRankResultDTO selectCurrentAgency(@Param("areaCode") String areaCode, @Param("dataType") String dataType, @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/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 f637a0e942..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; @@ -70,4 +71,6 @@ public interface AgencyService { * @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/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 9731353c92..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; @@ -310,4 +311,15 @@ public class AgencyServiceImpl implements AgencyService { 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/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java index 3b3f424ed2..6b8d0ca44f 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 @@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao; import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao; @@ -34,18 +35,20 @@ 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.datareport.utils.DateUtils; -import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.AgencyInfoDTO; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO; import com.epmet.plugins.form.WorkRecordRankFormDTO; import com.epmet.plugins.form.WorkRecordTrendFormDTO; import com.epmet.plugins.result.WorkRecordRankResultDTO; +import com.epmet.plugins.result.WorkRecordSubRank; import com.epmet.plugins.result.WorkRecordTrendResultDTO; 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 org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.time.format.DateTimeFormatter; @@ -71,7 +74,8 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -124,30 +128,46 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl customerIds=new ArrayList<>(); + Result> result=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + if (result.success() && CollectionUtils.isNotEmpty(result.getData())) { + log.info("包含子客户"); + customerIds.add(formDTO.getCustomerId()); + customerIds.addAll(result.getData()); + } + String dateId= baseDao.selectLatestDateId(customerIds); + if(StringUtils.isBlank(dateId)){ + throw new RenException("dateId is null"); } - 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 { - //非社区的 - List resultDTOList = baseDao.selectCurrentAgency(agencyDTO.getAreaCode(), formDTO.getDataType(), dateId); - if(!CollectionUtils.isEmpty(resultDTOList)){ - WorkRecordRankResultDTO resultDTO=resultDTOList.get(0); - resultDTO.setSubRankList(baseDao.selectSubList(agencyDTO.getAreaCode(), agencyDTO.getAgencyId(), formDTO.getDataType(), formDTO.getTopRow(), dateId)); - return resultDTO; - } + WorkRecordRankResultDTO returnDto = new WorkRecordRankResultDTO(); + //当前组织的自身的数据 + AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId()); + List subAgencyRankList = baseDao.selectSubList( + CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? agencyInfoDTO.getSubAgencyIds() : new ArrayList<>(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId); + List subGridList = baseDao.selectSubGridList( + CollectionUtils.isNotEmpty(agencyInfoDTO.getSubGridIds()) ? agencyInfoDTO.getSubGridIds() : new ArrayList<>(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId); + 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(); } - return new WorkRecordRankResultDTO(); + 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; } /** 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 d0eace34dc..e3215147f0 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,49 +3,92 @@ - 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} + + + + + 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..16b7d3d554 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 From 6a2db9a9b059e2b80f3dca4835d49e9f4a0e170e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 27 Feb 2021 19:48:08 +0800 Subject: [PATCH 39/77] =?UTF-8?q?5=E3=80=81=E3=80=90=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E3=80=91=E6=9C=AC=E6=9C=BA=E5=8F=8A=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E6=8E=92=E5=90=8D=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/WorkRecordController.java | 2 -- .../plugins/ScreenWorkRecordOrgDailyDao.java | 20 +++++++++++------- .../ScreenWorkRecordOrgDailyServiceImpl.java | 7 +++---- .../ScreenCustomerWorkRecordDictDao.xml | 2 +- .../plugins/ScreenWorkRecordOrgDailyDao.xml | 21 ------------------- 5 files changed, 17 insertions(+), 35 deletions(-) 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 592ea4ebc2..5229d84359 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 @@ -21,12 +21,10 @@ import org.springframework.web.bind.annotation.*; 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){ 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 d88c5627b2..372df80c38 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; @@ -37,24 +36,31 @@ public interface ScreenWorkRecordOrgDailyDao extends BaseDao selectSubList(@Param("subAgencyIds") List subAgencyIds, - // @Param("subGridIds")List subGridIds, @Param("dataType")String dataType, @Param("customerId")String customerId, @Param("dateId")String dateId); + /** + * @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, - @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/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 6b8d0ca44f..92f7ab291a 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,13 +17,13 @@ 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.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -134,13 +134,12 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl customerIds=new ArrayList<>(); Result> result=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); if (result.success() && CollectionUtils.isNotEmpty(result.getData())) { - log.info("包含子客户"); - customerIds.add(formDTO.getCustomerId()); customerIds.addAll(result.getData()); } + customerIds.add(formDTO.getCustomerId()); String dateId= baseDao.selectLatestDateId(customerIds); if(StringUtils.isBlank(dateId)){ - throw new RenException("dateId is null"); + log.warn("selectLatestDateId dateId is null customerIds" + JSON.toJSONString(customerIds)); } WorkRecordRankResultDTO returnDto = new WorkRecordRankResultDTO(); //当前组织的自身的数据 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 d6379ed76d..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,7 +2,6 @@ - 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 e3215147f0..a844e7c4ab 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 @@ -16,7 +16,6 @@ - - - \ No newline at end of file From 8226eec2bbea628a014d83d78015a98156ecb7e8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Feb 2021 14:22:20 +0800 Subject: [PATCH 40/77] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=BF=97=E6=84=BF?= =?UTF-8?q?=E8=80=85=E6=9C=8D=E5=8A=A1=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/VoluntaryServiceTrendFormDTO.java | 31 ++++++++ .../plugins/form/WorkRecordTrendFormDTO.java | 2 +- .../result/VoluntaryServiceTrendDTO.java | 30 ++++++++ .../VoluntaryServiceTrendResultDTO.java | 23 ++++++ .../plugins/WorkRecordController.java | 22 ++++++ .../plugins/ScreenWorkRecordOrgDailyDao.java | 4 + .../ScreenWorkRecordOrgMonthlyDao.java | 7 ++ .../ScreenWorkRecordOrgDailyService.java | 11 +++ .../ScreenWorkRecordOrgDailyServiceImpl.java | 77 ++++++++++++++++++- .../plugins/ScreenWorkRecordOrgDailyDao.xml | 30 ++++++++ .../plugins/ScreenWorkRecordOrgMonthlyDao.xml | 29 +++++++ 11 files changed, 261 insertions(+), 5 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/VoluntaryServiceTrendFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java 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/WorkRecordTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java index 448a32636c..db2184bdc1 100644 --- 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 @@ -16,7 +16,7 @@ public class WorkRecordTrendFormDTO implements Serializable { /** * party:支部建设; union:联建共建;党员志愿服务:voluntaryservice */ - @NotBlank(message = "dataType不能为空;可选值:party:支部建设; union:联建共建;党员志愿服务:voluntaryservice") + @NotBlank(message = "dataType不能为空;可选值:party:支部建设; union:联建共建") private String dataType; /** 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-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 5229d84359..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,10 +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.*; @@ -16,6 +20,7 @@ import org.springframework.web.bind.annotation.*; * @author yinzuomei@elink-cn.com * @date 2021/2/21 19:51 */ +@Slf4j @RestController @RequestMapping("screen/plugins/workrecord") public class WorkRecordController { @@ -47,4 +52,21 @@ public class WorkRecordController { 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/dao/plugins/ScreenWorkRecordOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java index 372df80c38..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 @@ -63,4 +63,8 @@ public interface ScreenWorkRecordOrgDailyDao extends BaseDao customerIds); + 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 6514c58fbf..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 @@ -20,8 +20,10 @@ 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; @@ -39,4 +41,9 @@ public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao 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/plugins/ScreenWorkRecordOrgDailyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java index df795a2065..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,10 @@ 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; @@ -104,4 +106,13 @@ public interface ScreenWorkRecordOrgDailyService extends BaseService currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId); + //下级所有组织 List subAgencyRankList = baseDao.selectSubList( CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? agencyInfoDTO.getSubAgencyIds() : new ArrayList<>(), formDTO.getDataType(), formDTO.getCustomerId(), dateId); + //直属网格 List subGridList = baseDao.selectSubGridList( CollectionUtils.isNotEmpty(agencyInfoDTO.getSubGridIds()) ? agencyInfoDTO.getSubGridIds() : new ArrayList<>(), formDTO.getDataType(), formDTO.getCustomerId(), dateId); + if (CollectionUtils.isNotEmpty(currentAgency)) { + returnDto.getSubRankList().addAll(currentAgency); + } returnDto.getSubRankList().addAll(subAgencyRankList); returnDto.getSubRankList().addAll(subGridList); int participateUserTotal = 0; @@ -223,4 +233,63 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl 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/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml index a844e7c4ab..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 @@ -90,4 +90,34 @@ 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 8902fda9f0..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 @@ -35,4 +35,33 @@ sw.month_id ASC + \ No newline at end of file From 118c445ddc32c25ecefa5835e1efe72c6a268016 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Feb 2021 14:56:35 +0800 Subject: [PATCH 41/77] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=96=B0=E5=A2=9Eapi/data/report/screen/index/subagencyindexra?= =?UTF-8?q?nk-py:=E4=B8=8B=E7=BA=A7=E9=83=A8=E9=97=A8or=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E6=8C=87=E6=95=B0=E6=8E=92=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/SubAgencyIndexRankPyFormDTO.java | 38 ++++++++++++++++++ .../controller/screen/IndexController.java | 12 +++++- .../screen/ScreenIndexDataMonthlyDao.java | 16 ++++++++ .../evaluationindex/screen/IndexService.java | 8 ++++ .../screen/impl/IndexServiceImpl.java | 37 +++++++++++++++++ .../ScreenWorkRecordOrgDailyServiceImpl.java | 1 + .../screen/ScreenIndexDataMonthlyDao.xml | 40 +++++++++++++++++++ 7 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java 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..4745f6df0c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java @@ -0,0 +1,38 @@ +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; +} 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..b0aaa5b5ff 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,15 @@ 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(@RequestBody SubAgencyIndexRankPyFormDTO formDTO) { + 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/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 a3a0fb5dcc..0d20ebd2a7 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 @@ -103,4 +103,20 @@ public interface ScreenIndexDataMonthlyDao{ * @author sun */ List getSingleIndexRank(SubSingleIndexRankFormDTO formDTO); + + /** + * @param yearId + * @param areaCode + * @Description 根据areaCode查询下级指数 + * @author yinzuomei + */ + List selectSubStreetByAreaCode(@Param("yearId")String yearId, @Param("areaCode")String areaCode,@Param("topNum") int topNum); + + /** + * @param yearId + * @param areaCode + * @Description 根据areaCode查询网格指数 + * @author yinzuomei + */ + List selectSubGridByAreaCode(@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/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/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 5c89d256f6..6f156334b9 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; @@ -385,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(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(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/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java index 061f5f1e7b..63f6fe4cd3 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 @@ -241,6 +241,7 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl + + + + From be99eb807716619101e41496417346b80058c490 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Feb 2021 15:50:36 +0800 Subject: [PATCH 42/77] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=86=E6=9E=90?= =?UTF-8?q?=E6=8A=BD=E5=8F=96=E9=80=BB=E8=BE=91bug=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E6=95=88=E7=8E=87=E5=88=86=E6=9E=90=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenProjectOrgDailyDao.xml | 2 +- .../com/epmet/controller/DemoController.java | 2 +- .../epmet/dao/crm/CustomerRelationDao.java | 4 +++ .../screen/ScreenCustomerAgencyDao.java | 2 ++ .../epmet/dao/org/StatsCustomerAgencyDao.java | 2 ++ .../service/crm/CustomerRelationService.java | 2 ++ .../crm/impl/CustomerRelationServiceImpl.java | 9 +++++++ .../ScreenProjectOrgDailyServiceImpl.java | 22 +++++++++++++--- ...nProjectQuantityOrgMonthlyServiceImpl.java | 26 ++++++++++++++++--- .../service/org/CustomerAgencyService.java | 2 ++ .../org/impl/CustomerAgencyServiceImpl.java | 5 ++++ .../mapper/crm/CustomerRelationDao.xml | 12 +++++++++ .../screen/ScreenCustomerAgencyDao.xml | 13 ++++++++++ .../mapper/org/StatsCustomerAgencyDao.xml | 7 +++++ 14 files changed, 101 insertions(+), 9 deletions(-) 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-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 4d9a22030a..1dd85ba74a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -790,8 +790,8 @@ public class DemoController { @RequestParam("dateId") String dateId, @RequestParam("monthId") String monthId) { screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); - screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId); + screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId, monthId); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java index 87a8db63bf..fabee946e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java @@ -23,6 +23,8 @@ import com.epmet.entity.crm.CustomerRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 客户关系表(01.14 add) * @@ -39,4 +41,6 @@ public interface CustomerRelationDao extends BaseDao { * @Date 2021/1/21 11:27 **/ CustomerSubInfoDTO selectCustomerSubInfo(@Param("customerId")String customerId); + + List selectListByPids(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index de96e0abd3..f61e21f2ad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -192,4 +192,6 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAgencyByCustomer(@Param("customerId")String customerId); + + List selectAgencyByAreaCode(String areaCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 9c1217bd02..05a85d3d7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -31,4 +31,6 @@ public interface StatsCustomerAgencyDao extends BaseDao { * @date 2021/1/14 上午11:07 */ List selectCustomerAreaCodeById(@Param("customerIds") List customerIds); + + CustomerAgencyEntity getRootAgencyInfo(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java index 25e3272436..7d9a9f8aca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java @@ -41,4 +41,6 @@ public interface CustomerRelationService extends BaseService getCustomerInfoMap(List customerIds); + + boolean haveSubCustomer(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java index 440491f8a5..ac09dc001a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java @@ -73,4 +73,13 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl customer)); } + + @Override + public boolean haveSubCustomer(String customerId) { + List list=baseDao.selectListByPids(customerId); + if(null==list||list.isEmpty()){ + return false; + } + return true; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index 3f69596cd3..b5c71b558b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -23,7 +23,6 @@ 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.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; @@ -34,7 +33,10 @@ import com.epmet.dto.pingyin.result.ProjectOrgDailyResultDTO; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectOrgDailyEntity; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.crm.CustomerRelationService; import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.service.org.CustomerAgencyService; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; @@ -45,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -62,6 +65,10 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl page(Map params) { @@ -148,9 +155,18 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl agencyInfos = agencyDao.selectAgencyByCustomer(customerId); + List agencyInfos = new ArrayList<>(); + //如果有子客户要按照跟组织的area_code查询组织列表 + if(customerRelationService.haveSubCustomer(customerId)){ + // + CustomerAgencyEntity rootAgency=customerAgencyService.getRootAgencyInfo(customerId); + agencyInfos=agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); + }else{ + agencyInfos=agencyDao.selectAgencyByCustomer(customerId); + } if (CollectionUtils.isEmpty(agencyInfos)){ - throw new RenException(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + return; } List projectOrgDaily = baseDao.selectOrgProject(agencyInfos, dateId); if (CollectionUtils.isEmpty(projectOrgDaily)){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java index 15b8a46201..960f863d95 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -23,7 +23,6 @@ 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.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; @@ -35,7 +34,10 @@ import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.ScreenProjectQuantityOrgMonthlyDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyEntity; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.crm.CustomerRelationService; import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; +import com.epmet.service.org.CustomerAgencyService; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; @@ -45,6 +47,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -62,7 +65,10 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< @Autowired private ScreenCustomerAgencyDao agencyDao; - + @Autowired + private CustomerRelationService customerRelationService; + @Autowired + private CustomerAgencyService customerAgencyService; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -147,10 +153,20 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< */ @Override public void extractionProjectOrgMonthly(String customerId, String monthId) { - List screenProjectOrgDailyDTOS = agencyDao.selectAgencyByCustomer(customerId); + List screenProjectOrgDailyDTOS = new ArrayList<>(); + //如果有子客户要按照跟组织的area_code查询组织列表 + if(customerRelationService.haveSubCustomer(customerId)){ + // + CustomerAgencyEntity rootAgency=customerAgencyService.getRootAgencyInfo(customerId); + screenProjectOrgDailyDTOS=agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); + }else{ + screenProjectOrgDailyDTOS=agencyDao.selectAgencyByCustomer(customerId); + } if (CollectionUtils.isEmpty(screenProjectOrgDailyDTOS)){ - throw new RenException(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + return; } + List agencyInfos = ConvertUtils.sourceToTarget(screenProjectOrgDailyDTOS, ScreenProjectQuantityOrgMonthlyDTO.class); List projectOrg = baseDao.selectQuantityOrgMonthly(agencyInfos, monthId); if (!CollectionUtils.isEmpty(projectOrg)){ @@ -174,6 +190,7 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< if (a.getAreaCode().equals(p.getAreaCode())){ a.setClosedIncr(p.getClosedIncr()); a.setProjectIncr(p.getProjectIncr()); + a.setProjectIncr(p.getProjectIncr()); } }); } @@ -183,6 +200,7 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< a.setClosedTotal(p.getClosedTotal()); a.setProjectTotal(p.getProjectTotal()); a.setUnClosedTotal(p.getUnClosedTotal()); + a.setProjectIncr(p.getProjectIncr()); } }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index b93c4563ec..b3aa943ada 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -18,4 +18,6 @@ public interface CustomerAgencyService { * @date 2021/1/14 上午11:07 */ List selectCustomerAreaCodeById(List customerIds); + + CustomerAgencyEntity getRootAgencyInfo(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 702da0930d..8a8fae83b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -45,4 +45,9 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { } return new ArrayList<>(); } + + @Override + public CustomerAgencyEntity getRootAgencyInfo(String customerId) { + return customerAgencyDao.getRootAgencyInfo(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml index a92c55e9f9..88c12c8deb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml @@ -22,4 +22,16 @@ AND cr.`STATUS` = 'open' AND cr.PARENT_CUSTOMER_ID =#{customerId} + + \ No newline at end of file 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/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index 945b47260e..d5ead92c47 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -118,4 +118,11 @@ ) + \ No newline at end of file From f9c33183f8055b2a2d5466efc8597fb41156c27a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 1 Mar 2021 09:28:48 +0800 Subject: [PATCH 43/77] =?UTF-8?q?data/report/project/projectdetail?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/project/impl/ProjectServiceImpl.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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 e0742c8a0c..4f6c646ad6 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 @@ -204,17 +204,15 @@ 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()){ + throw new RenException(String.format("项目信息查询失败(该接口目前只支持e事通内的客户),projectId:%s", processListFormDTO.getProjectId())); } + 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); From d1c13b35953ec0d22593391b0a3b3a229e082694 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 1 Mar 2021 09:36:44 +0800 Subject: [PATCH 44/77] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/controller/screen/ScreenProjectController.java | 2 +- .../com/epmet/controller/ScreenProjectDataCollController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 2d2c1e79a0..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 @@ -68,7 +68,7 @@ public class ScreenProjectController { return screenProjectService.projectDistribution(formDTO); } - @PostMapping("projectdetail") + @PostMapping("projectdetailv2") public Result projectDetail(@RequestBody ScreenProjectDetailFormDTO formDTO){ return screenProjectService.projectDistributionDetail(formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java index cfb2a30536..43b6171c05 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -141,7 +141,7 @@ public class ScreenProjectDataCollController { @RequestMapping("uploadprojectinfo") public Result uploadProjectInfo(@RequestHeader("CustomerId") String customerId,@RequestBody ScreenCollFormDTO param){ if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { - throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + throw new ValidateException("参数错误:dataList不能为空且dateId不能为空"); } projectDataService.collect(customerId,param); return new Result(); From 83b9995acffecedd0c0644612efcb09947d8501b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 1 Mar 2021 13:25:46 +0800 Subject: [PATCH 45/77] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml | 2 +- .../screen/ScreenProjectQuantityOrgMonthlyDao.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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} From a6180241d67b2ff72d0891a347432d95d925238f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 1 Mar 2021 14:44:27 +0800 Subject: [PATCH 46/77] =?UTF-8?q?=E3=80=90146=E4=BD=93=E7=B3=BB=E3=80=91?= =?UTF-8?q?=E7=AB=9E=E6=A0=87=E7=AE=A1=E7=90=86-=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E8=A7=A3=EF=BC=8C=E5=8F=AF=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2fake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/datareport/service/plugins/impl/OfsServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java index 7ae8b62e43..fbe09c540f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java @@ -52,6 +52,7 @@ public class OfsServiceImpl implements OfsService { * @description 【146体系】竞标管理-列表 * @Date 2021/1/22 13:38 **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List queryBidList(String customerId) { return screenBidInfoDao.selectList(customerId); From 57c1586c6a427ef3723491db93d7b6ccfcb5325c Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 1 Mar 2021 15:02:05 +0800 Subject: [PATCH 47/77] =?UTF-8?q?data/report/plugins/ofs/list=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=BB=99=E5=90=8D=E7=A7=B0=E5=8A=A0=E4=B8=8A=E5=BA=8F?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/FineExampleFormDTO.java | 2 -- .../screen/PartyMemberLeadController.java | 2 +- .../screen/impl/PartyMemberLeadServiceImpl.java | 13 +++++-------- .../resources/mapper/plugins/ScreenListInfoDao.xml | 10 +++++++--- 4 files changed, 13 insertions(+), 14 deletions(-) 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 938c15bdf4..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 @@ -22,6 +22,4 @@ public class FineExampleFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {FineExample.class}) private String agencyId; - - private String customerId; } 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 9a0d67f2b2..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 @@ -30,7 +30,7 @@ public class PartyMemberLeadController { * @date 2020/8/20 1:56 下午 */ @PostMapping("fineexample") - public Result fineExample(@RequestHeader("CustomerId") String customerId, @RequestBody FineExampleFormDTO fineExampleFormDTO){ + public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); return new Result().ok(partyMemberLeadService.fineExample(fineExampleFormDTO)); } 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 ce075165b6..61c4331216 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 @@ -70,14 +70,11 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { - String customerId = fineExampleFormDTO.getCustomerId(); - String areaCode = null; - if(StringUtils.isBlank(customerId)){ - ScreenCustomerAgencyDTO agencyInfo = customerAgencyDao.selectByAgencyId(fineExampleFormDTO.getAgencyId()); - if(null == agencyInfo) throw new RenException("未找到对应的机关"); - customerId = agencyInfo.getCustomerId(); - areaCode = agencyInfo.getAreaCode(); - } + 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()) 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 From f0a818d3f5e1fab9c78651b4d244003a99cb1698 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 1 Mar 2021 15:18:14 +0800 Subject: [PATCH 48/77] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E5=A0=B5=E7=82=B9?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenDifficultyDataDao.java | 3 +-- .../impl/GrassRootsGovernServiceImpl.java | 7 +------ .../screen/impl/ScreenProjectServiceImpl.java | 1 + .../mapper/screen/ScreenDifficultyDataDao.xml | 20 ++++++++++--------- 4 files changed, 14 insertions(+), 17 deletions(-) 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 8041e34caa..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 @@ -44,12 +44,11 @@ public interface ScreenDifficultyDataDao { /** * @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数【new】 - * @Param orgIds * @Param type * @author zxc * @date 2021/2/25 下午6:41 */ - List selectDifficultyNew(@Param("orgIds")List orgIds,@Param("type")String type); + List selectDifficultyByAreaCode(@Param("areaCode")String areaCode,@Param("type")String type); ProjectDetailResultDTO projectDetail(@Param("eventId")String projectId); 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 ec53c3c834..a94607333f 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 @@ -104,18 +104,13 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List difficultProject(AgencyNumTypeParamFormDTO param) { - List nextAgencyIds = new ArrayList<>(); List result = new ArrayList<>(); if(null == param.getTopNum()){ param.setTopNum(NumConstant.TWO); } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); if (StringUtils.isNotEmpty(param.getAreaCode())){ - nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); - if (CollectionUtils.isEmpty(nextAgencyIds)){ - return new ArrayList<>(); - } - result = screenDifficultyDataDao.selectDifficultyNew(nextAgencyIds,param.getType()); + result = screenDifficultyDataDao.selectDifficultyByAreaCode(param.getAreaCode(),param.getType()); }else { result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); } 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 8f2369ea07..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 @@ -106,6 +106,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { * @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/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 59abb0b764..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 @@ -53,7 +53,7 @@ - SELECT diff.EVENT_ID AS projectId, diff.EVENT_CONTENT AS title, @@ -65,15 +65,17 @@ diff.EVENT_RE_ORG AS handleDepts, diff.EVENT_RE_ORG AS handleCount FROM - screen_difficulty_data diff + screen_difficulty_data diff + left join screen_customer_grid scg + on(diff.ORG_ID=scg.GRID_ID and scg.DEL_FLAG='0') WHERE - diff.DEL_FLAG = '0' - AND ( - - diff.ALL_PARENT_IDS LIKE CONCAT('%',#{id},'%') - - ) - ORDER BY (CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT ELSE diff.EVENT_RE_ORG END) DESC + diff.DEL_FLAG = '0' + AND scg.AREA_CODE like concat(#{areaCode},'%') + ORDER BY + (CASE #{type} + WHEN 'timelongest' THEN diff.EVENT_COST_TIME + WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT + ELSE diff.EVENT_RE_ORG END) DESC \ No newline at end of file From f6b97632d55d1058d84f4ced70cc6492fb0c00bb Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 1 Mar 2021 17:22:06 +0800 Subject: [PATCH 49/77] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=9F=A5=E8=AF=A2=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=B8=BA=E7=A9=BA=E6=97=B6=E5=A1=AB=E5=85=850?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/screen/ScreenUserJoinDao.xml | 69 +++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) 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 749de01cef..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,57 +5,56 @@ From 0822e05479b394e1b911621bfa7e57ee61eba3ac Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 1 Mar 2021 17:22:18 +0800 Subject: [PATCH 50/77] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/group/service/impl/ResiGroupCodeServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 Date: Mon, 1 Mar 2021 17:29:23 +0800 Subject: [PATCH 51/77] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/GrassRootsGovernServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 a94607333f..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 @@ -267,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); @@ -282,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(); From 00357cc9561fd384fc956dd67b8bc707932a1576 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 1 Mar 2021 18:03:22 +0800 Subject: [PATCH 52/77] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E3=80=81=E8=81=94=E5=BB=BA=E5=85=B1=E5=BB=BA=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 63f6fe4cd3..9bf3d32056 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 @@ -161,9 +161,9 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl Date: Mon, 1 Mar 2021 18:09:28 +0800 Subject: [PATCH 53/77] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E3=80=81=E8=81=94=E5=BB=BA=E5=85=B1=E5=BB=BA=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScreenWorkRecordOrgDailyServiceImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 9bf3d32056..60cd057d9c 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 @@ -161,9 +161,7 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl= formDTO.getTopRow() ? From 1b51d028eb507607297028e45dfcab5eae443d7a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 1 Mar 2021 19:16:23 +0800 Subject: [PATCH 54/77] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E3=80=81=E8=81=94=E5=BB=BA=E5=85=B1=E5=BB=BA=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScreenWorkRecordOrgDailyServiceImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 60cd057d9c..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 @@ -134,6 +134,7 @@ 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()); } @@ -144,23 +145,24 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(), formDTO.getDataType(), formDTO.getCustomerId(), dateId); //下级所有组织 - List subAgencyRankList = baseDao.selectSubList( - CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? agencyInfoDTO.getSubAgencyIds() : new ArrayList<>(), + List subAgencyRankList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? baseDao.selectSubList( + agencyInfoDTO.getSubAgencyIds(), formDTO.getDataType(), formDTO.getCustomerId(), - dateId); + dateId) : new ArrayList<>(); //直属网格 - List subGridList = baseDao.selectSubGridList( - CollectionUtils.isNotEmpty(agencyInfoDTO.getSubGridIds()) ? agencyInfoDTO.getSubGridIds() : new ArrayList<>(), + List subGridList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubGridIds()) ? baseDao.selectSubGridList( + agencyInfoDTO.getSubGridIds(), formDTO.getDataType(), formDTO.getCustomerId(), - dateId); + dateId) : new ArrayList<>(); returnDto.getSubRankList().addAll(subAgencyRankList); returnDto.getSubRankList().addAll(subGridList); From 1164b2807a2fc519d51242925d2a85481b4a7de0 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 2 Mar 2021 10:12:30 +0800 Subject: [PATCH 55/77] =?UTF-8?q?=E9=9D=9E=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ScreenProjectQuantityOrgMonthlyServiceImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java index 960f863d95..3d06e12698 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -188,19 +188,19 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< if (!CollectionUtils.isEmpty(projectOrg)){ projectOrg.forEach(p -> { if (a.getAreaCode().equals(p.getAreaCode())){ - a.setClosedIncr(p.getClosedIncr()); - a.setProjectIncr(p.getProjectIncr()); - a.setProjectIncr(p.getProjectIncr()); + a.setClosedIncr(null == p.getClosedIncr() ? NumConstant.ZERO : p.getClosedIncr()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); } }); } if (!CollectionUtils.isEmpty(projectGrandOrg)){ projectGrandOrg.forEach(p -> { if (a.getAreaCode().equals(p.getAreaCode())){ - a.setClosedTotal(p.getClosedTotal()); - a.setProjectTotal(p.getProjectTotal()); - a.setUnClosedTotal(p.getUnClosedTotal()); - a.setProjectIncr(p.getProjectIncr()); + a.setClosedTotal(null == p.getClosedTotal() ? NumConstant.ZERO : p.getClosedTotal()); + a.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + a.setUnClosedTotal(null == p.getUnClosedTotal() ? NumConstant.ZERO : p.getUnClosedTotal()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); } }); } From fca8867d69670b3723cf9e77945e54d6a9cb6703 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 2 Mar 2021 10:48:28 +0800 Subject: [PATCH 56/77] =?UTF-8?q?=E5=8F=8D=E5=8F=82=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GrassrootsPartyDevServiceImpl.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 6285e007f4..6c94e983ec 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 @@ -12,6 +12,7 @@ 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; @@ -78,7 +79,7 @@ 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; } @@ -96,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 From 66e8f0b269aec787e613683a50a5839f03bb9033 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 2 Mar 2021 13:47:05 +0800 Subject: [PATCH 57/77] =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=A6=9C=E5=8D=95=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/screen/ScreenGovernRankDataDao.xml | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) 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 f98257b0a0..35130ae0b1 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 @@ -27,7 +27,7 @@ \ No newline at end of file From 3f927a1359b102c79d4c64f900f37deb115660f7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 2 Mar 2021 13:56:20 +0800 Subject: [PATCH 58/77] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E7=BE=A4=E4=BC=97=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3sql?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 0db5e467e1..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 @@ -29,7 +29,7 @@ FROM screen_customer_agency sca LEFT JOIN screen_party_link_masses_data md - ON ( sca.agency_id = md.ORG_ID AND md.del_flag = '0' ) + ON ( sca.agency_id = md.ORG_ID AND md.del_flag = '0' and md.org_type='agency') WHERE SCA.DEL_FLAG='0' AND sca.is_display = '1' @@ -47,7 +47,7 @@ FROM screen_customer_grid scg LEFT JOIN screen_party_link_masses_data md - ON ( scg.GRID_ID = md.ORG_ID AND md.del_flag = '0' ) + ON ( scg.GRID_ID = md.ORG_ID AND md.del_flag = '0' and md.org_type='grid' ) WHERE scg.DEL_FLAG='0' AND scg.GRID_ID in From dcf6cfafa1ea16cbbb9bfdc7a30a6ab0b36a6842 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 2 Mar 2021 14:53:49 +0800 Subject: [PATCH 59/77] =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=A6=9C=E5=8D=95=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/GovernCapacityResultDTO.java | 2 + .../mapper/screen/ScreenGovernRankDataDao.xml | 95 +++++++++++-------- 2 files changed, 55 insertions(+), 42 deletions(-) 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-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml index 35130ae0b1..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 @@ (SELECT - rankData.ORG_NAME AS agencyName, - rankData.RESPONSE_RATIO, - rankData.RESOLVED_RATIO, - rankData.GOVERN_RATIO, - rankData.SATISFACTION_RATIO, - pa.AGENCY_NAME AS parentAgencyName - FROM - screen_govern_rank_data rankData - LEFT JOIN screen_customer_agency agency ON (rankData.org_id = agency.AGENCY_ID AND agency.DEL_FLAG = '0') - left join screen_customer_agency pa on(agency.PARENT_AREA_CODE=pa.AREA_CODE and pa.DEL_FLAG='0') - WHERE - rankData.DEL_FLAG = '0' - AND rankData.org_id in - - #{orgId} - - AND rankData.MONTH_ID =#{monthId} - ORDER BY - (rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC, - rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC) + agency.agency_id as orgId, + agency.AGENCY_NAME AS agencyName, + IFNULL(rankData.RESPONSE_RATIO,0) AS RESPONSE_RATIO, + IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO, + IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO, + IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO, + pa.AGENCY_NAME AS parentAgencyName + FROM screen_customer_agency agency + left join screen_customer_agency pa + on(agency.PARENT_AREA_CODE=pa.AREA_CODE + and pa.DEL_FLAG='0') + left join screen_govern_rank_data rankData + ON (agency.AGENCY_ID =rankData.org_id + AND rankData.DEL_FLAG = '0' + and rankData.org_type='agency') + WHERE + agency.DEL_FLAG = '0' + AND agency.agency_id in + + #{orgId} + + AND rankData.MONTH_ID =#{monthId} + ORDER BY + (rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC, + rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC + ) union - (SELECT - rankData.ORG_NAME AS agencyName, - rankData.RESPONSE_RATIO, - rankData.RESOLVED_RATIO, - rankData.GOVERN_RATIO, - rankData.SATISFACTION_RATIO, - ca.agency_name AS parentAgencyName - FROM - screen_govern_rank_data rankData - inner JOIN screen_customer_grid grid ON (rankData.org_id = grid.grid_id AND grid.DEL_FLAG = 0) - left join screen_customer_agency ca on (ca.agency_id = grid.parent_agency_id) - WHERE - rankData.DEL_FLAG = '0' - AND rankData.org_id in - - #{orgId} - - AND rankData.MONTH_ID =#{monthId} - ORDER BY - (rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC, - rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO - DESC + ( + SELECT + grid.grid_id as orgId, + grid.GRID_NAME AS agencyName, + IFNULL(rankData.RESPONSE_RATIO,0) AS RESPONSE_RATIO, + IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO, + IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO, + IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO, + ca.agency_name AS parentAgencyName + FROM screen_customer_grid grid + left join screen_customer_agency ca + on (ca.agency_id = grid.parent_agency_id) + left join screen_govern_rank_data rankData + ON (grid.grid_id=rankData.org_id + AND grid.DEL_FLAG = 0 + and rankData.org_type='grid') + WHERE grid.DEL_FLAG = '0' + AND grid.GRID_ID in + + #{orgId} + + AND rankData.MONTH_ID =#{monthId} + ORDER BY + (rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC, + rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO + DESC ) From 2ee24b2f39a3f96a564347955eac16de16b05ec1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 2 Mar 2021 15:08:36 +0800 Subject: [PATCH 60/77] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/enums/EnvEnum.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 8cbf23061d..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; @@ -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) { From 46a622c83ef3598ed2ee2f95f73838dbeedd36c8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 2 Mar 2021 15:30:35 +0800 Subject: [PATCH 61/77] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E5=A4=A7=E5=B1=8F-?= =?UTF-8?q?=E4=B8=8B=E7=BA=A7=E8=A1=97=E9=81=93or=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E6=8C=87=E6=95=B0=E6=8E=92=E8=A1=8C=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/form/SubAgencyIndexRankPyFormDTO.java | 4 ++++ .../datareport/controller/screen/IndexController.java | 3 ++- .../screen/ScreenIndexDataMonthlyDao.java | 10 ++++++++-- .../evaluationindex/screen/impl/IndexServiceImpl.java | 4 ++-- .../mapper/screen/ScreenIndexDataMonthlyDao.xml | 2 ++ 5 files changed, 18 insertions(+), 5 deletions(-) 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 index 4745f6df0c..f437e1a5b4 100644 --- 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 @@ -6,6 +6,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; + /** * 描述一下 * @@ -35,4 +36,7 @@ public class SubAgencyIndexRankPyFormDTO implements Serializable { @NotBlank(message = "type不能为空,街道:street;网格:grid") private String type; + + @NotBlank(message = "customerId不能为空") + private String 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 b0aaa5b5ff..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 @@ -157,7 +157,8 @@ public class IndexController { * @Date 2021/2/28 14:33 **/ @PostMapping("subagencyindexrank-py") - Result> subAgencyIndexRankPy(@RequestBody SubAgencyIndexRankPyFormDTO formDTO) { + 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/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 0d20ebd2a7..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 @@ -110,7 +110,10 @@ public interface ScreenIndexDataMonthlyDao{ * @Description 根据areaCode查询下级指数 * @author yinzuomei */ - List selectSubStreetByAreaCode(@Param("yearId")String yearId, @Param("areaCode")String areaCode,@Param("topNum") int topNum); + List selectSubStreetByAreaCode(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("areaCode") String areaCode, + @Param("topNum") int topNum); /** * @param yearId @@ -118,5 +121,8 @@ public interface ScreenIndexDataMonthlyDao{ * @Description 根据areaCode查询网格指数 * @author yinzuomei */ - List selectSubGridByAreaCode(@Param("yearId")String yearId, @Param("areaCode")String areaCode,@Param("topNum") int topNum); + 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/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 6f156334b9..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 @@ -401,7 +401,7 @@ public class IndexServiceImpl implements IndexService { LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); String yearId = String.valueOf(now.getYear()); if("street".equals(formDTO.getType())){ - List streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(yearId,formDTO.getAreaCode(),formDTO.getTopNum()); + List streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum()); // 小数四舍五入 streetList.forEach(indexRank -> { indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); @@ -411,7 +411,7 @@ public class IndexServiceImpl implements IndexService { }); return streetList; } - List gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(yearId,formDTO.getAreaCode(),formDTO.getTopNum()); + List gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum()); // 小数四舍五入 gridList.forEach(indexRank -> { indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); 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 d298c0f1e7..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 @@ -299,6 +299,7 @@ WHERE sca.del_flag = '0' AND sca.PARENT_AREA_CODE=#{areaCode} + and sy.CUSTOMER_ID=#{customerId} ORDER BY index_total DESC LIMIT #{topNum} @@ -319,6 +320,7 @@ WHERE scg.del_flag = '0' AND scg.AREA_CODE like CONCAT(#{areaCode},'%') + and sy.CUSTOMER_ID=#{customerId} ORDER BY index_total DESC LIMIT #{topNum} From 928abb3d33a1f8edeca9929bed10d6f5d322c1fa Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 2 Mar 2021 16:14:41 +0800 Subject: [PATCH 62/77] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/aspect/RequirePermissionAspect.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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()); } } From 5fc7e64bb82136d0450e146218dc11753927daaa Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 2 Mar 2021 16:23:14 +0800 Subject: [PATCH 63/77] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/GovWebServiceImpl.java | 7 ++----- .../main/java/com/epmet/service/impl/LoginServiceImpl.java | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) 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、账号是否存在 //获取用户信息 From ad68ffe71feb04a72a8d31eb08d1916e3a56c948 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 2 Mar 2021 16:29:56 +0800 Subject: [PATCH 64/77] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=88=86=E6=95=B0?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E5=A2=9E=E5=8A=A0monthId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/IndexCalculateController.java | 4 ++-- .../extract/toscreen/impl/ScreenExtractServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 1bf83298cc..26380abda1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -144,7 +144,7 @@ public class IndexCalculateController { long start = System.currentTimeMillis(); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); if (aBoolean) { - log.error("客户Id:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), aBoolean, (System.currentTimeMillis() - start) / 1000); + log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), formDTO.getMonthId(), aBoolean, (System.currentTimeMillis() - start) / 1000); } redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); @@ -200,7 +200,7 @@ public class IndexCalculateController { long start = System.currentTimeMillis(); try { Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); if (aBoolean) { return new Result().ok(true); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 1727e5ef69..8eda9e93c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -292,7 +292,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { formDTO1.setMonthId(monthId); formDTO1.setCustomerId(customerId); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO1); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO1.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); } catch (Exception e) { log.error("extractMonthly 计算分数异常,参数:{}", JSON.toJSONString(formDTO1)); } From 480bc7631c693fb522b0d5b2f8b674df53959f66 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 2 Mar 2021 17:25:17 +0800 Subject: [PATCH 65/77] =?UTF-8?q?=E5=8C=85=E8=A3=85=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD=E4=BD=BF=E7=94=A8equals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/GrassrootsPartyDevServiceImpl.java | 2 +- .../evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 6c94e983ec..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 @@ -277,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/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 61c4331216..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 @@ -329,7 +329,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { 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); } From cd5402fdca305ce616492af25f2ff158334b7b3e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Mar 2021 09:05:26 +0800 Subject: [PATCH 66/77] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenCustomerAgencyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d738a4d0db..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 @@ -298,7 +298,7 @@ and m.AREA_CODE=#{areaCode} - m.PARENT_AGENCY_ID=#{agencyId} + and m.PARENT_AGENCY_ID=#{agencyId} From dc7a96aca71a5d22504107acf9c24478e5c07418 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Mar 2021 09:16:40 +0800 Subject: [PATCH 67/77] =?UTF-8?q?bug=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenCustomerGridDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 16b7d3d554..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 @@ -133,7 +133,7 @@ and m.AREA_CODE=#{areaCode} - m.PARENT_AGENCY_ID=#{agencyId} + and m.PARENT_AGENCY_ID=#{agencyId} From f84578f3a4be789758149faba5edcdc6bbbc4069 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Mar 2021 12:26:49 +0800 Subject: [PATCH 68/77] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E5=8F=91=E8=A1=A8?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=EF=BC=8C=E6=9F=A5=E7=9C=8B=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../validator/IdCardNoValidatorUtils.java | 20 +++++++++---------- .../com/epmet/dao/IssueSuggestionDao.java | 3 +++ .../impl/IssueSuggestionServiceImpl.java | 15 +++++++++++--- .../resources/mapper/IssueSuggestionDao.xml | 8 ++++++++ 4 files changed, 33 insertions(+), 13 deletions(-) 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/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 From 861f90cee38ffa505f2ab879a376ac0652d09be5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 3 Mar 2021 17:30:03 +0800 Subject: [PATCH 69/77] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=BC=80=E6=96=B0=E6=96=B9=E6=B3=95=E3=80=90=E5=8F=AF=E5=A4=9A?= =?UTF-8?q?=E6=9C=88=E4=B8=80=E8=B5=B7=E8=AE=A1=E7=AE=97=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/indexcal/IndexStatisticsFormDTO.java | 23 ++++++++++++ .../controller/IndexCalculateController.java | 7 ++++ .../indexcal/IndexCalculateService.java | 3 ++ .../impl/IndexCalculateServiceImpl.java | 37 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/IndexStatisticsFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/IndexStatisticsFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/IndexStatisticsFormDTO.java new file mode 100644 index 0000000000..dd63b1fea7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/IndexStatisticsFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/3/3 下午4:32 + */ +@Data +public class IndexStatisticsFormDTO implements Serializable { + + private static final long serialVersionUID = 1127307237675056558L; + + private String customerId; + + private String monthId; + + private String startMonth; + + private String endMonth; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 26380abda1..58bd3ab491 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.CalculateStatus; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.IndexStatisticsFormDTO; import com.epmet.model.CalculateFlagModel; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; @@ -335,4 +336,10 @@ public class IndexCalculateController { factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); }*/ + + @PostMapping("indexstatistics") + public Result indexStatistics(@RequestBody IndexStatisticsFormDTO formDTO){ + indexCalculateService.indexStatistics(formDTO); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java index 7866473d6f..4e7c074a57 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.indexcal; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.IndexStatisticsFormDTO; /** * 指标计算service @@ -16,4 +17,6 @@ public interface IndexCalculateService { * @return */ Boolean indexCalculate(CalculateCommonFormDTO formDTO); + + Boolean indexStatistics(IndexStatisticsFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index db48bb1214..72e3369716 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -7,11 +7,14 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.dto.indexcal.IndexStatisticsFormDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.redis.IndexCalRedis; import com.epmet.service.crm.CustomerRelationService; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.util.DimIdGenerator; @@ -55,6 +58,8 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private ScreenCustomerAgencyDao screenCustomerAgencyDao; @Autowired private CustomerRelationService customerRelationService; + @Autowired + private IndexOriginExtractService indexOriginExtractService; @Override public Boolean indexCalculate(CalculateCommonFormDTO formDTO) { @@ -203,4 +208,36 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private Map getCustomerInfoMap(List customerIds) { return customerRelationService.getCustomerInfoMap(customerIds); } + + @Override + public Boolean indexStatistics(IndexStatisticsFormDTO formDTO) { + List customerIds = new ArrayList<>(); + if (StringUtils.isEmpty(formDTO.getCustomerId())){ + Result> externalCustomerIds = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); + if (!externalCustomerIds.success()){ + log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); + return false; + } + customerIds = externalCustomerIds.getData(); + }else customerIds.add(formDTO.getCustomerId()); + List monthIds = new ArrayList<>(); + if (StringUtils.isNotEmpty(formDTO.getStartMonth()) && StringUtils.isNotEmpty(formDTO.getEndMonth())){ + monthIds = DateUtils.getMonthBetween(formDTO.getStartMonth(),formDTO.getEndMonth()); + }else { + if (StringUtils.isEmpty(formDTO.getMonthId())){ + // 默认上月 + monthIds.add(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); + }else monthIds.add(formDTO.getMonthId()); + } + List finalMonthIds = monthIds; + customerIds.forEach(customerId -> { + finalMonthIds.forEach(monthId -> { + CalculateCommonFormDTO extractFormDTO = new CalculateCommonFormDTO(); + extractFormDTO.setCustomerId(customerId); + extractFormDTO.setMonthId(monthId); + this.indexCalculate(extractFormDTO); + }); + }); + return null; + } } From 0d54716db35312a0353014c01659f699ee00fd7e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Mar 2021 17:43:19 +0800 Subject: [PATCH 70/77] indexstatistics --- .../epmet/dto/screencoll/form/CustomerAgencyFormDTO.java | 5 +++-- .../java/com/epmet/controller/plugins/OfsController.java | 6 +++--- .../indexcal/impl/IndexCalculateServiceImpl.java | 9 ++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java index 0ef8749799..2ef49407e4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java @@ -60,7 +60,7 @@ public class CustomerAgencyFormDTO implements Serializable { private String level; /** - * 行政地区编码 + * 行政地区编码,孔村、榆山、锦水以及孔村要有值 */ private String areaCode; @@ -75,7 +75,8 @@ public class CustomerAgencyFormDTO implements Serializable { private String isDisplay; /** - * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + * v2升级:当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + * 孔村、榆山、锦水以及孔村要有值 */ private String parentAreaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java index 09f5942c5c..ca112ac6a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java @@ -26,7 +26,7 @@ public class OfsController { * @param customerId * @param formDTO * @author yinzuomei - * @description 【146】一张清单 + * @description 【146】一张清单 isFirst=true时,根据customerId先删除后增加 * @Date 2021/1/22 10:19 **/ @PostMapping("onelist-daily") @@ -40,7 +40,7 @@ public class OfsController { * @param customerId * @param formDTO * @author yinzuomei - * @description 【146】合同监管 + * @description 【146】合同监管 isFirst=true时,根据customerId先删除后增加 * @Date 2021/1/22 10:42 **/ @PostMapping("contract-daily") @@ -54,7 +54,7 @@ public class OfsController { * @param customerId * @param formDTO * @author yinzuomei - * @description 【146】竞标管理 + * @description 【146】竞标管理 isFirst=true时,根据customerId先删除后增加 * @Date 2021/1/22 10:53 **/ @PostMapping("bid-daily") diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index 72e3369716..afcfe24d75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -2,12 +2,13 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; -import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CustomerSubInfoDTO; import com.epmet.dto.indexcal.IndexStatisticsFormDTO; @@ -235,9 +236,11 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { CalculateCommonFormDTO extractFormDTO = new CalculateCommonFormDTO(); extractFormDTO.setCustomerId(customerId); extractFormDTO.setMonthId(monthId); - this.indexCalculate(extractFormDTO); + long start = System.currentTimeMillis(); + boolean calFlag=this.indexCalculate(extractFormDTO); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + calFlag + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); }); }); - return null; + return true; } } From 3b03299ef9fd9ce925dfd2d6934f0af53e12629e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Mar 2021 18:41:54 +0800 Subject: [PATCH 71/77] indexstatistics --- .../indexcal/impl/IndexCalculateServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index afcfe24d75..d517fd70ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -210,6 +211,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { return customerRelationService.getCustomerInfoMap(customerIds); } + @Async @Override public Boolean indexStatistics(IndexStatisticsFormDTO formDTO) { List customerIds = new ArrayList<>(); @@ -224,6 +226,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { List monthIds = new ArrayList<>(); if (StringUtils.isNotEmpty(formDTO.getStartMonth()) && StringUtils.isNotEmpty(formDTO.getEndMonth())){ monthIds = DateUtils.getMonthBetween(formDTO.getStartMonth(),formDTO.getEndMonth()); + log.info(JSON.toJSONString(monthIds)); }else { if (StringUtils.isEmpty(formDTO.getMonthId())){ // 默认上月 @@ -238,7 +241,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { extractFormDTO.setMonthId(monthId); long start = System.currentTimeMillis(); boolean calFlag=this.indexCalculate(extractFormDTO); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + calFlag + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + extractFormDTO.getCustomerId() + ";monthId:" + extractFormDTO.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + calFlag + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); }); }); return true; From 61eca4df096324cf9c37559367b771ade64aa94c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 3 Mar 2021 19:03:14 +0800 Subject: [PATCH 72/77] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/service/project/impl/ProjectServiceImpl.java | 3 ++- .../main/java/com/epmet/service/impl/ProjectServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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 e7ccd80f26..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 @@ -211,7 +211,8 @@ public class ProjectServiceImpl implements ProjectService { ProjectDetailResultDTO projectDetailResultDTO=new ProjectDetailResultDTO(); Result result=govProjectOpenFeignClient.queryProjectInfoByProjectId(processListFormDTO.getProjectId()); if(!result.success()||null==result.getData()){ - throw new RenException(String.format("项目信息查询失败(该接口目前只支持e事通内的客户),projectId:%s", processListFormDTO.getProjectId())); + log.warn(String.format("项目信息查询失败(该接口目前只支持e事通内的客户),projectId:%s", processListFormDTO.getProjectId())); + return projectDetailResultDTO; } ProjectInfoDTO projectInfoDTO=result.getData(); projectDetailResultDTO.setImgUrlList(projectInfoDTO.getImgUrlList()); 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 2fb4b5f45c..309377bb4b 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 @@ -1928,7 +1928,7 @@ public class ProjectServiceImpl extends BaseServiceImpl issueDTOResult=govIssueOpenFeignClient.queryIssueDetail(formDTO); From 0ac8f3b7564831a033c0e0f9ccfba1c8b915b6b9 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 4 Mar 2021 09:43:27 +0800 Subject: [PATCH 73/77] =?UTF-8?q?=E7=BB=99mybatis=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=9A=84=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=A2=9E=E5=8A=A0=E6=97=A0?= =?UTF-8?q?=E5=8F=82=E6=9E=84=E9=80=A0=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/ScreenDifficultyImgDataEntity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java index ea60d69e09..c063015f17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java @@ -7,6 +7,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; /** @@ -19,6 +20,7 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper=false) @TableName("screen_difficulty_img_data") @AllArgsConstructor +@NoArgsConstructor public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; From 6f1bef31f2aa4d7b7218e37c7a2f02dad3d73aec Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 4 Mar 2021 10:10:56 +0800 Subject: [PATCH 74/77] =?UTF-8?q?selectIssueProjectList=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=8C=87=E5=AE=9Acustomer=5Fid?= =?UTF-8?q?=E8=A1=A8=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/issue/StatsIssueDao.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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}