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 001/234] =?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 002/234] =?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 003/234] =?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 004/234] =?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 005/234] =?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 006/234] =?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 007/234] =?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 008/234] =?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 009/234] =?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 010/234] =?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 011/234] =?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 012/234] =?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 013/234] =?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 014/234] =?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 015/234] =?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 016/234] =?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 017/234] =?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 018/234] =?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 019/234] =?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 021/234] =?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 2ec73d7dc22564535b9e80e946c88fd1b0ddcf12 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 25 Feb 2021 17:08:29 +0800 Subject: [PATCH 022/234] =?UTF-8?q?=E3=80=90=E9=85=92=E5=9F=8Ee=E9=80=9A?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=99=BB=E5=BD=95=E3=80=91=E5=B0=86yml?= =?UTF-8?q?=E7=9A=84=E7=A7=98=E9=92=A5=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=88=86=E6=88=902=E4=BB=BD=EF=BC=8Cc=E7=AB=AF=E5=92=8Cg?= =?UTF-8?q?=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 36 ++++++++++++------- epmet-auth/src/main/resources/bootstrap.yml | 12 ++++--- .../com/epmet/commons/thirdplat/DemoApp.java | 2 +- .../apiservice/jcet/JcetApiService.java | 18 +++++----- .../thirdplat/properties/ThirdplatProps.java | 6 +++- 5 files changed, 48 insertions(+), 26 deletions(-) diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 5015feb391..74e4e92ab9 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -200,9 +200,13 @@ - http://101.206.141.251:21006 - soXDEoM1 - V7ea0KnlYt7eSyzc + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc + + http://101.206.141.219:21006 + xSMONWwP + UUCnxLyXiB4eBF4p @@ -249,9 +253,13 @@ - http://101.206.141.251:21006 - soXDEoM1 - V7ea0KnlYt7eSyzc + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc + + http://101.206.141.219:21006 + xSMONWwP + UUCnxLyXiB4eBF4p @@ -293,9 +301,13 @@ - http://101.206.141.251:21006 - soXDEoM1 - V7ea0KnlYt7eSyzc + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc + + http://101.206.141.219:21006 + xSMONWwP + UUCnxLyXiB4eBF4p @@ -341,9 +353,9 @@ - https://jcytc.lzjczl.com:21009 - 2cy0a9lA - 6hU3PQgxLcXr27SE + https://jcytc.lzjczl.com:21009 + 2cy0a9lA + 6hU3PQgxLcXr27SE diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 6efee6a635..35d3f0e1f7 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -135,7 +135,11 @@ shutdown: # 调用第三方平台相关参数 thirdplat: - jcet: - domain: @thirdplat.jcet.domain@ - appkey: @thirdplat.jcet.appkey@ - appsecret: @thirdplat.jcet.appsecret@ \ No newline at end of file + jcetCend: + domain: @thirdplat.jcet.c.domain@ + appkey: @thirdplat.jcet.c.appkey@ + appsecret: @thirdplat.jcet.c.appsecret@ + jcetGend: + domain: @thirdplat.jcet.g.domain@ + appkey: @thirdplat.jcet.g.appkey@ + appsecret: @thirdplat.jcet.g.appsecret@ \ No newline at end of file diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/DemoApp.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/DemoApp.java index 43b27e385b..1b874efc82 100644 --- a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/DemoApp.java +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/DemoApp.java @@ -20,7 +20,7 @@ public class DemoApp { //ssoToken.setSsoToken("wxz"); SsoTicketFormDTO ssoTicket = new SsoTicketFormDTO(); - ssoTicket.setSsoTicket("wxz"); + ssoTicket.setSsoTicket("ssoTicket-jGOAW66udmRtUWBKgs3q7k1w7prGxd5I"); int bodyLength = JSON.toJSONString(ssoTicket).getBytes("utf-8").length; 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..b158a61b6e 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 @@ -22,11 +22,13 @@ public class JcetApiService extends AbstractApiService { Logger logger = LoggerFactory.getLogger(getClass()); - private JcetThirdplatProps jcetThirdplatProps; + private JcetThirdplatProps jcetThirdplatCendProps; + private JcetThirdplatProps jcetThirdplatGendProps; public JcetApiService(ThirdplatProps props) { this.thirdplatProps = props; - jcetThirdplatProps = props.getJcet(); + jcetThirdplatCendProps = props.getJcetCend(); + jcetThirdplatGendProps = props.getJcetGend(); } /** @@ -43,12 +45,12 @@ public class JcetApiService extends AbstractApiService { SsoTicketFormDTO ssoTicket = new SsoTicketFormDTO(); ssoTicket.setSsoTicket(ticket); - String domain = jcetThirdplatProps.getDomain(); + String domain = jcetThirdplatCendProps.getDomain(); Result result = HttpClientManager.getInstance().sendPost( domain.concat(JcetConstants.URL_GET_USER_BY_TICKET), domain.startsWith("https://"), JSON.toJSONString(ssoTicket), - getHeaders(ssoTicket)); + getHeaders(ssoTicket, jcetThirdplatCendProps.getAppkey(), jcetThirdplatCendProps.getAppsecret())); try { logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); @@ -98,15 +100,15 @@ public class JcetApiService extends AbstractApiService { * @return * @throws UnsupportedEncodingException */ - private Map getHeaders(Object contentObject) throws UnsupportedEncodingException { + private Map getHeaders(Object contentObject, String appKey, String appSecret) throws UnsupportedEncodingException { int bodyLength = JSON.toJSONString(contentObject).getBytes("utf-8").length; 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()); - String encryptContent = jcetThirdplatProps.getAppkey() + timestamp + bodyLength; - headers.put(JcetConstants.PLAT_HEADER_OPEN_SIGN, SignUtils.generate(encryptContent, jcetThirdplatProps.getAppsecret())); + headers.put(JcetConstants.PLAT_HEADER_OPEN_APP_ID, appKey); + String encryptContent = appKey + timestamp + bodyLength; + headers.put(JcetConstants.PLAT_HEADER_OPEN_SIGN, SignUtils.generate(encryptContent, appSecret)); return headers; } 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..6ce8c89f9b 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 @@ -7,6 +7,10 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties(prefix = "thirdplat") public class ThirdplatProps { - private JcetThirdplatProps jcet; + // C端 + private JcetThirdplatProps jcetCend; + + // G端 + private JcetThirdplatProps jcetGend; } 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 023/234] =?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 024/234] =?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 025/234] =?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 026/234] =?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 027/234] =?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 95d13b3d5f75a1824076536f44b09b48cbd59278 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 26 Feb 2021 01:49:56 +0800 Subject: [PATCH 029/234] =?UTF-8?q?=E5=A2=9E=E5=8A=A0G=E7=AB=AFssotoken?= =?UTF-8?q?=E7=99=BB=E5=BD=95=20=E4=BF=AE=E6=94=B9G=E7=AB=AF=E7=99=BB?= =?UTF-8?q?=E5=BD=95=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 | 7 +-- .../epmet/dto/form/SsoWorkLoginFormDTO.java | 42 +++++++++++++++++ .../java/com/epmet/service/SsoService.java | 3 +- .../epmet/service/impl/SsoServiceImpl.java | 10 +++-- .../apiservice/AbstractApiService.java | 10 ++++- .../apiservice/jcet/JcetApiService.java | 45 ++++++++++++++++--- ...ltDTO.java => JcetCUserInfoResultDTO.java} | 2 +- .../result/jcet/JcetGUserInfoResultDTO.java | 25 +++++++++++ 8 files changed, 127 insertions(+), 17 deletions(-) create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/SsoWorkLoginFormDTO.java rename epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/{JcetUserInfoResultDTO.java => JcetCUserInfoResultDTO.java} (91%) create mode 100644 epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetGUserInfoResultDTO.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 86fc44aa18..2f5f480bf0 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.SsoEnteOrgFormDTO; import com.epmet.dto.form.SsoLoginFormDTO; +import com.epmet.dto.form.SsoWorkLoginFormDTO; import com.epmet.dto.result.SsoLoginResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.SsoService; @@ -45,7 +46,7 @@ public class SsoController { public Result testssoLogin(){ ThirdPlatUserInfo userInfoByTicket = null; try { - userInfoByTicket = jcetApiService.getUserInfoByTicket("ssoTicket-vYtMRuXAQZri3wpA2vyq5D8n3Q9oO7ui"); + userInfoByTicket = jcetApiService.getCUserInfoByTicket("ssoTicket-vYtMRuXAQZri3wpA2vyq5D8n3Q9oO7ui"); } catch (Exception e) { e.printStackTrace(); } @@ -58,8 +59,8 @@ public class SsoController { * @Description 1、ticket自动登录获取内部token **/ @PostMapping("work/login") - public Result ssoWorkLogin(@RequestBody SsoLoginFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, SsoLoginFormDTO.SsoLoginForm.class); + public Result ssoWorkLogin(@RequestBody SsoWorkLoginFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SsoWorkLoginFormDTO.SsoLoginForm.class); return new Result().ok(ssoService.ssoWorkLogin(formDTO)); } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/SsoWorkLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/SsoWorkLoginFormDTO.java new file mode 100644 index 0000000000..32ff9aa00b --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoWorkLoginFormDTO.java @@ -0,0 +1,42 @@ +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 SsoWorkLoginFormDTO implements Serializable { + + private static final long serialVersionUID = -6543952487970013031L; + + public interface SsoLoginForm{} + + /** + * sso票据,有效期为300秒 + */ + @NotBlank(message = "ssotoken不能为空",groups = SsoLoginForm.class) + private String token; + + /** + * 三方平台应用AppId + */ + @NotBlank(message = "三方平台应用AppId不能为空",groups = SsoLoginForm.class) + private String appId; + + /** + * app类型 resi;居民段,gov:工作端 + */ + @NotBlank(message = "app不能为空",groups = SsoLoginForm.class) + private String app; + + /** + * app;居民段,app:工作端 + */ + @NotBlank(message = "client不能为空",groups = SsoLoginForm.class) + private String client; +} diff --git a/epmet-auth/src/main/java/com/epmet/service/SsoService.java b/epmet-auth/src/main/java/com/epmet/service/SsoService.java index a2986482ab..b1f10e5622 100644 --- a/epmet-auth/src/main/java/com/epmet/service/SsoService.java +++ b/epmet-auth/src/main/java/com/epmet/service/SsoService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.dto.form.SsoEnteOrgFormDTO; import com.epmet.dto.form.SsoLoginFormDTO; +import com.epmet.dto.form.SsoWorkLoginFormDTO; import com.epmet.dto.result.SsoLoginResultDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -24,7 +25,7 @@ public interface SsoService { * @Author sun * @Description 1、ticket自动登录获取内部token **/ - UserTokenResultDTO ssoWorkLogin(SsoLoginFormDTO formDTO); + UserTokenResultDTO ssoWorkLogin(SsoWorkLoginFormDTO formDTO); /** * @param 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 67d00ea4e6..16cb78efe4 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 @@ -75,6 +75,7 @@ public class SsoServiceImpl implements SsoService { @Override public SsoLoginResultDTO ssoLogin(SsoLoginFormDTO formDTO) { String customerId = getCustomerId(formDTO.getAppId()); + //String customerId = "3a4f923665a7a07701bcb311aac9a156"; String userId = ""; Result apiServiceResult = operCrmOpenFeignClient.getApiServiceByCustomerId(new ApiServiceFormDTO(customerId)); @@ -89,7 +90,7 @@ public class SsoServiceImpl implements SsoService { ThirdPlatUserInfo userInfo; try { AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(apiServiceResult.getData().getApiServiceName()); - userInfo = apiService.getUserInfoByTicket(formDTO.getTicket()); + userInfo = apiService.getCUserInfoByTicket(formDTO.getTicket()); } catch (Exception e) { throw new RenException(e.getMessage()); } @@ -199,10 +200,11 @@ public class SsoServiceImpl implements SsoService { * @Description 1、ticket自动登录获取内部token **/ @Override - public UserTokenResultDTO ssoWorkLogin(SsoLoginFormDTO formDTO) { + public UserTokenResultDTO ssoWorkLogin(SsoWorkLoginFormDTO formDTO) { //1.根据appId查询客户id String customerId = getCustomerId(formDTO.getAppId()); + //String customerId = "3a4f923665a7a07701bcb311aac9a156"; //2.客户Id换取第三方apiService,根据ticket换取华为Id Result apiServiceResult = operCrmOpenFeignClient.getApiServiceByCustomerId(new ApiServiceFormDTO(customerId)); @@ -215,7 +217,7 @@ public class SsoServiceImpl implements SsoService { ThirdPlatUserInfo userInfo; try { AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(apiServiceResult.getData().getApiServiceName()); - userInfo = apiService.getUserInfoByTicket(formDTO.getTicket()); + userInfo = apiService.getGUserInfoBySSOToken(formDTO.getToken()); } catch (Exception e) { throw new RenException(e.getMessage()); } @@ -431,7 +433,7 @@ public class SsoServiceImpl implements SsoService { ThirdPlatUserInfo userInfo; try { AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(apiServiceResult.getData().getApiServiceName()); - userInfo = apiService.getUserInfoByTicket(formDTO.getTicket()); + userInfo = apiService.getGUserInfoBySSOToken(formDTO.getTicket()); } catch (Exception e) { throw new RenException(e.getMessage()); } 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..c1f3cfcbc7 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 @@ -19,7 +19,15 @@ public abstract class AbstractApiService { * @return * @throws Exception */ - public abstract ThirdPlatUserInfo getUserInfoByTicket(String ticket) throws Exception; + public abstract ThirdPlatUserInfo getCUserInfoByTicket(String ticket) throws Exception; + + /** + * G端用户token获取用户信息 + * @param token + * @return + * @throws Exception + */ + public abstract ThirdPlatUserInfo getGUserInfoBySSOToken(String token) throws Exception; /** * @Description 解析请求结果 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 b158a61b6e..5dbe5bdce0 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 @@ -5,7 +5,8 @@ import com.epmet.commons.thirdplat.apiservice.AbstractApiService; import com.epmet.commons.thirdplat.bean.ThirdPlatUserInfo; import com.epmet.commons.thirdplat.constants.JcetConstants; import com.epmet.commons.thirdplat.dto.form.jcet.SsoTicketFormDTO; -import com.epmet.commons.thirdplat.dto.result.jcet.JcetUserInfoResultDTO; +import com.epmet.commons.thirdplat.dto.result.jcet.JcetCUserInfoResultDTO; +import com.epmet.commons.thirdplat.dto.result.jcet.JcetGUserInfoResultDTO; import com.epmet.commons.thirdplat.encrypt.SignUtils; import com.epmet.commons.thirdplat.properties.JcetThirdplatProps; import com.epmet.commons.thirdplat.properties.ThirdplatProps; @@ -37,7 +38,7 @@ public class JcetApiService extends AbstractApiService { * @author wxz * @date 2021.01.19 10:26 */ - public ThirdPlatUserInfo getUserInfoByTicket(String ticket) throws UnsupportedEncodingException { + public ThirdPlatUserInfo getCUserInfoByTicket(String ticket) throws UnsupportedEncodingException { logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口入参 ticket:{}", ticket); @@ -50,7 +51,7 @@ public class JcetApiService extends AbstractApiService { domain.concat(JcetConstants.URL_GET_USER_BY_TICKET), domain.startsWith("https://"), JSON.toJSONString(ssoTicket), - getHeaders(ssoTicket, jcetThirdplatCendProps.getAppkey(), jcetThirdplatCendProps.getAppsecret())); + getHeaders(JSON.toJSONString(ssoTicket).getBytes("utf-8").length, jcetThirdplatCendProps.getAppkey(), jcetThirdplatCendProps.getAppsecret())); try { logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); @@ -59,7 +60,7 @@ public class JcetApiService extends AbstractApiService { } logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<"); - JcetUserInfoResultDTO resultDTO = parseResult(result, JcetUserInfoResultDTO.class); + JcetCUserInfoResultDTO resultDTO = parseResult(result, JcetCUserInfoResultDTO.class); ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo(); userInfo.setOpenId(resultDTO.getId()); @@ -68,6 +69,38 @@ public class JcetApiService extends AbstractApiService { return userInfo; } + @Override + public ThirdPlatUserInfo getGUserInfoBySSOToken(String token) throws Exception { + + logger.info("【请求酒城e通第三方平台】getGUserInfoBySSOToken()接口开始>>>>>>>>>>>>"); + logger.info("【请求酒城e通第三方平台】getGUserInfoBySSOToken()接口入参 ticket:{}", token); + + HashMap params = new HashMap<>(); + params.put("ssoToken",token); + + String domain = jcetThirdplatGendProps.getDomain(); + Result result = HttpClientManager.getInstance().sendGet( + domain.concat(JcetConstants.URL_GET_USER_BY_TOKEN), + domain.startsWith("https://"), + params, + getHeaders(0, jcetThirdplatGendProps.getAppkey(), jcetThirdplatGendProps.getAppsecret())); + + try { + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); + } catch (Exception e) { + //e.printStackTrace(); + } + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<"); + + JcetGUserInfoResultDTO resultDTO = parseResult(result, JcetGUserInfoResultDTO.class); + + ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo(); + userInfo.setOpenId(resultDTO.getUid()); + userInfo.setName(resultDTO.getName()); + userInfo.setMobile(resultDTO.getMobile()); + return userInfo; + } + /** * @return * @Description 通过token获取用户信息 @@ -96,12 +129,10 @@ public class JcetApiService extends AbstractApiService { /** * 获取请求所需要的头信息 * - * @param contentObject * @return * @throws UnsupportedEncodingException */ - private Map getHeaders(Object contentObject, String appKey, String appSecret) throws UnsupportedEncodingException { - int bodyLength = JSON.toJSONString(contentObject).getBytes("utf-8").length; + private Map getHeaders(int bodyLength, String appKey, String appSecret) throws UnsupportedEncodingException { Map headers = new HashMap(); long timestamp = System.currentTimeMillis(); diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetUserInfoResultDTO.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetCUserInfoResultDTO.java similarity index 91% rename from epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetUserInfoResultDTO.java rename to epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetCUserInfoResultDTO.java index 8c025e5b9b..765126025d 100644 --- a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetUserInfoResultDTO.java +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetCUserInfoResultDTO.java @@ -3,7 +3,7 @@ package com.epmet.commons.thirdplat.dto.result.jcet; import lombok.Data; @Data -public class JcetUserInfoResultDTO { +public class JcetCUserInfoResultDTO { private String id; /** * 用户名称 diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetGUserInfoResultDTO.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetGUserInfoResultDTO.java new file mode 100644 index 0000000000..24f2faf27c --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetGUserInfoResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.commons.thirdplat.dto.result.jcet; + +import lombok.Data; + +@Data +public class JcetGUserInfoResultDTO { + private String uid; + /** + * 手机号码 + */ + private String mobile; + /** + * 姓名 + */ + private String name; + /** + * 账号 + */ + private String account; + + /** + * 用户编码 + */ + private String code; +} 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 030/234] =?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 031/234] =?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 032/234] =?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 0b74d92a5935043f785985a4acba4af8ea6f6991 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 26 Feb 2021 11:00:10 +0800 Subject: [PATCH 033/234] =?UTF-8?q?HttpClientManager=20header=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BAobject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apiservice/jcet/JcetApiService.java | 7 ++++--- .../commons/tools/utils/HttpClientManager.java | 16 ++++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) 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 5dbe5bdce0..c2e631ae16 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 @@ -38,6 +38,7 @@ public class JcetApiService extends AbstractApiService { * @author wxz * @date 2021.01.19 10:26 */ + @Override public ThirdPlatUserInfo getCUserInfoByTicket(String ticket) throws UnsupportedEncodingException { logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); @@ -132,11 +133,11 @@ public class JcetApiService extends AbstractApiService { * @return * @throws UnsupportedEncodingException */ - private Map getHeaders(int bodyLength, String appKey, String appSecret) throws UnsupportedEncodingException { + private Map getHeaders(int bodyLength, String appKey, String appSecret) throws UnsupportedEncodingException { - 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_TIMESTAMP, timestamp); headers.put(JcetConstants.PLAT_HEADER_OPEN_APP_ID, appKey); String encryptContent = appKey + timestamp + bodyLength; headers.put(JcetConstants.PLAT_HEADER_OPEN_SIGN, SignUtils.generate(encryptContent, appSecret)); 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..463e0b4c6d 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,17 @@ 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 (StringUtils.isNotBlank(k)) { + httppost.addHeader(k, v == null ? null : v.toString()); + } }); } if (StringUtils.isNotEmpty(jsonStrParam)) { @@ -348,7 +350,7 @@ public class HttpClientManager { } } - public Result sendGet(String url, boolean isHttps, Map params, Map headerMap) { + public Result sendGet(String url, boolean isHttps, Map params, Map headerMap) { try { URIBuilder builder = new URIBuilder(url); @@ -363,7 +365,9 @@ public class HttpClientManager { httpGet.setConfig(requestConfig); if (null != headerMap){ headerMap.forEach((k,v) -> { - httpGet.addHeader(k,v); + if (StringUtils.isNotBlank(k)) { + httpGet.addHeader(k, v == null ? null : v.toString()); + } }); } return execute(httpGet, isHttps); 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 034/234] =?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 035/234] =?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 24001e55abf3e40ef943db9fbd39c5502ee842a5 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 26 Feb 2021 14:50:19 +0800 Subject: [PATCH 036/234] =?UTF-8?q?h5=E5=B7=A5=E4=BD=9C=E7=AB=AF=E7=99=BB?= =?UTF-8?q?=E9=99=86=E6=8E=A5=E5=8F=A3=E5=85=A5=E5=8F=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/SsoEnteOrgFormDTO.java | 6 +++--- .../main/java/com/epmet/service/impl/SsoServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/SsoEnteOrgFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/SsoEnteOrgFormDTO.java index 4706061267..d74deaf828 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/SsoEnteOrgFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoEnteOrgFormDTO.java @@ -15,10 +15,10 @@ public class SsoEnteOrgFormDTO implements Serializable { public interface AddUserInternalGroup {} public interface AddUserShowGroup extends CustomerClientShowGroup {} /** - * wxCode + * sso票据,有效期为300秒 */ - @NotBlank(message = "ticket不能为空",groups = {AddUserInternalGroup.class}) - private String ticket; + @NotBlank(message = "ssotoken不能为空",groups = SsoWorkLoginFormDTO.SsoLoginForm.class) + private String token; /** * 手机号 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 16cb78efe4..8da49ca303 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 @@ -433,7 +433,7 @@ public class SsoServiceImpl implements SsoService { ThirdPlatUserInfo userInfo; try { AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(apiServiceResult.getData().getApiServiceName()); - userInfo = apiService.getGUserInfoBySSOToken(formDTO.getTicket()); + userInfo = apiService.getGUserInfoBySSOToken(formDTO.getToken()); } catch (Exception e) { throw new RenException(e.getMessage()); } From c64a35837cd774f6cde12ec6d3c10661410c5c3b Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 26 Feb 2021 14:59:22 +0800 Subject: [PATCH 037/234] =?UTF-8?q?=E4=BF=AE=E6=94=B9sso=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E7=AB=AF=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/SsoController.java | 4 ++-- .../src/main/java/com/epmet/service/SsoService.java | 2 +- .../main/java/com/epmet/service/impl/SsoServiceImpl.java | 8 ++++---- 3 files changed, 7 insertions(+), 7 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 2f5f480bf0..e7ee68d696 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java @@ -37,9 +37,9 @@ public class SsoController { * @date 2021/1/18 下午4:59 */ @PostMapping("resi/login") - public Result ssoLogin(@RequestBody SsoLoginFormDTO formDTO){ + public Result ssoResiLogin(@RequestBody SsoLoginFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, SsoLoginFormDTO.SsoLoginForm.class); - return new Result().ok(ssoService.ssoLogin(formDTO)); + return new Result().ok(ssoService.ssoResiLogin(formDTO)); } @PostMapping("test") 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 b1f10e5622..bb4c712ea8 100644 --- a/epmet-auth/src/main/java/com/epmet/service/SsoService.java +++ b/epmet-auth/src/main/java/com/epmet/service/SsoService.java @@ -18,7 +18,7 @@ public interface SsoService { * @author zxc * @date 2021/1/18 下午4:59 */ - SsoLoginResultDTO ssoLogin(SsoLoginFormDTO formDTO); + SsoLoginResultDTO ssoResiLogin(SsoLoginFormDTO formDTO); /** * @param 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 16cb78efe4..b91e1981d6 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 @@ -73,7 +73,7 @@ public class SsoServiceImpl implements SsoService { * @date 2021/1/18 下午4:59 */ @Override - public SsoLoginResultDTO ssoLogin(SsoLoginFormDTO formDTO) { + public SsoLoginResultDTO ssoResiLogin(SsoLoginFormDTO formDTO) { String customerId = getCustomerId(formDTO.getAppId()); //String customerId = "3a4f923665a7a07701bcb311aac9a156"; String userId = ""; @@ -425,10 +425,10 @@ public class SsoServiceImpl implements SsoService { //2.客户Id换取第三方apiService,根据ticket换取华为Id Result apiServiceResult = operCrmOpenFeignClient.getApiServiceByCustomerId(new ApiServiceFormDTO(formDTO.getCustomerId())); if (!apiServiceResult.success()) { - throw new RenException("【SSO登录】调用OperCrm获取ApiService接口失败:", apiServiceResult.getInternalMsg()); + throw new RenException("【SSO enterOrg】调用OperCrm获取ApiService接口失败:", apiServiceResult.getInternalMsg()); } if (apiServiceResult.getData() == null || StringUtils.isBlank(apiServiceResult.getData().getApiServiceName())) { - throw new RenException("【SSO登录】调用OperCrm获取ApiService,查询到的结果为空:", apiServiceResult.toString()); + throw new RenException("【SSO enterOrg】调用OperCrm获取ApiService,查询到的结果为空:", apiServiceResult.toString()); } ThirdPlatUserInfo userInfo; try { @@ -439,7 +439,7 @@ public class SsoServiceImpl implements SsoService { } if (null == userInfo){ throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), - "【SSO登录】调用第三方平台查询用户信息失败,用户信息为空"); + "【SSO enterOrg】调用第三方平台查询用户信息失败,用户信息为空"); } //3、记录staff_wechat,并记录用户激活状态,激活时间 From bf2e8786dca09eb69ab4acf86b497dd3857603a0 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 26 Feb 2021 15:48:52 +0800 Subject: [PATCH 038/234] =?UTF-8?q?=E3=80=90sso=E7=99=BB=E5=BD=95=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9third=E6=9C=8D=E5=8A=A1=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E7=9A=84=E5=86=99=E6=B3=95=EF=BC=8C=E7=94=B1=E7=A1=AC?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E6=94=B9=E4=B8=BA=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 8 ++++++++ .../main/java/com/epmet/service/impl/SsoServiceImpl.java | 6 +++++- epmet-auth/src/main/resources/bootstrap.yml | 7 ++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 74e4e92ab9..eaa22e7557 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -207,6 +207,8 @@ http://101.206.141.219:21006 xSMONWwP UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -260,6 +262,8 @@ http://101.206.141.219:21006 xSMONWwP UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -308,6 +312,8 @@ http://101.206.141.219:21006 xSMONWwP UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -356,6 +362,8 @@ https://jcytc.lzjczl.com:21009 2cy0a9lA 6hU3PQgxLcXr27SE + + https://epmet-cloud.elinkservice.cn 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 bfee9177ba..fa58ce86fa 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 @@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -66,6 +67,9 @@ public class SsoServiceImpl implements SsoService { @Autowired private CpUserDetailRedis cpUserDetailRedis; + @Value("${epmet.third.urlPrefix}") + private String epmetThirdUrlPrefix; + /** * @Description 0、入口:得到token * @Param formDTO @@ -174,7 +178,7 @@ public class SsoServiceImpl implements SsoService { */ public String getCustomerId(String appId){ JSONObject jsonObject = new JSONObject(); - String customerMsgUrl = "https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/"; + String customerMsgUrl = epmetThirdUrlPrefix + "/api/third/customermp/getcustomermsg/"; String data = HttpClientManager.getInstance().sendPostByJSON(customerMsgUrl + appId, JSON.toJSONString(jsonObject)).getData(); log.info("调用third服务,根据appId查询客户信息:httpclient->url:" + customerMsgUrl + ",结果->" + data); JSONObject toResult = JSON.parseObject(data); diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 35d3f0e1f7..02f3a33105 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -142,4 +142,9 @@ thirdplat: jcetGend: domain: @thirdplat.jcet.g.domain@ appkey: @thirdplat.jcet.g.appkey@ - appsecret: @thirdplat.jcet.g.appsecret@ \ No newline at end of file + appsecret: @thirdplat.jcet.g.appsecret@ + +epmet: +# third服务的相关配置 + third: + urlPrefix: @epmet.third.urlprefix@ \ 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 039/234] =?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 040/234] =?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 041/234] =?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 042/234] =?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 043/234] =?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 044/234] =?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 045/234] =?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 046/234] =?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 047/234] =?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 048/234] =?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 049/234] =?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 050/234] =?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 051/234] =?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 052/234] =?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 053/234] =?UTF-8?q?data/report/plugins/ofs/list=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=BB=99=E5=90=8D=E7=A7=B0=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E5=BA=8F=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 054/234] =?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 055/234] =?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 056/234] =?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 057/234] =?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 058/234] =?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 059/234] =?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 060/234] =?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 061/234] =?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 062/234] =?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 063/234] =?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 064/234] =?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 065/234] =?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 066/234] =?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 067/234] =?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 068/234] =?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 069/234] =?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 070/234] =?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 071/234] =?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 072/234] =?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 073/234] =?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 1082d4127f538201470a9cc839b51eb4582cc130 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 3 Mar 2021 10:38:07 +0800 Subject: [PATCH 074/234] =?UTF-8?q?h5=E5=B7=A5=E4=BD=9C=E7=AB=AF=E7=99=BB?= =?UTF-8?q?=E9=99=86=E8=B0=83=E6=95=B4token=E7=BC=93=E5=AD=98=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/SsoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 fa58ce86fa..aba56b4a49 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 @@ -303,7 +303,7 @@ public class SsoServiceImpl implements SsoService { int expire = jwtTokenProperties.getExpire(); GovTokenDto govTokenDto = new GovTokenDto(); govTokenDto.setApp(LoginConstant.APP_GOV); - govTokenDto.setClient(LoginConstant.CLIENT_WXMP); + govTokenDto.setClient(LoginConstant.CLIENT_APP); govTokenDto.setUserId(staffLatestAgency.getStaffId()); govTokenDto.setOpenId(userInfo.getOpenId()); govTokenDto.setSessionKey(""); 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 075/234] =?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 076/234] =?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 077/234] 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 078/234] 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 079/234] =?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 080/234] =?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 081/234] =?UTF-8?q?selectIssueProjectList=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=8C=87=E5=AE=9Acustomer?= =?UTF-8?q?=5Fid=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} - + \ No newline at end of file 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 27d91a7f2a..60a464c1e7 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 @@ -50,6 +50,6 @@ and t1.CUSTOMER_ID=#{customerId} order by t1.DATE_ID desc limit 1 - ) + )and m.customerId=#{customerId} \ No newline at end of file From 007939a285dda4e3d746f2553d94c9a18c103ce3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 5 Mar 2021 12:35:27 +0800 Subject: [PATCH 092/234] =?UTF-8?q?=E3=80=90send=5Fmsg=E3=80=91=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E6=9C=AA=E5=BC=80=E5=90=AF=E6=94=B9=E4=B8=BAwarn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/SysSmsServiceImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java index fe270e280c..e2c1d1f864 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java @@ -201,7 +201,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl @Override public void projectSendMsg(List formDTOList) { if (CollectionUtils.isEmpty(formDTOList)){ - logger.error(SysSmsConstant.IS_NULL_PARAM_LIST); + logger.warn(SysSmsConstant.IS_NULL_PARAM_LIST); return; } Map> groupByCustomer = formDTOList.stream().collect(Collectors.groupingBy(ProjectSendMsgFormDTO::getCustomerId)); @@ -213,7 +213,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl } List parameterResult = listResult.getData(); if (CollectionUtils.isEmpty(parameterResult)){ - logger.error(SysSmsConstant.PARAMETER_INFO_IS_ZERO); + logger.warn(SysSmsConstant.PARAMETER_INFO_IS_ZERO); return; } groupByCustomer.forEach((customerId,v) -> { @@ -230,11 +230,11 @@ public class SysSmsServiceImpl extends BaseServiceImpl if (customerId.equals(p.getCustomerId())){ // 判断参数开关是否打开,false:未打开 if (p.getSwitchStatus() == false){ - logger.error(String.format(SysSmsConstant.NOT_ON_SWITCH,customerId,p.getParameterKey())); + logger.warn(String.format(SysSmsConstant.NOT_ON_SWITCH,customerId,p.getParameterKey())); }else { // 判断余额状态 false:余额不足 if (p.getBalanceStatus() == false){ - logger.error(String.format(SysSmsConstant.NOT_ENOUGH_BALANCE,customerId,p.getParameterValue())); + logger.warn(String.format(SysSmsConstant.NOT_ENOUGH_BALANCE,customerId,p.getParameterValue())); }else { v.forEach(dto->{ SysSmsDTO sysSmsDTO = new SysSmsDTO(); @@ -249,7 +249,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl }); }); }catch (RenException e){ - logger.error(e.getInternalMsg()); + logger.warn(e.getInternalMsg()); } Map> groupBySwitch = parameterResult.stream().collect(Collectors.groupingBy(CrmParameterResultDTO::getSwitchStatus)); List crmParameterTrue = groupBySwitch.get(true); @@ -274,7 +274,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl //短信服务 AbstractSmsService service = SmsFactory.build(); if (service == null) { - logger.error("发送短信异常,ErrorCode:%s,异常AbstractSmsService is null", ModuleErrorCode.SMS_CONFIG); + logger.warn("发送短信异常,ErrorCode:%s,异常AbstractSmsService is null", ModuleErrorCode.SMS_CONFIG); } //发送短信 if (StringUtils.isNotBlank(sysSmsDTO.getAliyunTemplateCode())) { @@ -283,7 +283,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl service.sendSms(sysSmsDTO.getMobile(), map); } } catch (Exception e) { - logger.error(String.format("项目提醒发送短信失败,失败手机号:%s,ErrorCode:%s", sysSmsDTO.getMobile(), e.getMessage())); + logger.warn(String.format("项目提醒发送短信失败,失败手机号:%s,ErrorCode:%s", sysSmsDTO.getMobile(), e.getMessage())); } } From b4e50495a9b4670f02346b8705aee4ad6306211f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 5 Mar 2021 12:47:46 +0800 Subject: [PATCH 093/234] CUSTOMER_ID --- .../main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 60a464c1e7..9ef167d327 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 @@ -50,6 +50,6 @@ and t1.CUSTOMER_ID=#{customerId} order by t1.DATE_ID desc limit 1 - )and m.customerId=#{customerId} + )and m.CUSTOMER_ID=#{customerId} \ No newline at end of file From 0b515ea9bbbc7606390542f71efb8fb61b399ab3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 5 Mar 2021 14:04:54 +0800 Subject: [PATCH 094/234] =?UTF-8?q?=E6=8C=87=E6=95=B0=E8=AE=A1=E7=AE=97=20?= =?UTF-8?q?street=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/CommunityScoreDao.java | 1 + .../FactIndexGovrnAblityOrgMonthlyDao.java | 1 + .../FactIndexPartyAblityOrgMonthlyDao.java | 1 + .../FactIndexServiceAblityOrgMonthlyDao.java | 1 + .../impl/IndexCalculateStreetServiceImpl.java | 12 +++++----- .../indexcal/CommunityScoreDao.xml | 21 +++++++++++++++++ .../FactIndexGovrnAblityOrgMonthlyDao.xml | 23 +++++++++++++++++++ .../FactIndexPartyAblityOrgMonthlyDao.xml | 18 +++++++++++++++ .../FactIndexServiceAblityOrgMonthlyDao.xml | 18 +++++++++++++++ 9 files changed, 90 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 1e653e61a7..d88c05e053 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -97,6 +97,7 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScoreExistSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); + List selectSubCommAvgScoreExistSubNotSelf(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); /** * 根据入参查询 查询社区id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index 48d156cc81..72888053f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -75,6 +75,7 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); /** * 根据组织类型删除数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index ebbdc9424f..01d76af0bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -86,6 +86,7 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMapExistSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); + List> selectPublishArticleCountMapExistSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); /** * @Description 查询社区下的发文数 Map【根据areaCode】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index bacc7b77ed..5bcd057058 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -87,6 +87,7 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectActivityCountMapExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); /** * 根据组织类型删除数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index c2d488ea41..9343575dc3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -613,7 +613,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreExistSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { @@ -634,7 +634,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 街道名义发文数量 - List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSub(monthId,form.getCustomerAreaCode(),NumConstant.NINE); + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode(),NumConstant.NINE); if (CollectionUtils.isEmpty(mapList)) { log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -688,7 +688,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { - List subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreExistSub(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("查询街道下属所有社区治理能力汇总为空"); }else if (subGridGovernAvg.size() > NumConstant.ZERO) { @@ -708,7 +708,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 治理能力的六个五级指标 - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSub(monthId,form.getCustomerAreaCode()); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(monthId,form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(communityGovernAbility)){ log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); }else{ @@ -762,7 +762,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { - List subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreExistSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.warn("查询街道下属社区服务能力得分平均值为空"); } else if (subCommServiceAvg.size() > NumConstant.ZERO) { @@ -781,7 +781,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); } } else { - List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(monthId,form.getCustomerAreaCode()); + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNotSelf(monthId,form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); }else{ 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 2ba5e4ef54..66be2a6a38 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 @@ -168,4 +168,25 @@ AND fics.index_code = #{indexCode} GROUP BY fics.parent_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 8f93aa364b..19cfc84047 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 @@ -173,4 +173,27 @@ AND gm.month_id = #{monthId} 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 26974bd968..d3bab2a559 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 @@ -149,5 +149,23 @@ 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 9bf7bc2570..0e35707bce 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 @@ -130,4 +130,22 @@ AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sm.month_id = #{monthId} + From 9c496342c556b9830604b140be0130e322d21760 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 5 Mar 2021 14:49:14 +0800 Subject: [PATCH 095/234] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97=20?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=BA=A7=E5=88=AB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactIndexPartyAblityOrgMonthlyDao.java | 1 + .../IndexCalculateCommunityServiceImpl.java | 6 +++--- .../evaluationindex/indexcal/GridScoreDao.xml | 1 + .../FactIndexPartyAblityOrgMonthlyDao.xml | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index 01d76af0bd..99c0efaa60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -97,6 +97,7 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMapbyAreaCode(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectPublishArticleCountMapbyAreaCodeNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); /** * 根据组织类型删除数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 8c03bf53f5..38d14d8667 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -628,7 +628,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } } else { // 社区名义发文数量 - List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapbyAreaCode( form.getMonthId(),form.getCustomerAreaCode()); + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapbyAreaCodeNotSelf( form.getMonthId(),form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -702,7 +702,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } } else { // 治理能力的六个五级指标 - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSub(form.getMonthId(),form.getCustomerAreaCode()); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(communityGovernAbility)){ log.warn(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); }else{ @@ -774,7 +774,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); } } else { - List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(form.getMonthId(),form.getCustomerAreaCode()); + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(communityActivityCountList)) { log.warn(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); }else{ 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 87992f8ee7..cee52bfea1 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 @@ -198,6 +198,7 @@ AND figc.month_id = #{monthId} AND figc.index_code = #{indexCode} AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') + AND sca.AREA_CODE != #{areaCode} GROUP BY figc.agency_id 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 d3bab2a559..9ce69d1128 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 @@ -167,5 +167,23 @@ AND sca.AREA_CODE != #{areaCode} AND pm.month_id = #{monthId} + From ae0a074dbd4466356fc492e35166d0ea7cc50f68 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 5 Mar 2021 15:38:00 +0800 Subject: [PATCH 096/234] =?UTF-8?q?=E8=81=94=E8=B0=83=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97fake=E6=95=B0=E6=8D=AE=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/constant/NumConstant.java | 1 + .../impl/ScreenWorkRecordOrgDailyServiceImpl.java | 12 ++++++++++-- .../mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml | 7 +++---- .../controller/plugins/WorkRecordColController.java | 3 +++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 59e3ce4bdc..a9cc07d7a4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -26,6 +26,7 @@ public interface NumConstant { int TEN = 10; int ELEVEN = 11; int TWELVE = 12; + int THIRTEEN = 13; int SEVENTEEN = 17; int FIFTEEN = 15; int FOURTEEN=14; 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 0474d32f2e..2144440ad0 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 @@ -143,6 +143,8 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl list = screenWorkRecordOrgMonthlyDao.selectMonthList(formDTO); //3-2.遍历封装数据并返回 @@ -299,4 +301,10 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl SELECT sw.MONTH_ID AS monthId, - (select resource_label from screen_customer_work_record_dict where resource_code = sw.type_code and customer_id = #{customerId})`name` + (select resource_label from screen_customer_work_record_dict where resource_code = sw.meeting_code and customer_id = #{customerId})`name` ,SUM(sw.organize_total) as `value` @@ -24,13 +24,12 @@ WHERE sw.del_flag = '0' AND sca.del_flag = '0' - AND sw.customer_id = #{customerId} AND sca.area_code LIKE CONCAT('%',(select area_code from screen_customer_agency where agency_id = #{agencyId}),'%') - AND sw.month_id > #{startMonth} + AND sw.month_id >= #{startMonth} AND sw.month_id #{endMonth} AND wrd.data_type = #{dataType} GROUP BY - sw.month_id,sw.type_code + sw.month_id,sw.meeting_code ORDER BY sw.month_id ASC diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java index 314a814ade..5331ca5cfa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java @@ -49,6 +49,7 @@ public class WorkRecordColController { log.error("com.epmet.controller.plugins.WorkRecordColController.resourceDict,param:{}", JSON.toJSONString(data)); throw new ValidateException("客户Id、上传数据列表、日期Id不可为空"); } + // log.info("【工作日志】客户资源字典信息上传"+JSON.toJSONString(data,true)); dictService.collect(customerId,data); return new Result(); } @@ -68,6 +69,7 @@ public class WorkRecordColController { log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrg,param:{}", JSON.toJSONString(data)); throw new ValidateException("客户Id、上传数据列表、月份Id不可为空"); } + // log.info("【工作日志】组织按月统计"+JSON.toJSONString(data,true)); screenWorkRecordOrgMonthlyService.collect(customerId,data); return new Result(); } @@ -87,6 +89,7 @@ public class WorkRecordColController { log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrgDaily,param:{}", JSON.toJSONString(data)); throw new ValidateException("客户Id、上传数据列表、日期Id不可为空"); } + // log.info("【工作日志】组织按日统计 累计值"+JSON.toJSONString(data,true)); screenWorkRecordOrgDailyService.collectOrgDaily(customerId,data); return new Result(); } From 651722d42e0fbf5e827872bfa693704ef99438e8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 5 Mar 2021 17:36:05 +0800 Subject: [PATCH 097/234] =?UTF-8?q?=E9=83=A8=E7=BD=B2=E9=80=9A=E7=9F=A5=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E6=9C=8D=E5=8A=A1=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E7=9A=84=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 3 +- epmet-auth/src/main/resources/bootstrap.yml | 1 + epmet-commons/epmet-commons-tools/pom.xml | 5 ++ .../aspect/CustomerApplicationRunner.java | 81 ++++++++++++++----- .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../epmet-third/epmet-third-server/pom.xml | 7 -- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 3 +- .../src/main/resources/bootstrap.yml | 1 + .../src/main/resources/bootstrap.yml | 3 +- pom.xml | 28 ++++--- 40 files changed, 143 insertions(+), 60 deletions(-) diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml index 7ecdd66d2b..152e65a3e0 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml +++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /sys @@ -132,4 +133,4 @@ ribbon: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 412dba2dc3..25b9a31702 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /auth diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index e2fd786edf..10b76c6f11 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -149,6 +149,11 @@ commons-httpclient 3.1 + + + com.aliyun + alibaba-dingtalk-service-sdk + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java index 4500453213..4537414335 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java @@ -8,11 +8,17 @@ package com.epmet.commons.tools.aspect; +import com.alibaba.fastjson.JSON; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiRobotSendRequest; +import com.dingtalk.api.response.OapiRobotSendResponse; import com.epmet.commons.tools.dto.form.DingTalkTextMsg; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.SpringContextUtils; +import com.taobao.api.ApiException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Value; @@ -35,32 +41,69 @@ public class CustomerApplicationRunner implements ApplicationRunner { private static Logger logger = LogManager.getLogger(CustomerApplicationRunner.class); @Value("${spring.application.name}") private String appName; + @Value("${server.version}") + private String version; @Override public void run(ApplicationArguments args) { - //发送启动成功消息 EnvEnum currentEnv = EnvEnum.getCurrentEnv(); logger.info(currentEnv); if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode()) && !EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) { - InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); - String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + //sendDingTextMsg(); + sendDingMarkDownMsg(); + } + } + + private void sendDingTextMsg() { + //发送启动成功消息 + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + + //开发小组 群机器人地址 + String url = "https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"; + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(EnvEnum.getCurrentEnv().getName()) + .append("【") + .append(appName) + .append("】") + .append("ip地址: ") + .append(serverIp) + .append("部署完毕!"); + DingTalkTextMsg msg = new DingTalkTextMsg(); + msg.setWebHook(url); + msg.setAtAll(true); + msg.setContent(stringBuilder.toString()); + Result stringResult = HttpClientManager.getInstance().sendPostByJSON(url, msg.getMsgContent()); + logger.info(stringResult); + } + + private String getServerIp() { + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + return inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + } + + private void sendDingMarkDownMsg() { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"); + OapiRobotSendRequest request = new OapiRobotSendRequest(); + request.setMsgtype("markdown"); + OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); + markdown.setTitle("部署成功通知"); - //开发小组 群机器人地址 - String url = "https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"; - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append(EnvEnum.getCurrentEnv().getName()) - .append("【") - .append(appName) - .append("】") - .append("ip地址: ") - .append(serverIp) - .append("部署完毕!"); - DingTalkTextMsg msg = new DingTalkTextMsg(); - msg.setWebHook(url); - msg.setAtAll(true); - msg.setContent(stringBuilder.toString()); - Result stringResult = HttpClientManager.getInstance().sendPostByJSON(url, msg.getMsgContent()); - logger.info(stringResult); + markdown.setText("部署成功通知 \n" + + "> 服务:" + appName + "\n\n" + + "> 版本:" + version + "\n\n" + + "> 环境:" + EnvEnum.getCurrentEnv().getName() + "\n\n" + + "> IP: " + getServerIp() + "\n\n" + ); + request.setMarkdown(markdown); + OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); + at.setIsAtAll(true); + request.setAt(at); + try { + OapiRobotSendResponse execute = client.execute(request); + logger.info("=====通知结果===>" + JSON.toJSONString(execute)); + } catch (ApiException e) { + logger.error("sendDingMarkDownMsg exception", e); } } diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index a0c1c35811..7a6c236128 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -2,6 +2,7 @@ server: tomcat: max-swallow-size: 100MB port: @server.port@ + version: @version@ servlet: context-path: /api spring: diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index f889044c69..55e3265590 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /data/aggregator @@ -153,4 +154,4 @@ dingTalk: logging: level: - com.epmet.dataaggre: debug \ No newline at end of file + com.epmet.dataaggre: debug diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index 01c4f3d8db..4b220e0c72 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /data/report @@ -154,4 +155,4 @@ jwt: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index dfbb2b9a4c..bc14f070f8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /data/stats diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml index f9a372c94e..110490c3af 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /activiti diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index 11cc4d6aef..8348460f3f 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /commonservice @@ -136,4 +137,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml index 1352c66f87..e131231414 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /demo diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml index 6ac74f4419..7a067d1606 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /epmet/ext @@ -108,4 +109,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index 07c67a3b3b..2cd6e68458 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /heart @@ -143,4 +144,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index f30a2913ad..85974efb60 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /job diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml index 0639ecbfd2..b361be7236 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /message @@ -142,4 +143,4 @@ shutdown: rocketmq: name-server: @rocketmq.nameserver@ producer: - group: @rocketmq.producer.group@ \ No newline at end of file + group: @rocketmq.producer.group@ diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index c05b439898..5b6b4b9e75 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /oss @@ -139,4 +140,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml index b9d229a850..a6233bb7a3 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /point @@ -135,4 +136,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index ee37509ddc..fdd764c6e0 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -148,13 +148,6 @@ compile - - - com.aliyun - alibaba-dingtalk-service-sdk - 1.0.1 - - diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml index fbee2e36e0..0606e7f123 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /third @@ -145,4 +146,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml index 6fcc5979f5..c8fe1196c9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/access @@ -122,4 +123,4 @@ pagehelper: #feign 日志需要该配置 logging: level: - com.epmet: debug \ No newline at end of file + com.epmet: debug diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml index 9153797714..241ae97b26 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/grid @@ -85,4 +86,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml index 47a5ebc5a3..06974a6810 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/issue diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml index 80c0b06e6b..6c3a83e1f1 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/mine diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index 6f63c9a156..0a9653fd28 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/org @@ -144,4 +145,4 @@ shutdown: waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 rocketmq: - name-server: @rocketmq.nameserver@ \ No newline at end of file + name-server: @rocketmq.nameserver@ diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index fbe1c0a83e..2db2f15416 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/project @@ -126,4 +127,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml index e12f35bd48..c570e30147 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/voice @@ -125,4 +126,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml index 34a87bb782..15ccaab5b1 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /oper/access @@ -128,4 +129,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml index 30b2608312..f8760dbee8 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /oper/crm @@ -134,4 +135,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml index d9b167d150..360e2ad6e2 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /oper/customize @@ -131,4 +132,4 @@ rocketmq: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index 210ad19829..6823a772e7 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/group @@ -155,4 +156,4 @@ elink: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,每超过30秒,打印一次错误日志 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,每超过30秒,打印一次错误日志 diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml index 4d85502367..9be4ac049f 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/guide @@ -129,4 +130,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml index 12c7a97693..09b4ba2437 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/hall diff --git a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml index ec830e5a69..76f5542795 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/home diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml index 7ba08a2040..48dc370737 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/mine diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml index efd4689143..4577b0cae3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/partymember @@ -128,4 +129,4 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml index cbac285587..b1bca8e761 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/voice diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml index 247b417689..3a3726f148 100644 --- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /adv @@ -136,4 +137,4 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml index e9de135959..0c5c04d86e 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /epmetscan diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 68f5492ae8..0ff8f5dcc1 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /epmetuser @@ -153,4 +154,4 @@ rocketmq: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/pom.xml b/pom.xml index dcbdbc44dc..b0d6621300 100644 --- a/pom.xml +++ b/pom.xml @@ -76,17 +76,23 @@ springfox-swagger-ui ${swagger.version} - - mysql - mysql-connector-java - ${mysql.version} - - - + + mysql + mysql-connector-java + ${mysql.version} + + + + + com.aliyun + alibaba-dingtalk-service-sdk + 1.0.1 + + From 25ec3f071ab3818e2a3096ca485c8651b004c52e Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 5 Mar 2021 17:46:07 +0800 Subject: [PATCH 098/234] =?UTF-8?q?=E5=85=A5=E5=8F=82key=E5=80=BC=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/plugins/result/WorkRecordTrendResultDTO.java | 2 +- .../controller/plugins/WorkRecordController.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 eb5df34e99..6c0aec4959 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 @@ -50,7 +50,7 @@ public class WorkRecordTrendResultDTO implements Serializable { * 各项资源对应某一月份数据 */ @JsonIgnore - private Integer value; + private Integer value = 0; } } 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 0e903b9120..4e409e6316 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 @@ -1,5 +1,6 @@ package com.epmet.datareport.controller.plugins; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService; @@ -50,6 +51,12 @@ public class WorkRecordController { public Result trend(@RequestHeader("CustomerId")String customerId, @RequestBody WorkRecordTrendFormDTO formDTO){ formDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(formDTO); + if(!"party".equals(formDTO.getDataType())&&!"union".equals(formDTO.getDataType())){ + throw new RenException("入参dataType值错误,可选值:party--支部建设; union--联建共建"); + } + if(!"organize".equals(formDTO.getType())&&!"joinuser".equals(formDTO.getType())&&!"avguser".equals(formDTO.getType())){ + throw new RenException("入参type值错误,可选值:组织次数--organize;参与人数--joinuser;平均参与人数--avguser"); + } return new Result().ok(screenWorkRecordOrgDailyService.trend(formDTO)); } From 38365ca401c8a4fa3aa160e02c2275a29c00eeb6 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 8 Mar 2021 09:37:27 +0800 Subject: [PATCH 099/234] =?UTF-8?q?epmet=E8=B0=83=E7=94=A8=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E9=87=87=E9=9B=86=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=AE=A1=E7=AE=97level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScreenProjectDataServiceImpl.java | 73 ++++++++++--------- 1 file changed, 38 insertions(+), 35 deletions(-) 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 index b826fd1f6e..cd6117ce6c 100644 --- 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 @@ -132,43 +132,46 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl { 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); + //2021.3.8 epmet中,调用方传level,这边不再计算 + if(item.getProjectLevel() == null){ + //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(); } - } 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); + } 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(); } - } catch (ParseException e) { - e.printStackTrace(); } } //先删除该projectId对应的旧数据 From e9a07fdad60f789590bfad1c09fc9684cfeb39dc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 8 Mar 2021 10:39:06 +0800 Subject: [PATCH 100/234] =?UTF-8?q?rankList=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9AdateId=20is=20null=20=E8=B5=8B=E5=80=BC?= =?UTF-8?q?=E4=B8=BA=E6=98=A8=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScreenWorkRecordOrgDailyServiceImpl.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/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java index 2144440ad0..8cabbe6145 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,20 +134,19 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl customerIds=new ArrayList<>(); Result> result=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); - // log.info("result: "+JSON.toJSONString(result)); + log.info("根据customerId查询其所有下级子客户idresult: "+JSON.toJSONString(result)); if (result.success() && CollectionUtils.isNotEmpty(result.getData())) { customerIds.addAll(result.getData()); } customerIds.add(formDTO.getCustomerId()); String dateId= baseDao.selectLatestDateId(customerIds); if(StringUtils.isBlank(dateId)){ - log.warn("selectLatestDateId dateId is null customerIds" + JSON.toJSONString(customerIds)); + dateId= com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE); + log.warn("dateId 赋值为"+dateId+" ; selectLatestDateId dateId is null customerIds" + JSON.toJSONString(customerIds)); } - log.info("=============dateId:"+dateId); - dateId= com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE); WorkRecordRankResultDTO returnDto = new WorkRecordRankResultDTO(); AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId()); - // log.info("agencyInfoDTO: "+JSON.toJSONString(agencyInfoDTO)); + log.info("agencyInfoDTO: "+JSON.toJSONString(agencyInfoDTO)); //当前组织的自身的数据 List currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(), formDTO.getDataType(), @@ -168,6 +167,7 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(), formDTO.getDataType(), @@ -167,7 +167,7 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2021.03.04 22:56 + */ + List initNewScreenProjectData(@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/extract/FactOriginProjectOrgPeriodDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java index 70a1fee036..5f3bf2ae42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.form.CostDayFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -83,4 +84,13 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao */ List selectDeptHandle(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.05 15:12 + */ + List selectProjectNodeStartStopTime(@Param("list")List list); } \ No newline at end of file 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 index b1cea20772..83612bf486 100644 --- 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 @@ -18,7 +18,8 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,7 @@ public interface ScreenProjectDataDao extends BaseDao { int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId); + int checkIfExisted(@Param("customerId") String customerId); + + List selectPending(ScreenProjectDataDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 3d4526a0fe..3aac2d6ebe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -103,5 +104,22 @@ public interface ProjectDao extends BaseDao { */ String selectParameterValueByKey(@Param("customerId") String customerId); + /** + * @Description 查找客户项目超期参数 + * + * @param customerId + * @return java.util.List + * @author wangc + * @date 2021.03.05 17:52 + */ + List selectProjectExceedParams(@Param("customerId") String customerId); + /** + * @Description 批量查询项目信息 + * @param ids + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:32 + */ + List batchSelectProjectInfo(@Param("ids")List ids); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 3cb5f6e0e7..2a7a0f2cad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -25,6 +25,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.pingyin.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -319,4 +320,20 @@ public interface FactOriginProjectMainDailyService extends BaseService selectClosedIncr(String customerId, String monthId); + + /** + * @Description 初始化screen_project_data数据 + * 如果是dateId不为空,则查询前一天的数据 + * 否则全查(适用于首次初始化的场景) + * + * 这是只查询指定天新增的项目,对于需要更新状态的项目,对历史数据(流转中的项目)进行遍历查询 + * @param customerId + * @param dateId + * @param exceedLimit 超期上线 + * @param about2exceedLimit 即将超期参数 + * @return java.util.List + * @author wangc + * @date 2021.03.04 22:56 + */ + List initNewScreenProjectData(String customerId,String dateId,Integer exceedLimit,Integer about2exceedLimit); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index c5aaa76daa..94a5fe0855 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -25,27 +25,33 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.pingyin.result.*; +import com.epmet.dto.result.CostDayResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collector; +import java.util.stream.Collectors; /** * 项目主表_日统计 @@ -57,6 +63,10 @@ import java.util.Map; @DataSource(DataSourceConstant.STATS) public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl implements FactOriginProjectMainDailyService { + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private FactOriginProjectOrgPeriodDailyDao periodDao; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -358,4 +368,49 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl(); } + + /** + * @Description 初始化screen_project_data数据 + * 如果是dateId不为空,则查询前一天的数据 + * 否则全查(适用于首次初始化的场景) + * + * 这是只查询指定天新增的项目,对于需要更新状态的项目,对历史数据(流转中的项目)进行遍历查询 + * @param customerId + * @param dateId + * @param exceedLimit 超期上线 + * @param about2exceedLimit 即将超期参数 + * @return java.util.List + * @author wangc + * @date 2021.03.04 22:56 + */ + @Override + public List initNewScreenProjectData(String customerId, String dateId,Integer exceedLimit,Integer about2exceedLimit) { + boolean ifYesterday = true; + if(!StringUtils.equals(DateUtils.getBeforeNDay(NumConstant.ONE).substring(0,8),dateId)){ + ifYesterday = false; + } + List projects = baseDao.initNewScreenProjectData(customerId, dateId); + //如果不是昨天立项 + if(!CollectionUtils.isEmpty(projects) && !ifYesterday){ + Result> costDays = epmetCommonServiceOpenFeignClient.costWorkDays(periodDao.selectProjectNodeStartStopTime(projects.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()))); + if(null != costDays && !CollectionUtils.isEmpty(costDays.getData())){ + Map> projectPeriodMap + = costDays.getData().stream().collect(Collectors.groupingBy(CostDayResultDTO :: getId)); + projects.stream().map(o -> { + + List days = projectPeriodMap.get(o.getProjectId()); + if(!CollectionUtils.isEmpty(days)){ + Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays(); + //事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + if(max > exceedLimit) + o.setProjectLevel(NumConstant.ONE); + else if(max >= about2exceedLimit) + o.setProjectLevel(NumConstant.TWO); + } + return null; + }); + } + } + return projects; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java new file mode 100644 index 0000000000..fe147887b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java @@ -0,0 +1,27 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; + +/** + * @Description + * 给【screen_project_data】 + * 【screen_project_process_attachment】 + * 【screen_project_img_data】 + * 【screen_project_process】这四个表定时整理数据 + * @author wangc + * @date 2021.03.04 13:38 +*/ + +public interface ScreenProjectSettleService { + + + /** + * @Description 抽取项目数据到screen_project_* + * @param param + * @return void + * @author wangc + * @date 2021.03.04 23:09 + */ + void extractScreenData(ScreenCentralZoneDataFormDTO param); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java new file mode 100644 index 0000000000..c223dd32c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -0,0 +1,91 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenProjectSettleService; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; +import com.epmet.service.project.ProjectProcessService; +import com.epmet.service.project.ProjectService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.stream.Collector; +import java.util.stream.Collectors; + +/** + * @Description + * @ClassName ScreenProjectSettleServiceImpl + * @Auth wangc + * @Date 2021-03-04 23:10 + */ +public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleService { + + + @Autowired + private ScreenProjectDataService targetDbService; + @Autowired + private FactOriginProjectMainDailyService originMainService; + @Autowired + private ProjectService projectService; + @Autowired + private ProjectProcessService processService; + + /** + * @Description 抽取项目数据到screen_project_* + * @param param + * @return void + * @author wangc + * @date 2021.03.04 23:09 + */ + @Override + @Transactional + public void extractScreenData(ScreenCentralZoneDataFormDTO param) { + int rows = targetDbService.checkIfExisted(param.getCustomerId()); + List exceedParams = projectService.getProjectExceedParams(param.getCustomerId()); + Integer exceedLimit = NumConstant.FIVE; + Integer about2ExceedLimit = NumConstant.FIVE; + + + if(!CollectionUtils.isEmpty(exceedParams)){ + for(ProjectExceedParamsResultDTO ex :exceedParams){ + if(null != ex.getDefaultExceedLimit()){ + exceedLimit = null == ex.getExceedLimit() ? ex.getDefaultExceedLimit() : ex.getExceedLimit(); + } + if(null != ex.getDefaultAbout2ExceedLimit()){ + about2ExceedLimit = null == ex.getAbout2ExceedLimit() ? ex.getDefaultAbout2ExceedLimit() : ex.getDefaultAbout2ExceedLimit(); + } + } + + } + List metaData = + originMainService.initNewScreenProjectData(param.getCustomerId(), param.getDateId(),exceedLimit,about2ExceedLimit); + + if(!CollectionUtils.isEmpty(metaData)) { + List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); + if(!CollectionUtils.isEmpty(info)){ + metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), + nature.getId())).map(projectInfo -> { + meta.setProjectCreateTime(projectInfo.getCreatedTime()); + meta.setProjectTitle(projectInfo.getTitle()); + return null; + })); + } + + } + ScreenProjectDataDTO orientCase = new ScreenProjectDataDTO(); + orientCase.setCustomerId(param.getCustomerId()); + //待更新的数据 需要检测更新的字段为:①projectStatusCode ②closeCaseTime ③allCategoryName ④projectLevel + List orientData = + targetDbService.getPending(orientCase); + + + + } +} 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 index 82d296a1a3..5a30bcabf5 100644 --- 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 @@ -96,4 +96,22 @@ public interface ScreenProjectDataService extends BaseService param); + + /** + * @Description 查询是否存在客户的数据 + * @param customerId + * @return int + * @author wangc + * @date 2021.03.04 23:35 + */ + int checkIfExisted(String customerId); + + /** + * @Description 获取客户下已经入库而且未结案的数据集 + * @param + * @return + * @author wangc + * @date 2021.03.08 09:32 + */ + List getPending(ScreenProjectDataDTO 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 index cd6117ce6c..f3a2ca3bca 100644 --- 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 @@ -21,7 +21,6 @@ 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; @@ -32,10 +31,8 @@ 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; @@ -222,4 +219,29 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl getPending(ScreenProjectDataDTO param) { + return baseDao.selectPending(param); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 2dc0e88aa6..26755f4421 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -22,9 +22,12 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.project.ProjectInfoDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; +import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 项目表 @@ -109,4 +112,32 @@ public interface ProjectService extends BaseService { * @date 2020.11.06 14:14 */ Integer getOvertimeProjectByParameter(String customerId); + + /** + * @Description 查找客户项目超期参数 + * + * @param customerId + * @return java.util.List + * @author wangc + * @date 2021.03.05 17:52 + */ + List getProjectExceedParams(@Param("customerId") String customerId); + + /** + * @Description 获取项目相关信息 + * @param projectIds + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:28 + */ + List getProjectInfo(List projectIds); + + /** + * @Description 获取项目的所有标签名称 用-连接 + * @param projectIds + * @return java.util.Map + * @author wangc + * @date 2021.03.08 10:28 + */ + Map getProjectCategory(List projectIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 5ba8ea04d6..5edae89e65 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -25,12 +25,14 @@ import com.epmet.dao.project.ProjectDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; /** * 项目表 @@ -97,4 +99,41 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2021.03.05 17:52 + */ + @Override + public List getProjectExceedParams(String customerId) { + return baseDao.selectProjectExceedParams(customerId); + } + + /** + * @Description 获取项目相关信息 + * @param projectIds + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:28 + */ + @Override + public List getProjectInfo(List projectIds) { + return baseDao.batchSelectProjectInfo(projectIds); + } + + /** + * @Description 获取项目的所有标签名称 用-连接 + * @param projectIds + * @return java.util.Map + * @author wangc + * @date 2021.03.08 10:28 + */ + @Override + public Map getProjectCategory(List projectIds) { + return null; + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 3d21f70ce7..c33d899ce7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -534,4 +534,33 @@ AND PROJECT_STATUS = 'closed' GROUP BY GRID_ID + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml index d607aac0d0..53fc7a5a69 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -140,4 +140,20 @@ GROUP BY fp.ORG_ID + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index 82e0587dc5..8295404e77 100644 --- 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 @@ -40,4 +40,20 @@ limit 1000 + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 08c8d78d5b..ce28113075 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -105,5 +105,25 @@ and CUSTOMER_ID = #{customerId} and PARAMETER_KEY ='detention_days' + + + + \ No newline at end of file From a516d6c965ddebc90106dbd39718995c5975d6d7 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 8 Mar 2021 14:46:38 +0800 Subject: [PATCH 103/234] =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E9=86=92?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E8=AF=B7=E6=B1=82=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=8F=8A=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/logback-spring.xml | 2 +- .../tools/aspect/BaseRequestLogAspect.java | 3 + .../tools/constant/ThreadLocalConstant.java | 7 +- .../tools/filter/LogMsgSendFilter.java | 130 ++++-------------- 4 files changed, 39 insertions(+), 103 deletions(-) diff --git a/epmet-auth/src/main/resources/logback-spring.xml b/epmet-auth/src/main/resources/logback-spring.xml index 734c4114a1..0152e72505 100644 --- a/epmet-auth/src/main/resources/logback-spring.xml +++ b/epmet-auth/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java index ff877a04be..02c3d8f18a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java @@ -1,6 +1,8 @@ package com.epmet.commons.tools.aspect; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ThreadLocalConstant; import com.epmet.commons.tools.exception.*; import com.epmet.commons.tools.utils.Result; import org.apache.commons.lang3.StringUtils; @@ -61,6 +63,7 @@ public abstract class BaseRequestLogAspect { try { Object[] args = point.getArgs(); + ThreadLocalConstant.requestParam.set(JSON.toJSONString(args)); log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{}", transactionSerial, requestURI, method, objectsToString(args)); result = point.proceed(); resultInfoLog(transactionSerial, getExecPeriod(startTime), result); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java index 2dad0d6dba..6a2b304cfa 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java @@ -1,7 +1,5 @@ package com.epmet.commons.tools.constant; -import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; - /** * ThreadLocal常亮 */ @@ -16,4 +14,9 @@ public class ThreadLocalConstant { * 用于向DataFilterInterceptor传递权限过滤的sql片段(需要在Controller相关的AOP中进行清理,防止变量残留) */ public static final ThreadLocal sqlFilter = new ThreadLocal(); + + /** + * 用于本次的获取请求参数 + */ + public static final ThreadLocal requestParam = new ThreadLocal(); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java index 4e2f0d16ab..df8121e059 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java @@ -6,6 +6,7 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.classic.spi.IThrowableProxy; import ch.qos.logback.classic.spi.StackTraceElementProxy; import ch.qos.logback.core.spi.FilterReply; +import com.epmet.commons.tools.constant.ThreadLocalConstant; import com.epmet.commons.tools.dto.form.DingTalkTextMsg; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.utils.DingdingMsgSender; @@ -15,9 +16,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.commons.util.InetUtils; import org.springframework.core.env.Environment; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import javax.servlet.http.HttpServletRequest; import java.text.SimpleDateFormat; -import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -64,14 +68,26 @@ public class LogMsgSendFilter extends LevelFilter { stringBuilder.append("IP地址:" + serverIp); stringBuilder.append("\n"); } + stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp())); stringBuilder.append("\n"); stringBuilder.append("TraceId:" + Thread.currentThread().getName()); stringBuilder.append("\n"); + + HttpServletRequest request = getRequest(); + if (request != null) { + String requestURI = request.getRequestURI(); + stringBuilder.append("请求路径:" + requestURI); + stringBuilder.append("\n"); + + stringBuilder.append("请求参数:" + ThreadLocalConstant.requestParam.get()); + stringBuilder.append("\n"); + } + String formattedMessage = event.getFormattedMessage(); IThrowableProxy throwableProxy = event.getThrowableProxy(); if (throwableProxy == null && formattedMessage.length() > 1000) { - formattedMessage = formattedMessage.substring(0, getCharacterPosition(formattedMessage, baseProjectPackage, 5)); + formattedMessage = formattedMessage.substring(0, getCharacterPosition(formattedMessage, baseProjectPackage, 5)); } stringBuilder.append("告警信息:" + formattedMessage); stringBuilder.append("\n"); @@ -159,105 +175,19 @@ public class LogMsgSendFilter extends LevelFilter { } } - public static void main(String[] args) { - String msg = "<<<<<<<<异常响应<<<<<<<<:事务流水号:na1597027822634, 执行时长:59ms, 响应数据:{\"code\":8102,\"internalMsg\":\"验证码错误\",\"msg\":\"验证码错误\"}, 异常信息:验证码错误, 堆栈信息:com.epmet.commons.tools.exception.RenException: \n" + - " at com.epmet.service.impl.VolunteerInfoServiceImpl.authenticate(VolunteerInfoServiceImpl.java:91)\n" + - " at com.epmet.service.impl.VolunteerInfoServiceImpl$$FastClassBySpringCGLIB$$7babb2e8.invoke()\n" + - " at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)\n" + - " at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n" + - " at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)\n" + - " at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n" + - " at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)\n" + - " at com.epmet.service.impl.VolunteerInfoServiceImpl$$EnhancerBySpringCGLIB$$f78b4778.authenticate()\n" + - " at com.epmet.controller.ResiVolunteerController.authenticate(ResiVolunteerController.java:59)\n" + - " at com.epmet.controller.ResiVolunteerController$$FastClassBySpringCGLIB$$e023fb55.invoke()\n" + - " at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)\n" + - " at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n" + - " at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n" + - " at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)\n" + - " at com.epmet.commons.tools.aspect.BaseRequestLogAspect.proceed(BaseRequestLogAspect.java:66)\n" + - " at com.epmet.aspect.RequestLogAspect.proceed(RequestLogAspect.java:26)\n" + - " at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)\n" + - " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + - " at java.lang.reflect.Method.invoke(Method.java:498)\n" + - " at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)\n" + - " at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)\n" + - " at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n" + - " at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n" + - " at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)\n" + - " at com.epmet.controller.ResiVolunteerController$$EnhancerBySpringCGLIB$$1c0751c0.authenticate()\n" + - " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + - " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" + - " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + - " at java.lang.reflect.Method.invoke(Method.java:498)\n" + - " at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)\n" + - " at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)\n" + - " at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)\n" + - " at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:893)\n" + - " at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:798)\n" + - " at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\n" + - " at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)\n" + - " at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)\n" + - " at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)\n" + - " at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)\n" + - " at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)\n" + - " at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\n" + - " at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:88)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:94)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:114)\n" + - " at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)\n" + - " at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\n" + - " at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)\n" + - " at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)\n" + - " at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\n" + - " at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)\n" + - " at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\n" + - " at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)\n" + - " at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\n" + - " at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)\n" + - " at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591)\n" + - " at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n" + - " at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n" + - " at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n" + - " at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n" + - " at java.lang.Thread.run(Thread.java:745)"; + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + if (sra == null){ + return null; + } + return sra.getRequest(); - String substring = msg.substring(0, getCharacterPosition(msg, "com.epme1t", 5)); - System.out.println(substring); } From 607e6a1e67a9d7de7ba1e72053d5f6bed9c3369f Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 8 Mar 2021 18:17:53 +0800 Subject: [PATCH 104/234] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/GovWebController.java | 32 ++- epmet-auth/src/main/resources/bootstrap.yml | 6 + .../commons/tools/utils/RSASignature.java | 251 ++++++++++++++++++ .../scan/common/util/RSASignature.java | 152 ----------- 4 files changed, 287 insertions(+), 154 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java delete mode 100644 epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java index e096c6a65a..d0afcf3c32 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java @@ -1,19 +1,22 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.RSASignature; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.GovWebService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + /** - * @Description PC工作端-登陆服务 * @author sun + * @Description PC工作端-登陆服务 */ @RestController @RequestMapping("govweb") @@ -21,7 +24,10 @@ public class GovWebController { @Autowired private GovWebService govWebService; - + @Value("${epmet.login.publicKey}") + private String publicKey; + @Value("${epmet.login.privateKey}") + private String privateKey; /** * @param formDTO @@ -32,8 +38,30 @@ public class GovWebController { @PostMapping("login") public Result workLogin(@RequestBody GovWebLoginFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); + + try { + if (formDTO.getPassword().length() > 50) { + String newPassword = RSASignature.decryptByPrivateKey(formDTO.getPassword(), privateKey); + formDTO.setPassword(newPassword); + } + + } catch (Exception e) { + e.printStackTrace(); + } return new Result().ok(govWebService.login(formDTO)); } + /** + * desc: 获取前端密码加密 公钥 + * + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/3/8 5:07 下午 + */ + @PostMapping("getKey") + public Result getResiWxPhone() { + return new Result().ok(publicKey); + } + } diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 25b9a31702..b2068e7118 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -145,3 +145,9 @@ thirdplat: appId: 7a5aec009ba4eba8e254ee64fe3775e1 appKey: 14faef9af508d1c253b720ea5a43f9de appSecret: 38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595 + +epmet: + login: + publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKjgDaHWqWgquoatbC4zzQCgqE8C425VIOyzJVVgH1HUYCHpuNUnGCv3HBAl2RsziWQqQgd1xxl0C3a5J4J69o8CAwEAAQ== + privateKey: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAqOANodapaCq6hq1sLjPNAKCoTwLjblUg7LMlVWAfUdRgIem41ScYK/ccECXZGzOJZCpCB3XHGXQLdrkngnr2jwIDAQABAkAyYaWvgrtHuHetdk+v+QRQC54q9FGluP/5nfilX+f4IUf8j92o/ZohTtmJn9qcDiAP4wxCLIsfy4IW3psST78BAiEA0A/E0WvtI7spWnjfw+wMDhdVMIbIJvDbj/cqMwRZInUCIQDPyO2sbXpwDjmAvyn0jpGJJxU5POWYdI37rTf9fScMcwIhAMkWNHbjBHKANVuHb10ACjakPmWEHnXkW5AspdBg53TxAiARPbzq99KXBbcjxbj3f/T3inSqYTEz60f0wDTLJd1dnQIhAIFe6Jd1TduIxGk1PDh/b/3q0jNGgVXkFnUBnKWDaL9N + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java new file mode 100644 index 0000000000..ac051e7093 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java @@ -0,0 +1,251 @@ +package com.epmet.commons.tools.utils; + +import javax.crypto.Cipher; +import java.security.*; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; + +/** + * @author jianjun liu + * @date 2020-06-05 16:48 + **/ + +public class RSASignature { + + + //非对称密钥算法 + private static final String KEY_ALGORITHM = "RSA"; + //密钥长度,在512到65536位之间,建议不要太长,否则速度很慢,生成的加密数据很长 + private static final int KEY_SIZE = 512; + //字符编码 + private static final String CHARSET = "UTF-8"; + + /** + * 生成密钥对 + * + * @return KeyPair 密钥对 + */ + public static KeyPair getKeyPair() throws Exception { + return getKeyPair(null); + } + + /** + * 生成密钥对 + * + * @param password 生成密钥对的密码 + * @return + * @throws Exception + */ + public static KeyPair getKeyPair(String password) throws Exception { + //实例化密钥生成器 + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_ALGORITHM); + //初始化密钥生成器 + if (password == null) { + keyPairGenerator.initialize(KEY_SIZE); + } else { + SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG"); + secureRandom.setSeed(password.getBytes(CHARSET)); + keyPairGenerator.initialize(KEY_SIZE, secureRandom); + } + //生成密钥对 + return keyPairGenerator.generateKeyPair(); + } + + /** + * 取得私钥 + * + * @param keyPair 密钥对 + * @return byte[] 私钥 + */ + public static byte[] getPrivateKeyBytes(KeyPair keyPair) { + return keyPair.getPrivate().getEncoded(); + } + + /** + * 取得Base64编码的私钥 + * + * @param keyPair 密钥对 + * @return String Base64编码的私钥 + */ + public static String getPrivateKey(KeyPair keyPair) { + return Base64.getEncoder().encodeToString(getPrivateKeyBytes(keyPair)); + } + + /** + * 取得公钥 + * + * @param keyPair 密钥对 + * @return byte[] 公钥 + */ + public static byte[] getPublicKeyBytes(KeyPair keyPair) { + return keyPair.getPublic().getEncoded(); + } + + /** + * 取得Base64编码的公钥 + * + * @param keyPair 密钥对 + * @return String Base64编码的公钥 + */ + public static String getPublicKey(KeyPair keyPair) { + return Base64.getEncoder().encodeToString(getPublicKeyBytes(keyPair)); + } + + /** + * 私钥加密 + * + * @param data 待加密数据 + * @param privateKey 私钥字节数组 + * @return byte[] 加密数据 + */ + public static byte[] encryptByPrivateKey(byte[] data, byte[] privateKey) throws Exception { + //实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + //生成私钥 + PrivateKey key = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(privateKey)); + //数据加密 + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * 私钥加密 + * + * @param data 待加密数据 + * @param privateKey Base64编码的私钥 + * @return String Base64编码的加密数据 + */ + public static String encryptByPrivateKey(String data, String privateKey) throws Exception { + byte[] key = Base64.getDecoder().decode(privateKey); + return Base64.getEncoder().encodeToString(encryptByPrivateKey(data.getBytes(CHARSET), key)); + } + + /** + * 公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥字节数组 + * @return byte[] 加密数据 + */ + public static byte[] encryptByPublicKey(byte[] data, byte[] publicKey) throws Exception { + //实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + //生成公钥 + PublicKey key = keyFactory.generatePublic(new X509EncodedKeySpec(publicKey)); + //数据加密 + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * 公钥加密 + * + * @param data 待加密数据 + * @param publicKey Base64编码的公钥 + * @return String Base64编码的加密数据 + */ + public static String encryptByPublicKey(String data, String publicKey) throws Exception { + byte[] key = Base64.getDecoder().decode(publicKey); + return Base64.getEncoder().encodeToString(encryptByPublicKey(data.getBytes(CHARSET), key)); + } + + /** + * 私钥解密 + * + * @param data 待解密数据 + * @param privateKey 私钥字节数组 + * @return byte[] 解密数据 + */ + public static byte[] decryptByPrivateKey(byte[] data, byte[] privateKey) throws Exception { + //实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + //生成私钥 + PrivateKey key = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(privateKey)); + //数据解密 + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.DECRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * 私钥解密 + * + * @param data Base64编码的待解密数据 + * @param privateKey Base64编码的私钥 + * @return String 解密数据 + */ + public static String decryptByPrivateKey(String data, String privateKey) throws Exception { + byte[] key = Base64.getDecoder().decode(privateKey); + return new String(decryptByPrivateKey(Base64.getDecoder().decode(data), key), CHARSET); + } + + /** + * 公钥解密 + * + * @param data 待解密数据 + * @param publicKey 公钥字节数组 + * @return byte[] 解密数据 + */ + public static byte[] decryptByPublicKey(byte[] data, byte[] publicKey) throws Exception { + //实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + //产生公钥 + PublicKey key = keyFactory.generatePublic(new X509EncodedKeySpec(publicKey)); + //数据解密 + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.DECRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * 公钥解密 + * + * @param data Base64编码的待解密数据 + * @param publicKey Base64编码的公钥 + * @return String 解密数据 + */ + public static String decryptByPublicKey(String data, String publicKey) throws Exception { + byte[] key = Base64.getDecoder().decode(publicKey); + return new String(decryptByPublicKey(Base64.getDecoder().decode(data), key), CHARSET); + } + + /** + * 测试加解密方法 + * + * @param args + * @throws Exception + */ + public static void main(String[] args) throws Exception { + //生成密钥对,一般生成之后可以放到配置文件中 + KeyPair keyPair = RSASignature.getKeyPair(); + //公钥 + String publicKey = RSASignature.getPublicKey(keyPair); + //私钥 + String privateKey = RSASignature.getPrivateKey(keyPair); + + System.out.println("公钥:\n" + publicKey); + System.out.println("私钥:\n" + privateKey); + + String data = "RSA 加解密测试!"; + { + System.out.println("\n===========私钥加密,公钥解密=============="); + String s1 = RSASignature.encryptByPrivateKey(data, privateKey); + System.out.println("加密后的数据:" + s1); + String s2 = RSASignature.decryptByPublicKey(s1, publicKey); + System.out.println("解密后的数据:" + s2 + "\n\n"); + } + + { + System.out.println("\n===========公钥加密,私钥解密=============="); + String s1 = RSASignature.encryptByPublicKey(data, publicKey); + System.out.println("加密后的数据:" + s1); + String s2 = RSASignature.decryptByPrivateKey(s1, privateKey); + System.out.println("解密后的数据:" + s2 + "\n\n"); + } + + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java deleted file mode 100644 index c79906908d..0000000000 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.epmet.openapi.scan.common.util; - -import org.apache.commons.codec.binary.Base64; -import org.bouncycastle.util.encoders.UrlBase64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.crypto.Cipher; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.security.KeyFactory; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.Signature; -import java.security.cert.Certificate; -import java.security.cert.CertificateFactory; -import java.security.spec.PKCS8EncodedKeySpec; -import java.security.spec.X509EncodedKeySpec; - -/** - * @author jianjun liu - * @date 2020-06-05 16:48 - **/ - -public class RSASignature { - private static final Logger LOGGER = LoggerFactory.getLogger(RSASignature.class); - public static final String KEY_ALGORITHM = "RSA"; - public static final String SIGNATURE_ALGORITHM = "SHA1WithRSA"; - public static final String ENCODING = "utf-8"; - public static final String X509 = "X.509"; - - /** - * 获取私钥 - * - * @param key - * @return - * @throws Exception - */ - public static PrivateKey getPrivateKey(String key) throws Exception { - byte[] keyBytes = Base64.decodeBase64(key.getBytes(ENCODING)); - PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes); - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - PrivateKey privateKey = keyFactory.generatePrivate(keySpec); - return privateKey; - } - - /** - * 获取公钥 - * - * @param key - * @return - * @throws Exception - */ - public static PublicKey getPublicKey(String key) throws Exception { - byte[] keyBytes = Base64.decodeBase64(key.getBytes(ENCODING)); - CertificateFactory certificateFactory = CertificateFactory.getInstance(X509); - InputStream in = new ByteArrayInputStream(keyBytes); - Certificate certificate = certificateFactory.generateCertificate(in); - PublicKey publicKey = certificate.getPublicKey(); - return publicKey; - } - - /** - * 使用公钥对明文进行加密,返回BASE64编码的字符串 - * - * @param publicKey - * @param plainText - * @return - */ - public static String encrypt(String publicKey, String plainText) { - try { - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - byte[] encodedKey = Base64.decodeBase64(publicKey.getBytes(ENCODING)); - PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); - Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); - cipher.init(Cipher.ENCRYPT_MODE, pubKey); - byte[] enBytes = cipher.doFinal(plainText.getBytes()); - return new String(Base64.encodeBase64(enBytes)); - } catch (Exception e) { - LOGGER.error("rsa encrypt exception: {}", e.getMessage(), e); - } - return null; - } - - /** - * 使用私钥对明文密文进行解密 - * - * @param privateKey - * @param enStr - * @return - */ - public static String decrypt(String privateKey, String enStr) { - try { - PrivateKey priKey = getPrivateKey(privateKey); - Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); - cipher.init(Cipher.DECRYPT_MODE, priKey); - byte[] deBytes = cipher.doFinal(Base64.decodeBase64(enStr)); - return new String(deBytes); - } catch (Exception e) { - LOGGER.error("rsa decrypt exception: {}", e.getMessage(), e); - } - return null; - } - - /** - * RSA私钥签名 - * - * @param content 待签名数据 - * @param privateKey 私钥 - * @return 签名值 - */ - public static String signByPrivateKey(String content, String privateKey) { - try { - PrivateKey priKey = getPrivateKey(privateKey); - Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); - signature.initSign(priKey); - signature.update(content.getBytes(ENCODING)); - byte[] signed = signature.sign(); - return new String(UrlBase64.encode(signed), ENCODING); - } catch (Exception e) { - LOGGER.error("sign error, content: {}", content, e); - } - return null; - } - - /** - * 公钥验签 - * - * @param content - * @param sign - * @param publicKey - * @return - */ - public static boolean verifySignByPublicKey(String content, String sign, String publicKey) { - try { - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - byte[] encodedKey = Base64.decodeBase64(publicKey.getBytes(ENCODING)); - PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); - - Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); - signature.initVerify(pubKey); - signature.update(content.getBytes(ENCODING)); - - return signature.verify(UrlBase64.decode(sign.getBytes(ENCODING))); - - } catch (Exception e) { - LOGGER.error("verify sign error, content: {}, sign: {}", content, sign, e); - } - return false; - } - -} From 6d09f1f6665c900a7d6aa30d30e52b41867f0c61 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 8 Mar 2021 19:33:29 +0800 Subject: [PATCH 105/234] screenProjectData --- .../java/com/epmet/dao/topic/TopicDao.java | 10 +++++++ .../main/java/com/epmet/dao/user/UserDao.java | 11 ++++++++ .../impl/ScreenProjectSettleServiceImpl.java | 17 ++++++++++-- .../com/epmet/service/topic/TopicService.java | 11 ++++++++ .../service/topic/impl/TopicServiceImpl.java | 26 +++++++++++++++++++ .../com/epmet/service/user/UserService.java | 10 +++++++ .../service/user/impl/UserServiceImpl.java | 21 +++++++++++++++ .../extract/FactOriginProjectMainDailyDao.xml | 2 +- .../FactOriginProjectOrgPeriodDailyDao.xml | 16 +++++++----- .../main/resources/mapper/topic/TopicDao.xml | 14 ++++++++++ .../main/resources/mapper/user/UserDao.xml | 16 ++++++++++++ 11 files changed, 145 insertions(+), 9 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 1d9a6125bc..8a888cb733 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -8,6 +8,7 @@ package com.epmet.dao.topic; */ import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO; @@ -117,4 +118,13 @@ public interface TopicDao { * @date 2020.09.28 16:28 */ List selectTopicContent(@Param("list") List list); + + /** + * @Description 根据话题Id查询大屏项目的相关信息 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:13 + */ + List selectScreenProjectData(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index b9162c30a2..411452caeb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -2,6 +2,7 @@ package com.epmet.dao.user; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -131,4 +132,14 @@ public interface UserDao { * @date 2020.09.25 13:54 **/ List selectRegisteredUserByCustomerId(@Param("customerId") String customerId); + + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List selectScreenProjectData(@Param("list") List list); } + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index c223dd32c5..fcc94586f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -10,13 +10,15 @@ import com.epmet.service.evaluationindex.extract.toscreen.ScreenProjectSettleSer import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.UserService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.List; -import java.util.stream.Collector; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -36,6 +38,10 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic private ProjectService projectService; @Autowired private ProjectProcessService processService; + @Autowired + private TopicService topicService; + @Autowired + private UserService userService; /** * @Description 抽取项目数据到screen_project_* @@ -65,7 +71,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic } List metaData = - originMainService.initNewScreenProjectData(param.getCustomerId(), param.getDateId(),exceedLimit,about2ExceedLimit); + originMainService.initNewScreenProjectData(param.getCustomerId(), rows <= NumConstant.ZERO ? null : param.getDateId(),exceedLimit,about2ExceedLimit); if(!CollectionUtils.isEmpty(metaData)) { List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); @@ -77,7 +83,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic return null; })); } + metaData = Optional.ofNullable(topicService.getScreenProjectData(metaData)).orElse(metaData); + metaData = Optional.ofNullable(userService.getScreenProjectData(metaData)).orElse(metaData); } ScreenProjectDataDTO orientCase = new ScreenProjectDataDTO(); orientCase.setCustomerId(param.getCustomerId()); @@ -85,6 +93,11 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic List orientData = targetDbService.getPending(orientCase); + //TODO 给metaData和orientData赋上分类信息 + + //TODO 重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily + + //TODO 更新结案时间和结案状态 } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index 8acaa3c3ac..d1bcbb6823 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -2,6 +2,7 @@ package com.epmet.service.topic; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; @@ -83,4 +84,14 @@ public interface TopicService { * @date 2020.09.28 16:28 */ Map getTopicContent(List list); + + /** + * @Description 获取大屏项目相关信息 + * + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List getScreenProjectData(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 61c926507d..37160da483 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.*; @@ -183,6 +184,31 @@ public class TopicServiceImpl implements TopicService { return result; } + /** + * @Description 获取大屏项目相关信息 + * + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + @Override + public List getScreenProjectData(List list) { + List collection = topicDao.selectScreenProjectData(list); + if(!CollectionUtils.isEmpty(collection)){ + list.stream().flatMap(target -> collection.stream().filter( + res -> StringUtils.equals(target.getTopicId(),res.getTopicId()) + ).map(merge -> { + target.setLatitude(merge.getLatitude()); + target.setLongitude(merge.getLongitude()); + target.setProjectContent(merge.getProjectContent()); + target.setProjectAddress(merge.getProjectAddress()); + return null; + })); + } + return collection; + } + /** * @Description 初始化机关-所有下级网格Map * @param pid - 固定一个机关Id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 767af842b0..862541c52c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -2,6 +2,7 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.util.DimIdGenerator; @@ -75,4 +76,13 @@ public interface UserService { * @date 2020.09.25 13:54 **/ List getRegisteredUserList(String customerId); + + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List getScreenProjectData(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index bc0a9e83d2..bea50e548e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; @@ -728,4 +729,24 @@ public class UserServiceImpl implements UserService { return userList; } + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + @Override + public List getScreenProjectData(List list) { + List collection = userDao.selectScreenProjectData(list); + if(!CollectionUtils.isEmpty(collection)){ + list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) + .map(merge -> { + target.setLinkName(merge.getLinkName()); + target.setLinkMobile(merge.getLinkMobile()); + return null;})); + } + return collection; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index c33d899ce7..6d6676b09b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -546,7 +546,7 @@ data.AGENCY_ID as parentId, agency.AGENCY_NAME as orgName, data.ID as projectId, - data.TOPIC_CREATOR_ID as linkMan, + data.TOPIC_CREATOR_ID as linkName, IF(data.PROJECT_STATUS = 'closed','closed_case',data.PROJECT_STATUS) as projectStatusCode, 3 as projectLevel, IF(data.PIDS IS NULL || TRIM(data.PIDS) = '',data.AGENCY_ID,CONCAT(REPLACE(data.PIDS,':',','),',',data.AGENCY_ID)) as allParentIds, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml index 53fc7a5a69..0790001c64 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -144,16 +144,20 @@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index ab24c331f7..8ad22fa07f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -242,4 +242,18 @@ ID = #{item.sourceId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 810a972262..969a848ae3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -514,4 +514,20 @@ AND register.CUSTOMER_ID = #{customerId} AND register.FIRST_REGISTER = '1' + + + + From 0a2df53b4e3288616941725ce40b643c6ed80fde Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 9 Mar 2021 00:28:51 +0800 Subject: [PATCH 106/234] screenProjectData --- .../epmet/dto/project/ProjectCategoryDTO.java | 97 +++++++++++++++++++ .../com/epmet/dao/project/ProjectDao.java | 10 ++ .../com/epmet/service/Issue/IssueService.java | 11 +++ .../impl/ScreenProjectSettleServiceImpl.java | 8 ++ .../epmet/service/project/ProjectService.java | 9 +- .../project/impl/ProjectServiceImpl.java | 19 +++- .../resources/mapper/project/ProjectDao.xml | 9 ++ 7 files changed, 156 insertions(+), 7 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java new file mode 100644 index 0000000000..3ca8dc43fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 来源网格id + */ + private String gridId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 3aac2d6ebe..6cde49825c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; @@ -122,4 +123,13 @@ public interface ProjectDao extends BaseDao { * @date 2021.03.08 10:32 */ List batchSelectProjectInfo(@Param("ids")List ids); + + /** + * @Description 查询项目的分类信息 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 23:44 + */ + List selectProjectCategory(@Param("list")List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index 239ad2d8b1..3d40be1a94 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -11,6 +11,8 @@ import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author zhaoqifeng @@ -172,4 +174,13 @@ public interface IssueService { * @date 2020/9/27 11:20 上午 */ List selectIssueVoteStatis(String customerId, String monthId); + + /** + * @Description 查找项目的分类名称 以-相连 + * @param param + * @return java.util.Map + * @author wangc + * @date 2021.03.09 00:23 + */ + Map getIntegratedProjectCategory(Map> param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index fcc94586f7..67a01c50d9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.project.ProjectEntity; +import com.epmet.service.Issue.IssueService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenProjectSettleService; import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; @@ -18,7 +19,9 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.List; +import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; /** @@ -42,6 +45,8 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic private TopicService topicService; @Autowired private UserService userService; + @Autowired + private IssueService issueService; /** * @Description 抽取项目数据到screen_project_* @@ -94,6 +99,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic targetDbService.getPending(orientCase); //TODO 给metaData和orientData赋上分类信息 + List projectIds = metaData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()); + projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); + Map> categoryMap = projectService.getProjectCategory(projectIds); //TODO 重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 26755f4421..e5f8d822f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -28,6 +28,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; +import java.util.Set; /** * 项目表 @@ -133,11 +134,11 @@ public interface ProjectService extends BaseService { List getProjectInfo(List projectIds); /** - * @Description 获取项目的所有标签名称 用-连接 + * @Description 获取项目的所有标签名称 用-连接 * @param projectIds - * @return java.util.Map + * @return java.util.Map> * @author wangc - * @date 2021.03.08 10:28 + * @date 2021.03.08 23:46 */ - Map getProjectCategory(List projectIds); + Map> getProjectCategory(List projectIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 5edae89e65..27c628fe21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -24,15 +24,20 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * 项目表 @@ -127,13 +132,21 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @return java.util.Map> * @author wangc * @date 2021.03.08 10:28 */ @Override - public Map getProjectCategory(List projectIds) { - return null; + public Map> getProjectCategory(List projectIds) { + List categories = baseDao.selectProjectCategory(projectIds); + if(CollectionUtils.isEmpty(categories)) return null; + Map> map = new HashMap<>(); + Map> projectMap = categories.stream().collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId)); + projectMap.forEach((k,v) -> { + Set categoryIds = v.stream().map(ProjectCategoryDTO::getCategoryId).collect(Collectors.toSet()); + map.put(k,categoryIds); + }); + return map; } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index ce28113075..2a8699d341 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -126,4 +126,13 @@ + + \ No newline at end of file From ae1ce33407957e373b0ee6807bc9ffa391dc365c Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 9 Mar 2021 02:10:56 +0800 Subject: [PATCH 107/234] screenProjectData --- .../issue/IssueProjectCategoryDictDTO.java | 106 ++++++++++++++++++ .../FactOriginProjectMainDailyDao.java | 2 +- .../com/epmet/dao/issue/StatsIssueDao.java | 8 +- .../com/epmet/service/Issue/IssueService.java | 2 +- .../service/Issue/impl/IssueServiceImpl.java | 25 ++++- .../FactOriginProjectLogDailyService.java | 1 + .../FactOriginProjectMainDailyService.java | 6 +- .../FactOriginProjectLogDailyServiceImpl.java | 1 + ...FactOriginProjectMainDailyServiceImpl.java | 55 +++++---- .../impl/ScreenProjectSettleServiceImpl.java | 22 +++- .../project/ProjectProcessService.java | 3 + .../impl/ProjectProcessServiceImpl.java | 7 ++ .../extract/FactOriginProjectMainDailyDao.xml | 6 +- .../resources/mapper/issue/StatsIssueDao.xml | 34 ++++++ 14 files changed, 239 insertions(+), 39 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java new file mode 100644 index 0000000000..1955847edd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.issue; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueProjectCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id, 产品默认default + */ + private String customerId; + + /** + * 上级分类ID 顶级此列存储0 + */ + private String pid; + + /** + * 所有上级分类ID,用逗号分开 + */ + private String pids; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + + /** + * 分类名称 + */ + private String categoryName; + + /** + * 分类类别1,2,3,4.... + */ + private String categoryType; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 2e2328d1c2..086c2e4b61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -287,6 +287,6 @@ public interface FactOriginProjectMainDailyDao extends BaseDao initNewScreenProjectData(@Param("customerId")String customerId,@Param("dateId") String dateId); + List initNewScreenProjectData(@Param("customerId")String customerId,@Param("dateId") String dateId,@Param("dataEndTime")String dataEndTime); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index 190353059f..875efb82e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -5,15 +5,13 @@ import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; -import com.epmet.dto.issue.IssueAgencyDTO; -import com.epmet.dto.issue.IssueDTO; -import com.epmet.dto.issue.IssueGridDTO; -import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.issue.*; import com.epmet.entity.issue.IssueEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; @Mapper public interface StatsIssueDao extends BaseDao { @@ -181,4 +179,6 @@ public interface StatsIssueDao extends BaseDao { * @date 2020/9/27 1:22 下午 */ List selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List selectCategory(@Param("customerId") String customerId, @Param("ids") Set set); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index 3d40be1a94..22201f81ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -182,5 +182,5 @@ public interface IssueService { * @author wangc * @date 2021.03.09 00:23 */ - Map getIntegratedProjectCategory(Map> param); + Map getIntegratedProjectCategory(Map> param,String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index e134358618..4ad4e58488 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -1,22 +1,24 @@ package com.epmet.service.Issue.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; -import com.epmet.dto.issue.IssueAgencyDTO; -import com.epmet.dto.issue.IssueDTO; -import com.epmet.dto.issue.IssueGridDTO; -import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.issue.*; import com.epmet.entity.issue.IssueEntity; import com.epmet.service.Issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author zhaoqifeng @@ -143,4 +145,19 @@ public class IssueServiceImpl implements IssueService { public List selectIssueVoteStatis(String customerId, String dateId) { return statsIssueDao.selectIssueVoteStatis(customerId, dateId); } + + @Override + public Map getIntegratedProjectCategory(Map> param,String customerId) { + Map map = new HashMap<>(); + param.forEach((projectId,categoryIds) -> { + List categories = statsIssueDao.selectCategory(customerId, categoryIds); + if(!CollectionUtils.isEmpty(categories)){ + StringBuilder str = new StringBuilder(); + categories.forEach(category -> {str.append(category.getCategoryName()).append("-");}); + map.put(projectId,str.substring(NumConstant.ZERO,str.length() - NumConstant.TWO)); + } + }); + + return map; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index 2a3c3ab304..c337c085da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import java.math.BigDecimal; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 2a7a0f2cad..ea44540cd9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -328,6 +328,7 @@ public interface FactOriginProjectMainDailyService extends BaseService initNewScreenProjectData(String customerId,String dateId,Integer exceedLimit,Integer about2exceedLimit); + List initNewScreenProjectData(String customerId,Integer rows ,String dateId,Integer exceedLimit,Integer about2exceedLimit); + + void computerIfExceed(List list,Integer exceedLimit,Integer about2exceedLimit); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 7b3f127cd2..641b7efa03 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import org.apache.commons.lang3.StringUtils; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 94a5fe0855..dde63f6ead 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -376,6 +376,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl initNewScreenProjectData(String customerId, String dateId,Integer exceedLimit,Integer about2exceedLimit) { + public List initNewScreenProjectData(String customerId,Integer rows , String dateId,Integer exceedLimit,Integer about2exceedLimit) { boolean ifYesterday = true; - if(!StringUtils.equals(DateUtils.getBeforeNDay(NumConstant.ONE).substring(0,8),dateId)){ + if(!StringUtils.equals(DateUtils.getBeforeNDay(NumConstant.ONE),dateId)){ ifYesterday = false; } - List projects = baseDao.initNewScreenProjectData(customerId, dateId); + List projects = baseDao.initNewScreenProjectData(customerId, rows == NumConstant.ZERO && ifYesterday ? "" : dateId, dateId); //如果不是昨天立项 - if(!CollectionUtils.isEmpty(projects) && !ifYesterday){ - Result> costDays = epmetCommonServiceOpenFeignClient.costWorkDays(periodDao.selectProjectNodeStartStopTime(projects.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()))); - if(null != costDays && !CollectionUtils.isEmpty(costDays.getData())){ - Map> projectPeriodMap - = costDays.getData().stream().collect(Collectors.groupingBy(CostDayResultDTO :: getId)); - projects.stream().map(o -> { - - List days = projectPeriodMap.get(o.getProjectId()); - if(!CollectionUtils.isEmpty(days)){ - Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays(); - //事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 - if(max > exceedLimit) - o.setProjectLevel(NumConstant.ONE); - else if(max >= about2exceedLimit) - o.setProjectLevel(NumConstant.TWO); - } - return null; - }); - } - } + if(!CollectionUtils.isEmpty(projects) && !ifYesterday) + computerIfExceed(projects,exceedLimit,about2exceedLimit); + return projects; } + + @Override + public void computerIfExceed(List list,Integer exceedLimit,Integer about2exceedLimit){ + if(CollectionUtils.isEmpty(list)) return; + Result> costDays = epmetCommonServiceOpenFeignClient.costWorkDays(periodDao.selectProjectNodeStartStopTime(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()))); + if(null != costDays && !CollectionUtils.isEmpty(costDays.getData())){ + Map> projectPeriodMap + = costDays.getData().stream().collect(Collectors.groupingBy(CostDayResultDTO :: getId)); + list.stream().map(o -> { + List days = projectPeriodMap.get(o.getProjectId()); + if(!CollectionUtils.isEmpty(days)){ + Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays(); + //事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + if(max > exceedLimit) + o.setProjectLevel(NumConstant.ONE); + else if(max >= about2exceedLimit) + o.setProjectLevel(NumConstant.TWO); + } + return null; + }); + } + } + + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 67a01c50d9..e49ca919f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.Issue.IssueService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.ScreenProjectSettleService; import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; @@ -38,6 +39,8 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic @Autowired private FactOriginProjectMainDailyService originMainService; @Autowired + private FactOriginProjectLogDailyService logService; + @Autowired private ProjectService projectService; @Autowired private ProjectProcessService processService; @@ -76,7 +79,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic } List metaData = - originMainService.initNewScreenProjectData(param.getCustomerId(), rows <= NumConstant.ZERO ? null : param.getDateId(),exceedLimit,about2ExceedLimit); + originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit); if(!CollectionUtils.isEmpty(metaData)) { List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); @@ -98,13 +101,24 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic List orientData = targetDbService.getPending(orientCase); - //TODO 给metaData和orientData赋上分类信息 + // 给metaData和orientData赋上分类信息 List projectIds = metaData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()); projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); Map> categoryMap = projectService.getProjectCategory(projectIds); + if(!CollectionUtils.isEmpty(categoryMap)){ + Map integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); + if(!CollectionUtils.isEmpty(integratedProjectCategoryMap)){ + metaData.forEach(meta -> { + meta.setAllCategoryName(integratedProjectCategoryMap.get(meta.getProjectId())); + }); + orientData.forEach(orient -> { + orient.setAllCategoryName(integratedProjectCategoryMap.get(orient.getProjectId())); + }); + } + } - //TODO 重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily - + //重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily + originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit); //TODO 更新结案时间和结案状态 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java index 5a27fdca62..2405390872 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -22,6 +22,7 @@ import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; @@ -124,4 +125,6 @@ public interface ProjectProcessService extends BaseService * @date 2020.09.28 14:44 */ Map getLatestOperation(List list, String customerId); + + void updateProjectStatus(List list, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index d45bad78ed..16f140f165 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.dto.project.ProjectOrgRelationDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.service.project.ProjectProcessService; @@ -125,4 +126,10 @@ public class ProjectProcessServiceImpl extends BaseServiceImplo,(a,n)-> a)); } } + + @Override + public void updateProjectStatus(List list,String dateId) { + if(CollectionUtils.isEmpty(list)) return; + + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 6d6676b09b..b4e887642a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -550,7 +550,8 @@ IF(data.PROJECT_STATUS = 'closed','closed_case',data.PROJECT_STATUS) as projectStatusCode, 3 as projectLevel, IF(data.PIDS IS NULL || TRIM(data.PIDS) = '',data.AGENCY_ID,CONCAT(REPLACE(data.PIDS,':',','),',',data.AGENCY_ID)) as allParentIds, - data.TOPIC_ID + data.TOPIC_ID, + #{dataEndTime} as dataEndTime FROM `fact_origin_project_main_daily` data LEFT JOIN DIM_AGENCY agency on data.agency_id = agency.id @@ -561,6 +562,9 @@ AND data.DATE_ID = #{dateId} + + AND CAST(data.DATE_ID AS SIGNED) CAST(#{dataEndTime} AS SIGNED) + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index bd307d1d78..ad18c3d988 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 @@ -287,4 +287,38 @@ AND DATE_FORMAT(ivd.CREATED_TIME,'%Y%m%d') = #{dateId} + + \ No newline at end of file From d086ecef931fe921b0ef1ea47d0718aa8672c3ac Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 9 Mar 2021 10:30:41 +0800 Subject: [PATCH 108/234] =?UTF-8?q?=E8=A7=A3=E5=86=B3sso=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=B9=B3=E5=8F=B0=E5=90=88=E5=B9=B6=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/SsoServiceImpl.java | 2 +- .../commons/thirdplat/apiservice/jcet/JcetApiService.java | 3 ++- .../commons/thirdplat/apiservice/pyld/PyldApiService.java | 7 ++++++- 3 files changed, 9 insertions(+), 3 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 860719988d..3f77b56af1 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 @@ -144,7 +144,7 @@ public class SsoServiceImpl implements SsoService { ThirdPlatformEnum platformEnum = ThirdPlatformEnum.getEnum(formDTO.getPlatform()); String apiService = platformEnum.getApiService(); AbstractApiService apiServiceImpl = (AbstractApiService) SpringContextUtils.getBean(apiService); - thirdUser = apiServiceImpl.getUserInfoByTicket(formDTO.getThirdToken()); + thirdUser = apiServiceImpl.getGUserInfoBySSOToken(formDTO.getThirdToken()); } catch (RenException e) { throw new RenException(e.getCode(), e.getMessage()); } catch (Exception e) { 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 e12d008941..f499156947 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 @@ -14,6 +14,7 @@ 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.util.HashMap; @@ -38,7 +39,7 @@ public class JcetApiService extends AbstractApiService { * @author wxz * @date 2021.01.19 10:26 */ - public ThirdPlatUserInfo getUserInfoByTicket(String ticket) throws UnsupportedEncodingException { + public ThirdPlatUserInfo getCUserInfoByTicket(String ticket) throws UnsupportedEncodingException { logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口入参 ticket:{}", ticket); 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 958fd8b1bb..b5307c2951 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 @@ -40,6 +40,11 @@ public class PyldApiService extends AbstractApiService { pyldThirdplatProps = props.getPyld(); } + @Override + public ThirdPlatUserInfo getCUserInfoByTicket(String ticket) throws Exception { + return null; + } + /** * @return * @Description 通过第三方平台ticket获取用户信息 @@ -47,7 +52,7 @@ public class PyldApiService extends AbstractApiService { * @date 2021.01.19 10:26 */ @Override - public ThirdPlatUserInfo getUserInfoByTicket(String platformToken) { + public ThirdPlatUserInfo getGUserInfoBySSOToken(String platformToken) { logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口入参 platformToken:{}", platformToken); From 3b9297b7482a00c75f4eacc95c8e1b56d0166dd9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 9 Mar 2021 11:03:35 +0800 Subject: [PATCH 109/234] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationFailedEventListener.java | 84 +++++++++++++++++++ ...ava => ApplicationReadyEventListener.java} | 13 ++- 2 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationFailedEventListener.java rename epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/{CustomerApplicationRunner.java => ApplicationReadyEventListener.java} (90%) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationFailedEventListener.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationFailedEventListener.java new file mode 100644 index 0000000000..5c219ab095 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationFailedEventListener.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.aspect; + +import com.alibaba.fastjson.JSON; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiRobotSendRequest; +import com.dingtalk.api.response.OapiRobotSendResponse; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.taobao.api.ApiException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.event.ApplicationFailedEvent; +import org.springframework.cloud.commons.util.InetUtils; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Component; + +/** + * 应用 启动健康检查 通知类 + * CustomerApplicationRunner + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class ApplicationFailedEventListener implements ApplicationListener { + private static Logger logger = LogManager.getLogger(ApplicationFailedEventListener.class); + @Value("${spring.application.name}") + private String appName; + @Value("${server.version}") + private String version; + + @Override + public void onApplicationEvent(ApplicationFailedEvent applicationFailedEvent) { + Throwable exception = applicationFailedEvent.getException(); + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + logger.info(currentEnv); + if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode()) && !EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) { + sendDingMarkDownMsg(exception); + } + } + + + private String getServerIp() { + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + return inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + } + + private void sendDingMarkDownMsg(Throwable exception) { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"); + OapiRobotSendRequest request = new OapiRobotSendRequest(); + request.setMsgtype("markdown"); + OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); + markdown.setTitle("部署失败通知"); + + markdown.setText("部署失败通知 \n" + + "> 服务:" + appName + "\n\n" + + "> 版本:" + version + "\n\n" + + "> 环境:" + EnvEnum.getCurrentEnv().getName() + "\n\n" + + "> IP: " + getServerIp() + "\n\n" + + "> 异常:" + exception.getMessage() + "\n\n" + ); + request.setMarkdown(markdown); + OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); + at.setIsAtAll(true); + request.setAt(at); + try { + OapiRobotSendResponse execute = client.execute(request); + logger.info("=====通知结果===>" + JSON.toJSONString(execute)); + } catch (ApiException e) { + logger.error("sendDingMarkDownMsg exception", e); + } + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationReadyEventListener.java similarity index 90% rename from epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationReadyEventListener.java index 4537414335..901163e7ac 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationReadyEventListener.java @@ -22,10 +22,9 @@ import com.taobao.api.ApiException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.cloud.commons.util.InetUtils; -import org.springframework.core.annotation.Order; +import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; /** @@ -36,16 +35,15 @@ import org.springframework.stereotype.Component; * @since 1.0.0 */ @Component -@Order(value = 99) -public class CustomerApplicationRunner implements ApplicationRunner { - private static Logger logger = LogManager.getLogger(CustomerApplicationRunner.class); +public class ApplicationReadyEventListener implements ApplicationListener { + private static Logger logger = LogManager.getLogger(ApplicationReadyEventListener.class); @Value("${spring.application.name}") private String appName; @Value("${server.version}") private String version; @Override - public void run(ApplicationArguments args) { + public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) { EnvEnum currentEnv = EnvEnum.getCurrentEnv(); logger.info(currentEnv); if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode()) && !EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) { @@ -107,4 +105,5 @@ public class CustomerApplicationRunner implements ApplicationRunner { } } + } From df3fe4cbaa0e5d83c5df80c37dd3a6c5b42cd721 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Mar 2021 12:53:22 +0800 Subject: [PATCH 110/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/AgencyScoreDao.java | 2 + .../indexcal/DeptScoreDao.java | 1 + .../screen/ScreenCustomerAgencyDao.java | 8 +++ .../IndexCalculateDistrictServiceImpl.java | 19 ++++--- .../indexcal/AgencyScoreDao.xml | 50 ++++++++++++++++++- .../evaluationindex/indexcal/DeptScoreDao.xml | 21 ++++++++ .../FactIndexPartyAblityOrgMonthlyDao.xml | 3 +- .../screen/ScreenCustomerAgencyDao.xml | 14 ++++++ 8 files changed, 109 insertions(+), 9 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 5e0d0585be..bc00d9e97b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -71,6 +71,7 @@ public interface AgencyScoreDao extends BaseDao { * @date 2021/1/15 下午4:23 */ List selectAgencyScoreInfoExistsSub(@Param("areaCode") String areaCode,@Param("areaCodeLength") Integer areaCodeLength, @Param("monthId")String monthId, @Param("dataType")String dataType); + List selectAgencyScoreInfoExistsSubSelf(@Param("areaCode") String areaCode, @Param("monthId")String monthId, @Param("dataType")String dataType); /** * @Description 区下级街道得分平均值 @@ -91,6 +92,7 @@ public interface AgencyScoreDao extends BaseDao { * @date 2021/1/18 上午9:09 */ List selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); + List selectAgencyScoreAvgByOrgIds(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("orgIds")List orgIds); /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index a22317c371..cc35dbb875 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -77,6 +77,7 @@ public interface DeptScoreDao extends BaseDao { * @date 2021/1/18 上午9:31 */ List selectGovernDeptScoreAvgExistsSub(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectGovernDeptScoreAvgExistsSubNotSelf(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode); /** * @return int 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 f61e21f2ad..44eeb11fa6 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 @@ -194,4 +194,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAgencyByCustomer(@Param("customerId")String customerId); List selectAgencyByAreaCode(String areaCode); + + /** + * @Description 根据areaCode查询下级组织 + * @Param areaCode + * @author zxc + * @date 2021/3/9 上午9:41 + */ + List selectAgencyByParentAreaCode(@Param("areaCode") String areaCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 592c114fd4..5ea39f0d4c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.dto.indexcal.AgencyCalResultDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; @@ -604,10 +605,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + List orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),orgInfos.stream().map(o -> o.getOrgId()).collect(Collectors.toList())); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { @@ -629,7 +631,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else { // 区名义发文数量 - List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSub(monthId,form.getCustomerAreaCode(),NumConstant.SIX); + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode(),NumConstant.SIX); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -682,9 +684,12 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + List orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { - List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); +// List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); + log.info(districtGovernAvgList.toString()); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ districtGovernAvgList.remove(districtGovernAvgList.get(i)); @@ -710,7 +715,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ - List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelf(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); for (int i = 0; i < deptScoreAvgList.size(); i++) { if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ deptScoreAvgList.remove(deptScoreAvgList.get(i)); @@ -762,10 +767,12 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + List orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { - List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); +// List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ subStreetAvgList.remove(subStreetAvgList.get(i)); @@ -815,7 +822,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String customerId = form.getCustomerId(); String monthId = form.getMonthId(); List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); - List agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSub(form.getCustomerAreaCode(),NumConstant.SIX,monthId, IndexCalConstant.DISTRICT_LEVEL); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSubSelf(form.getCustomerAreaCode(),monthId, IndexCalConstant.DISTRICT_LEVEL); detailListByParentCode.forEach(detail -> { agencyScoreList.forEach(community -> { if (detail.getIndexCode().equals(community.getIndexCode())) { 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 6ba1ac05cf..c082758802 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 @@ -142,6 +142,7 @@ WHERE fias.del_flag = 0 AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') + AND sca.AREA_CODE != #{areaCode} AND fias.MONTH_ID = #{monthId} AND fias.data_type = #{dataType} AND fias.IS_TOTAL = "0" @@ -159,7 +160,7 @@ fics.year_id, ROUND(AVG( fics.score ),6) AS score, fics.customer_id, - PARENT_AGENCY_ID AS parentId + fics.PARENT_AGENCY_ID AS parentId FROM fact_index_agency_score fics LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID @@ -172,4 +173,51 @@ AND fics.DATA_TYPE = #{dataType} GROUP BY fics.parent_agency_id + + + + + 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 d5f2e9b8a0..f0dc795c8e 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 @@ -172,4 +172,25 @@ AND fidc.index_code = #{indexCode} GROUP BY fidc.agency_id + 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 9ce69d1128..c0f9e6e261 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 @@ -163,8 +163,7 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pm.AGENCY_ID WHERE pm.del_flag = '0' - AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND sca.AREA_CODE != #{areaCode} + AND sca.AREA_CODE = #{areaCode} AND pm.month_id = #{monthId} + + + From 797011a8ef7b8b9c00ed649b3d5deb3f7ad2d797 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Mar 2021 13:25:11 +0800 Subject: [PATCH 111/234] =?UTF-8?q?sql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9c3497f29e..5552a9df4b 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 @@ -402,6 +402,6 @@ sca.AREA_CODE FROM screen_customer_agency sca WHERE DEL_FLAG = 0 - and sca.PARENT_AREA_CODE like #{areaCode} + and sca.PARENT_AREA_CODE = #{areaCode} From b89490cf08e0fc41192d52b01503f5f9aedc8155 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 9 Mar 2021 13:33:49 +0800 Subject: [PATCH 112/234] test --- .../java/com/epmet/commons/tools/filter/LogMsgSendFilter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java index 4e2f0d16ab..79d0b59f6e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java @@ -17,7 +17,6 @@ import org.springframework.cloud.commons.util.InetUtils; import org.springframework.core.env.Environment; import java.text.SimpleDateFormat; -import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -274,7 +273,7 @@ public class LogMsgSendFilter extends LevelFilter { } return slashMatcher.start(); } catch (Exception e) { - logger.warn("getCharacterPosition no matche"); + logger.warn("getCharacterPosition no matche", e); return 0; } } From bd23c5c5ded97aa5f817634f43a7dd92ffdc3ccc Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 9 Mar 2021 13:43:56 +0800 Subject: [PATCH 113/234] test --- .../com/epmet/controller/LoginController.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java index 45c8950d9c..f70495eb51 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -12,6 +12,7 @@ import com.epmet.dto.form.ResiWxPhoneFormDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.CaptchaService; import com.epmet.service.LoginService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -28,6 +29,7 @@ import java.io.IOException; * @Author yinzuomei * @Date 2020/3/14 13:58 */ +@Slf4j @RestController @RequestMapping("login") public class LoginController { @@ -47,15 +49,20 @@ public class LoginController { **/ @GetMapping("captcha") public void captcha(HttpServletResponse response, String uuid) throws IOException { - //uuid不能为空 - AssertUtils.isBlank(uuid, ErrorCode.IDENTIFIER_NOT_NULL); - //生成图片验证码 - BufferedImage image = captchaService.create(uuid); - response.setHeader("Cache-Control", "no-store, no-cache"); - response.setContentType("image/jpeg"); - ServletOutputStream out = response.getOutputStream(); - ImageIO.write(image, "jpg", out); - out.close(); + try { + //uuid不能为空 + AssertUtils.isBlank(uuid, ErrorCode.IDENTIFIER_NOT_NULL); + //生成图片验证码 + BufferedImage image = captchaService.create(uuid); + response.reset(); + response.setHeader("Cache-Control", "no-store, no-cache"); + response.setContentType("image/jpeg"); + ServletOutputStream out = response.getOutputStream(); + ImageIO.write(image, "jpg", out); + out.close(); + } catch (IOException e) { + log.error("获取登陆验证码异常", e); + } } /** From cc2b5b3a6dbda3c3fe09a8b04b6eaf6e664b3e81 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 9 Mar 2021 13:49:34 +0800 Subject: [PATCH 114/234] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/aspect/BaseRequestLogAspect.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java index ff877a04be..5eaada034e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java @@ -61,6 +61,7 @@ public abstract class BaseRequestLogAspect { try { Object[] args = point.getArgs(); + ThreadLocalConstant.requestParam.set(objectsToString(args)); log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{}", transactionSerial, requestURI, method, objectsToString(args)); result = point.proceed(); resultInfoLog(transactionSerial, getExecPeriod(startTime), result); From ff1d9694224c3ecb4ee249ccce693c55105862ec Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 9 Mar 2021 14:05:59 +0800 Subject: [PATCH 115/234] =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/aspect/BaseRequestLogAspect.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java index 02c3d8f18a..4b3496ee36 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java @@ -1,6 +1,5 @@ package com.epmet.commons.tools.aspect; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ThreadLocalConstant; import com.epmet.commons.tools.exception.*; @@ -14,6 +13,7 @@ import org.springframework.dao.DuplicateKeyException; import javax.servlet.http.HttpServletRequest; import java.time.Duration; import java.time.LocalDateTime; +import java.util.Arrays; /** * 日志切面 @@ -63,7 +63,7 @@ public abstract class BaseRequestLogAspect { try { Object[] args = point.getArgs(); - ThreadLocalConstant.requestParam.set(JSON.toJSONString(args)); + ThreadLocalConstant.requestParam.set(Arrays.toString(point.getArgs())); log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{}", transactionSerial, requestURI, method, objectsToString(args)); result = point.proceed(); resultInfoLog(transactionSerial, getExecPeriod(startTime), result); From d7bf8d2eb9cc7b56228d9d4428c9c4b322da34c2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 9 Mar 2021 14:13:12 +0800 Subject: [PATCH 116/234] =?UTF-8?q?=E8=8E=B7=E5=8F=96pubkey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/GovWebController.java | 2 +- .../main/java/com/epmet/commons/tools/utils/RSASignature.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java index d0afcf3c32..8a85cb9da4 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java @@ -59,7 +59,7 @@ public class GovWebController { * @date 2021/3/8 5:07 下午 */ @PostMapping("getKey") - public Result getResiWxPhone() { + public Result getPubKey() { return new Result().ok(publicKey); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java index ac051e7093..6de665f7eb 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java @@ -237,7 +237,7 @@ public class RSASignature { String s2 = RSASignature.decryptByPublicKey(s1, publicKey); System.out.println("解密后的数据:" + s2 + "\n\n"); } - + //===== { System.out.println("\n===========公钥加密,私钥解密=============="); String s1 = RSASignature.encryptByPublicKey(data, publicKey); From e83a8c8386feb5242d8a282fa3680b8215523576 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Mar 2021 14:47:18 +0800 Subject: [PATCH 117/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexPartyAblityOrgMonthlyDao.java | 4 ++-- .../indexcal/impl/IndexCalculateDistrictServiceImpl.java | 2 +- .../indexcal/impl/IndexCalculateStreetServiceImpl.java | 2 +- .../indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index 99c0efaa60..dd3774be45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -85,8 +85,8 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMapExistSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); - List> selectPublishArticleCountMapExistSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); + List> selectPublishArticleCountMapExistSubStreet(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectPublishArticleCountMapExistSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); /** * @Description 查询社区下的发文数 Map【根据areaCode】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 5ea39f0d4c..b679cd8c99 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -631,7 +631,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else { // 区名义发文数量 - List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode(),NumConstant.SIX); + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); } else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 9343575dc3..539667b0a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -634,7 +634,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } } else { // 街道名义发文数量 - List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode(),NumConstant.NINE); + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubStreet(monthId,form.getCustomerAreaCode()); if (CollectionUtils.isEmpty(mapList)) { log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); } else { 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 c0f9e6e261..457443543b 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 @@ -132,7 +132,7 @@ - SELECT pm.AGENCY_ID, pm.PARENT_ID, @@ -147,6 +147,7 @@ WHERE pm.del_flag = '0' AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') + AND sca.AREA_CODE != #{areaCode} AND pm.month_id = #{monthId} \ No newline at end of file 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 index 06023e11b6..d9e112ddca 100644 --- 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 @@ -10,4 +10,9 @@ limit 1000 + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index 9e2bd9fe1d..2ee1a3c029 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -311,4 +311,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index 8ad22fa07f..f272c6f692 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -256,4 +256,20 @@ ID = #{project.topicId} + + \ No newline at end of file From 9feedc7b912c173600792a4f819c19a655f69b19 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 9 Mar 2021 17:54:24 +0800 Subject: [PATCH 122/234] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=AE=A2=E6=88=B7-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E5=92=8C=E7=83=AD=E5=BF=83=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/ResiGroupController.java | 3 +- .../group/form/CommonGridAndPageFormDTO.java | 2 + .../group/controller/ResiGroupController.java | 13 +++++- .../service/impl/ResiGroupServiceImpl.java | 42 +++++++++++++++---- .../impl/GroupInvitationServiceImpl.java | 12 +++++- .../impl/ResiGroupMemberServiceImpl.java | 6 ++- .../impl/ResiWarmheartedApplyServiceImpl.java | 9 +++- 7 files changed, 71 insertions(+), 16 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java index 193e5bac1e..4ee3b04ee8 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java @@ -140,8 +140,9 @@ public class ResiGroupController { */ @PostMapping("edit-auditing-list") @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_GROUP_EDIT_AUDITINGLIST) - public Result> getEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){ + public Result> getEditAuditingList(@LoginUser TokenDto tokenDto, @RequestBody CommonGridAndPageFormDTO param){ ValidatorUtils.validateEntity(param, CommonGridAndPageFormDTO.GridPageGroup.class); + param.setCustomerId(tokenDto.getCustomerId()); return groupOpenFeignClient.govEditAuditingList(param); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java index 169073eb68..1e4b79644c 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java @@ -37,4 +37,6 @@ public class CommonGridAndPageFormDTO implements Serializable { @Min(1) private Integer pageSize; + private String customerId; + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index d8e11dc942..569a9137b3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -19,6 +19,7 @@ package com.epmet.modules.group.controller; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -405,7 +406,17 @@ public class ResiGroupController { */ @PostMapping("gov-edit-auditing-list") public Result> govEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){ - return new Result>().ok(resiGroupService.getEditAuditingList(param)); + List list = resiGroupService.getEditAuditingList(param); + if (StrConstant.SPECIAL_CUSTOMER.equals(param.getCustomerId())) { + list.forEach(item -> { + if (item.getMessageText().contains("热心居民")) { + item.setMessageText(item.getMessageText().replace("热心居民", "组长")); + } else if (item.getMessageText().contains("居民")) { + item.setMessageText(item.getMessageText().replace("居民", "学员")); + } + }); + } + return new Result>().ok(list); } /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 0f64fe67d7..a4d13430a4 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -21,10 +21,7 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.AppClientConstant; -import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.*; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -384,7 +381,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl result = epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getRegMobile())) { logger.info(String.format("加入小组界面初始化查询成功,当前用户非注册居民,epmet-user-server接口入参%s,返回%s",JSON.toJSONString(resiUserInfoFormDTO),JSON.toJSONString(result))); - throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + if (StrConstant.SPECIAL_CUSTOMER.equals(initApplyGroupFormDTO.getCustomerId())) { + throw new RenException(8001, "只有注册学员才可以加入小组"); + } else { + throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + } + } } @@ -526,7 +532,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl>().ok(baseDao.getApplyingGroupsByCustIdAndGridId(params)); + List list = baseDao.getApplyingGroupsByCustIdAndGridId(params); + if (StrConstant.SPECIAL_CUSTOMER.equals(params.getCustomerId())) { + list.forEach(item -> { + if (item.getMessageText().contains("热心居民")) { + item.setMessageText(item.getMessageText().replace("热心居民", "组长")); + } else if (item.getMessageText().contains("居民")) { + item.setMessageText(item.getMessageText().replace("居民", "学员")); + } + }); + } + return new Result>().ok(list); } /** @@ -1234,7 +1254,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); if (!result1.success() || null == result1.getData()) { - result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); - result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg()); + if (StrConstant.SPECIAL_CUSTOMER.equals(formDTO.getCustomerId())) { + result.setCode(8201); + result.setMsg("请完善学员信息"); + } else { + result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); + result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg()); + } return result; } //1:热心居民申请行为记录表新增数据 From e2632a25cc6589ab337d619f4d2199e8d65e7dbf Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Mar 2021 19:24:16 +0800 Subject: [PATCH 123/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IndexCalculateDistrictServiceImpl.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 0071929851..b21a19ceac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -626,11 +626,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); - } + }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); @@ -714,11 +714,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - if (!c.getParentId().equals(NumConstant.ZERO_STR)) { +// if (!c.getParentId().equals(NumConstant.ZERO_STR)) { pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); - } +// } }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); @@ -786,7 +786,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { // List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); - log.info("subStreetAvgList"+subStreetAvgList.toString()); + log.info("subStreetAvgList:::"+subStreetAvgList.toString()); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ subStreetAvgList.remove(subStreetAvgList.get(i)); @@ -801,11 +801,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - if (!c.getParentId().equals(NumConstant.ZERO_STR)) { +// if (!c.getParentId().equals(NumConstant.ZERO_STR)) { pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); - } +// } }); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); @@ -837,7 +837,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String monthId = form.getMonthId(); List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); List agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSubSelf(form.getCustomerAreaCode(),monthId, IndexCalConstant.DISTRICT_LEVEL); - log.info("agencyScoreList"+agencyScoreList.toString()); + log.info("agencyScoreList:::"+agencyScoreList.toString()); detailListByParentCode.forEach(detail -> { agencyScoreList.forEach(community -> { if (detail.getIndexCode().equals(community.getIndexCode())) { @@ -865,6 +865,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); result.add(score); }); + log.info("result:::"+result.toString()); if (!CollectionUtils.isEmpty(result)){ agencyScoreDao.insertStreetRecord(result); } From 64ef6b3a53325d28852afcaa8e5d6443160da796 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Mar 2021 19:43:36 +0800 Subject: [PATCH 124/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateDistrictServiceImpl.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index b21a19ceac..66beab2f9e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -626,11 +626,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); - + }else { + pid.put(c.getAgencyId(), customerAgencyDao.selectPid(c.getAgencyId())); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + } }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); @@ -714,11 +718,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { -// if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); -// } + }else { + pid.put(c.getAgencyId(), customerAgencyDao.selectPid(c.getAgencyId())); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + } }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); @@ -801,11 +809,15 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { -// if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); -// } + }else { + pid.put(c.getAgencyId(), customerAgencyDao.selectPid(c.getAgencyId())); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + } }); IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); indexInputVOS.add(index1VO); From b2b0bc794e134cf0eed81f923d51d792d0248485 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 9 Mar 2021 19:45:09 +0800 Subject: [PATCH 125/234] screenProjectData --- .../dto/screen/ScreenProjectProcessDTO.java | 2 +- .../screen/ScreenProjectDataDao.java | 4 + .../screen/ScreenProjectImgDataDao.java | 7 ++ .../ScreenProjectProcessAttachmentDao.java | 8 ++ .../screen/ScreenProjectProcessDao.java | 5 + .../epmet/dao/project/ProjectProcessDao.java | 1 + .../impl/ScreenExtractServiceImpl.java | 8 ++ .../impl/ScreenProjectSettleServiceImpl.java | 22 ++-- .../screen/ScreenProjectDataService.java | 17 +-- .../screen/ScreenProjectImgDataService.java | 2 + ...ScreenProjectProcessAttachmentService.java | 2 + .../screen/ScreenProjectProcessService.java | 2 + .../impl/ScreenProjectDataServiceImpl.java | 49 ++++++--- .../impl/ScreenProjectImgDataServiceImpl.java | 10 ++ ...enProjectProcessAttachmentServiceImpl.java | 10 ++ .../impl/ScreenProjectProcessServiceImpl.java | 14 +++ .../project/ProjectProcessService.java | 9 ++ .../impl/ProjectProcessServiceImpl.java | 22 ++++ .../screen/ScreenProjectDataDao.xml | 102 ++++++++++++++++++ .../screen/ScreenProjectImgDataDao.xml | 40 +++++++ .../ScreenProjectProcessAttachmentDao.xml | 58 ++++++++++ .../screen/ScreenProjectProcessDao.xml | 54 +++++++++- .../mapper/project/ProjectProcessDao.xml | 19 +++- 23 files changed, 432 insertions(+), 35 deletions(-) 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 index 20daa5ec73..e2479d607a 100644 --- 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 @@ -143,7 +143,7 @@ public class ScreenProjectProcessDTO implements Serializable { /** * 数据截止日期 */ - private String DataEndTime; + private String dataEndTime; private List points; 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 index 83612bf486..48a06725cc 100644 --- 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 @@ -40,4 +40,8 @@ public interface ScreenProjectDataDao extends BaseDao { int checkIfExisted(@Param("customerId") String customerId); List selectPending(ScreenProjectDataDTO param); + + void insertBatch(@Param("list") List list); + + void updateBatch(@Param("list") List list,@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 index 2c4039af04..4904f32724 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 中央区-项目数据图片 @@ -30,4 +34,7 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ScreenProjectImgDataDao extends BaseDao { + void deleteByProjectIds(@Param("list") List list); + + void insertBatch(@Param("list") List list); } 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 index d4650815f5..4a84a02c90 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 中央区-项目数据处理节点附件表 @@ -30,4 +34,8 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ScreenProjectProcessAttachmentDao extends BaseDao { + void deleteByProcessId(@Param("list") List list); + + void insertBatch(@Param("list")List list); + } 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 index 15c9c8e372..fb8a8b0bd1 100644 --- 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 @@ -18,10 +18,13 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectProcessDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 中央区-项目数据项目处理进展表 * @@ -34,4 +37,6 @@ public interface ScreenProjectProcessDao extends BaseDao list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java index 65230a0fef..f9647a4fe0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -166,6 +166,7 @@ public interface ProjectProcessDao extends BaseDao { */ List selectClosedProjectOnAppointedDay(@Param("customerId") String customerId, @Param("dateId") String dateId); + List selectClosedProjectByProjectIds(@Param("list")List list); /** * @Description 统计新增项目节点以及被流转到的指向部门 * @param customerId 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 8eda9e93c6..a3ef916716 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 @@ -66,6 +66,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private ScreenProjectGridDailyService screenProjectGridDailyService; @Autowired private ScreenProjectOrgDailyService screenProjectOrgDailyService; + @Autowired + private ScreenProjectSettleServiceImpl screenProjectSettleService; /** * @param extractOriginFormDTO @@ -195,6 +197,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { }catch (Exception e){ log.error("项目(事件)分析按组织_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); } + try{ + //大屏项目数据抽取_按天抽取 + screenProjectSettleService.extractScreenData(param); + }catch (Exception e){ + log.error("大屏项目数据抽取_按天抽取_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } log.info("===== extractDaily method end ======"); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 42faad98fd..c416b69b0b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -129,24 +129,32 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic //重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit); + processService.updateProjectCloseTime(metaData); //更新结案时间和结案状态 processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId()); - - //TODO collect - metaData - //TODO update - orientData + //FIXME release here + targetDbService.insertOrUpdateBatch(param.getCustomerId(),param.getDateId(),metaData,orientData); if(!CollectionUtils.isEmpty(metaData)){ List imgs = topicService.buildNewScreenProjectImgData(metaData); - //TODO collect img - //TODO 先按照项目Id全删除,再insert + if(CollectionUtils.isEmpty(imgs)){ + //FIXME release here + targetImgService.insertBatch(imgs); + } } // List processes = processService.buildNewScreenProjectProcessData(param.getCustomerId(), param.getDateId(),!targetProcessService.checkIfHistoricalDataExists(param.getCustomerId())); - //TODO collect process 按照processId删除,再insert - if(!CollectionUtils.isEmpty(processes)){ + //FIXME release here + targetProcessService.insertBatch(processes,param.getCustomerId(),param.getDateId()); List attachments = processService.buildProcessAttachmentData(processes.stream().map(ScreenProjectProcessDTO::getProcessId).distinct().collect(Collectors.toList())); + if(!CollectionUtils.isEmpty(attachments)){ + //FIXME release here + targetAttachmentService.insertBatch(attachments); + } } + + } } 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 index e7429f5b52..7078f229d1 100644 --- 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 @@ -97,14 +97,6 @@ public interface ScreenProjectDataService extends BaseService param); - /** - * @Description 内部数据入库 - * @param param - * @return void - * @author wangc - * @date 2021.03.09 11:10 - */ - void collect(ScreenCollFormDTO param); /** * @Description 查询是否存在客户的数据 @@ -123,4 +115,13 @@ public interface ScreenProjectDataService extends BaseService getPending(ScreenProjectDataDTO param); + + /** + * @Description collect或更新 + * @param + * @return void + * @author wangc + * @date 2021.03.09 17:36 + */ + void insertOrUpdateBatch(String customerId,String dateId,List meta,List orient); } 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 index eba2c666d8..fb170d618d 100644 --- 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 @@ -93,4 +93,6 @@ public interface ScreenProjectImgDataService extends BaseService list); + } 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 index de086e33a2..44289bdfc7 100644 --- 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 @@ -92,4 +92,6 @@ public interface ScreenProjectProcessAttachmentService extends BaseService list); } 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 index e43d603711..e9b1154699 100644 --- 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 @@ -98,4 +98,6 @@ public interface ScreenProjectProcessService extends BaseService param); boolean checkIfHistoricalDataExists(String customerId); + + void insertBatch(List list,String customerId,String dateId); } 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 index 296250b420..f31ac40995 100644 --- 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 @@ -21,6 +21,7 @@ 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; @@ -31,10 +32,12 @@ 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 org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.ArrayUtils; 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.text.ParseException; @@ -219,23 +222,6 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl param) { - //内部数据抽取的逻辑是,不管dateId指定的哪一天,只要在抽取时,目标数据库中没有相应数据 - //就抽取指定日期及其之前的所有数据,因此在删除时只需对指定日期删除即可,上述情况是因为 - //库中无数据,范围性删除无意义,只是针对在数据库有历史数据的情况下,保证对同一天进行反 - //复采集时数不会重复 - - - } - /** * @Description 查询是否存在客户的数据 @@ -261,4 +247,33 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl meta, List orient) { + //内部数据抽取的逻辑是,不管dateId指定的哪一天,只要在抽取时,目标数据库中没有相应数据 + //就抽取指定日期及其之前的所有数据,因此在删除时只需对指定日期删除即可,上述情况是因为 + //库中无数据,范围性删除无意义,只是针对在数据库有历史数据的情况下,保证对同一天进行反 + //复采集时数不会重复 + if(!CollectionUtils.isEmpty(meta)){ + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,dateId); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId); + } + List> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(part)); + } + + + if(!CollectionUtils.isEmpty(orient)){ + List> partition = ListUtils.partition(orient, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.updateBatch(part,dateId)); + } + } + } 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 index 3b149b2d37..7e12e3924b 100644 --- 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 @@ -20,6 +20,7 @@ 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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; @@ -27,6 +28,7 @@ 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.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 中央区-项目数据图片 @@ -96,4 +99,11 @@ public class ScreenProjectImgDataServiceImpl extends BaseServiceImpl list) { + baseDao.deleteByProjectIds(list.stream().map(ScreenProjectImgDataDTO::getProjectId).distinct().collect(Collectors.toList())); + List> partition = ListUtils.partition(list, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(list)); + } + } 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 index 7219b2ae21..7a3e382e70 100644 --- 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 @@ -20,6 +20,7 @@ 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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; @@ -27,6 +28,7 @@ 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.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 中央区-项目数据处理节点附件表 @@ -95,4 +98,11 @@ public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl list) { + baseDao.deleteByProcessId(list.stream().map(ScreenProjectProcessAttachmentDTO::getProcessId).distinct().collect(Collectors.toList())); + List> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(part)); + } + } 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 index f7d6a80805..26e08a99bf 100644 --- 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 @@ -35,6 +35,7 @@ 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.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -159,4 +160,17 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl NumConstant.ZERO; } + @Override + public void insertBatch(List list,String customerId,String dateId) { + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId); + } + + List> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED); + partition.forEach(part -> { + baseDao.insertBatch(part); + }); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java index 0604fa56c3..84386e9ec3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -138,6 +138,15 @@ public interface ProjectProcessService extends BaseService */ void updateProjectStatus(List list, String dateId,String customerId); + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + void updateProjectCloseTime(List list); + /** * @Description 构建大屏项目进展数据 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index ecb329a522..bb53ec2891 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -156,6 +156,28 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl list) { + if(CollectionUtils.isEmpty(list)) return; + List closedInfo = baseDao.selectClosedProjectByProjectIds(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); + if(CollectionUtils.isEmpty(closedInfo)) return; + + list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( + merge -> { + //target.setProjectStatusCode("closed_case"); + target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + return null; + } + )); + } + /** * @Description 构建大屏项目进展数据 * 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 index 8295404e77..58dc3978e7 100644 --- 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 @@ -56,4 +56,106 @@ and project_level = #{projectLevel} + + + INSERT INTO screen_project_data + ( + id, + customer_id, + org_type, + org_id, + parent_id, + org_name, + project_id, + project_title, + project_create_time, + link_name, + link_mobile, + project_content, + project_level, + project_address, + all_category_name, + longitude, + latitude, + close_case_time, + data_end_time, + all_parent_ids, + project_status_code, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.projectId}, + #{item.projectTitle}, + #{item.projectCreateTime}, + #{item.linkName}, + #{item.linkMobile}, + #{item.projectContent}, + #{item.projectLevel}, + #{item.projectAddress}, + #{item.allCategoryName}, + #{item.longitude}, + #{item.latitude}, + #{item.closeCaseTime}, + #{item.dataEndTime}, + #{item.allParentIds}, + #{item.projectStatusCode}, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + + + update screen_project_data + + + + + when PROJECT_ID=#{i.projectId} then #{i.projectStatusCode} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.closeCaseTime} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.allCategoryName} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.projectLevel} + + + + + DATA_END_TIME = #{dataEndTime}, + updated_time = now() + where + + PROJECT_ID=#{i.projectId} + + 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 index 3604a5df25..a9caf4992e 100644 --- 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 @@ -18,4 +18,44 @@ + + delete from screen_project_img_data + + + PROJECT_ID = #{projectId} + + + + + + + INSERT INTO screen_project_img_data + ( + id, + customer_id, + project_id, + project_img_url, + sort, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.projectId}, + #{item.projectImgUrl}, + #{item.sort}, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + 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 index 8560281d3b..953f2bee72 100644 --- 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 @@ -26,5 +26,63 @@ + + delete from screen_project_process_attachment + + + PROCESS_ID = #{processId} + + + + + + INSERT INTO screen_project_process_attachment + ( + id, + attachment_id, + customer_id, + project_id, + process_id, + file_place, + file_name, + attachment_name, + attachment_size, + attachment_format, + attachment_type, + attachment_url, + sort, + duration, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.attachmentId}, + #{item.customerId}, + #{item.projectId}, + #{item.processId}, + #{item.filePlace}, + #{item.fileName}, + #{item.attachmentName}, + #{item.attachmentSize}, + #{item.attachmentFormat}, + #{item.attachmentType}, + #{item.attachmentUrl}, + #{item.sort}, + #{item.duration}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + 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 index d9e112ddca..1a37f2bb88 100644 --- 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 @@ -6,7 +6,7 @@ delete from screen_project_process where customer_id = #{customerId} - and DATA_END_TIME = #{dateId} + and DATA_END_TIME = #{ } limit 1000 @@ -15,4 +15,56 @@ select count(id) from `screen_project_process` where del_flag = '0' and customer_id = #{customerId} + + + INSERT INTO screen_project_process + ( + id, + customer_id, + process_id, + project_id, + transfer_dept_ids, + transfer_dept_name, + handler_name, + handler_id, + handler_type, + org_id_path, + operation, + public_reply, + internal_remark, + process_time, + data_end_time, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.processId}, + #{item.projectId}, + #{item.transferDeptName}, + #{item.transferDeptIds}, + #{item.handlerName}, + #{item.handlerId}, + #{item.handlerType}, + #{item.orgIdPath}, + #{item.operation}, + #{item.publicReply}, + #{item.internalRemark}, + #{item.processTime}, + #{item.dataEndTime}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index 2ee1a3c029..ff952f62eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -326,6 +326,23 @@ AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId} + + + @@ -362,7 +379,7 @@ process.PUBLIC_REPLY, process.INTERNAL_REMARK, process.CREATED_TIME as processTime, - #{dataEndTime} as dataEndTime + #{dataEndTime} as dataEndTime, staff.DEPARTMENT_NAME, CASE WHEN staff.DEPARTMENT_ID IS NOT NULL trim(staff.DEPARTMENT_ID) ]]> '' THEN staff.DEPARTMENT_ID WHEN staff.GRID_ID IS NOT NULL trim(staff.GRID_ID) ]]> '' THEN staff.GRID_ID From 2570557e122a3d8692de7a803742addb8aae0598 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 9 Mar 2021 20:02:47 +0800 Subject: [PATCH 126/234] screenProjectData --- .../extract/toscreen/impl/ScreenExtractServiceImpl.java | 2 +- .../extract/toscreen/impl/ScreenProjectSettleServiceImpl.java | 4 ++++ .../mapper/evaluationindex/screen/ScreenProjectProcessDao.xml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) 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 a3ef916716..37eae6ac60 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 @@ -67,7 +67,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { @Autowired private ScreenProjectOrgDailyService screenProjectOrgDailyService; @Autowired - private ScreenProjectSettleServiceImpl screenProjectSettleService; + private ScreenProjectSettleService screenProjectSettleService; /** * @param extractOriginFormDTO diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index c416b69b0b..d73cbe09a4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -19,8 +19,10 @@ import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; import com.epmet.service.topic.TopicService; import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -33,6 +35,8 @@ import java.util.stream.Collectors; * @Auth wangc * @Date 2021-03-04 23:10 */ +@Service +@Slf4j public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleService { 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 index 1a37f2bb88..b1072ad590 100644 --- 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 @@ -6,7 +6,7 @@ delete from screen_project_process where customer_id = #{customerId} - and DATA_END_TIME = #{ } + and DATA_END_TIME = #{dateId} limit 1000 From 9c1f78cb828c14632e802b8f0d333196c6972544 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 9 Mar 2021 20:08:08 +0800 Subject: [PATCH 127/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenCustomerAgencyDao.java | 1 + .../impl/IndexCalculateDistrictServiceImpl.java | 12 ++++++++++++ .../screen/ScreenCustomerAgencyDao.xml | 8 ++++++++ 3 files changed, 21 insertions(+) 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 44eeb11fa6..2953077792 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 @@ -95,6 +95,7 @@ public interface ScreenCustomerAgencyDao extends BaseDao { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),orgInfos.stream().map(o -> o.getOrgId()).collect(Collectors.toList())); + // 暂时的 + subGridPartyAvgScore.forEach(s -> { + s.setParentId(customerAgencyDao.selectParentId(s.getAgencyId())); + }); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); @@ -703,6 +707,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { // List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); + // 暂时的 + districtGovernAvgList.forEach(s -> { + s.setParentId(customerAgencyDao.selectParentId(s.getAgencyId())); + }); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); log.info(districtGovernAvgList.toString()); for (int i = 0; i < districtGovernAvgList.size(); i++) { @@ -794,6 +802,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { // List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); + // 暂时的 + subStreetAvgList.forEach(s -> { + s.setParentId(customerAgencyDao.selectParentId(s.getAgencyId())); + }); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ 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 5552a9df4b..13d48fe24c 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 @@ -404,4 +404,12 @@ WHERE DEL_FLAG = 0 and sca.PARENT_AREA_CODE = #{areaCode} + From e4e3166c1a61e2352f4e84869a255d7079b2d2e4 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 10 Mar 2021 09:42:03 +0800 Subject: [PATCH 128/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 1 - 1 file changed, 1 deletion(-) 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 c082758802..f42c0de60c 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 @@ -195,7 +195,6 @@ fics.agency_id = #{org} ) - GROUP BY AGENCY_ID + From 9d99e4a784b5e527c8ffed978e7ecd646f77b245 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 10 Mar 2021 11:16:16 +0800 Subject: [PATCH 132/234] screenProjectData --- .../com/epmet/controller/DemoController.java | 11 +++++++++-- ...FactOriginProjectMainDailyServiceImpl.java | 6 +++--- .../impl/ScreenProjectSettleServiceImpl.java | 11 ++++++----- .../impl/ScreenProjectDataServiceImpl.java | 4 ++++ .../impl/ScreenProjectImgDataServiceImpl.java | 3 +++ ...enProjectProcessAttachmentServiceImpl.java | 3 +++ .../impl/ScreenProjectProcessServiceImpl.java | 1 + .../impl/ProjectProcessServiceImpl.java | 19 +++++++++---------- .../service/topic/impl/TopicServiceImpl.java | 13 ++++++------- .../service/user/impl/UserServiceImpl.java | 4 ++-- .../screen/ScreenProjectDataDao.xml | 2 +- .../resources/mapper/issue/StatsIssueDao.xml | 2 +- .../mapper/project/ProjectProcessDao.xml | 2 +- 13 files changed, 49 insertions(+), 32 deletions(-) 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 829a345264..4bb409b6eb 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 @@ -806,15 +806,22 @@ public class DemoController { return new Result(); } - @Autowired + /*@Autowired private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; @PostMapping("diff") public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ ndddYhjfService.difficultyDataHub(param); return new Result(); - } + }*/ + @Autowired + private ScreenProjectSettleService screenProjectSettleService; + @PostMapping("project-test") + public Result project(@RequestBody ScreenCentralZoneDataFormDTO param){ + screenProjectSettleService.extractScreenData(param); + return new Result(); + } public static void main(String[] args) { List monthIds = DateUtils.getMonthBetween("202001","202012"); for(String monthId:monthIds){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 905c67cc3c..c20f350797 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -406,7 +406,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl> projectPeriodMap = costDays.getData().stream().collect(Collectors.groupingBy(CostDayResultDTO :: getId)); - list.stream().map(o -> { + list = list.stream().map(o -> { List days = projectPeriodMap.get(o.getProjectId()); if(!CollectionUtils.isEmpty(days)){ Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays(); @@ -416,8 +416,8 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl= about2exceedLimit) o.setProjectLevel(NumConstant.TWO); } - return null; - }); + return o; + }).collect(Collectors.toList()); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index d73cbe09a4..7d97fd2674 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -69,7 +69,6 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic * @date 2021.03.04 23:09 */ @Override - @Transactional public void extractScreenData(ScreenCentralZoneDataFormDTO param) { int rows = targetDbService.checkIfExisted(param.getCustomerId()); List exceedParams = projectService.getProjectExceedParams(param.getCustomerId()); @@ -96,12 +95,12 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic if(!CollectionUtils.isEmpty(metaData)) { List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); if(!CollectionUtils.isEmpty(info)){ - metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), + metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), nature.getId())).map(projectInfo -> { meta.setProjectCreateTime(projectInfo.getCreatedTime()); meta.setProjectTitle(projectInfo.getTitle()); - return null; - })); + return meta; + })).collect(Collectors.toList()); } topicService.fillScreenProjectData(metaData); //metaData = Optional.ofNullable(topicService.getScreenProjectData(metaData)).orElse(metaData); @@ -117,7 +116,8 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic // 给metaData和orientData赋上分类信息 List projectIds = Optional.ofNullable(metaData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())).orElse(new ArrayList<>()); - projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); + if(!CollectionUtils.isEmpty(orientData)) + projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); Map> categoryMap = projectService.getProjectCategory(projectIds); if(!CollectionUtils.isEmpty(categoryMap)){ Map integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); @@ -161,4 +161,5 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic } + } 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 index f31ac40995..9152e8f0b6 100644 --- 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 @@ -54,6 +54,7 @@ import java.util.Map; * @since v1.0.0 2021-02-23 */ @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectDataServiceImpl extends BaseServiceImpl implements ScreenProjectDataService { @Resource @@ -231,6 +232,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl getPending(ScreenProjectDataDTO param) { return baseDao.selectPending(param); } @@ -255,6 +258,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl meta, List orient) { //内部数据抽取的逻辑是,不管dateId指定的哪一天,只要在抽取时,目标数据库中没有相应数据 //就抽取指定日期及其之前的所有数据,因此在删除时只需对指定日期删除即可,上述情况是因为 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 index 7e12e3924b..cb1217f055 100644 --- 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 @@ -19,11 +19,13 @@ 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.ScreenProjectImgDataDao; import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; @@ -45,6 +47,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2021-02-23 */ @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectImgDataServiceImpl extends BaseServiceImpl implements ScreenProjectImgDataService { @Override 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 index 7a3e382e70..e750394f9b 100644 --- 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 @@ -19,11 +19,13 @@ 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.ScreenProjectProcessAttachmentDao; import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; @@ -45,6 +47,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2021-02-23 */ @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl implements ScreenProjectProcessAttachmentService { @Override public PageData page(Map params) { 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 index 26e08a99bf..71c461e0e6 100644 --- 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 @@ -53,6 +53,7 @@ import java.util.Map; * @since v1.0.0 2021-02-23 */ @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectProcessServiceImpl extends BaseServiceImpl implements ScreenProjectProcessService { @Resource diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index bb53ec2891..0c5c4117e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -147,13 +147,13 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl closedInfo = baseDao.selectClosedProjectOnAppointedDay(customerId, dateId); if(CollectionUtils.isEmpty(closedInfo)) return; - list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( + list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( merge -> { target.setProjectStatusCode("closed_case"); target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); - return null; + return target; } - )); + )).collect(Collectors.toList()); } /** @@ -169,13 +169,13 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl closedInfo = baseDao.selectClosedProjectByProjectIds(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); if(CollectionUtils.isEmpty(closedInfo)) return; - list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( + list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( merge -> { //target.setProjectStatusCode("closed_case"); target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); - return null; + return target; } - )); + )).collect(Collectors.toList()); } /** @@ -191,7 +191,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl buildNewScreenProjectProcessData(String customerId, String dateId, boolean ifRanged) { List processes = baseDao.selectProjectProcessAndDirection(customerId, ifRanged ? null : dateId, dateId); if(CollectionUtils.isEmpty(processes)) return null; - processes.stream().filter(process -> StringUtils.equalsAny(process.getOperation(), + return processes.stream().filter(process -> StringUtils.equalsAny(process.getOperation(), "close","return","transfer")).map(target -> { List points = target.getPoints(); if(!CollectionUtils.isEmpty(points)){ @@ -204,10 +204,9 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl fillScreenProjectData(List list) { List collection = topicDao.selectScreenProjectData(list); if(!CollectionUtils.isEmpty(collection)){ - list.stream().flatMap(target -> collection.stream().filter( + list = list.stream().flatMap(target -> collection.stream().filter( res -> StringUtils.equals(target.getTopicId(),res.getTopicId()) ).map(merge -> { target.setLatitude(merge.getLatitude()); target.setLongitude(merge.getLongitude()); target.setProjectContent(merge.getProjectContent()); target.setProjectAddress(merge.getProjectAddress()); - return null; - })); + return target; + })).collect(Collectors.toList()); } return collection; } @@ -221,13 +221,12 @@ public class TopicServiceImpl implements TopicService { public List buildNewScreenProjectImgData(List list) { List imgs = topicDao.initNewScreenProjectImgData(list.get(NumConstant.ZERO).getCustomerId(), list); if(CollectionUtils.isEmpty(imgs)) return null; - imgs.stream().flatMap(img -> list.stream().filter(project -> StringUtils.equals(img.getTopicId(),project.getTopicId())).map( + return imgs.stream().flatMap(img -> list.stream().filter(project -> StringUtils.equals(img.getTopicId(),project.getTopicId())).map( match -> { img.setProjectId(match.getProjectId()); - return null; + return img; } - )); - return imgs; + )).collect(Collectors.toList()); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index efa1893cba..db739b79ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -740,11 +740,11 @@ public class UserServiceImpl implements UserService { public List fillScreenProjectData(List list) { List collection = userDao.selectScreenProjectData(list); if(!CollectionUtils.isEmpty(collection)){ - list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) + list = list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) .map(merge -> { target.setLinkName(merge.getLinkName()); target.setLinkMobile(merge.getLinkMobile()); - return null;})); + return target;})).collect(Collectors.toList()); } return collection; } 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 index 58dc3978e7..1f439d7a3a 100644 --- 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 @@ -50,7 +50,7 @@ select * from screen_project_data where del_flag = '0' - and customerId = #{customerId} + and customer_id = #{customerId} and project_status_code = 'pending' and project_level = #{projectLevel} 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 ad18c3d988..b4619ff0a2 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 @@ -314,7 +314,7 @@ outter.id = #{id} - AND NOT EXIST ( + AND NOT EXISTS ( SELECT * FROM issue_project_category_dict WHERE del_flag = '0' AND customer_id = #{customerId} and id = outter.id ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index ff952f62eb..698d7d2417 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -334,7 +334,7 @@ `project_process` WHERE del_flag = '0' - AND customer_id = #{customerId} + AND operation = 'close' From f9852f088b20bb1fa0ed44f3904ba9491eb415d6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 10 Mar 2021 14:36:49 +0800 Subject: [PATCH 133/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE-?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=BA=A7=E5=88=AB=E5=8F=91=E6=96=87=E6=95=B0?= =?UTF-8?q?=E9=87=8Fsql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml | 1 + 1 file changed, 1 insertion(+) 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 457443543b..911b62e8c6 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 @@ -182,6 +182,7 @@ WHERE fm.del_flag = '0' AND fm.month_id = #{monthId} + AND fm.DATA_TYPE = 'community' AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.AREA_CODE != #{areaCode} From 510dec45eac48fb225a46411d6f692b9d4319cd2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 10 Mar 2021 16:50:06 +0800 Subject: [PATCH 134/234] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=20jcet=20g=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index eaa22e7557..5af5eae312 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -363,6 +363,10 @@ 2cy0a9lA 6hU3PQgxLcXr27SE + http://101.206.141.219:21006 + xSMONWwP + UUCnxLyXiB4eBF4p + https://epmet-cloud.elinkservice.cn From 9693fd1f7743e6d7d7afb516b4d58dbca5385770 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 10 Mar 2021 16:55:10 +0800 Subject: [PATCH 135/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml | 1 + .../indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml | 1 + 2 files changed, 2 insertions(+) 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 19cfc84047..d189ad2ee6 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 @@ -193,6 +193,7 @@ WHERE gm.del_flag = '0' AND gm.month_id = #{monthId} + AND gm.DATA_TYPE = 'community' AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.AREA_CODE != #{areaCode} 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 0e35707bce..e35e4de6f8 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 @@ -144,6 +144,7 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sm.AGENCY_ID WHERE sm.del_flag = '0' + AND sm.DATA_TYPE = 'community' AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.AREA_CODE != #{areaCode} AND sm.month_id = #{monthId} From 7df97b77db21ff926c13ecff2c6fa45ed969149a Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 10 Mar 2021 17:15:24 +0800 Subject: [PATCH 136/234] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2=EF=BC=8C=E4=BF=9D=E8=AF=81?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=94=A8=E6=88=B7=E6=9C=80=E5=A4=9A=E5=8F=AA?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=B8=80=E6=9D=A1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/RegisterRelationDao.java | 5 +- .../com/epmet/redis/UserBaseInfoRedis.java | 91 +++++++++++++++++++ .../service/impl/GridLatestServiceImpl.java | 2 +- .../service/impl/UserBadgeServiceImpl.java | 2 +- .../resources/mapper/RegisterRelationDao.xml | 28 ++++++ 5 files changed, 125 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java index 4570711923..a19881ce9a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java @@ -18,11 +18,11 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.RegisterRelationDTO; import com.epmet.entity.RegisterRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + import java.util.List; /** @@ -44,4 +44,7 @@ public interface RegisterRelationDao extends BaseDao { * @date 2020.07.23 15:31 **/ RegisterRelationEntity selectRegisteredGridIdByUserId(@Param("userId") String userId); + + + RegisterRelationEntity selectRegisteredGridIdByUserIdAndCustomerId(@Param("userId") String userId, @Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java index ec6d1eb485..315341ae84 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java @@ -190,6 +190,97 @@ public class UserBaseInfoRedis { return null; } + + /** + * @Description 缓存中获取用户基本信息 + * @param userId + * @return + * @author wangc + * @date 2020.07.23 14:58 + **/ + public UserBaseInfoResultDTO getUserInfo(String userId,String customerId){ + if(StringUtils.isNotBlank(userId)){ + //获取居民缓存key + Map map = redisUtils.hGetAll(UserRedisKeys.getResiUserKey(userId)); + if(null != map && !map.isEmpty()) { + //缓存中有数据,直接返回 + return BeanUtil.mapToBean(map, UserBaseInfoResultDTO.class, true); + } + //缓存中没有数据,先查数据库,放入缓存后再返回 + UserBaseInfoResultDTO baseInfo = userBaseInfoDao.selectListByUserIdList(userId); + + if(null != baseInfo && StringUtils.isNotBlank(baseInfo.getId())){ + + //如果没有首次注册网格,则没有网格名称(xx机关-xx网格)、显示昵称(xx网格-x先生/女士) + RegisterRelationEntity relation = registerRelationDao.selectRegisteredGridIdByUserIdAndCustomerId(userId,customerId); + if(null != relation && StringUtils.isNotBlank(relation.getGridId())){ + baseInfo.setCustomerId(relation.getCustomerId()); + BelongGridNameFormDTO gridParam = new BelongGridNameFormDTO(); + gridParam.setGridId(relation.getGridId()); + baseInfo.setRegisteredGridId(relation.getGridId()); + Result gridResult = + govOrgOpenFeignClient.getGridNameByGridId(gridParam); + if(gridResult.success() && null != gridResult.getData() + && StringUtils.isNotBlank(gridResult.getData().getBelongsGridName())){ + String gridFullName = gridResult.getData().getBelongsGridName(); + baseInfo.setRegisteredGridName(gridFullName); + StringBuffer buffer = new StringBuffer(gridFullName.split(ModuleConstant.DASH)[NumConstant.ONE]).append(ModuleConstant.DASH).append(baseInfo.getSurname()); + switch (baseInfo.getGender()) { + case NumConstant.ONE_STR: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_MALE); + break; + case NumConstant.TWO_STR: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_FEMALE); + break; + default: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_GENDER_UNKNOWN); + } + baseInfo.setShowName(buffer.toString()); + } + } + else{ + //如果没有居民注册记录,说明当前用户是陌生人,需要从陌生人网格访问列表中查询所属的客户Id + LatestGridInfoResultDTO gridLatest = + gridLatestDao.selectLatestGridInfoByUserId(userId); + if(null != gridLatest){ + baseInfo.setCustomerId(gridLatest.getCustomerId()); + } + } + set(baseInfo); + return baseInfo; + }else{ + //如果没有,说明这里是陌生人 + //陌生人不放入缓存,也不更新用户基础信息表 + baseInfo = new UserBaseInfoResultDTO(); + baseInfo.setUserId(userId); + List wechatInfo = userWechatDao.selectByUserId(userId); + if(null != wechatInfo && !wechatInfo.isEmpty()){ + baseInfo.setNickname(wechatInfo.get(NumConstant.ZERO).getNickname()); + if(StringUtils.isBlank(baseInfo.getNickname())){ + baseInfo.setNickname(ModuleConstant.EMPTY_STR); + } + }else{ + return null; + } + RegisterRelationEntity relation = registerRelationDao.selectRegisteredGridIdByUserId(userId); + if(null != relation && StringUtils.isNotBlank(relation.getGridId())){ + baseInfo.setCustomerId(relation.getCustomerId()); + }else{ + LatestGridInfoResultDTO gridLatest = + gridLatestDao.selectLatestGridInfoByUserId(userId); + if(null != gridLatest){ + baseInfo.setCustomerId(gridLatest.getCustomerId()); + } + } + } + + return baseInfo; + + } + + return null; + } + /** * @Description 更新缓存 * @param entity diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java index 46bd30dfff..c18e91c05d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java @@ -210,7 +210,7 @@ public class GridLatestServiceImpl extends BaseServiceImpl { if(StringUtils.isNotBlank(info.getUserId())){ - UserBaseInfoResultDTO cache = userBaseInfoRedis.getUserInfo(info.getUserId()); + UserBaseInfoResultDTO cache = userBaseInfoRedis.getUserInfo(info.getUserId(),customerUserFormDTO.getCustomerId()); if(null != cache) { info.setRegisteredGrid(StringUtils.isBlank(cache.getRegisteredGridName()) ? ModuleConstant.EMPTY_STR : cache.getRegisteredGridName()); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 02e3c8c875..391ad95b7c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -342,7 +342,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { //居民端 CertificationDetailResultDTO resiResult = userBadgeDao.selectBadgeAuthRecord(tokenDto.getUserId(), certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); if(null == resiResult){ - UserBaseInfoResultDTO userInfo = userBaseInfoRedis.getUserInfo(tokenDto.getUserId()); + UserBaseInfoResultDTO userInfo = userBaseInfoRedis.getUserInfo(tokenDto.getUserId(),certificationDetailFormDTO.getCustomerId()); resiResult = ConvertUtils.sourceToTarget(userInfo,CertificationDetailResultDTO.class); if(null != resiResult) resiResult.setIdcard(userInfo.getIdNum()); } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml index 44dbb58269..403e3fcc8e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml @@ -33,6 +33,7 @@ + + + + \ No newline at end of file From 7193a584bd243e60a2c027d996e763c0d0fcffba Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 10 Mar 2021 18:01:57 +0800 Subject: [PATCH 137/234] =?UTF-8?q?extUserInfo=20=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=8A=A0=E4=B8=8AcustomerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/UserBaseInfoServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 2072097574..f76628b60d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -366,6 +366,7 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl Date: Wed, 10 Mar 2021 18:52:33 +0800 Subject: [PATCH 138/234] screenProjectData --- .../toscreen/impl/ScreenProjectSettleServiceImpl.java | 5 +++-- .../screen/ScreenProjectDataService.java | 2 +- .../screen/impl/ScreenProjectDataServiceImpl.java | 3 ++- .../evaluationindex/screen/ScreenProjectDataDao.xml | 11 +++++++++-- .../resources/mapper/project/ProjectProcessDao.xml | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 7d97fd2674..7f94601066 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -107,11 +107,12 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic userService.fillScreenProjectData(metaData); //metaData = Optional.ofNullable(userService.getScreenProjectData(metaData)).orElse(metaData); } + ScreenProjectDataDTO orientCase = new ScreenProjectDataDTO(); orientCase.setCustomerId(param.getCustomerId()); //待更新的数据 需要检测更新的字段为:①projectStatusCode ②closeCaseTime ③allCategoryName ④projectLevel List orientData = - targetDbService.getPending(orientCase); + targetDbService.getPending(orientCase,param.getDateId()); // 给metaData和orientData赋上分类信息 List projectIds = @@ -141,7 +142,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic if(!CollectionUtils.isEmpty(metaData)){ List imgs = topicService.buildNewScreenProjectImgData(metaData); - if(CollectionUtils.isEmpty(imgs)){ + if(!CollectionUtils.isEmpty(imgs)){ //FIXME release here targetImgService.insertBatch(imgs); } 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 index 7078f229d1..3838eb4c50 100644 --- 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 @@ -114,7 +114,7 @@ public interface ScreenProjectDataService extends BaseService getPending(ScreenProjectDataDTO param); + List getPending(ScreenProjectDataDTO param,String dateId); /** * @Description collect或更新 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 index 9152e8f0b6..dbe158ef98 100644 --- 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 @@ -246,7 +246,8 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl getPending(ScreenProjectDataDTO param) { + public List getPending(ScreenProjectDataDTO param,String dateId) { + param.setDataEndTime(dateId); return baseDao.selectPending(param); } 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 index 1f439d7a3a..a6c7b1eb6b 100644 --- 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 @@ -55,6 +55,7 @@ and project_level = #{projectLevel} + and data_end_time ]]> #{dataEndTime} @@ -150,9 +151,15 @@ + + + #{dataEndTime} + + + now() + - DATA_END_TIME = #{dataEndTime}, - updated_time = now() + where PROJECT_ID=#{i.projectId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index 698d7d2417..e9079abc3b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -403,7 +403,7 @@ select count(id) from screen_project_data where del_flag = '0' and customer_id = #{customerId} 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 index b1072ad590..fc19f60add 100644 --- 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 @@ -10,6 +10,12 @@ limit 1000 + + delete from screen_project_process + where customer_id = #{customerId} + and DATE_FORMAT(PROCESS_TIME,'%Y%m%d') = #{dateId} + limit 1000 + - SELECT - fics.agency_id, - fics.month_id, - fics.quarter_id, - fics.year_id, - ROUND(AVG( fics.score ),6) AS score, - fics.customer_id, - fics.PARENT_AGENCY_ID AS parentId - FROM - fact_index_agency_score fics - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID - WHERE - fics.del_flag = '0' - AND sca.level = 'district' - AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND fics.month_id = #{monthId} - AND fics.index_code = #{indexCode} - AND fics.DATA_TYPE = #{dataType} - GROUP BY fics.parent_agency_id + SELECT a2.pid AS parentId,a.monthId,a.quarterId,a.yearId,ROUND(AVG( a.score ),6) AS score,a.customerId,a.parentId AS agencyId FROM + (SELECT + fics.agency_id AS agencyId, + fics.month_id AS monthId, + fics.quarter_id AS quarterId, + fics.year_id AS yearId, + ROUND(AVG( fics.score ),6) AS score, + fics.customer_id AS customerId, + (SELECT AGENCY_ID FROM screen_customer_agency WHERE AREA_CODE = #{areaCode}) AS parentId + FROM + fact_index_agency_score fics + WHERE + fics.del_flag = '0' + AND fics.month_id = #{monthId} + AND fics.index_code = #{indexCode} + AND fics.agency_id IN (SELECT AGENCY_ID FROM screen_customer_agency WHERE PARENT_AREA_CODE = #{areaCode}) + GROUP BY agencyId) a + LEFT JOIN screen_customer_agency a2 ON a2.AGENCY_ID = a.parentId + GROUP BY a2.AGENCY_ID @@ -214,6 +215,7 @@ fias.del_flag = 0 AND sca.AREA_CODE = #{areaCode} AND fias.MONTH_ID = #{monthId} + AND fias.customer_id = #{customerId} AND fias.IS_TOTAL = "0" AND (fias.INDEX_CODE = "zhilinengli" OR fias.INDEX_CODE = "dangjiannengli" 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 5690d1a665..28eda4f99c 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 @@ -142,6 +142,7 @@ AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND cs.MONTH_ID = #{monthId} AND cs.IS_TOTAL = "0" + AND cs.customer_id = #{customerId} AND (cs.INDEX_CODE = "dangjiannengli" OR cs.INDEX_CODE = "zhilinengli" OR cs.INDEX_CODE = "fuwunengli") @@ -179,14 +180,14 @@ sca.pid AS parentId FROM fact_index_community_score fics - LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID + LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.AGENCY_ID WHERE fics.del_flag = '0' AND sca.DEL_FLAG = 0 - AND sca.AREA_CODE IN - (SELECT AREA_CODE FROM screen_customer_agency WHERE DEL_FLAG = '0' AND PARENT_AREA_CODE = #{areaCode}) + AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') + AND sca.`LEVEL` = 'community' AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} - GROUP BY fics.parent_agency_id + GROUP BY parentId 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 d189ad2ee6..1217c43131 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 @@ -193,8 +193,37 @@ WHERE gm.del_flag = '0' AND gm.month_id = #{monthId} - AND gm.DATA_TYPE = 'community' + AND gm.DATA_TYPE = 'street' AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.AREA_CODE != #{areaCode} + AND gm.PARENT_ID = '0' + + + + 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 911b62e8c6..eeddf7a408 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 @@ -146,8 +146,7 @@ LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = pm.AGENCY_ID WHERE pm.del_flag = '0' - AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') - AND sca.AREA_CODE != #{areaCode} + AND sca.PARENT_AREA_CODE = #{areaCode} AND pm.month_id = #{monthId} + From 4a3ca383ccd4649752d47d9b30e71253f6b117c3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 12 Mar 2021 09:49:43 +0800 Subject: [PATCH 145/234] =?UTF-8?q?=E5=B9=B3=E9=98=B4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java | 2 +- .../indexcal/impl/IndexCalculateCommunityServiceImpl.java | 3 ++- .../indexcal/impl/IndexCalculateStreetServiceImpl.java | 7 ++----- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index 4188e5f96f..24f48eef4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -75,7 +75,7 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); - List> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("level")String level); /** * @Description 孔村单独查询 * @Param monthId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 0d084096ec..693f02c50d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.constant.ProjectConstant; +import com.epmet.constant.ScreenConstant; import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySubScoreDao; @@ -702,7 +703,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } } else { // 治理能力的六个五级指标 - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode()); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode(), ScreenConstant.COMMUNITY); if (CollectionUtils.isEmpty(communityGovernAbility)){ log.warn(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); }else{ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 000b41921c..552efefa9d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -8,10 +8,7 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.constant.DataSourceConstant; -import com.epmet.constant.IndexCalConstant; -import com.epmet.constant.OrgTypeConstant; -import com.epmet.constant.ProjectConstant; +import com.epmet.constant.*; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -908,7 +905,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ public List> disposeFiveLevel(CalculateCommonFormDTO formDTO){ List> result = new ArrayList<>(); - List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET); List> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ kongCunGovernAbility.forEach(k -> { 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 1217c43131..3dbe2956ed 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 @@ -193,7 +193,7 @@ WHERE gm.del_flag = '0' AND gm.month_id = #{monthId} - AND gm.DATA_TYPE = 'street' + AND gm.DATA_TYPE = #{level} AND sca.AREA_CODE LIKE CONCAT(#{areaCode},'%') AND sca.AREA_CODE != #{areaCode} AND gm.PARENT_ID = '0' From 2d5e64b207c020fc49389a8c87ec1d7ab6b7e844 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 12 Mar 2021 14:29:51 +0800 Subject: [PATCH 146/234] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=AE=9A=E5=88=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8C=83=E5=9B=B4=EF=BC=9A=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E3=80=81=E5=A4=96=E9=93=BE=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/UpdateCustomerFunctionFormDTO.java | 10 ++++++++++ .../controller/CustomerFunctionDetailController.java | 1 - .../java/com/epmet/dao/CustomerFunctionDetailDao.java | 1 + .../epmet/service/CustomerFunctionDetailService.java | 1 + .../resources/mapper/CustomerFunctionDetailDao.xml | 7 +++++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java index 83800e2af5..3f65de5bb8 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java @@ -50,4 +50,14 @@ public class UpdateCustomerFunctionFormDTO implements Serializable { private String iconSmallImg; private String userId; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 自定义业务域名(可设置多个 用分号分隔) + */ + private String domainName; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java index 0778f3d989..3a69b6da62 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -143,7 +143,6 @@ public class CustomerFunctionDetailController { /** * 客户定制功能修改 入参 - * 目前允许修改功能名称、大小图标 * * @param tokenDto * @param formDTO diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java index bfbefc518d..8334159e8c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -73,6 +73,7 @@ public interface CustomerFunctionDetailDao extends BaseDao ICON_SMALL_IMG = #{iconSmallImg}, + + + DOMAIN_NAME = #{domainName}, + + + TARGET_LINK = #{targetLink}, + UPDATED_BY = #{userId}, UPDATED_TIME = now() WHERE From 875b87cf1d3b870147585a3c45acc0d196fad4da Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 15 Mar 2021 15:29:13 +0800 Subject: [PATCH 147/234] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E5=8A=A0log=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 391ad95b7c..9a342916e4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -153,6 +153,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { */ @Override public void initPartyMemberBadge(String userId,TokenDto tokenDto){ + log.info("开始初始化【"+userId+"】党员徽章"); List userIds = resiUserBadgeDao.selectUserIds(); List badges = new ArrayList<>(); String partyBadgeId = badgeDao.getPartyBadgeId(null); @@ -195,6 +196,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { List oneUserIds = new ArrayList<>(); oneUserIds.add(userId); List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(oneUserIds); + log.info("user【"+userId+"】基本信息:"+userBaseInfoResultDTOS.toString()); if (!CollectionUtils.isEmpty(userIds)) { AtomicReference status = new AtomicReference<>(true); userIds.forEach(u -> { @@ -232,6 +234,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { badges.add(dto); }); } + log.info("即将插入的徽章信息:"+badges); resiUserBadgeDao.insertResiUserBadge(badges); } } From 8c5ffb9209e0b338a77929269c1a3c9ef2520ea1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 15 Mar 2021 15:41:47 +0800 Subject: [PATCH 148/234] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E5=8A=A0log=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 9a342916e4..41ef5f072a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -200,7 +200,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { if (!CollectionUtils.isEmpty(userIds)) { AtomicReference status = new AtomicReference<>(true); userIds.forEach(u -> { - if(u.equals(userId)){ + if(u.getUserId().equals(userId)){ status.set(false); } }); From 5b9a75601585aa42e454cd0400c6dcb94cf8277c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 15 Mar 2021 15:43:16 +0800 Subject: [PATCH 149/234] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E5=8A=A0log=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 41ef5f072a..b076c7eaff 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -153,7 +153,6 @@ public class UserBadgeServiceImpl implements UserBadgeService { */ @Override public void initPartyMemberBadge(String userId,TokenDto tokenDto){ - log.info("开始初始化【"+userId+"】党员徽章"); List userIds = resiUserBadgeDao.selectUserIds(); List badges = new ArrayList<>(); String partyBadgeId = badgeDao.getPartyBadgeId(null); From 68817f0770cf4618dba15dd5c5b2d6522ebaec86 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 16 Mar 2021 09:51:37 +0800 Subject: [PATCH 150/234] =?UTF-8?q?=E5=BE=BD=E7=AB=A0bug=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index b076c7eaff..110739d089 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -199,7 +199,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { if (!CollectionUtils.isEmpty(userIds)) { AtomicReference status = new AtomicReference<>(true); userIds.forEach(u -> { - if(u.getUserId().equals(userId)){ + if(u.equals(userId)){ status.set(false); } }); From 62e68b5d23e22dec514a21eb1f321ac36bf5f319 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 16 Mar 2021 10:15:53 +0800 Subject: [PATCH 151/234] =?UTF-8?q?=E5=BE=BD=E7=AB=A0bug=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 110739d089..b076c7eaff 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -199,7 +199,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { if (!CollectionUtils.isEmpty(userIds)) { AtomicReference status = new AtomicReference<>(true); userIds.forEach(u -> { - if(u.equals(userId)){ + if(u.getUserId().equals(userId)){ status.set(false); } }); From 8595a1d68884c84f05a4209441d07f3ec8098985 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 Mar 2021 12:47:12 +0800 Subject: [PATCH 152/234] =?UTF-8?q?=E5=AE=89=E5=AE=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=87=E9=9B=86=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screencoll/ScreenCollFormDTO.java | 35 ++++++- .../AnCommunityProjectProfileFormDTO.java | 10 ++ .../AnGrassRootsGovernMonthlyFormDTO.java | 17 +++- .../form/AnGrassRootsOrgMonthlyFormDTO.java | 13 +++ .../form/AnGrassRootsPmRankFormDTO.java | 19 +++- .../AnGrassRootsPmTotalMonthlyFormDTO.java | 13 +++ .../controller/AnScreenCollController.java | 94 +++++++++++++------ .../screen/AnScreenCollService.java | 10 +- .../screen/impl/AnScreenCollServiceImpl.java | 70 ++++++-------- 9 files changed, 205 insertions(+), 76 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java index fa3e97d11d..16ab5fee7d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -1,8 +1,12 @@ package com.epmet.dto.screencoll; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.Valid; +import javax.validation.constraints.*; import java.io.Serializable; import java.util.List; @@ -14,21 +18,47 @@ import java.util.List; */ @Data public class ScreenCollFormDTO implements Serializable { - private static final long serialVersionUID = 4605543711669000348L; + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface IsFirstShowGroup extends CustomerClientShowGroup { + } + + public interface DateIdShowGroup extends CustomerClientShowGroup { + } + + public interface MonthIdShowGroup extends CustomerClientShowGroup { + } + + public interface CustomerIdShowGroup extends CustomerClientShowGroup { + } + + public interface DataListShowGroup extends CustomerClientShowGroup { + + } + /** * 当为true时后台将先删除当前维度的数据,后新增 */ + @NotNull(message = "isFirst不能为空", groups = IsFirstShowGroup.class) private Boolean isFirst; /** * 日期Id, 数据更新至:yyyyMMdd */ + @NotBlank(message = "dateId不能为空;", groups = DateIdShowGroup.class) + @Length(min = 8, max = 8, message = "dateId不能为空,格式应为yyyyMMdd;", groups = {DateIdShowGroup.class}) private String dateId; /** * yyyyMM */ + @NotBlank(message = "monthId不能为空,格式yyyyMM;", groups = MonthIdShowGroup.class) + @Length(min = 6, max = 6, message = "monthId不能为空,格式应为yyyyMM;", groups = {MonthIdShowGroup.class}) private String monthId; /** @@ -39,6 +69,8 @@ public class ScreenCollFormDTO implements Serializable { /** * 数据集合 */ + @Valid + @NotEmpty(message = "dataList不能为空", groups = DataListShowGroup.class) private List dataList; @Override @@ -49,5 +81,6 @@ public class ScreenCollFormDTO implements Serializable { /** * 当前客户id */ + @NotBlank(message = "customerId不能为空;", groups = CustomerIdShowGroup.class) private String customerId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java index d81ae5cf9e..0d52614cfd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -14,23 +17,30 @@ import java.io.Serializable; public class AnCommunityProjectProfileFormDTO implements Serializable { private static final long serialVersionUID = 1466172677051250092L; + public interface DefaultShowGroup extends CustomerClientShowGroup { + } + /** * 数据更新至: yyyy|yyyyMM|yyyyMMdd,项目根据实际情况赋值 */ + @NotBlank(message = "dataEndTime不能为空;", groups = DefaultShowGroup.class) private String dataEndTime; /** * 社区id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 项目数 */ + @NotNull(message = "projectTotal不能为空;", groups = DefaultShowGroup.class) private Integer projectTotal; /** * 等级 */ + @NotBlank(message = "level不能为空;", groups = DefaultShowGroup.class) private String level; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java index adcb9f63b2..ff3727625b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; @@ -12,51 +15,63 @@ import java.math.BigDecimal; * @since v1.0.0 2020-10-09 */ @Data -public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { +public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { private static final long serialVersionUID = -6947401956711903753L; + public interface DefaultShowGroup extends CustomerClientShowGroup { + } + /** * 网格,街道或社区id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 网格,街道名称或者社区名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid;组织:agency */ + @NotBlank(message = "orgType不能为空,网格:grid;组织:agency;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 参与项目数 */ + @NotNull(message = "partiProjectTotal不能为空;", groups = DefaultShowGroup.class) private Integer partiProjectTotal; /** * 办结项目数 */ + @NotNull(message = "closedProjectTotal不能为空;", groups = DefaultShowGroup.class) private Integer closedProjectTotal; /** * 项目响应度 存储的是%前面的数 */ + @NotNull(message = "projectResponseRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal projectResponseRatio; /** * 项目满意率,存储的是%前面的数 */ + @NotNull(message = "projectSatisRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal projectSatisRatio; /** * 办结率 for 社区 */ + @NotNull(message = "closedProjectRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal closedProjectRatio; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java index 70242f1ad3..5ca82e599e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,39 +16,49 @@ import java.io.Serializable; @Data public class AnGrassRootsOrgMonthlyFormDTO implements Serializable { private static final long serialVersionUID = -7389300512268641307L; + + public interface DefaultShowGroup extends CustomerClientShowGroup {} + /** * 网格id或者组织(街道或社区)id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 组织名称OR网格名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid; 组织:agency */ + @NotBlank(message = "orgType不能为空;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 党群数 */ + @NotNull(message = "groupTotal不能为空;", groups = DefaultShowGroup.class) private Integer groupTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;", groups = DefaultShowGroup.class) private Integer issueTotal; /** * 项目数 */ + @NotNull(message = "projectTotal不能为空;", groups = DefaultShowGroup.class) private Integer projectTotal; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java index b889e54661..c558760bf4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java @@ -1,7 +1,11 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,60 +17,73 @@ import java.io.Serializable; @Data public class AnGrassRootsPmRankFormDTO implements Serializable { private static final long serialVersionUID = 3642729389245262928L; + public interface DefaultShowGroup extends CustomerClientShowGroup {} /** - * 月份Id + * 月份Id */ + @NotBlank(message = "monthId不能为空;", groups = DefaultShowGroup.class) + @Length(min = 6, max = 6, message = "monthId不能为空,格式应为yyyyMM;", groups = {DefaultShowGroup.class}) private String monthId; /** * 用户id */ + @NotBlank(message = "userId不能为空;", groups = DefaultShowGroup.class) private String userId; /** * 姓名 */ + @NotBlank(message = "userName不能为空;", groups = DefaultShowGroup.class) private String userName; /** * 所属支部id */ + @NotBlank(message = "branchId不能为空;", groups = DefaultShowGroup.class) private String branchId; /** * 所属支部名称 */ + @NotBlank(message = "branchName不能为空;", groups = DefaultShowGroup.class) private String branchName; /** * 所属社区id */ + @NotBlank(message = "communityId不能为空;", groups = DefaultShowGroup.class) private String communityId; /** * 所属社区名称 */ + @NotBlank(message = "communityName不能为空;", groups = DefaultShowGroup.class) private String communityName; /** * 群成员数 */ + @NotNull(message = "groupMemberTotal不能为空;",groups =DefaultShowGroup.class ) private Integer groupMemberTotal; /** * 话题数 */ + @NotNull(message = "topicTotal不能为空;",groups =DefaultShowGroup.class ) private Integer topicTotal; /** * 参与人次 */ + @NotNull(message = "partiUserTotal不能为空;",groups =DefaultShowGroup.class ) private Integer partiUserTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;",groups =DefaultShowGroup.class ) private Integer issueTotal; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java index 4adb2ee168..1f1bcb4315 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -14,44 +17,54 @@ import java.io.Serializable; public class AnGrassRootsPmTotalMonthlyFormDTO implements Serializable { private static final long serialVersionUID = 8675347783888892404L; + public interface DefaultShowGroup extends CustomerClientShowGroup {} + /** * 网格id或者组织(街道或社区)id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 组织名称OR网格名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid;组织:agency */ + @NotBlank(message = "orgType不能为空;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 群成员数 */ + @NotNull(message = "groupMemberTotal不能为空;", groups = DefaultShowGroup.class) private Integer groupMemberTotal; /** * 话题数 */ + @NotNull(message = "topicTotal不能为空;", groups = DefaultShowGroup.class) private Integer topicTotal; /** * 话题参与人次 */ + @NotNull(message = "topicPartiUserTotal不能为空;", groups = DefaultShowGroup.class) private Integer topicPartiUserTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;", groups = DefaultShowGroup.class) private Integer issueTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java index 0766df597b..5b862b66ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java @@ -1,11 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.AnScreenCollService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,79 +22,116 @@ public class AnScreenCollController { private AnScreenCollService screenCollService; /** - * @Description 安宁大屏数据采集 - 基层党员-各类总数 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 * @author wangc * @date 2020.10.09 17:20 */ @PostMapping("pmtotal") - public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.pmTotal(formDTO,customerId); + public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsPmTotalMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.pmTotal(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 * @author wangc * @date 2020.10.09 17:19 */ @PostMapping("pmrank") - public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if (StringUtils.isBlank(formDTO.getMonthId())){ - throw new ValidateException("月份Id不能为空"); - } - screenCollService.pmRank(formDTO,customerId); + public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsPmRankFormDTO.DefaultShowGroup.class); + }); + screenCollService.pmRank(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 * @author wangc * @date 2020.10.09 17:22 */ @PostMapping("grassrootsorg") - public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.grassrootsOrg(formDTO,customerId); + public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsOrgMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.grassrootsOrg(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层治理-各类数 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层治理-各类数 按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 * @author wangc * @date 2020.10.09 17:23 */ @PostMapping("grassrootsgovern") - public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.grassrootsGovern(formDTO,customerId); + public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsGovernMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.grassrootsGovern(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 中央区-项目概要 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 * @author wangc * @date 2020.10.09 16:41 */ @PostMapping("projectfile") - public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.communityProjectProfile(formDTO,customerId); + public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnCommunityProjectProfileFormDTO.DefaultShowGroup.class); + }); + screenCollService.communityProjectProfile(formDTO); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java index 15a9d72a35..a347d5286d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java @@ -17,7 +17,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 16:41 */ - void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId); + void communityProjectProfile(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 @@ -27,7 +27,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:19 */ - void pmRank(ScreenCollFormDTO formDTO,String customerId); + void pmRank(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层党员-各类总数 @@ -37,7 +37,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:20 */ - void pmTotal(ScreenCollFormDTO formDTO,String customerId); + void pmTotal(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 @@ -46,7 +46,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:22 */ - void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId); + void grassrootsOrg(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层治理-各类数 @@ -55,5 +55,5 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:23 */ - void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId); + void grassrootsGovern(ScreenCollFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java index e5229f146b..30adab1c63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java @@ -4,11 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; +import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.AnScreenCollService; @@ -17,10 +13,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - - -import java.util.List; /** @@ -56,17 +48,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void communityProjectProfile(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = communityProjectProfileDao.deleteBatch(customerId); + int affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); while(affectRows >= NumConstant.ONE){ - affectRows = communityProjectProfileDao.deleteBatch(customerId); + affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); } } Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { - communityProjectProfileDao.insertBatch(list,customerId); + communityProjectProfileDao.insertBatch(list,formDTO.getCustomerId()); }); } @@ -81,17 +73,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void pmRank(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void pmRank(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { - pmRankDao.insertBatch(list,customerId); + pmRankDao.insertBatch(list,formDTO.getCustomerId()); }); } @@ -105,21 +97,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void pmTotal(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void pmTotal(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { pmTotalMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); @@ -136,21 +128,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void grassrootsOrg(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { orgMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); @@ -167,21 +159,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void grassrootsGovern(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { governMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); From 093e33c22a3d5f2b434d06ec8a341824d79d511e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 Mar 2021 13:44:56 +0800 Subject: [PATCH 153/234] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E7=94=A8=E5=8F=82=E6=95=B0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/KcScreenCollController.java | 77 +++++++++--- .../ScreenProjectDataCollController.java | 60 ++++----- .../controller/plugins/OfsController.java | 4 + .../plugins/WorkRecordColController.java | 35 ++---- .../screen/KcScreenCollService.java | 57 +++------ ...ScreenProjectCategoryGridDailyService.java | 3 +- .../ScreenProjectCategoryOrgDailyService.java | 3 +- .../screen/ScreenProjectDataService.java | 2 +- .../screen/ScreenProjectGridDailyService.java | 3 +- .../screen/ScreenProjectOrgDailyService.java | 3 +- .../screen/ScreenProjectProcessService.java | 2 +- ...reenProjectQuantityGridMonthlyService.java | 3 +- ...creenProjectQuantityOrgMonthlyService.java | 3 +- .../screen/impl/KcScreenCollServiceImpl.java | 114 +++++++++--------- ...enProjectCategoryGridDailyServiceImpl.java | 11 +- ...eenProjectCategoryOrgDailyServiceImpl.java | 7 +- .../impl/ScreenProjectDataServiceImpl.java | 24 ++-- .../ScreenProjectGridDailyServiceImpl.java | 9 +- .../ScreenProjectOrgDailyServiceImpl.java | 9 +- .../impl/ScreenProjectProcessServiceImpl.java | 14 +-- ...ProjectQuantityGridMonthlyServiceImpl.java | 9 +- ...nProjectQuantityOrgMonthlyServiceImpl.java | 9 +- .../ScreenCustomerWorkRecordDictService.java | 3 +- .../ScreenWorkRecordOrgDailyService.java | 2 +- .../ScreenWorkRecordOrgMonthlyService.java | 3 +- ...reenCustomerWorkRecordDictServiceImpl.java | 8 +- .../ScreenWorkRecordOrgDailyServiceImpl.java | 8 +- ...ScreenWorkRecordOrgMonthlyServiceImpl.java | 9 +- 28 files changed, 237 insertions(+), 257 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java index b64d7855a0..34269ee507 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.KcScreenCollService; @@ -35,7 +36,9 @@ public class KcScreenCollController { @PostMapping("homepage/platformsummary") public Result platFormSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertPlatFormSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertPlatFormSummary(formDTO); return new Result(); } @@ -54,7 +57,9 @@ public class KcScreenCollController { @PostMapping("issue/summary") public Result issueSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertIssueSummary(formDTO); return new Result(); } @@ -73,7 +78,9 @@ public class KcScreenCollController { @PostMapping("issue/trend") public Result issueTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertIssueTrend(formDTO); return new Result(); } @@ -92,7 +99,9 @@ public class KcScreenCollController { @PostMapping("user/summary") public Result userSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertUserSummary(formDTO); return new Result(); } @@ -111,7 +120,9 @@ public class KcScreenCollController { @PostMapping("volunteer/heartrank") public Result volunteerHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerHeartRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertVolunteerHeartRank(formDTO); return new Result(); } @@ -130,7 +141,9 @@ public class KcScreenCollController { @PostMapping("user/userheartrank") public Result userHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserHeartRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertUserHeartRank(formDTO); return new Result(); } @@ -149,7 +162,9 @@ public class KcScreenCollController { @PostMapping("act/summary") public Result actSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertActSummary(formDTO); return new Result(); } @@ -168,7 +183,9 @@ public class KcScreenCollController { @PostMapping("act/trend") public Result actTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertActTrend(formDTO); return new Result(); } @@ -187,7 +204,9 @@ public class KcScreenCollController { @PostMapping("act/volunteersummary") public Result volunteerSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertVolunteerSummary(formDTO); return new Result(); } @@ -206,7 +225,9 @@ public class KcScreenCollController { @PostMapping("project/summary") public Result projectSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertProjectSummary(formDTO); return new Result(); } @@ -225,7 +246,9 @@ public class KcScreenCollController { @PostMapping("project/categorysummary") public Result categorySummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertCategorySummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertCategorySummary(formDTO); return new Result(); } @@ -244,7 +267,9 @@ public class KcScreenCollController { @PostMapping("project/satisanalysis") public Result projectSatisanalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSatisanalysis(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertProjectSatisanalysis(formDTO); return new Result(); } @@ -263,7 +288,9 @@ public class KcScreenCollController { @PostMapping("news/summary") public Result newsSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsSummary(formDTO); return new Result(); } @@ -282,7 +309,9 @@ public class KcScreenCollController { @PostMapping("news/trend") public Result newsTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertNewsTrend(formDTO); return new Result(); } @@ -301,7 +330,9 @@ public class KcScreenCollController { @PostMapping("news/hotrank") public Result newsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsHotRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsHotRank(formDTO); return new Result(); } @@ -320,7 +351,9 @@ public class KcScreenCollController { @PostMapping("news/categoryanalysis") public Result newsCategoryAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsCategoryAnalysis(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsCategoryAnalysis(formDTO); return new Result(); } @@ -339,7 +372,9 @@ public class KcScreenCollController { @PostMapping("group/summary") public Result groupSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertGroupSummary(formDTO); return new Result(); } @@ -358,7 +393,9 @@ public class KcScreenCollController { @PostMapping("group/detail") public Result groupDetail(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupDetail(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertGroupDetail(formDTO); return new Result(); } @@ -377,7 +414,9 @@ public class KcScreenCollController { @PostMapping("group/topictrend") public Result groupTopicTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupTopicTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertGroupTopicTrend(formDTO); return new Result(); } } 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 43b6171c05..0af70355e9 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 @@ -1,16 +1,14 @@ package com.epmet.controller; -import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; 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; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; @@ -50,10 +48,9 @@ public class ScreenProjectDataCollController { **/ @RequestMapping("quantity-grid-monthly") public Result quantityGridMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getMonthId())) { - throw new ValidateException("参数错误:dataList不能为空且monthId不能为空"); - } - projectQuantityGridMonthlyService.collect(customerId, param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectQuantityGridMonthlyService.collect(param); return new Result(); } @@ -63,10 +60,9 @@ public class ScreenProjectDataCollController { **/ @RequestMapping("quantity-org-monthly") public Result quantityOrgMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getMonthId())) { - throw new ValidateException("参数错误:dataList不能为空且monthId不能为空"); - } - projectQuantityOrgMonthlyService.collect(customerId, param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectQuantityOrgMonthlyService.collect(param); return new Result(); } @@ -76,10 +72,9 @@ public class ScreenProjectDataCollController { **/ @RequestMapping("project-grid-daily") public Result projectGridDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { - throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); - } - projectGridDailyService.collect(customerId, param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectGridDailyService.collect(param); return new Result(); } @@ -89,10 +84,9 @@ public class ScreenProjectDataCollController { **/ @RequestMapping("project-org-daily") public Result projectOrgDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { - throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); - } - projectOrgDailyService.collect(customerId, param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectOrgDailyService.collect(param); return new Result(); } @@ -107,10 +101,9 @@ public class ScreenProjectDataCollController { */ @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); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectCategoryGridDailyService.collect(param); return new Result(); } @@ -124,10 +117,9 @@ public class ScreenProjectDataCollController { */ @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); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectCategoryOrgDailyService.collect(param); return new Result(); } //上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算 @@ -140,10 +132,9 @@ 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不能为空且dateId不能为空"); - } - projectDataService.collect(customerId,param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectDataService.collect(param); return new Result(); } @@ -155,10 +146,9 @@ public class ScreenProjectDataCollController { */ @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); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectProcessService.collect(param); return new Result(); } 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 ca112ac6a9..33e7c281aa 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 @@ -1,6 +1,7 @@ package com.epmet.controller.plugins; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.plugins.BidFormDTO; import com.epmet.dto.plugins.ContractFormDTO; import com.epmet.dto.plugins.OneListFormDTO; @@ -32,6 +33,7 @@ public class OfsController { @PostMapping("onelist-daily") public Result collOneList(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); ofsService.collOneList(formDTO); return new Result(); } @@ -46,6 +48,7 @@ public class OfsController { @PostMapping("contract-daily") public Result collContract(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); ofsService.collContract(formDTO); return new Result(); } @@ -60,6 +63,7 @@ public class OfsController { @PostMapping("bid-daily") public Result collBid(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); ofsService.collBid(formDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java index 5331ca5cfa..8bbce3e324 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java @@ -1,8 +1,7 @@ package com.epmet.controller.plugins; -import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; @@ -10,9 +9,7 @@ import com.epmet.service.plugins.ScreenCustomerWorkRecordDictService; import com.epmet.service.plugins.ScreenWorkRecordOrgDailyService; import com.epmet.service.plugins.ScreenWorkRecordOrgMonthlyService; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; /** @@ -44,13 +41,9 @@ public class WorkRecordColController { */ @PostMapping("resource-dict") public Result resourceDict(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ - if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || - StringUtils.isBlank(data.getDateId())) { - log.error("com.epmet.controller.plugins.WorkRecordColController.resourceDict,param:{}", JSON.toJSONString(data)); - throw new ValidateException("客户Id、上传数据列表、日期Id不可为空"); - } - // log.info("【工作日志】客户资源字典信息上传"+JSON.toJSONString(data,true)); - dictService.collect(customerId,data); + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + dictService.collect(data); return new Result(); } @@ -64,13 +57,9 @@ public class WorkRecordColController { */ @PostMapping("org-monthly") public Result collectOrg(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ - if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || - StringUtils.isBlank(data.getMonthId())) { - log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrg,param:{}", JSON.toJSONString(data)); - throw new ValidateException("客户Id、上传数据列表、月份Id不可为空"); - } - // log.info("【工作日志】组织按月统计"+JSON.toJSONString(data,true)); - screenWorkRecordOrgMonthlyService.collect(customerId,data); + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + screenWorkRecordOrgMonthlyService.collect(data); return new Result(); } @@ -84,13 +73,9 @@ public class WorkRecordColController { */ @PostMapping("org-daily") public Result collectOrgDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ - if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || - StringUtils.isBlank(data.getDateId())) { - log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrgDaily,param:{}", JSON.toJSONString(data)); - throw new ValidateException("客户Id、上传数据列表、日期Id不可为空"); - } - // log.info("【工作日志】组织按日统计 累计值"+JSON.toJSONString(data,true)); - screenWorkRecordOrgDailyService.collectOrgDaily(customerId,data); + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + screenWorkRecordOrgDailyService.collectOrgDaily(data); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java index 492a951156..5eaca5388c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java @@ -17,12 +17,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertPlatFormSummary(ScreenCollFormDTO formDTO, String customerId); + void insertPlatFormSummary(ScreenCollFormDTO formDTO); /** * 2、议题分析-各类总数 @@ -30,12 +29,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertIssueSummary(ScreenCollFormDTO formDTO, String customerId); + void insertIssueSummary(ScreenCollFormDTO formDTO); /** * 3、议题分析-参与趋势 @@ -43,12 +41,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertIssueTrend(ScreenCollFormDTO formDTO, String customerId); + void insertIssueTrend(ScreenCollFormDTO formDTO); /** * 4、用户分析-各类总数 @@ -56,12 +53,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertUserSummary(ScreenCollFormDTO formDTO, String customerId); + void insertUserSummary(ScreenCollFormDTO formDTO); /** * 5、公益互助-志愿者公益时长排名 @@ -69,12 +65,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertVolunteerHeartRank(ScreenCollFormDTO formDTO, String customerId); + void insertVolunteerHeartRank(ScreenCollFormDTO formDTO); /** * 6、用户分析-用户趋势 @@ -82,12 +77,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertUserHeartRank(ScreenCollFormDTO formDTO, String customerId); + void insertUserHeartRank(ScreenCollFormDTO formDTO); /** * 7、公益互助-活动各类总数 @@ -95,12 +89,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertActSummary(ScreenCollFormDTO formDTO, String customerId); + void insertActSummary(ScreenCollFormDTO formDTO); /** * 8、公益互助-活动次数趋势 @@ -108,12 +101,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertActTrend(ScreenCollFormDTO formDTO, String customerId); + void insertActTrend(ScreenCollFormDTO formDTO); /** * 9、公益互助-志愿者画像 @@ -121,12 +113,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertVolunteerSummary(ScreenCollFormDTO formDTO, String customerId); + void insertVolunteerSummary(ScreenCollFormDTO formDTO); /** * 10、项目分析-各类总数 @@ -134,12 +125,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertProjectSummary(ScreenCollFormDTO formDTO, String customerId); + void insertProjectSummary(ScreenCollFormDTO formDTO); /** * 11、项目分析-按分类统计 @@ -147,12 +137,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertCategorySummary(ScreenCollFormDTO formDTO, String customerId); + void insertCategorySummary(ScreenCollFormDTO formDTO); /** * 12、项目分析-满意度分析 @@ -160,12 +149,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertProjectSatisanalysis(ScreenCollFormDTO formDTO, String customerId); + void insertProjectSatisanalysis(ScreenCollFormDTO formDTO); /** * 13、党建声音-新闻各类总数汇总 @@ -173,12 +161,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsSummary(ScreenCollFormDTO formDTO, String customerId); + void insertNewsSummary(ScreenCollFormDTO formDTO); /** * 14、党建声音-新闻阅读参与趋势 @@ -186,12 +173,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsTrend(ScreenCollFormDTO formDTO, String customerId); + void insertNewsTrend(ScreenCollFormDTO formDTO); /** * 15、党建声音-热度新闻排行 @@ -199,12 +185,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsHotRank(ScreenCollFormDTO formDTO, String customerId); + void insertNewsHotRank(ScreenCollFormDTO formDTO); /** * 16、党建声音-新闻按类别统计 @@ -212,12 +197,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO, String customerId); + void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO); /** * 17、邻里党群-各类总数汇总 @@ -225,12 +209,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupSummary(ScreenCollFormDTO formDTO, String customerId); + void insertGroupSummary(ScreenCollFormDTO formDTO); /** * 18、邻里党群-小组详情 @@ -238,12 +221,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupDetail(ScreenCollFormDTO formDTO, String customerId); + void insertGroupDetail(ScreenCollFormDTO formDTO); /** * 19、邻里党群-话题参与趋势 @@ -251,10 +233,9 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupTopicTrend(ScreenCollFormDTO formDTO, String customerId); + void insertGroupTopicTrend(ScreenCollFormDTO formDTO); } 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 index 5306e7f73b..da711d85e3 100644 --- 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 @@ -98,9 +98,8 @@ public interface ScreenProjectCategoryGridDailyService extends BaseService param); + void collect(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 index 005232d59a..ce71722794 100644 --- 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 @@ -98,9 +98,8 @@ public interface ScreenProjectCategoryOrgDailyService extends BaseService param); + void collect(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/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java index 82d296a1a3..1db733c72c 100644 --- 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 @@ -95,5 +95,5 @@ public interface ScreenProjectDataService extends BaseService param); + void collect(ScreenCollFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java index 2b710cefb3..7702f0cfd1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java @@ -96,13 +96,12 @@ public interface ScreenProjectGridDailyService extends BaseService data); + void collect(ScreenCollFormDTO data); /** * @Description 数据抽取【网格-日】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java index 587a6eef72..ee1f4bf1e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java @@ -96,13 +96,12 @@ public interface ScreenProjectOrgDailyService extends BaseService data); + void collect(ScreenCollFormDTO data); /** * @Description 数据抽取【机关-日】 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 index f4b050fe13..986161a667 100644 --- 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 @@ -95,5 +95,5 @@ public interface ScreenProjectProcessService extends BaseService param); + void collect(ScreenCollFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java index 6d5e5b909d..da29112ad7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java @@ -95,13 +95,12 @@ public interface ScreenProjectQuantityGridMonthlyService extends BaseService data); + void collect(ScreenCollFormDTO data); /** * @Description 数据抽取 【网格-月】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java index 88c451bcfc..6088a6dba4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java @@ -96,13 +96,12 @@ public interface ScreenProjectQuantityOrgMonthlyService extends BaseService data); + void collect(ScreenCollFormDTO data); /** * @Description 数据抽取【组织-月】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java index 2e4abd79df..dc3bed6bd7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java @@ -82,285 +82,285 @@ public class KcScreenCollServiceImpl implements KcScreenCollService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPlatFormSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertPlatFormSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcPlatformSummaryDailyDao.deletePlatFormSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcPlatformSummaryDailyDao.deletePlatFormSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcPlatformSummaryDailyDao.batchInsertPlatFormSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcPlatformSummaryDailyDao.batchInsertPlatFormSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertIssueSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertIssueSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcIssueSummaryGridDailyDao.deleteIssueSummaryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcIssueSummaryGridDailyDao.deleteIssueSummaryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcIssueSummaryGridDailyDao.batchInsertIssueSummaryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcIssueSummaryGridDailyDao.batchInsertIssueSummaryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertIssueTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertIssueTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcIssueTrendGridMonthlyDao.deleteIssueTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcIssueTrendGridMonthlyDao.deleteIssueTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcIssueTrendGridMonthlyDao.batchInsertIssueTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcIssueTrendGridMonthlyDao.batchInsertIssueTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertUserSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertUserSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcUserSummaryDailyDao.deleteUserSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcUserSummaryDailyDao.deleteUserSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcUserSummaryDailyDao.batchInsertUserSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcUserSummaryDailyDao.batchInsertUserSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertVolunteerHeartRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertVolunteerHeartRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcVolunteerHeatRankGridDailyDao.deleteVolunteerHeatRankGrid(customerId); + deleteNum = screenKcVolunteerHeatRankGridDailyDao.deleteVolunteerHeatRankGrid(formDTO.getCustomerId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcVolunteerHeatRankGridDailyDao.batchInsertVolunteerHeatRankGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcVolunteerHeatRankGridDailyDao.batchInsertVolunteerHeatRankGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertUserHeartRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertUserHeartRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcUserTrendGridMonthlyDao.deleteUserTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcUserTrendGridMonthlyDao.deleteUserTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcUserTrendGridMonthlyDao.batchInsertUserTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcUserTrendGridMonthlyDao.batchInsertUserTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertActSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertActSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcActSummaryDailyDao.deleteActSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcActSummaryDailyDao.deleteActSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcActSummaryDailyDao.batchInsertActSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcActSummaryDailyDao.batchInsertActSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertActTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertActTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcActTrendMonthlyDao.deleteActTrend(customerId, formDTO.getMonthId()); + deleteNum = screenKcActTrendMonthlyDao.deleteActTrend(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcActTrendMonthlyDao.batchInsertActTrend(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcActTrendMonthlyDao.batchInsertActTrend(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertVolunteerSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertVolunteerSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcVolunteerSummaryDailyDao.deleteVolunteerSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcVolunteerSummaryDailyDao.deleteVolunteerSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcVolunteerSummaryDailyDao.batchInsertVolunteerSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcVolunteerSummaryDailyDao.batchInsertVolunteerSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertProjectSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertProjectSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectSummaryGridDailyDao.deleteProjectSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcProjectSummaryGridDailyDao.deleteProjectSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectSummaryGridDailyDao.batchInsertProjectSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcProjectSummaryGridDailyDao.batchInsertProjectSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertCategorySummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertCategorySummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectCategoryGridDailyDao.deleteCategoryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcProjectCategoryGridDailyDao.deleteCategoryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectCategoryGridDailyDao.batchInsertCategoryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcProjectCategoryGridDailyDao.batchInsertCategoryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertProjectSatisanalysis(ScreenCollFormDTO formDTO, String customerId) { + public void insertProjectSatisanalysis(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectSatisGridMonthlyDao.deleteProjectSatisGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcProjectSatisGridMonthlyDao.deleteProjectSatisGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectSatisGridMonthlyDao.batchInsertProjectSatisGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcProjectSatisGridMonthlyDao.batchInsertProjectSatisGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsSummaryDailyDao.deleteNewsSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcNewsSummaryDailyDao.deleteNewsSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsSummaryDailyDao.batchInsertNewsSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsSummaryDailyDao.batchInsertNewsSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsTrendMonthlyDao.deleteNewsTrend(customerId, formDTO.getMonthId()); + deleteNum = screenKcNewsTrendMonthlyDao.deleteNewsTrend(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsTrendMonthlyDao.batchInsertNewsTrend(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcNewsTrendMonthlyDao.batchInsertNewsTrend(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsHotRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsHotRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsRankDao.deleteNewsRank(customerId); + deleteNum = screenKcNewsRankDao.deleteNewsRank(formDTO.getCustomerId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsRankDao.batchInsertNewsRank(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsRankDao.batchInsertNewsRank(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsCategoryAnalysisDao.deleteNewsCategoryAnalysis(customerId, formDTO.getDateId()); + deleteNum = screenKcNewsCategoryAnalysisDao.deleteNewsCategoryAnalysis(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsCategoryAnalysisDao.batchInsertNewsCategoryAnalysis(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsCategoryAnalysisDao.batchInsertNewsCategoryAnalysis(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcGroupSummaryGridDailyDao.deleteGroupSummaryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcGroupSummaryGridDailyDao.deleteGroupSummaryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcGroupSummaryGridDailyDao.batchInsertGroupSummaryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcGroupSummaryGridDailyDao.batchInsertGroupSummaryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupDetail(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupDetail(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcGroupDetailGridDailyDao.deleteGroupDetailGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcGroupDetailGridDailyDao.deleteGroupDetailGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcGroupDetailGridDailyDao.batchInsertGroupDetailGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcGroupDetailGridDailyDao.batchInsertGroupDetailGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupTopicTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupTopicTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcTopicTrendGridMonthlyDao.deleteTopicTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcTopicTrendGridMonthlyDao.deleteTopicTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcTopicTrendGridMonthlyDao.batchInsertTopicTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcTopicTrendGridMonthlyDao.batchInsertTopicTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } 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 index 70ce72a036..acc891ac1a 100644 --- 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 @@ -21,19 +21,17 @@ 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.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; @@ -108,23 +106,22 @@ public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl param) { + public void collect(ScreenCollFormDTO param) { if(param.getIsFirst()){ int deleteNum; do { - deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId()); + deleteNum = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(),param.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(param.getDataList())) { param.getDataList().forEach(item -> { - item.setCustomerId(customerId); + item.setCustomerId(param.getCustomerId()); item.setDateId(param.getDateId()); }); insertBatch(ConvertUtils.sourceToTarget(param.getDataList(), ScreenProjectCategoryGridDailyEntity.class)); 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 index 290b30cf74..5660fad150 100644 --- 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 @@ -107,23 +107,22 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl param) { + public void collect(ScreenCollFormDTO param) { if(param.getIsFirst()){ int deleteNum; do { - deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId()); + deleteNum = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(),param.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(param.getDataList())) { param.getDataList().forEach(item -> { - item.setCustomerId(customerId); + item.setCustomerId(param.getCustomerId()); item.setDateId(param.getDateId()); }); Lists.partition(param.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { 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 index cd6117ce6c..d74577768f 100644 --- 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 @@ -21,21 +21,19 @@ 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.constant.FieldConstant; 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 com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; 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; @@ -120,11 +118,11 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl param) { + public void collect(ScreenCollFormDTO param) { if (param.getIsFirst()) { - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); while (affectedRows > 0) { - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); } } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -177,11 +175,11 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl deleteWrapper = new QueryWrapper<>(); deleteWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) - .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId); + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()); baseDao.delete(deleteWrapper); QueryWrapper screenProjectImgDataEntityQueryWrapper = new QueryWrapper<>(); screenProjectImgDataEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) - .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId); + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()); screenProjectImgDataDao.delete(screenProjectImgDataEntityQueryWrapper); //如果orgType未知,获取一下 @@ -204,7 +202,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + int affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,"APP_USER",data.getDateId()); + baseDao.insertBatch(list,data.getCustomerId(),"APP_USER",data.getDateId()); }); } 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 b5c71b558b..98fc2f38f7 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 @@ -125,7 +125,6 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + int affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,"APP_USER",data.getDateId()); + baseDao.insertBatch(list,data.getCustomerId(),"APP_USER",data.getDateId()); }); } 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 index 1d18eb0b7f..8d6cde3ed0 100644 --- 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 @@ -110,29 +110,29 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl param) { + public void collect(ScreenCollFormDTO param) { if (param.getIsFirst()) { - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); while (affectedRows > 0) { - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), 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(param.getCustomerId()), "customer_id", param.getCustomerId()) .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(param.getCustomerId()), "customer_id", param.getCustomerId()) .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); screenProjectProcessAttachmentDao.delete(screenProjectProcessAttachmentEntityQueryWrapper); //插入 ScreenProjectProcessEntity screenProjectProcessEntity = ConvertUtils.sourceToTarget(item, ScreenProjectProcessEntity.class); - screenProjectProcessEntity.setCustomerId(customerId); + screenProjectProcessEntity.setCustomerId(param.getCustomerId()); screenProjectProcessEntity.setDataEndTime(param.getDateId()); baseDao.insert(screenProjectProcessEntity); @@ -140,7 +140,7 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,"APP_USER",data.getMonthId()); + baseDao.insertBatch(list,data.getCustomerId(),"APP_USER",data.getMonthId()); }); } 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 730719d035..91917d22b7 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 @@ -123,7 +123,6 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< /** * @Description 数据采集 - * @param customerId * @param data * @return void * @author wangc @@ -132,15 +131,15 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< @Transactional(rollbackFor = Exception.class) @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public void collect(String customerId, ScreenCollFormDTO data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,"APP_USER",data.getMonthId()); + baseDao.insertBatch(list,data.getCustomerId(),"APP_USER",data.getMonthId()); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java index 6f5ac2573e..98d18d8339 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java @@ -96,11 +96,10 @@ public interface ScreenCustomerWorkRecordDictService extends BaseService data); + void collect(ScreenCollFormDTO data); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java index 6edbb9ba92..c14291c641 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java @@ -30,5 +30,5 @@ import com.epmet.entity.plugins.ScreenWorkRecordOrgDailyEntity; */ public interface ScreenWorkRecordOrgDailyService extends BaseService { - void collectOrgDaily(String customerId, ScreenCollFormDTO data); + void collectOrgDaily(ScreenCollFormDTO data); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java index 0e16b4b1fe..7804957e4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java @@ -32,11 +32,10 @@ public interface ScreenWorkRecordOrgMonthlyService extends BaseService data); + void collect(ScreenCollFormDTO data); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java index 05b1172eb7..7a6291717a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java @@ -107,15 +107,15 @@ public class ScreenCustomerWorkRecordDictServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteBatch(customerId); + int affectedRows = baseDao.deleteBatch(data.getCustomerId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteBatch(customerId); + affectedRows = baseDao.deleteBatch(data.getCustomerId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,data.getDateId()); + baseDao.insertBatch(list,data.getCustomerId(),data.getDateId()); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java index c517555fbc..8f4d4f7c84 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java @@ -41,15 +41,15 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl data) { + public void collectOrgDaily(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteBatch(customerId,data.getDateId()); + int affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getDateId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteBatch(customerId,data.getDateId()); + affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getDateId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,data.getDateId()); + baseDao.insertBatch(list,data.getCustomerId(),data.getDateId()); }); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java index a27cb040aa..7ecd3c4eb6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java @@ -42,7 +42,6 @@ public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteBatch(customerId,data.getMonthId()); + int affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getMonthId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteBatch(customerId,data.getMonthId()); + affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getMonthId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,data.getMonthId()); + baseDao.insertBatch(list,data.getCustomerId(),data.getMonthId()); }); } From c677cabebadd44cb554b9555b42ca39ca05e14b2 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 16 Mar 2021 15:21:09 +0800 Subject: [PATCH 154/234] =?UTF-8?q?=E5=BE=BD=E7=AB=A0bug=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/RegisterRelationDao.java | 8 +++++++ .../service/RegisterRelationService.java | 2 ++ .../epmet/service/UserBaseInfoService.java | 8 +++++++ .../impl/RegisterRelationServiceImpl.java | 5 ++++ .../service/impl/UserBadgeServiceImpl.java | 2 +- .../service/impl/UserBaseInfoServiceImpl.java | 24 +++++++++++++++++++ .../resources/mapper/RegisterRelationDao.xml | 5 ++++ 7 files changed, 53 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java index a19881ce9a..160e1a4afc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java @@ -47,4 +47,12 @@ public interface RegisterRelationDao extends BaseDao { RegisterRelationEntity selectRegisteredGridIdByUserIdAndCustomerId(@Param("userId") String userId, @Param("customerId")String customerId); + + /** + * @Description 根据userId查询注册网格ID + * @Param userId + * @author zxc + * @date 2021/3/16 下午3:05 + */ + String selectRegisterGridIdByUserId(@Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java index e40e9ea607..96814c5fce 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java @@ -112,4 +112,6 @@ public interface RegisterRelationService extends BaseService { **/ List queryUserBaseInfo(List userIdList); + /** + * @Description 查询用户信息 + * @Param userIdList + * @author zxc + * @date 2021/3/16 下午2:52 + */ + List queryUserBaseInfoPlus(List userIdList); + /** * @return void * @param diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index f8a78f8c14..ca7b3db589 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -339,4 +339,9 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl oneUserIds = new ArrayList<>(); oneUserIds.add(userId); - List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(oneUserIds); + List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfoPlus(oneUserIds); log.info("user【"+userId+"】基本信息:"+userBaseInfoResultDTOS.toString()); if (!CollectionUtils.isEmpty(userIds)) { AtomicReference status = new AtomicReference<>(true); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index f76628b60d..852ca55843 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.redis.UserBaseInfoRedis; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import com.epmet.service.RegisterRelationService; import com.epmet.service.UserBaseInfoService; import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; @@ -77,6 +78,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -181,6 +184,27 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl queryUserBaseInfoPlus(List userIdList) { + if (CollectionUtils.isEmpty(userIdList)){ + return new ArrayList<>(); + } + List result = new ArrayList<>(); + userIdList.forEach(id -> { + UserBaseInfoResultDTO baseInfo = userBaseInfoRedis.getUserInfo(id); + if (null != baseInfo && StringUtils.isEmpty(baseInfo.getRegisteredGridId())){ + String gridId = registerRelationService.selectRegisterGridIdByUserId(id); + if (StringUtils.isNotEmpty(gridId)){ + baseInfo.setRegisteredGridId(gridId); + }else { + throw new RenException("查询用户【"+id+"】所属网格失败"); + } + } + result.add(baseInfo); + }); + return result; + } + /** * @return void * @author yinzuomei diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml index 403e3fcc8e..c3f7bf7682 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml @@ -72,5 +72,10 @@ LIMIT 1 + + + \ No newline at end of file From e6a74e72ac8305d53a6133148c1f85f9699290f3 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 16 Mar 2021 15:33:17 +0800 Subject: [PATCH 155/234] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=85=9A=E5=91=98=E8=BF=9E=E5=B8=A6=E8=AE=A4=E8=AF=81=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E6=97=B6=E5=85=88=E6=8F=92=E5=85=A5register=5Frelatio?= =?UTF-8?q?n=E5=86=8D=E6=9B=B4=E6=96=B0=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/UserResiInfoServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 9c973e7b78..e5e7678835 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -271,10 +271,10 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl Date: Tue, 16 Mar 2021 15:53:14 +0800 Subject: [PATCH 156/234] screenProjectData --- .../impl/FactOriginProjectMainDailyServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 7bc06ac834..1a51ba5690 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -385,13 +385,13 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl initNewScreenProjectData(String customerId,Integer rows , String dateId,Integer exceedLimit,Integer about2exceedLimit) { - boolean ifYesterday = true; - if(!StringUtils.equals(DateUtils.getBeforeNDay(NumConstant.ONE),dateId)){ - ifYesterday = false; + boolean ifBeforeYesterday = true; + if(Integer.parseInt(DateUtils.getBeforeNDay(NumConstant.ONE)) > Integer.parseInt(dateId)){ + ifBeforeYesterday = false; } - List projects = baseDao.initNewScreenProjectData(customerId, rows == NumConstant.ZERO && ifYesterday ? "" : dateId, dateId); + List projects = baseDao.initNewScreenProjectData(customerId, rows <= NumConstant.ZERO ? "" : dateId, dateId); //如果不是昨天立项 - if(!CollectionUtils.isEmpty(projects) && !ifYesterday) + if(!CollectionUtils.isEmpty(projects) && !ifBeforeYesterday) computerIfExceed(projects,exceedLimit,about2exceedLimit); return projects; From bf3cd3b7428ee9260aef5f419a7b147a03808290 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 16 Mar 2021 17:43:05 +0800 Subject: [PATCH 157/234] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=8F=9C=E5=8D=95-?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/GovCustomerMenuDTO.java | 81 +++++++++++ .../com/epmet/dto/form/MenuConfigFormDTO.java | 27 ++++ .../controller/GovCustomerMenuController.java | 129 +++++++++++++++++ .../com/epmet/dao/GovCustomerMenuDao.java | 55 ++++++++ .../main/java/com/epmet/dao/GovMenuDao.java | 9 ++ .../epmet/entity/GovCustomerMenuEntity.java | 51 +++++++ .../com/epmet/excel/GovCustomerMenuExcel.java | 62 ++++++++ .../com/epmet/redis/GovCustomerMenuRedis.java | 47 +++++++ .../epmet/service/GovCustomerMenuService.java | 126 +++++++++++++++++ .../impl/GovCustomerMenuServiceImpl.java | 132 ++++++++++++++++++ .../service/impl/GovMenuServiceImpl.java | 30 +++- .../resources/mapper/GovCustomerMenuDao.xml | 29 ++++ .../src/main/resources/mapper/GovMenuDao.xml | 14 ++ 13 files changed, 785 insertions(+), 7 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovCustomerMenuDao.xml diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java new file mode 100644 index 0000000000..93d5e9c66e --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Data +public class GovCustomerMenuDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * gov_menu表主键 + */ + private String tableId; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java new file mode 100644 index 0000000000..1bd4fc67bc --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 菜单配置 - 一菜单 多 客户 + */ +@Data +public class MenuConfigFormDTO implements Serializable { + private static final long serialVersionUID = -2898130727929596798L; + + /** + * gov_menu表主键 + */ + @NotBlank(message = "菜单ID不能为空") + private String tableId; + + /** + * 客户id 列表 + */ + @NotBlank(message = "客户id 列表不能为空") + private List customerIds; +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java new file mode 100644 index 0000000000..5e60482a5f --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java @@ -0,0 +1,129 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.GovCustomerMenuDTO; +import com.epmet.dto.form.MenuConfigFormDTO; +import com.epmet.excel.GovCustomerMenuExcel; +import com.epmet.service.GovCustomerMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@RestController +@RequestMapping("govcustomermenu") +public class GovCustomerMenuController { + + @Autowired + private GovCustomerMenuService govCustomerMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govCustomerMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovCustomerMenuDTO data = govCustomerMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovCustomerMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govCustomerMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovCustomerMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govCustomerMenuService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govCustomerMenuService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = govCustomerMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GovCustomerMenuExcel.class); + } + + /** + * 给每个客户 配置可见菜单 + * 先删除,后新增 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:15 2021-03-16 + **/ + @PostMapping("addcustomermenu") + public Result addCustomerMenu(@RequestBody MenuConfigFormDTO formDTO) { + //效验数据 + if (StringUtils.isBlank(formDTO.getTableId())) { + throw new RenException("菜单ID不能为空"); + } + govCustomerMenuService.saveCustomerMenu(formDTO); + return new Result(); + } + + /** + * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds) + * + * @param tableId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 16:26 2021-03-16 + **/ + @GetMapping("getcustomerids/{tableid}") + public Result> getcustomerids(@PathVariable("tableid") String tableId){ + List data = govCustomerMenuService.getcustomerIds(tableId); + return new Result>().ok(data); + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java new file mode 100644 index 0000000000..6daa27f116 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovCustomerMenuEntity; +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-03-16 + */ +@Mapper +public interface GovCustomerMenuDao extends BaseDao { + + /** + * 根据gov_menu表主键,先清除之前配置的客户信息 + * + * @param tableId + * @return void + * @Author zhangyong + * @Date 14:24 2021-03-16 + **/ + void deleteBatchTableIds(@Param("tableId") String tableId); + + /** + * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds) + * + * @param tableId + * @return java.util.List + * @Author zhangyong + * @Date 16:29 2021-03-16 + **/ + List selectListcustomerIds(@Param("tableId") String tableId); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java index 1e36bff758..ba05556dc1 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java @@ -49,4 +49,13 @@ public interface GovMenuDao extends BaseDao { * @param pid 父菜单ID */ List getListPid(String pid); + + /** + * 查询客户菜单列表 + * + * @param customerId 客户id + * @param type 菜单类型 + * @param language 语言 + */ + List getCustomerMenuList(@Param("customerId") String customerId, @Param("type") Integer type, @Param("language") String language); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java new file mode 100644 index 0000000000..d0358e7124 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_customer_menu") +public class GovCustomerMenuEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * gov_menu表主键 + */ + private String tableId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java new file mode 100644 index 0000000000..1ac8f2d886 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Data +public class GovCustomerMenuExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "gov_menu表主键") + private String tableId; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java new file mode 100644 index 0000000000..2333a6bd48 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Component +public class GovCustomerMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java new file mode 100644 index 0000000000..dea2a31ca0 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovCustomerMenuDTO; +import com.epmet.dto.form.MenuConfigFormDTO; +import com.epmet.entity.GovCustomerMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +public interface GovCustomerMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovCustomerMenuDTO + * @author generator + * @date 2021-03-16 + */ + GovCustomerMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-03-16 + */ + void save(GovCustomerMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-03-16 + */ + void update(GovCustomerMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-03-16 + */ + void delete(String[] ids); + + /** + * 给每个客户 配置可见菜单 + * + * @param formDTO + * @return void + * @Author zhangyong + * @Date 14:16 2021-03-16 + **/ + void saveCustomerMenu(MenuConfigFormDTO formDTO); + + /** + * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds) + * + * @param tableId + * @return java.util.List + * @Author zhangyong + * @Date 16:29 2021-03-16 + **/ + List getcustomerIds(String tableId); + + /** + * 根据gov_menu表主键,先清除之前配置的客户信息 + * + * @param tableId + * @return void + * @Author zhangyong + * @Date 14:24 2021-03-16 + **/ + void deleteBatchTableIds(String tableId); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java new file mode 100644 index 0000000000..32cf57e0c7 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.GovCustomerMenuDao; +import com.epmet.dto.GovCustomerMenuDTO; +import com.epmet.dto.form.MenuConfigFormDTO; +import com.epmet.entity.GovCustomerMenuEntity; +import com.epmet.redis.GovCustomerMenuRedis; +import com.epmet.service.GovCustomerMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Service +public class GovCustomerMenuServiceImpl extends BaseServiceImpl implements GovCustomerMenuService { + + @Autowired + private GovCustomerMenuRedis govCustomerMenuRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovCustomerMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovCustomerMenuDTO.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 GovCustomerMenuDTO get(String id) { + GovCustomerMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovCustomerMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovCustomerMenuDTO dto) { + GovCustomerMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovCustomerMenuEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovCustomerMenuDTO dto) { + GovCustomerMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovCustomerMenuEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void saveCustomerMenu(MenuConfigFormDTO formDTO) { + if (NumConstant.ZERO < formDTO.getCustomerIds().size()) { + baseDao.deleteBatchTableIds(formDTO.getTableId()); + + List entities = new ArrayList<>(); + for (String customerId : formDTO.getCustomerIds()) { + GovCustomerMenuEntity entity = new GovCustomerMenuEntity(); + entity.setCustomerId(customerId); + entity.setTableId(formDTO.getTableId()); + entities.add(entity); + } + insertBatch(entities); + } + } + + @Override + public List getcustomerIds(String tableId) { + return baseDao.selectListcustomerIds(tableId); + } + + @Override + public void deleteBatchTableIds(String tableId) { + baseDao.deleteBatchTableIds(tableId); + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index 5a6efd43f2..cfa42e4975 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -35,10 +35,7 @@ import com.epmet.entity.GovMenuEntity; import com.epmet.enums.MenuTypeEnum; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.GovMenuRedis; -import com.epmet.service.GovLanguageService; -import com.epmet.service.GovMenuService; -import com.epmet.service.GovResourceService; -import com.epmet.service.GovRoleMenuService; +import com.epmet.service.*; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,6 +64,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl page(Map params) { @@ -154,6 +153,9 @@ public class GovMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(TokenDto tokenDto) { List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); if(menuList == null){ - menuList = getUserMenuList(tokenDto, MenuTypeEnum.MENU.value()); + menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); govMenuRedis.setUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), menuList); } @@ -195,6 +197,21 @@ public class GovMenuServiceImpl extends BaseServiceImpl + * @Author zhangyong + * @Date 15:51 2021-03-16 + **/ + private List getCustomerMenuList(String customerId, Integer type) { + List menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage()); + List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); + return TreeUtils.buildTree(dtoList); + } + @Override public Set getUserPermissions(TokenDto tokenDto) { //用户权限列表 @@ -243,5 +260,4 @@ public class GovMenuServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + UPDATE gov_customer_menu SET DEL_FLAG = '1' + WHERE DEL_FLAG = '0' + AND TABLE_ID = #{tableId, jdbcType=VARCHAR} + + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml index 90d0b8ee92..9ac55ce17b 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml @@ -39,4 +39,18 @@ select * from gov_menu where del_flag = 0 and pid = #{value} + From 3a3a1cab733ae07715ed8a77303fa9adc621ff15 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 17 Mar 2021 09:42:36 +0800 Subject: [PATCH 158/234] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=BC=93=E5=AD=98key?= =?UTF-8?q?=EF=BC=8C=E7=94=B1userId=20=E6=94=B9=E4=B8=BA=20customerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/GovMenuServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index cfa42e4975..1f16ad89e9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -187,11 +187,11 @@ public class GovMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(TokenDto tokenDto) { - List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient()); if(menuList == null){ menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); - govMenuRedis.setUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), menuList); + govMenuRedis.setUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient(), menuList); } return menuList; From 4a564833ae92d8356be3bbb47e2a7e5761dba652 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 17 Mar 2021 09:43:08 +0800 Subject: [PATCH 159/234] NumConstant --- .../screen/impl/ScreenProjectDataServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 index d5e656e71b..501bfa2c43 100644 --- 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 @@ -22,6 +22,7 @@ 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; @@ -32,8 +33,6 @@ import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; -import com.epmet.entity.evaluationindex.screen.*; -import com.epmet.service.evaluationindex.screen.*; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; From 41e26e774a2573954984f75fa31c856754e810b5 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 17 Mar 2021 10:13:39 +0800 Subject: [PATCH 160/234] =?UTF-8?q?=E6=94=B9=E6=88=90post=E8=AF=B7?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/GovCustomerMenuController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java index 5e60482a5f..a3cb9f8946 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java @@ -121,7 +121,7 @@ public class GovCustomerMenuController { * @Author zhangyong * @Date 16:26 2021-03-16 **/ - @GetMapping("getcustomerids/{tableid}") + @PostMapping("getcustomerids/{tableid}") public Result> getcustomerids(@PathVariable("tableid") String tableId){ List data = govCustomerMenuService.getcustomerIds(tableId); return new Result>().ok(data); From 5182ba8f637b5f547bc2ad853107befec8f3a571 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 17 Mar 2021 11:13:00 +0800 Subject: [PATCH 161/234] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=A1=B9=E7=9B=AE=E8=AF=9D=E9=A2=98Map?= =?UTF-8?q?=E6=97=B6=E9=81=87=E5=88=B0=E5=90=8C=E6=A0=B7=E7=9A=84key?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E4=B8=8A=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 6d9a78381e..83e3b9da38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -147,7 +147,7 @@ public class TopicServiceImpl implements TopicService { List imgs = topicDao.selectTopicImgs(list); if(CollectionUtils.isEmpty(imgs)) return Collections.EMPTY_MAP; //key -> topicId | value -> projectId - Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId,(o,n)->n)); //key -> topicId Map> result = imgs.stream().collect(Collectors.groupingBy(ScreenDifficultyImgDataEntity :: getEventId)); @@ -178,7 +178,7 @@ public class TopicServiceImpl implements TopicService { if(CollectionUtils.isEmpty(contents)) return Collections.EMPTY_MAP; Map topicContentMap = contents.stream().collect(Collectors.toMap(TopicContentResultDTO :: getTopicId,TopicContentResultDTO::getContent)); //key -> topicId | value -> projectId - Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId,(o,n)->n)); Map result = new HashMap<>(); projectTopicMap.forEach((topic,project) -> { result.put(project,topicContentMap.get(topic)); From 820e8dc642c37243cdb21a617f5ba646679351a7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 17 Mar 2021 13:13:17 +0800 Subject: [PATCH 162/234] =?UTF-8?q?=E6=8C=89=E5=A4=A9=E6=8A=BD=E5=8F=96?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E6=B3=A8=E9=87=8A=EF=BC=9AscreenProjectSettl?= =?UTF-8?q?eService.extractScreenData?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/ScreenExtractServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 37eae6ac60..74e3021a00 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 @@ -197,12 +197,13 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { }catch (Exception e){ log.error("项目(事件)分析按组织_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); } - try{ + //项目分类打标签未上线,暂时屏蔽 + /*try{ //大屏项目数据抽取_按天抽取 screenProjectSettleService.extractScreenData(param); }catch (Exception e){ log.error("大屏项目数据抽取_按天抽取_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); - } + }*/ log.info("===== extractDaily method end ======"); } From 56cd038c34fb6f3c0b4097232a1d79f34f88585e Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Mar 2021 14:26:48 +0800 Subject: [PATCH 163/234] =?UTF-8?q?=E5=8D=87=E7=BA=A7auth=EF=BC=9A?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=20jcet?= =?UTF-8?q?=20g=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/SsoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3f77b56af1..f051924c9e 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 @@ -166,7 +166,7 @@ public class SsoServiceImpl implements SsoService { //test end if (!result.success() || null == result.getData() || null == result.getData().getUserId()) { - logger.error("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在"); + logger.error("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在,param:{}", JSON.toJSONString(form)); throw new RenException(EpmetErrorCode.ERR10003.getCode()); } From 57900ec03fc5e09f6e71f799a64e0b8a792c6b06 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 18 Mar 2021 16:19:31 +0800 Subject: [PATCH 164/234] =?UTF-8?q?issueVoteStats=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/IssueVoteDetailDao.java | 18 ++++ .../com/epmet/redis/IssueVoteDetailRedis.java | 37 +++++++- .../impl/IssueVoteStatisticalServiceImpl.java | 86 ++++++++++++------- .../resources/mapper/IssueVoteDetailDao.xml | 36 ++++++++ 4 files changed, 141 insertions(+), 36 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java index 622a68e6cd..c5c96901ea 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IssueVoteDetailDTO; import com.epmet.dto.form.VoteFormDTO; +import com.epmet.dto.form.VoteRedisFormDTO; import com.epmet.dto.result.IssueAttitudeCountResultDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.entity.IssueVoteDetailEntity; @@ -95,4 +96,21 @@ public interface IssueVoteDetailDao extends BaseDao { * @Date 2020/11/18 14:35 **/ IssueVoteDetailDTO selectUserIssueDet(@Param("userId") String userId, @Param("issueId") String issueId); + + /** + * @Description 统计出一个议题的所有支持数和反对数 + * @param issueId + * @return com.epmet.dto.form.VoteRedisFormDTO + * @author wangc + * @date 2021.03.03 18:09 + */ + VoteRedisFormDTO selectInfo4Cache(@Param("issueId") String issueId); + /** + * @Description 批量统计出议题的所有支持数和反对数 + * @param issueIds + * @return java.util.Set + * @author wangc + * @date 2021.03.18 14:58 + */ + List selectBatchVoteCount(@Param("issueIds")Set issueIds); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java index 268ddfbf88..a4a1439936 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.IssueConstant; +import com.epmet.dao.IssueVoteDetailDao; import com.epmet.dto.IssueDTO; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.VoteRedisFormDTO; @@ -29,14 +30,20 @@ import com.epmet.feign.ResiGroupFeignClient; import com.epmet.service.IssueService; import com.epmet.service.IssueVoteDetailService; import com.epmet.utils.ModuleConstants; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; import java.lang.reflect.Field; +import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; import static com.epmet.commons.tools.redis.RedisUtils.NOT_EXPIRE; @@ -59,13 +66,37 @@ public class IssueVoteDetailRedis { @Autowired private IssueService issueService; + @Autowired + private RedisTemplate redisTemplate; + @Autowired private IssueVoteDetailService issueVoteDetailService; + @Autowired + private IssueVoteDetailDao issueVoteDetailDao; + public void delete(Object[] ids) { } + public void deleteBatch(List issueIds){ + if(CollectionUtils.isEmpty(issueIds)) return ; + Set keys = issueIds.stream().map(id -> { + return IssueConstant.REDIS_KEY + id; + }).collect(Collectors.toSet()); + + redisTemplate.executePipelined((RedisCallback) connection ->{ + keys.forEach( ser -> {connection.del(redisTemplate.getKeySerializer().serialize(ser));}); + return null; + }); + } + + + public void delete(String issueId){ + redisUtils.delete(IssueConstant.REDIS_KEY +issueId); + } + + public void set(VoteRedisFormDTO vote){ @@ -185,10 +216,8 @@ public class IssueVoteDetailRedis { } //如果缓存中没有,去表决详情中计算出实时数据,并放入缓存中 //无需查询issue_vote_statistical中的数据,因为不是实时数据,可能不准确,有定时任务会自动同步 - VoteRedisFormDTO voteCache = new VoteRedisFormDTO(); - voteCache.setIssueId(issueId); - voteCache.setSupportAmount(issueVoteDetailService.getVotingCount(issueId,IssueConstant.SUPPORT)); - voteCache.setOppositionAmount(issueVoteDetailService.getVotingCount(issueId,IssueConstant.OPPOSE)); + VoteRedisFormDTO voteCache = issueVoteDetailDao.selectInfo4Cache(issueId); + if(StringUtils.isBlank(voteCache.getIssueId())) voteCache.setIssueId(issueId); IssueDTO issue = issueService.get(issueId); if(null != issue){ CommonGridIdFormDTO gridId = new CommonGridIdFormDTO(); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index fc8a5138de..003b0acd9e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -63,7 +63,6 @@ import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.*; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * 议题表决统计表 @@ -256,6 +255,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet()); - List gridIds = issues.stream().map(IssueDTO::getGridId).collect(Collectors.toList()); + List gridIds = issues.stream().map(IssueDTO::getGridId).distinct().collect(Collectors.toList()); CommonGridIdListFormDTO gridIdList = new CommonGridIdListFormDTO(); gridIdList.setGridIds(gridIds); Result votableCountResult = resiGroupFeignClient.votableCounts(gridIdList); - Map votableCountMap = null; + Map votableCountMap1 = null; if(votableCountResult.success() && null != votableCountResult.getData() && null != votableCountResult.getData().getVotableCountMap()){ - votableCountMap = votableCountResult.getData().getVotableCountMap(); + votableCountMap1 = votableCountResult.getData().getVotableCountMap(); } + final Map votableCountMap = votableCountMap1; List statisticalList = baseDao.selectListByIds(ids); @@ -287,9 +288,8 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl existedIds = new HashSet<>(); - existedIds.addAll(ids); - existedIds.retainAll(statisiticalIds); + Set existedIds = new HashSet<>(statisiticalIds); + //更新 //对ids进行更新 - 从缓存中拿取 List listToUpdate = new ArrayList<>(); @@ -302,12 +302,42 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + Map issueGridMap = issues.stream().collect(Collectors.toMap(IssueDTO::getId,IssueDTO::getGridId,(o, n) -> o)); //新增 - List toInsert = new ArrayList<>(); + List toInsert = new LinkedList<>(); + List voteList = issueVoteDetailDao.selectBatchVoteCount(notExistedIds); + List votedIssueIds = new ArrayList<>(); + if(!CollectionUtils.isEmpty(voteList) && StringUtils.isNotBlank(voteList.get(NumConstant.ZERO).getIssueId())) { + toInsert = voteList.stream().map(o -> { + IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO(); + dto.setIssueId(o.getIssueId()); + dto.setOppositionCount(o.getOppositionAmount()); + dto.setSupportCount(o.getSupportAmount()); + dto.setVotableCount(Optional.ofNullable(votableCountMap.get(issueGridMap.get(o.getIssueId()))).orElse(NumConstant.ZERO)); + dto.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);dto.setUpdatedBy(ModuleConstants.CREATED_BY_SYSTEM); + return dto; + }).collect(Collectors.toList()); + votedIssueIds = voteList.stream().map(VoteRedisFormDTO::getIssueId).collect(Collectors.toList()); + } - List summaryList = issueVoteDetailDao.getVotingSummaryList(ids); + notExistedIds.removeAll(votedIssueIds); + if(!notExistedIds.isEmpty()){ + List collect = notExistedIds.stream().map(issueId -> { + IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO(); + dto.setIssueId(issueId); + dto.setSupportCount(NumConstant.ZERO); + dto.setOppositionCount(NumConstant.ZERO); + dto.setVotableCount(Optional.ofNullable(votableCountMap.get(issueGridMap.get(issueId))).orElse(NumConstant.ZERO)); + dto.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);dto.setUpdatedBy(ModuleConstants.CREATED_BY_SYSTEM); + return dto; + }).collect(Collectors.toList()); + if(!CollectionUtils.isEmpty(collect)) toInsert.addAll(collect);} + + /* + List summaryList = issueVoteDetailDao.getVotingSummaryList(notExistedIds); Map> summaryMap = summaryList.stream().collect(Collectors.groupingBy(IssueAttitudeCountResultDTO::getIssueId)); + for (Map.Entry> entry : summaryMap.entrySet()) { IssueVoteStatisticalDTO obj = new IssueVoteStatisticalDTO(); obj.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM); @@ -322,19 +352,15 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl setToInsert = toInsert.stream().map(IssueVoteStatisticalDTO::getIssueId).collect(Collectors.toSet()); +*/ + /* Set setToInsert = toInsert.stream().map(IssueVoteStatisticalDTO::getIssueId).collect(Collectors.toSet()); Set issuesNeverVotedIds = new HashSet(); issuesNeverVotedIds.addAll(ids); @@ -372,30 +398,27 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl redundantIds = new HashSet(); - redundantIds.addAll(statisiticalIds); - redundantIds.removeAll(ids); + //Set redundantIds = new HashSet(); + //redundantIds.addAll(statisiticalIds); + //redundantIds.removeAll(ids); //将redundantIds的议题统计信息删除 //因为statisiticalIds是通过ids查询出,因此不会出现这种情况 } else { //数据吻合,全部更新 List listToUpdate = new ArrayList<>(); - Map> gridIssueMap = - issues.stream().collect(Collectors.groupingBy(IssueDTO::getGridId)); - setVotableCountsAndUpdateCache(listToUpdate,issues,votableCountMap); // listToUpdate批量更新 @@ -518,8 +541,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl + issue_id = #{issueId} + GROUP BY issue_id, attitude @@ -119,4 +122,37 @@ AND ivd.ISSUE_ID =#{issueId} AND ivd.CREATED_BY =#{userId} + + + + \ No newline at end of file From 683326487fe576af3df9b37a8c3f2ec29995e2f1 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 19 Mar 2021 10:13:01 +0800 Subject: [PATCH 165/234] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=8E=A5=E5=8F=A3=20-=20=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/MenuFormDTO.java | 22 +++++++++++++++++++ .../controller/GovCustomerMenuController.java | 9 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java new file mode 100644 index 0000000000..83149065c5 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 菜单基础入参 + */ +@Data +public class MenuFormDTO implements Serializable { + private static final long serialVersionUID = -2898130727929596798L; + + /** + * gov_menu表主键 + */ + @NotBlank(message = "菜单ID不能为空") + private String tableId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java index a3cb9f8946..77d498fb37 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.GovCustomerMenuDTO; import com.epmet.dto.form.MenuConfigFormDTO; +import com.epmet.dto.form.MenuFormDTO; import com.epmet.excel.GovCustomerMenuExcel; import com.epmet.service.GovCustomerMenuService; import org.apache.commons.lang3.StringUtils; @@ -116,14 +117,14 @@ public class GovCustomerMenuController { /** * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds) * - * @param tableId + * @param formDTO * @return com.epmet.commons.tools.utils.Result> * @Author zhangyong * @Date 16:26 2021-03-16 **/ - @PostMapping("getcustomerids/{tableid}") - public Result> getcustomerids(@PathVariable("tableid") String tableId){ - List data = govCustomerMenuService.getcustomerIds(tableId); + @PostMapping("getcustomerids") + public Result> getcustomerids(@RequestBody MenuFormDTO formDTO){ + List data = govCustomerMenuService.getcustomerIds(formDTO.getTableId()); return new Result>().ok(data); } } From 8b5d7cf0f9ede1af33dea501879e525d26af7e67 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 19 Mar 2021 16:01:09 +0800 Subject: [PATCH 166/234] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IssueVoteStatisticalServiceImpl.java | 5 ++++- .../member/service/impl/ResiGroupMemberServiceImpl.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index 003b0acd9e..258f91bd74 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -258,6 +258,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl issues = @@ -265,18 +266,20 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet()); List gridIds = issues.stream().map(IssueDTO::getGridId).distinct().collect(Collectors.toList()); CommonGridIdListFormDTO gridIdList = new CommonGridIdListFormDTO(); gridIdList.setGridIds(gridIds); + // 根据网格Id查询网格下所有加入组的组员 Result votableCountResult = resiGroupFeignClient.votableCounts(gridIdList); Map votableCountMap1 = null; if(votableCountResult.success() && null != votableCountResult.getData() && null != votableCountResult.getData().getVotableCountMap()){ votableCountMap1 = votableCountResult.getData().getVotableCountMap(); } final Map votableCountMap = votableCountMap1; - + //查询指定议题的统计数据 List statisticalList = baseDao.selectListByIds(ids); if (null != statisticalList && statisticalList.size() > NumConstant.ZERO) { diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java index d420a7205b..33c2af52a6 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java @@ -814,9 +814,11 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl votableCountMap = new HashMap<>(); + // 给每个网格初始化 加入小组人数:0 gridList.getGridIds().forEach(gridId -> { votableCountMap.put(gridId, NumConstant.ZERO ); }); + // 查询 每个网格的人数 STATE = approved的 List list = baseDao.getMembersCountInGrids(gridList.getGridIds()); if(null == list || list.size() < NumConstant.ZERO){ result.setVotableCountMap(votableCountMap); From b4d30dc027df653f9daae8e83268ac4483815068 Mon Sep 17 00:00:00 2001 From: wangchao Date: Sat, 20 Mar 2021 00:19:05 +0800 Subject: [PATCH 167/234] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/IssueAuditController.java | 8 ++++++++ .../src/main/java/com/epmet/service/IssueService.java | 9 ++++++++- .../java/com/epmet/service/impl/IssueServiceImpl.java | 8 ++++++++ .../group/dto/member/ResiGroupMemberInfoRedisDTO.java | 5 +++-- .../modules/member/redis/ResiGroupMemberRedis.java | 5 ++--- .../com/epmet/controller/UserResiInfoController.java | 10 ++++++++++ 6 files changed, 39 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java index d6519fb6e9..f3320a96b8 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java @@ -115,6 +115,14 @@ public class IssueAuditController { return new Result>().ok(issueApplicationHistoryService.applicationHistoryWork(applicationHistoryWorkFormDTO)); } + /** + * @Description 工作端议题审核 + * @param token + * @param param + * @return java.lang.String + * @author wangc + * @date 2021.03.19 23:40 + */ @PostMapping("audit") public Result audit(@LoginUser TokenDto token, @RequestBody IssueAuditionFormDTO param){ return new Result().ok(issueService.audit(token,param)); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 0c58cfc807..4b14996149 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java @@ -152,7 +152,14 @@ public interface IssueService extends BaseService { * @date 2020.11.19 10:02 */ FirstTopicShiftedToIssueApplicationResultDTO topicShiftedToIssueV2(IssueShiftedFromTopicFormDTO issueShiftedFromTopicFormDTO); - + /** + * @Description 工作端议题审核 + * @param token + * @param param + * @return java.lang.String + * @author wangc + * @date 2021.03.19 23:40 + */ String audit(TokenDto token, IssueAuditionFormDTO param); /** diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 40fb145f77..b7d6c57015 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -443,6 +443,14 @@ public class IssueServiceImpl extends BaseServiceImpl imp return result; } + /** + * @Description 工作端议题审核 + * @param token + * @param param + * @return java.lang.String + * @author wangc + * @date 2021.03.19 23:40 + */ @Override @Transactional(rollbackFor = Exception.class) public String audit(TokenDto token, IssueAuditionFormDTO param){ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java index 1bbabfc036..cb468c33fe 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java @@ -51,7 +51,7 @@ public class ResiGroupMemberInfoRedisDTO implements Serializable { * */ private String memberMobile; /** - * 组Id,不存在redis的value中,存在redis的key中 + * 组Id * */ private String groupId; @@ -64,7 +64,8 @@ public class ResiGroupMemberInfoRedisDTO implements Serializable { "userShowName": "山东路-尹女士", "groupLeaderFlag": "leader", "enterGroupType": "created", - "memberStatus": "approved" + "memberStatus": "approved", + "groupId":"***" } * * diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java index d635bd1dea..c2c735c70b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java @@ -85,7 +85,7 @@ public class ResiGroupMemberRedis { } /** - * @Description 得到一个指定组内成员信息,如果redis中没有,则返回null + * @Description 得到一个指定组内成员信息,如果redis中没有,则去数据库查询并放入缓存 * @Param groupId * @Param userId * @return ResiGroupMemberInfoRedisDTO.class @@ -97,7 +97,7 @@ public class ResiGroupMemberRedis { ResiGroupMemberInfoRedisDTO memberCache = (ResiGroupMemberInfoRedisDTO) redisUtils.get(ResiGroupRedisKeys.getResiGroupMemberInfoKey(groupId,userId)); //如果缓存中没有该成员数据 - if(null == memberCache || StringUtils.isNotBlank(memberCache.getUserId())){ + if(null == memberCache || StringUtils.isBlank(memberCache.getUserId())){ Map param = new HashMap<>(); param.put(TopicConstant.CUSTOMER_USER_ID,userId); param.put(TopicConstant.RESI_GROUP_ID,groupId); @@ -140,7 +140,6 @@ public class ResiGroupMemberRedis { .concat(userId)); } } - memberCache.setGroupId(groupId); return memberCache; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index e4f54f6aa7..9275fb8707 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -202,6 +202,16 @@ public class UserResiInfoController { return new Result(); } + /** + * @Description 在分享链接之后完成注册居民之后调用的接口 + * 作用 + * + * 更改邀请浏览记录里"是否通过邀请链接注册居民" + * @param param + * @return void + * @author wangc + * @date 2020.12.18 16:34 + */ @PostMapping("submitinlink") public Result submitInLink(@RequestBody AfterRegisterResidentInSharableLinkFormDTO param, @LoginUser TokenDto token){ param.setInviteeId(token.getUserId()); From 070c228db323942fd473d7f68e76f74cb0052bd3 Mon Sep 17 00:00:00 2001 From: wangchao Date: Sun, 21 Mar 2021 23:37:37 +0800 Subject: [PATCH 168/234] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/ProjectServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 309377bb4b..e3c0f23a2d 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 @@ -1107,6 +1107,17 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Mon, 22 Mar 2021 00:40:31 +0800 Subject: [PATCH 169/234] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 83e3b9da38..3046f2d6c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -74,7 +74,7 @@ public class TopicServiceImpl implements TopicService { agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); }); - + //计算网格-组映射关系 List topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); topics.forEach(groupTopic -> { if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ From efe7e7405f7afc84d3aef2860ac24683c683fea6 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 22 Mar 2021 00:43:00 +0800 Subject: [PATCH 170/234] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 3046f2d6c6..c832202e70 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -74,7 +74,7 @@ public class TopicServiceImpl implements TopicService { agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); }); - //计算网格-组映射关系 + //计算网格-组-话题映射关系 List topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); topics.forEach(groupTopic -> { if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ From a6e8a50744655b67d6d5a67e6f02019ab8fa140b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 22 Mar 2021 10:34:29 +0800 Subject: [PATCH 171/234] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml index 84d66f138b..71da21f685 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml @@ -23,6 +23,9 @@ + + + SELECT - * + rgm.ID, + rgm.CUSTOMER_USER_ID, + rgm.RESI_GROUP_ID, + rgm.GROUP_LEADER_FLAG, + rgm.ENTER_GROUP_TYPE, + rgm.GROUP_INVITATION_ID, + rgm.GROUP_LEADER_FLAG, + rgm.STATUS FROM resi_group_member rgm WHERE diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java deleted file mode 100644 index c21ba28c1f..0000000000 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.epmet.constant; - -import org.apache.commons.lang3.StringUtils; - -/** - * @Description - * @ClassName UserRedisKeys - * @Auth wangc - * @Date 2020-07-22 17:16 - */ -public class UserRedisKeys { - - /** - * 党群e事通redis前缀 - */ - private static String rootPrefix = "epmet:"; - - /** - * @Description 用户缓存Key - * @Param 用户Id - * @return epmet:resi:user:userId - * @Author wangc - * @Date 2020.04.13 11:27 - **/ - public static String getResiUserKey(String userId){ - return rootPrefix.concat("resi:user:").concat(userId); - } - - /** - * @Description 用户勋章缓存 epmet:badge:user:[customerId]:[userId] - * @param userId - * @return epmet:badge:user:[customerId]:[userId] - * @author wangc - * @date 2020.11.05 13:34 - */ - public static String getResiUserBadgeKey(String customerId,String userId){ - return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat( StringUtils.isBlank(userId) ? "*" : userId );} -} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index d29a25ec0f..49390b11df 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -7,7 +7,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.BadgeConstant; -import com.epmet.constant.UserRedisKeys; import com.epmet.dao.BadgeDao; import com.epmet.dto.form.UserBadgeUnitFormDTO; import com.epmet.dto.result.UserBadgeInfoResultDTO; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java index 315341ae84..076791fcba 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java @@ -22,7 +22,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.UserRedisKeys; import com.epmet.dao.GridLatestDao; import com.epmet.dao.RegisterRelationDao; import com.epmet.dao.UserBaseInfoDao; @@ -389,4 +388,4 @@ public class UserBaseInfoRedis { } } } -} \ No newline at end of file +} From cbc4ab149b8e41a05db5ec81b861c981a43b7de9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 22 Mar 2021 17:27:32 +0800 Subject: [PATCH 176/234] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=B0=8F=E7=BB=84-?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BB=84=E9=95=BF=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BC=98=E5=8C=96=20=E7=9B=B4=E6=8E=A5=E4=BB=8E?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=8F=96=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/redis/UserBadgeRedis.java | 24 +++++++++---------- .../com/epmet/redis/UserBaseInfoRedis.java | 11 +++++---- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 49390b11df..0ffa41aaa0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -1,9 +1,9 @@ package com.epmet.redis; - import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.BadgeConstant; @@ -109,7 +109,7 @@ public class UserBadgeRedis { */ public List obtainUserBadge2List(String userId,String customerId) { List cache = - redisUtils.lrange(UserRedisKeys.getResiUserBadgeKey(customerId,userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); + redisUtils.lrange(RedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); if(!CollectionUtils.isEmpty(cache)) return cache; //补偿 cache = badgeService.getUserSortedBadge(userId,customerId); @@ -117,7 +117,7 @@ public class UserBadgeRedis { final List sortedBadges = cache; redisTemplate.executePipelined((RedisCallback>) connection ->{ sortedBadges.forEach(badge -> { - connection.listCommands().rPush(UserRedisKeys.getResiUserBadgeKey(customerId, userId).getBytes(), + connection.listCommands().rPush(RedisKeys.getResiUserBadgeKey(customerId, userId).getBytes(), redisTemplate.getValueSerializer().serialize(badge)); }); return null; @@ -141,7 +141,7 @@ public class UserBadgeRedis { List cacheBlank = new LinkedList<>(); userIds.forEach(userId -> { List badges = - redisUtils.lrange(UserRedisKeys.getResiUserBadgeKey(customerId,userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); + redisUtils.lrange(RedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); if(CollectionUtils.isEmpty(badges)){cacheBlank.add(userId);}else{result.put(userId,badges);} }); if(!CollectionUtils.isEmpty(cacheBlank)){ @@ -157,7 +157,7 @@ public class UserBadgeRedis { redisTemplate.executePipelined((RedisCallback>) connection ->{ covert.forEach(badge -> { - connection.listCommands().rPush(UserRedisKeys.getResiUserBadgeKey(customerId, k).getBytes(), + connection.listCommands().rPush(RedisKeys.getResiUserBadgeKey(customerId, k).getBytes(), redisTemplate.getValueSerializer().serialize(badge)); }); return null; @@ -178,14 +178,14 @@ public class UserBadgeRedis { */ public long pushOrRemoveUserBadge4List(String userId, String badgeId, String customerId) { if(StringUtils.isNotBlank(userId)) return illumeOrExtinguishStronglyConsistent(userId,customerId); - List orient = redisUtils.lrange(UserRedisKeys.getResiUserBadgeKey(customerId,userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); + List orient = redisUtils.lrange(RedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); UserBadgeUnitFormDTO unit = null; if (!CollectionUtils.isEmpty(orient)) { Optional opt = orient.stream().filter(badge -> StringUtils.equals(badgeId, badge.getBadgeId())).findFirst(); if (opt.isPresent()) { unit = opt.get(); - return redisUtils.lrem(UserRedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ONE, unit); + return redisUtils.lrem(RedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ONE, unit); } } @@ -206,7 +206,7 @@ public class UserBadgeRedis { if (poolOpt.isPresent()) unit = ConvertUtils.sourceToTarget(poolOpt.get(), UserBadgeUnitFormDTO.class); else return NumConstant.ZERO; } - redisUtils.leftPush(UserRedisKeys.getResiUserBadgeKey(customerId, userId), unit,-1); + redisUtils.leftPush(RedisKeys.getResiUserBadgeKey(customerId, userId), unit, -1); return NumConstant.ONE; } @@ -219,11 +219,11 @@ public class UserBadgeRedis { */ public long illumeOrExtinguishStronglyConsistent(String userId, String customerId){ List db = badgeService.getUserSortedBadge(userId,customerId); - redisUtils.delete(UserRedisKeys.getResiUserBadgeKey(customerId,userId)); + redisUtils.delete(RedisKeys.getResiUserBadgeKey(customerId, userId)); if(CollectionUtils.isNotEmpty(db)) { redisTemplate.executePipelined((RedisCallback>) connection -> { db.forEach(badge -> { - connection.listCommands().rPush(UserRedisKeys.getResiUserBadgeKey(customerId, userId).getBytes(), + connection.listCommands().rPush(RedisKeys.getResiUserBadgeKey(customerId, userId).getBytes(), redisTemplate.getValueSerializer().serialize(badge)); }); return null; @@ -240,7 +240,7 @@ public class UserBadgeRedis { * @date 2020.11.09 10:02 */ public void batchClearUserBadgeCache(String customerId){ - Set key = redisUtils.keys(UserRedisKeys.getResiUserBadgeKey(customerId, null)); + Set key = redisUtils.keys(RedisKeys.getResiUserBadgeKey(customerId, null)); if(CollectionUtils.isEmpty(key)) return; final Set keys = key; redisTemplate.executePipelined((RedisCallback) connection ->{ @@ -256,7 +256,7 @@ public class UserBadgeRedis { @Override public List doInRedis(RedisConnection connection) throws DataAccessException { connection.openPipeline(); - Set keys = connection.keys(redisTemplate.getKeySerializer().serialize(UserRedisKeys.getResiUserBadgeKey(customerId, null))); + Set keys = connection.keys(redisTemplate.getKeySerializer().serialize(RedisKeys.getResiUserBadgeKey(customerId, null))); return null; } },redisTemplate.getKeySerializer()); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java index 076791fcba..d5b8a993eb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java @@ -19,6 +19,7 @@ package com.epmet.redis; import cn.hutool.core.bean.BeanUtil; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -79,7 +80,7 @@ public class UserBaseInfoRedis { **/ public void set(UserBaseInfoResultDTO baseInfo){ if(StringUtils.isBlank(baseInfo.getUserId())) return; - String key = UserRedisKeys.getResiUserKey(baseInfo.getUserId()); + String key = RedisKeys.getResiUserKey(baseInfo.getUserId()); //bean to map Map map = BeanUtil.beanToMap(baseInfo, false, true); //用户缓存的有效期为七天 @@ -89,7 +90,7 @@ public class UserBaseInfoRedis { public UserBaseInfoResultDTO get(String userId){ if(StringUtils.isNotBlank(userId)) { - Map map = redisUtils.hGetAll(UserRedisKeys.getResiUserKey(userId)); + Map map = redisUtils.hGetAll(RedisKeys.getResiUserKey(userId)); if (null != map && !map.isEmpty()) { //缓存中有数据,直接返回 return BeanUtil.mapToBean(map, UserBaseInfoResultDTO.class, true); @@ -109,7 +110,7 @@ public class UserBaseInfoRedis { public UserBaseInfoResultDTO getUserInfo(String userId){ if(StringUtils.isNotBlank(userId)){ //获取居民缓存key - Map map = redisUtils.hGetAll(UserRedisKeys.getResiUserKey(userId)); + Map map = redisUtils.hGetAll(RedisKeys.getResiUserKey(userId)); if(null != map && !map.isEmpty()) { //缓存中有数据,直接返回 return BeanUtil.mapToBean(map, UserBaseInfoResultDTO.class, true); @@ -200,7 +201,7 @@ public class UserBaseInfoRedis { public UserBaseInfoResultDTO getUserInfo(String userId,String customerId){ if(StringUtils.isNotBlank(userId)){ //获取居民缓存key - Map map = redisUtils.hGetAll(UserRedisKeys.getResiUserKey(userId)); + Map map = redisUtils.hGetAll(RedisKeys.getResiUserKey(userId)); if(null != map && !map.isEmpty()) { //缓存中有数据,直接返回 return BeanUtil.mapToBean(map, UserBaseInfoResultDTO.class, true); @@ -363,7 +364,7 @@ public class UserBaseInfoRedis { public void clearUserCache(List userIds){ userIds.forEach(id ->{ if(StringUtils.isNotBlank(id)) { - redisUtils.delete(UserRedisKeys.getResiUserKey(id)); + redisUtils.delete(RedisKeys.getResiUserKey(id)); } }); } From 7d6d8c0e86c04921598f2b7f38b554985f735c7b Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 22 Mar 2021 17:42:53 +0800 Subject: [PATCH 177/234] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=B0=8F=E7=BB=84-?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BB=84=E9=95=BF=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BC=98=E5=8C=96=20=E5=A6=82=E6=9E=9C=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E4=B8=8D=E5=9C=A8=E4=BD=BF=E7=94=A8=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/group/service/impl/ResiGroupServiceImpl.java | 4 +--- .../java/com/epmet/controller/UserResiInfoController.java | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index bfa6a16c94..a6bb7833fc 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -1020,9 +1020,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl groupLeaderUserInfo = epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); + Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(dto.getGroupId()); if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { dto.setLeaderName(groupLeaderUserInfo.getData().getShowName()); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index e4f54f6aa7..a8fc12840e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -33,7 +33,6 @@ import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.excel.UserResiInfoExcel; import com.epmet.service.UserResiInfoService; -import jdk.nashorn.internal.parser.Token; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; From 2d3231993e41169c168717fe89e1e9ba3b2c335e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Mar 2021 09:37:51 +0800 Subject: [PATCH 178/234] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A1=A8=20=20=E8=BF=94=E5=9B=9E=E5=85=B7=E4=BD=93=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/UserWechatDao.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index f59dc05973..4c2adabf2f 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -59,7 +59,12 @@ SELECT * - + FROM USER_WECHAT WHERE From c6e4dbcbd5420082f006e411d62879da569de138 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 23 Mar 2021 09:58:19 +0800 Subject: [PATCH 179/234] =?UTF-8?q?=E5=BB=BA=E8=A1=A8=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.5__gov_customer_menu.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.5__gov_customer_menu.sql diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.5__gov_customer_menu.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.5__gov_customer_menu.sql new file mode 100644 index 0000000000..ce584ac5e9 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.5__gov_customer_menu.sql @@ -0,0 +1,12 @@ +CREATE TABLE `gov_customer_menu` ( + `ID` varchar(32) NOT NULL COMMENT '主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `TABLE_ID` varchar(32) NOT NULL COMMENT 'gov_menu表主键', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户菜单配置表'; From a1636d49336f9fe855d9c7d9b09b36304999efb2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Mar 2021 10:39:10 +0800 Subject: [PATCH 180/234] =?UTF-8?q?=E5=8A=A0=E5=BC=BA=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/filter/LogMsgSendFilter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java index 942e4a6570..0651951d56 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java @@ -123,6 +123,9 @@ public class LogMsgSendFilter extends LevelFilter { try { if (serverIp == null) { InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + if (inetUtils.findFirstNonLoopbackHostInfo() == null){ + return; + } serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); } } catch (Exception e) { From 4945189426e524eb9361764b700ee74b593c2481 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Mar 2021 15:44:28 +0800 Subject: [PATCH 181/234] =?UTF-8?q?=E9=BE=99=E6=B9=BE=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=86=E5=B8=83=E6=8E=A5=E5=8F=A3=E9=BB=98=E8=AE=A4=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E8=BD=AC=E9=A1=B9=E7=9B=AE=E6=97=B6=E9=97=B4=E9=99=8D?= =?UTF-8?q?=E5=BA=8F=E8=BF=94=E5=9B=9E=E5=89=8D20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../govproject/form/ProjectDistributionFormDTO.java | 13 +++++++++++++ .../dataaggre/service/govissue/GovIssueService.java | 2 +- .../service/govissue/impl/GovIssueServiceImpl.java | 9 +++++++-- .../govproject/impl/GovProjectServiceImpl.java | 2 +- .../src/main/resources/mapper/govissue/IssueDao.xml | 2 +- .../main/resources/mapper/govproject/ProjectDao.xml | 1 - 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectDistributionFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectDistributionFormDTO.java index f1f25aeb05..4e6f37f537 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectDistributionFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectDistributionFormDTO.java @@ -13,7 +13,20 @@ import java.io.Serializable; */ @Data public class ProjectDistributionFormDTO implements Serializable { + /** + * 网格id不必填 + */ private String gridId; @NotBlank(message = "customerId不能为空") private String customerId; + + /** + * 默认1 + */ + private Integer pageNo; + + /** + * 默认20 + */ + private Integer pageSize; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java index b3a96f917c..5159bda48f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java @@ -44,5 +44,5 @@ public interface GovIssueService { **/ List closedIssueList(ClosedIssueListFormDTO fromDTO); - List selectShiftProjectIssueList(String customerId,String gridId); + List selectShiftProjectIssueList(String customerId,String gridId,Integer pageNo,Integer pageSize); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java index e379b75a38..7b68d96332 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java @@ -314,8 +314,13 @@ public class GovIssueServiceImpl implements GovIssueService { } @Override - public List selectShiftProjectIssueList(String customerId,String gridId) { - return issueDao.selectShiftProjectIssueList(customerId,gridId); + public List selectShiftProjectIssueList(String customerId, String gridId, Integer pageNo, Integer pageSize) { + if (pageNo != null && pageSize != null) { + PageHelper.startPage(pageNo, pageSize); + }else{ + PageHelper.startPage(NumConstant.ONE, NumConstant.TWENTY); + } + return issueDao.selectShiftProjectIssueList(customerId, gridId); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index cc664bf225..abc34e5c5c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -114,7 +114,7 @@ public class GovProjectServiceImpl implements GovProjectService { @Override public List queryProjectDistribution(ProjectDistributionFormDTO formDTO) { List resultDTOList = new ArrayList<>(); - List issueInfoDTOList = govIssueService.selectShiftProjectIssueList(formDTO.getCustomerId(), formDTO.getGridId()); + List issueInfoDTOList = govIssueService.selectShiftProjectIssueList(formDTO.getCustomerId(), formDTO.getGridId(),formDTO.getPageNo(),formDTO.getPageSize()); if (CollectionUtils.isNotEmpty(issueInfoDTOList)) { List topicIds = issueInfoDTOList.stream().map(data -> data.getTopicId()).collect(Collectors.toList()); // log.info("话题id集合:" + JSON.toJSONString(topicIds, true)); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml index 44c2924ba8..185816c9bb 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml @@ -122,6 +122,6 @@ AND i.GRID_ID = #{gridId} - order by i.SHIFTED_TIME desc limit 100 + order by i.SHIFTED_TIME desc \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml index f171a790e3..eb4c0e2d93 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml @@ -140,6 +140,5 @@ #{issueId} - order by CREATED_TIME desc limit 100 \ No newline at end of file From 03c1760144b88c2270664f766aeaf7701645a5e8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Mar 2021 17:55:33 +0800 Subject: [PATCH 182/234] =?UTF-8?q?=E6=9B=BF=E6=8D=A2feign=E7=9A=84client?= =?UTF-8?q?=E7=AB=AF-=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/src/main/resources/bootstrap.yml | 2 +- .../main/java/com/epmet/commons/tools/feign/FeignConfig.java | 2 +- .../data-aggregator-server/src/main/resources/bootstrap.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index edab1bde4e..b7cc83fd9c 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -71,7 +71,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java index f7ae3265d0..c68dbc2913 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/FeignConfig.java @@ -53,6 +53,6 @@ public class FeignConfig implements RequestInterceptor { @Bean Logger.Level feignLoggerLevel() { - return Logger.Level.FULL;//控制台会输出debug日志 + return Logger.Level.BASIC;//控制台会输出debug日志 } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index 55e3265590..50e01db7ee 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -127,7 +127,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: From 3cd831408cc1d5ec8d82f99b08acda997ba52173 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Mar 2021 18:02:48 +0800 Subject: [PATCH 183/234] =?UTF-8?q?=E6=9B=BF=E6=8D=A2feign=E7=9A=84client?= =?UTF-8?q?=E7=AB=AF=E4=BD=BF=E7=94=A8okhttp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml | 2 +- epmet-gateway/src/main/resources/bootstrap.yml | 2 +- .../data-report-server/src/main/resources/bootstrap.yml | 2 +- .../data-statistical-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-activiti-server/src/main/resources/bootstrap.yml | 2 +- .../common-service-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-demo-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-heart-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-job/epmet-job-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-message-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-point-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-third-server/src/main/resources/bootstrap.yml | 2 +- .../gov-access-server/src/main/resources/bootstrap.yml | 2 +- .../gov-grid/gov-grid-server/src/main/resources/bootstrap.yml | 2 +- .../gov-issue/gov-issue-server/src/main/resources/bootstrap.yml | 2 +- .../gov-mine/gov-mine-server/src/main/resources/bootstrap.yml | 2 +- .../gov-org/gov-org-server/src/main/resources/bootstrap.yml | 2 +- .../gov-project-server/src/main/resources/bootstrap.yml | 2 +- .../gov-voice/gov-voice-server/src/main/resources/bootstrap.yml | 2 +- .../oper-access-server/src/main/resources/bootstrap.yml | 2 +- .../oper-crm/oper-crm-server/src/main/resources/bootstrap.yml | 2 +- .../oper-customize-server/src/main/resources/bootstrap.yml | 2 +- .../resi-group-server/src/main/resources/bootstrap.yml | 2 +- .../resi-guide-server/src/main/resources/bootstrap.yml | 2 +- .../resi-hall/resi-hall-server/src/main/resources/bootstrap.yml | 2 +- .../resi-home/resi-home-server/src/main/resources/bootstrap.yml | 2 +- .../resi-mine/resi-mine-server/src/main/resources/bootstrap.yml | 2 +- .../resi-partymember-server/src/main/resources/bootstrap.yml | 2 +- .../resi-voice-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-openapi-adv-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-openapi-scan/src/main/resources/bootstrap.yml | 2 +- epmet-user/epmet-user-server/src/main/resources/bootstrap.yml | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml index 152e65a3e0..89f42ed404 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml +++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml @@ -113,7 +113,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 7a6c236128..201573688e 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -419,7 +419,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index 4b220e0c72..3ecb0ec3d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -118,7 +118,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index bc14f070f8..f94ee99777 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -99,7 +99,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml index 110490c3af..811f0c352b 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml @@ -93,7 +93,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index 8348460f3f..ff4ec82dcf 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -100,7 +100,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml index e131231414..b9cf8dd559 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml @@ -83,7 +83,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml index 7a067d1606..1ed5a4306d 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -81,7 +81,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index 2cd6e68458..8fe49b4ea0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -99,7 +99,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index 85974efb60..20fc7cb138 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -100,7 +100,7 @@ feign: config: default: loggerLevel: FULL - httpclient: + okhttp: enabled: true logging: diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml index b361be7236..03945c0ebf 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml @@ -101,7 +101,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index 5b6b4b9e75..3bfe0d68bc 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -111,7 +111,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml index a6233bb7a3..08cae6a575 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml @@ -99,7 +99,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml index 0606e7f123..70ea9ad34a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml @@ -81,7 +81,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml index c8fe1196c9..d2038e569e 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml @@ -100,7 +100,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml index 241ae97b26..4afc1b94e4 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml @@ -57,7 +57,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml index 06974a6810..f1b74c03df 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml @@ -89,7 +89,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml index 6c3a83e1f1..1cfa2f121e 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml @@ -81,7 +81,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index 0a9653fd28..8baed16dd6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -113,7 +113,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index 2db2f15416..74f392af96 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -89,7 +89,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml index c570e30147..8b8c4bdb45 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml @@ -89,7 +89,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml index 15ccaab5b1..f7bad85d13 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml @@ -100,7 +100,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml index f8760dbee8..3d0b42162e 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml @@ -106,7 +106,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml index 360e2ad6e2..f9ee219699 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml @@ -100,7 +100,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index 6823a772e7..35cade577d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -100,7 +100,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml index 9be4ac049f..a8a75e8d97 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml @@ -101,7 +101,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml index 09b4ba2437..19a4ef53b8 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml @@ -57,7 +57,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml index 76f5542795..72ede48632 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml @@ -56,7 +56,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml index 48dc370737..7257f2ea6f 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml @@ -84,7 +84,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml index 4577b0cae3..0978c177e1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml @@ -100,7 +100,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml index b1bca8e761..9d398946ba 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml @@ -52,7 +52,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true hystrix: diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml index 3a3726f148..0bd40dcca7 100644 --- a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml @@ -113,7 +113,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml index 0c5c04d86e..0aa0583c97 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -55,7 +55,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 0ff8f5dcc1..bb127328eb 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -113,7 +113,7 @@ feign: config: default: loggerLevel: BASIC - httpclient: + okhttp: enabled: true From ca2ef72f1598003d3413bd2ed900c16abdffd059 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Mar 2021 18:27:04 +0800 Subject: [PATCH 184/234] =?UTF-8?q?=E5=9E=83=E5=9C=BE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B8=85=E7=90=86-=E6=B3=A8=E9=87=8A=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=B7=B2=E7=BB=8F=E6=8C=AA=E5=88=B0=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E9=87=8C=EF=BC=8C=E6=97=A0=E9=9C=80=E5=9C=A8?= =?UTF-8?q?=E8=BF=99=E6=94=BE=E7=9D=80=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/UserAccessServiceImpl.java | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/UserAccessServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/UserAccessServiceImpl.java index 3aea2fc5ee..1b1aa4c53d 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/UserAccessServiceImpl.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/UserAccessServiceImpl.java @@ -3,7 +3,6 @@ package com.epmet.service.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.StrangerResiGuideConstant; import com.epmet.dto.form.EnterGridFormDTO; import com.epmet.dto.form.UserEnterGridFormDTO; import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; @@ -38,26 +37,6 @@ public class UserAccessServiceImpl implements UserAccessService { userInfoParams.setGridId(formDTO.getGridId()); Result userInfoResult = epmetUserFeignClient.getUserInfoAndRoles(userInfoParams); - if(userInfoResult.success()){ - //2:调用epmet-user服务查询数据 新建网格记录数据 - /*VisitedFormDTO visitedFormDTO = new VisitedFormDTO(); - visitedFormDTO.setGridId(userInfoParams.getGridId()); - visitedFormDTO.setCustomerId(userInfoParams.getCustomerId()); - visitedFormDTO.setUserId(userInfoParams.getUserId()); - if(null != userInfoResult.getData().getUserRoleList() && userInfoResult.getData().getUserRoleList().size() > 0){ - visitedFormDTO.setIsReg(NumConstant.ONE_STR); - }else{ - visitedFormDTO.setIsReg(NumConstant.ZERO_STR); - } - Result re = epmetUserFeignClient.saveVisitedRecord(visitedFormDTO); - if (!re.success()) { - log.warn(StrangerResiGuideConstant.EPMET_USER_EXCEPTION); - }*/ - }else{ - //getUserInfoAndRoles调用失败 - log.warn(StrangerResiGuideConstant.EPMET_USER_EXCEPTION); - } - return userInfoResult; } } From 23c3c414c48afcede89f43ce0d28e3c8a73ec433 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Mar 2021 22:51:59 +0800 Subject: [PATCH 185/234] =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=B8=8D=E4=B8=80=E8=87=B4=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/UserWechatDao.xml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index 4c2adabf2f..1ec439f398 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -59,12 +59,7 @@ From 2a6bf3cf8eb59a6b2c0f3da3303b5e895a3abd14 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 24 Mar 2021 15:07:33 +0800 Subject: [PATCH 188/234] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E5=8D=95=E7=8B=AC=E6=9B=B4=E6=96=B0dataEndTi?= =?UTF-8?q?me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/ScreenDifficultyDataServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index 66873e1b6d..f263b332fc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -66,7 +66,7 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl Date: Wed, 24 Mar 2021 16:02:29 +0800 Subject: [PATCH 189/234] =?UTF-8?q?pc=E8=BF=90=E8=90=A5=E7=AB=AFtoken?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=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/service/impl/GovWebServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 bf0689b2b7..8575a8e244 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 @@ -106,6 +106,7 @@ public class GovWebServiceImpl implements GovWebService { logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]"); int expire = jwtTokenProperties.getExpire(); TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId(formDTO.getCustomerId()); tokenDto.setApp(formDTO.getApp()); tokenDto.setClient(formDTO.getClient()); tokenDto.setUserId(userId); From 05a567258e60f659c012ee4c1b8bd22686c4f38a Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Mar 2021 16:18:51 +0800 Subject: [PATCH 190/234] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E5=A0=B5=E7=82=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectMainDailyDao.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 675cce9c31..b9608e9ee3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -335,6 +335,7 @@ gridInfo.allParentIds FROM fact_origin_project_main_daily project + LEFT JOIN ( SELECT grid.ID AS dimGridId, @@ -368,7 +369,9 @@ grid.DEL_FLAG = '0' AND grid.CUSTOMER_ID = #{customerId} ) gridInfo ON project.GRID_ID = gridInfo.dimGridId + LEFT JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT ORG_ID ) AS reOrg FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY PROJECT_ID ) relation ON project.ID = relation.PROJECT_ID + LEFT JOIN ( SELECT PROJECT_ID, @@ -387,14 +390,15 @@ AND project.CUSTOMER_ID = #{customerId} AND project.ID IN ( - + SELECT DISTINCT period.project_id FROM fact_origin_project_org_period_daily period LEFT JOIN ( - + + SELECT project.ID AS projectId, IFNULL(period.handled_date,NOW()) AS finishDate @@ -571,4 +575,4 @@ - \ No newline at end of file + From 2d761725a91d4f73dcfb65de2e89fcc18dd405dd Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 24 Mar 2021 17:38:36 +0800 Subject: [PATCH 191/234] =?UTF-8?q?PC=E7=AB=AF=20=E6=AF=8F=E4=B8=AA?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=9A=84=E8=8F=9C=E5=8D=95=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E6=94=BE=E5=85=A5=E7=BC=93=E5=AD=98=EF=BC=8C?= =?UTF-8?q?=E6=AF=8F=E6=AC=A1=E7=99=BB=E9=99=86=E9=87=8D=E6=96=B0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/GovMenuServiceImpl.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index 1f16ad89e9..4e4c142b55 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -187,14 +187,15 @@ public class GovMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(TokenDto tokenDto) { - List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient()); - if(menuList == null){ - menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); - - govMenuRedis.setUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient(), menuList); - } - - return menuList; +// List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient()); +// if(menuList == null){ +// menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); +// +// govMenuRedis.setUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient(), menuList); +// } + // PC端 每个客户的菜单信息,不放入缓存,每次登陆重新查询。 + // 或者 你可以选择,在给每个客户 配置可见菜单的时候, 在saveCustomerMenu方法中,增加更新缓存的逻辑 + return getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); } /** From b107907a67cb3e34b470489fd518b79b9faf704b Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Mar 2021 18:13:20 +0800 Subject: [PATCH 192/234] =?UTF-8?q?resi-group=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E4=BB=8E?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=B8=AD=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/security/user/LoginUserUtil.java | 12 ++++++ .../screen/ScreenDifficultyDataEntity.java | 2 +- ...FactOriginProjectMainDailyServiceImpl.java | 3 +- ...srootsGovernDataAbsorptionServiceImpl.java | 6 +-- .../service/impl/ResiGroupServiceImpl.java | 11 +++--- .../java/com/epmet/constant/UserConstant.java | 12 ++++++ .../com/epmet/redis/UserResiInfoRedis.java | 14 +------ .../service/impl/UserResiInfoServiceImpl.java | 37 +++++++++++++++---- 8 files changed, 67 insertions(+), 30 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java index 088a26eb73..bb322aad2d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/user/LoginUserUtil.java @@ -34,6 +34,18 @@ public class LoginUserUtil { return userId; } + /** + * 查询登录用户的客户Id + * @return + */ + public String getCurrentCustomerId() { + HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); + if (request == null) { + return null; + } + return request.getHeader(AppClientConstant.CUSTOMER_ID); + } + /** * 登录用户的App头信息 * @return diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java index f8f7595adf..04c252172e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java @@ -61,7 +61,7 @@ public class ScreenDifficultyDataEntity extends BaseEpmetEntity { private String orgName; /** - * 事件原Id + * 事件原Id(项目Id) */ private String eventId; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 1a51ba5690..7f9d220602 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -248,6 +248,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl * @author wangc @@ -422,4 +423,4 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); - Map> imgMap = - topicService.getTopicImgs(projectSourceMap); + Map> imgMap = topicService.getTopicImgs(projectSourceMap); Map contentMap = topicService.getTopicContent(projectSourceMap); @@ -183,8 +182,9 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE)); }); List imgList = new LinkedList<>(); - imgMap.values().forEach(list -> {imgList.addAll(list);}); + imgMap.values().forEach(imgList::addAll); + //立案后会有 一个process 如果没有则说明是垃圾数据 如果有其他方式立项的项目则需要考虑下兼容 difficulties.removeIf( diff -> StringUtils.isBlank(diff.getLatestOperateDesc())); screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index ae929c6de9..72e61b1406 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -337,17 +337,18 @@ public class ResiGroupServiceImpl extends BaseServiceImpl getGroupLeaderUserInfo(String groupId) { + String customerId = loginUserUtil.getCurrentCustomerId(); //群主名称需要调用feign查询 - ResiGroupEntity resiGroupEntity = baseDao.selectById(groupId); - if (null == resiGroupEntity) { - return new Result<>(); - } +// ResiGroupEntity resiGroupEntity = baseDao.selectById(groupId); +// if (null == resiGroupEntity) { +// return new Result<>(); +// } ResiGroupMemberDTO groupMemberDTO = baseDao.selectGroupLeader(groupId); if (null == groupMemberDTO) { return new Result<>(); } UserResiInfoFormDTO resiUserInfoFormDTO = new UserResiInfoFormDTO(); - resiUserInfoFormDTO.setCustomerId(resiGroupEntity.getCustomerId()); + resiUserInfoFormDTO.setCustomerId(customerId); resiUserInfoFormDTO.setUserId(groupMemberDTO.getCustomerUserId()); return epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java index 2214369866..1e91d3cb14 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java @@ -85,4 +85,16 @@ public interface UserConstant { * user_wechat表更新数据失败 */ String UPDATE_USER_WECHAT = "更新用户微信信息失败"; + /** + * 先生 + */ + String MAN = "先生"; + /** + * 女士 + */ + String WOMAN = "女士"; + /** + * 先生/女士 + */ + String MAN_WOMAN = "先生/女士"; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiInfoRedis.java index 1ce33a14da..d4fd65f10d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiInfoRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserResiInfoRedis.java @@ -33,18 +33,6 @@ public class UserResiInfoRedis { @Autowired private RedisUtils redisUtils; - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - public void setUserResiMobileCode(String userId, String mobile, String verificationCode){ String key = RedisKeys.getResiRegisterMobileCodeKey(userId, mobile, verificationCode); //手机验证码放入缓存中 有效时间30分钟 @@ -61,4 +49,4 @@ public class UserResiInfoRedis { redisUtils.deleteByPattern(key); } -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index e5e7678835..a217a5dae1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -24,18 +24,15 @@ import com.epmet.common.token.util.UserUtil; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; -import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; -import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.constant.SmsTemplateConstant; +import com.epmet.constant.UserConstant; import com.epmet.constant.UserRoleConstant; import com.epmet.dao.UserCustomerDao; import com.epmet.dao.UserResiInfoDao; @@ -46,6 +43,7 @@ import com.epmet.dto.UserRoleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.entity.UserBaseInfoEntity; import com.epmet.entity.UserResiInfoEntity; @@ -163,8 +161,33 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl getUserResiInfoDTO(UserResiInfoFormDTO userResiInfoFormDTO) { - UserResiInfoResultDTO userResiInfoDTO = baseDao.selectUserResiInfoDTO(userResiInfoFormDTO); - return new Result().ok(userResiInfoDTO); + //先查缓存 否则查询数据库 这个方法里有 + UserBaseInfoResultDTO userBaseInfoResultDTO = userBaseInfoService.queryUserBaseInfoFromCache(userResiInfoFormDTO.getUserId()); + if (userBaseInfoResultDTO != null){ + UserResiInfoResultDTO resultDTO = new UserResiInfoResultDTO(); + resultDTO.setUserId(userBaseInfoResultDTO.getUserId()); + resultDTO.setRegMobile(userBaseInfoResultDTO.getMobile()); + resultDTO.setSurname(userBaseInfoResultDTO.getSurname()); + resultDTO.setName(userBaseInfoResultDTO.getName()); + resultDTO.setStreet(userBaseInfoResultDTO.getStreet()); + resultDTO.setDistrict(userBaseInfoResultDTO.getDistrict()); + resultDTO.setBuildingAddress(userBaseInfoResultDTO.getBuildingAddress()); + resultDTO.setNickName(userBaseInfoResultDTO.getNickname()); + + String gender = null; + if (NumConstant.ONE_STR.equals(userBaseInfoResultDTO.getGender())) { + gender = UserConstant.MAN; + } else if (NumConstant.TWO_STR.equals(userBaseInfoResultDTO.getGender())) { + gender = UserConstant.WOMAN; + } else { + gender = UserConstant.MAN_WOMAN; + } + String leaderName = userBaseInfoResultDTO.getStreet().concat(StrConstant.HYPHEN).concat(userBaseInfoResultDTO.getSurname()).concat(gender); + resultDTO.setShowName(leaderName); + resultDTO.setHeadPhoto(userBaseInfoResultDTO.getHeadImgUrl()); + return new Result().ok(resultDTO); + } + return new Result().ok(null); } /** From f00eccabbe51e4d849baa014cc45f5a9a8355f87 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 25 Mar 2021 14:58:13 +0800 Subject: [PATCH 193/234] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/DemoController.java | 4 ++-- .../ScreenGrassrootsGovernDataAbsorptionServiceImpl.java | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) 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 4bb409b6eb..7d2cf24432 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 @@ -806,14 +806,14 @@ public class DemoController { return new Result(); } - /*@Autowired + @Autowired private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; @PostMapping("diff") public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ ndddYhjfService.difficultyDataHub(param); return new Result(); - }*/ + } @Autowired private ScreenProjectSettleService screenProjectSettleService; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index 05ab26289b..ebb8c7fad5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -155,10 +155,12 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr //最近一次操作 Map latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId()); //图片 - List projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); + List projectSourceMap = difficulties.stream().map(diff->{ + ProjectSourceMapFormDTO map = new ProjectSourceMapFormDTO();map.setProjectId(diff.getEventId());map.setSourceId(diff.getEventImgUrl());return map; + }).collect(Collectors.toList()); + //factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); - Map> imgMap = - topicService.getTopicImgs(projectSourceMap); + Map> imgMap = topicService.getTopicImgs(projectSourceMap); Map contentMap = topicService.getTopicContent(projectSourceMap); From 25db686745555da883964d0565551dc0f654265b Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 25 Mar 2021 17:14:30 +0800 Subject: [PATCH 194/234] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E9=9A=BE?= =?UTF-8?q?=E7=82=B9=E8=B5=8C=E7=82=B9=E6=B5=8B=E8=AF=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/DemoController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 7d2cf24432..4bb409b6eb 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 @@ -806,14 +806,14 @@ public class DemoController { return new Result(); } - @Autowired + /*@Autowired private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; @PostMapping("diff") public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ ndddYhjfService.difficultyDataHub(param); return new Result(); - } + }*/ @Autowired private ScreenProjectSettleService screenProjectSettleService; From 36beefe80505fbbb60b84f02af5e908e6996dd12 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Mar 2021 09:13:43 +0800 Subject: [PATCH 195/234] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/ScreenProjectSettleServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 590f8c3df6..dfb64dfc01 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -69,7 +69,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic */ @Override public void extractScreenData(ScreenCentralZoneDataFormDTO param) { + //screen_project_data表是否存在此客户数据 int rows = targetDbService.checkIfExisted(param.getCustomerId()); + //查找客户项目超期参数 List exceedParams = projectService.getProjectExceedParams(param.getCustomerId()); Integer exceedLimit = NumConstant.FIVE; Integer about2ExceedLimit = NumConstant.FIVE; @@ -92,6 +94,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit); if(!CollectionUtils.isEmpty(metaData)) { + // 查询项目信息 List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); if(!CollectionUtils.isEmpty(info)){ metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), From 07367655ff75c888c2ac73be17e2704177ca63c6 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 26 Mar 2021 15:27:50 +0800 Subject: [PATCH 196/234] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E8=80=97=E6=97=B6=E6=8A=BD=E5=8F=96=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/todata/impl/ProjectExtractServiceImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index 35b5bbd577..cbbaee19c9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -437,11 +437,8 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { formattingData.add(dest); }); if(!CollectionUtils.isEmpty(formattingData)) { - List projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList()); - if (!CollectionUtils.isEmpty(projectIds)) { factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(null,param.getCustomerId()); factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData); - } } } From cc3e9d5586de8af112fda7e014d10e746baf9528 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Mar 2021 17:18:49 +0800 Subject: [PATCH 197/234] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index d8db277ec4..39501e53b4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -78,6 +78,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr //2.查询出客户下网格的相关信息 List gridList = customerGridService.queryGridInfoList(param.getCustomerId()); + // list 转 map,以gridId为key,a = gridList,作为value,(o,n)->o 是遇到相同的gridId舍弃,(o,n)->n 是覆盖原来的gridId Map gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); //3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分) @@ -96,7 +97,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr } } final String finalDateId = dateId; - + // 查询党员积分 Map scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId); //剔除垃圾数据 From 5d60cec1cf2b578fa896f1bdc1c997c65d98f34c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 26 Mar 2021 17:34:11 +0800 Subject: [PATCH 198/234] zancun --- .../user/result/UserStatisticalData.java | 33 +++++++++++++ .../epmet/controller/StatsUserController.java | 6 +++ .../service/impl/StatsUserServiceImpl.java | 7 ++- .../service/user/impl/UserServiceImpl.java | 49 ++++++++++--------- 4 files changed, 71 insertions(+), 24 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java index e50824d0cb..40315afc0c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java @@ -17,25 +17,58 @@ import java.util.List; public class UserStatisticalData implements Serializable { private static final long serialVersionUID = 7423427555123585566L; + /** + * 机关下(按日)参与用户数分析 + */ private List partiAgencyDailyList; + /** + * 网格下(按日)参与用户数分析 + */ private List partiGridDailyList; + /** + * 机关下(按月)参与用户数分析 + */ private List partiAgencyMonthlyList; + /** + * 网格下(月)参与用户数分析 + */ private List partiGridMonthlyList; + /** + * 机关(按日)注册用户数分析 + */ private List regAgencyDailyList; + /** + * 网格(按日)注册用户数分析 + */ private List regGridDailyList; + /** + * 机关(按月)注册用户数分析 + */ private List regAgencyMonthlyList; + /** + * 网格(月)注册用户数分析 + */ private List regGridMonthlyList; + /** + * 当前正在计算的客户id + */ private String customerId; + /** + * yyyyMMdd + */ private String dateId; + /** + * yyyyMM + */ private String monthId; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java index bc3ed0d09b..9c521b770a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java @@ -21,6 +21,12 @@ public class StatsUserController { @Autowired private StatsUserService statsUserService; + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @description 工作端数据一期,用户分析:参与用户、注册用户分析 + * @Date 2021/3/26 13:27 + **/ @RequestMapping("execute") public Result execute(@RequestBody StatsFormDTO formDTO) { statsUserService.partition(formDTO); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 35568a1e2f..20c1e711df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -63,12 +63,14 @@ public class StatsUserServiceImpl implements StatsUserService { List customerIdList = null; Date date = null; if (StringUtils.isNotBlank(formDTO.getDate())) { + //如果指定了参数,转化为yyyy-MM-dd格式 date = DateUtils.stringToDate(formDTO.getDate(), DateUtils.DATE_PATTERN); } if (StringUtils.isNotBlank(formDTO.getCustomerId())) { generate(formDTO.getCustomerId(), date); } else { do { + //每100个客户一组 customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { @@ -99,13 +101,14 @@ public class StatsUserServiceImpl implements StatsUserService { calendar.set(Calendar.MINUTE, NumConstant.ZERO); calendar.set(Calendar.SECOND, NumConstant.ZERO); - //2.初始化时间维度 + //2.初始化时间维度{"dateId":"20210325","monthId":"202103","quarterId":"2021Q1","weekId":"2021W13","yearId":"2021"} DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); //3.初始化机关维度 List agencies = dimAgencyService.getAllAgency(customerId); //List topAgencies = dimAgencyService.getTopAgency(customerId); - + // log.info(JSON.toJSONString(timeDimension)); + // log.info(JSON.toJSONString(agencies)); //4.计算机关统计数据、生成唯一性统计数据 try { UserStatisticalData agencyData = userService.traverseAgencyUser(agencies, date, timeDimension); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index db739b79ab..75163e0b21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -62,8 +62,8 @@ public class UserServiceImpl implements UserService { dataPacket.setDateId(timeDimension.getDateId()); dataPacket.setMonthId(timeDimension.getMonthId()); //自上向下检索 - Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + //subGridOfAgency key:agencyId ,value:当前组织下的所有网格(即直属网格+下级组织下的所有网格) Map> subGridOfAgency = new HashMap<>(); agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); @@ -71,12 +71,13 @@ public class UserServiceImpl implements UserService { //对每一个机关进行数据统计 if(subGridOfAgency.size() > NumConstant.ZERO){ - subGridOfAgency.forEach((k,v) -> { + //如果当前客户存在组织 + subGridOfAgency.forEach((agencyId,subGridIds) -> { queryUserData(ModuleConstant.DIM_SUB_AGENCY, - k, - (null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(k).get(NumConstant.ZERO).getPid(), - (null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? null : agencyMap.get(k).get(NumConstant.ZERO).getCustomerId(), - v, + agencyId, + // (null == agencyMap.get(agencyId) || agencyMap.get(agencyId).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(agencyId).get(NumConstant.ZERO).getPid(), + (null == agencyMap.get(agencyId) || agencyMap.get(agencyId).isEmpty()) ? null : agencyMap.get(agencyId).get(NumConstant.ZERO).getCustomerId(), + subGridIds, targetDate, dataPacket, timeDimension); @@ -111,7 +112,7 @@ public class UserServiceImpl implements UserService { if(null != v && v.size() > NumConstant.ZERO){ queryUserData(ModuleConstant.DIM_BELONGING_GRID, k, - v.get(NumConstant.ZERO).getPid(), + // v.get(NumConstant.ZERO).getPid(), v.get(NumConstant.ZERO).getCustomerId(), new HashSet<>(v.get(NumConstant.ZERO).getGridIds()), targetDate, @@ -181,22 +182,22 @@ public class UserServiceImpl implements UserService { /** * @Description 初始化机关-所有下级网格Map - * @param pid - 固定一个机关Id + * @param agencyId - 当前组织id * @param agency - AgencySubTreeDto * @param subGridOfAgency - Map> * @return * @author wangc * @date 2020.06.18 15:54 **/ - void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map> subGridOfAgency){ + void initAgencyGridMap(String agencyId, AgencySubTreeDto agency, Map> subGridOfAgency){ //向map中放入数据 - if(subGridOfAgency.containsKey(pid)){ + if(subGridOfAgency.containsKey(agencyId)){ //包含key - Set grids = subGridOfAgency.get(pid); + Set grids = subGridOfAgency.get(agencyId); if(null == grids){ grids = new HashSet<>(); - subGridOfAgency.put(pid,grids); + subGridOfAgency.put(agencyId,grids); } if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ grids.addAll(agency.getGridIds()); @@ -204,18 +205,20 @@ public class UserServiceImpl implements UserService { }else{ //不包含key Set grids = new HashSet<>(agency.getGridIds()); - subGridOfAgency.put(pid,grids); + subGridOfAgency.put(agencyId,grids); } - + //外层是从顶级组织向下循环,所以循环到社区时跳出 //定义递归出口 - if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){ - return ; + if (StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY, agency.getLevel()) + || null == agency.getSubAgencies() + || agency.getSubAgencies().size() == NumConstant.ZERO) { + return; } //定义递归入口 agency.getSubAgencies().forEach(obj -> { - initAgencyGridMap(pid,obj,subGridOfAgency); + initAgencyGridMap(agencyId,obj,subGridOfAgency); }); } @@ -223,7 +226,7 @@ public class UserServiceImpl implements UserService { * @Description 执行查询用户数据统计的逻辑 * @param relation - agency(下级机关加网格) | grid(直属网格) * @param agencyId - * @param pid + * @param //pid 当前agency的父级组织id * @param customerId * @param gridIds - 机关下所有网格集合/机关下直属网格集合 * @param targetDate @@ -233,10 +236,12 @@ public class UserServiceImpl implements UserService { * @author wangc * @date 2020.06.19 10:01 **/ - void queryUserData(String relation, String agencyId, String pid, String customerId, Set gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){ - - if(StringUtils.isBlank(pid)) - pid = NumConstant.ZERO_STR; + void queryUserData(String relation, String agencyId, + // String pid, + String customerId, Set gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){ + //pid没用到还传过来干啥-- 注释掉 + // if(StringUtils.isBlank(pid)) + // pid = NumConstant.ZERO_STR; dataPacket.setCustomerId(customerId); From 4266b73c96f9f9c7c8236fb6fdd055a9cd50df43 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 26 Mar 2021 17:35:14 +0800 Subject: [PATCH 199/234] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/StatsUserServiceImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 20c1e711df..8329b7c3f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -106,9 +106,6 @@ public class StatsUserServiceImpl implements StatsUserService { //3.初始化机关维度 List agencies = dimAgencyService.getAllAgency(customerId); - //List topAgencies = dimAgencyService.getTopAgency(customerId); - // log.info(JSON.toJSONString(timeDimension)); - // log.info(JSON.toJSONString(agencies)); //4.计算机关统计数据、生成唯一性统计数据 try { UserStatisticalData agencyData = userService.traverseAgencyUser(agencies, date, timeDimension); From 8d00219d0349f33f9470b7f7cfdd793c69e1c939 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 29 Mar 2021 10:21:19 +0800 Subject: [PATCH 200/234] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/impl/ScreenCentralZoneDataExtractServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java index 99c45d2f95..feceadf83d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -67,6 +67,7 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon List result = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); if(CollectionUtils.isEmpty(result)){ + // 根据dateId查询为空,先根据当前时间-1天是否和dateId相等,相等的话,查询往前推2天的数据 if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ result = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); } From e508b94d3a927c2d47dfe4c00e682caa19d455f7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 29 Mar 2021 13:18:00 +0800 Subject: [PATCH 201/234] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=86=E6=9E=90sql?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 7 +++ .../service/impl/StatsUserServiceImpl.java | 10 +++- .../service/user/impl/UserServiceImpl.java | 11 ++-- .../main/resources/mapper/user/UserDao.xml | 54 ++++++++++--------- 4 files changed, 50 insertions(+), 32 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 8c6432aadd..3217260019 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -424,6 +424,13 @@ public class DateUtils { return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD); } + public static String getBeforeNDay(int beforDay,String format){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.DATE, - beforDay); + Date date = c.getTime(); + return DateUtils.format(date,format); + } + /** * @return java.lang.String * @param beforMonth diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 8329b7c3f1..0d35eede37 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ProjectConstant; @@ -58,10 +59,16 @@ public class StatsUserServiceImpl implements StatsUserService { **/ @Override public void partition(StatsFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getDate())){ + //如果定时任务没有指定参数,默认数据更新至t-1,包含t-1这一天内的数据 + formDTO.setDate(DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN)); + } + int pageNo = NumConstant.ONE; int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; Date date = null; + if (StringUtils.isNotBlank(formDTO.getDate())) { //如果指定了参数,转化为yyyy-MM-dd格式 date = DateUtils.stringToDate(formDTO.getDate(), DateUtils.DATE_PATTERN); @@ -92,6 +99,7 @@ public class StatsUserServiceImpl implements StatsUserService { * @date 2020.06.28 14:40 **/ void generate(String customerId,Date date){ + log.info("customerId:"+customerId+";date:"+DateUtils.format(date,DateUtils.DATE_TIME_PATTERN)); //1.初始化时间参数 Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); @@ -103,7 +111,7 @@ public class StatsUserServiceImpl implements StatsUserService { //2.初始化时间维度{"dateId":"20210325","monthId":"202103","quarterId":"2021Q1","weekId":"2021W13","yearId":"2021"} DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); - + log.info("timeDimension:"+ JSON.toJSONString(timeDimension)); //3.初始化机关维度 List agencies = dimAgencyService.getAllAgency(customerId); //4.计算机关统计数据、生成唯一性统计数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 75163e0b21..b5594541a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -108,10 +108,10 @@ public class UserServiceImpl implements UserService { //自上向下检索 Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); if(null != agencyMap && agencyMap.size() > NumConstant.ZERO){ - agencyMap.forEach((k,v) -> { + agencyMap.forEach((agencyId,v) -> { if(null != v && v.size() > NumConstant.ZERO){ queryUserData(ModuleConstant.DIM_BELONGING_GRID, - k, + agencyId, // v.get(NumConstant.ZERO).getPid(), v.get(NumConstant.ZERO).getCustomerId(), new HashSet<>(v.get(NumConstant.ZERO).getGridIds()), @@ -258,6 +258,9 @@ public class UserServiceImpl implements UserService { //指定日期 OR T-1 calendar.setTime(targetDateCheck); + //calendar.get(Calendar.DATE) 当前日期数eg:2021-03-29 :29 + //calendar.getActualMinimum(Calendar.DAY_OF_MONTH) :1 + //如果目标日期不是是当月的第一天 if(calendar.get(Calendar.DATE) != calendar.getActualMinimum(Calendar.DAY_OF_MONTH)){ //求出这个月的第一天 @@ -269,7 +272,6 @@ public class UserServiceImpl implements UserService { isMonthBeginning = false; } - if(StringUtils.equals(ModuleConstant.DIM_SUB_AGENCY,relation)){ @@ -401,8 +403,6 @@ public class UserServiceImpl implements UserService { partiAgencyM.setWarmHeartedProportion(partiAgencyD.getWarmHeartedProportion()); partiAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); - - //如果是月初第一天,不再做日期区间查询 if(isMonthBeginning) { if (null == dataPacket.getRegAgencyMonthlyList()) { @@ -421,6 +421,7 @@ public class UserServiceImpl implements UserService { } }else{ //如果不是月初第一天 + //targetDateCheck:定时任务参数中的date;calendar.getTime():date所属月第一天; //本月注册用户增长数 Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 969a848ae3..f30740e0ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -40,11 +40,13 @@ + - AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d") + - AND CREATED_TIME CURDATE( ) AND CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT( DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") ) AS incr @@ -76,11 +78,13 @@ + - AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(#{targetDate},"%Y-%m-%d") + - AND CREATED_TIME CURDATE( ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") @@ -121,10 +125,10 @@ - AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND CREATED_TIME CURDATE( ) AND CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") @@ -164,10 +168,10 @@ - AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND CREATED_TIME CURDATE( ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") @@ -190,10 +194,10 @@ - AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND urole.CREATED_TIME CURDATE( ) AND urole.CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") @@ -221,10 +225,10 @@ - AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) + and DATE_FORMAT( urole.CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND urole.CREATED_TIME CURDATE( ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") AND erole.ROLE_NAME = '党员' @@ -261,10 +265,10 @@ - AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d")=DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND urole.CREATED_TIME CURDATE( ) AND urole.CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d")=DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") AND erole.ROLE_NAME = '热心居民' @@ -290,10 +294,10 @@ - AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND urole.CREATED_TIME CURDATE( ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") AND erole.ROLE_NAME = '热心居民'; @@ -332,8 +336,8 @@ - - AND CREATED_TIME =]]> #{startDate} AND CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) + AND CREATED_TIME =]]> DATE_FORMAT(#{startDate},"%Y-%m-%d") + AND CREATED_TIME DATE_FORMAT(#{endDate},"%Y-%m-%d") @@ -368,10 +372,8 @@ - - - AND CREATED_TIME =]]> #{startDate} AND CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) - + AND CREATED_TIME =]]> DATE_FORMAT(#{startDate},"%Y-%m-%d") + AND CREATED_TIME DATE_FORMAT(#{endDate},"%Y-%m-%d") @@ -394,9 +396,8 @@ - - - AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) + AND urole.CREATED_TIME =]]> DATE_FORMAT(#{startDate},"%Y-%m-%d") + AND urole.CREATED_TIME DATE_FORMAT(#{endDate},"%Y-%m-%d") AND erole.ROLE_NAME = '党员' @@ -423,7 +424,8 @@ - AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) + AND urole.CREATED_TIME =]]> DATE_FORMAT(#{startDate},"%Y-%m-%d") + AND urole.CREATED_TIME DATE_FORMAT(#{endDate},"%Y-%m-%d") AND erole.ROLE_NAME = '热心居民' From 77aeed3fbc6fc6904cdd9571aa7a61a47b44fd76 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Mar 2021 13:29:26 +0800 Subject: [PATCH 202/234] =?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 --- .../extract/todata/impl/FactOriginExtractServiceImpl.java | 2 +- .../todata/impl/FactOriginProjectLogDailyServiceImpl.java | 5 ++--- .../extract/todata/impl/ProjectExtractServiceImpl.java | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index f44eef01de..089be0c513 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -198,7 +198,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { try { projectExtractService.extractProjectPeriodData(paramNew); } catch (Exception e) { - log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + log.error("抽取【项目耗时数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); } } else { try { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 641b7efa03..b710d08af5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -30,7 +30,6 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; -import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import org.apache.commons.lang3.StringUtils; @@ -236,6 +235,7 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId); Map efficiencyMap = new HashMap<>(); + List projects = new LinkedList<>(); if (!CollectionUtils.isEmpty(projectsHandledByAgency)) { Map> agencyProjectsMap = new HashMap<>(); @@ -249,10 +249,9 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl projects = new LinkedList<>(); - agencyProjectsMap.forEach((key,value) -> {projects.addAll(value);}); //2.结案项目的总耗时 List costTimes = baseDao.selectProjectCostTime(projects); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index cbbaee19c9..8f1985b6be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -104,6 +104,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> { String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); String org = ""; + //取最短的ordIds中最后一个 则为最高级的那个orgIds if (orgIds.length > NumConstant.ONE) { org = orgIds[orgIds.length - 1]; } else { From 73d392866466000a07f7165a68b5bc4804eec9d9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Mar 2021 17:18:29 +0800 Subject: [PATCH 203/234] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0Pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/OssController.java | 42 +++++++++++++------ .../java/com/epmet/utils/ModuleConstant.java | 4 ++ .../epmet/dto/form/DraftContentFromDTO.java | 11 +++-- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 1559d4160b..34a94378ec 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -205,25 +205,43 @@ public class OssController { return ossService.uploadImg(file, null); } + /** + * desc: 党建声音模块 上传图片(2M)或附件(5M) + * + * @param file + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/3/29 4:56 下午 + */ @PostMapping("article/upload") public Result uploadArticleImg(@RequestParam("file") MultipartFile file) { - // 校验文件类型 - if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType()) - && !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) ) { - log.error("uploadArticleImg file type:{} is not support 2 upload",file.getContentType() == null? null:file.getContentType()); + // 校验文件类型 图片或pdf + if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) + && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType()) + && !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) + && !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { + log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType()); throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); } - - // 校验文件体积,不超过2m - long maxSize = 2 * 1024 * 1024; - long size = file.getSize(); - if (size > maxSize) { - throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() - , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + if (ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { + // 校验文件体积,不超过2m + long maxSize = 5 * 1024 * 1024; + long size = file.getSize(); + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } + } else { + // 校验文件体积,不超过2m + long maxSize = 2 * 1024 * 1024; + long size = file.getSize(); + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } } - return ossService.uploadImg(file, null); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java index a89b14fbd1..07a11d9ed7 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -26,6 +26,10 @@ public interface ModuleConstant extends Constant { * jpg文件类型 */ String FILE_CONTENT_TYPE_JPG = "image/jpg"; + /** + * pdf文件类型 + */ + String FILE_CONTENT_TYPE_PDF = "application/pdf"; /** * 项目附件-允许上传的文件类型 diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java index 7df78525c0..d85f17cf7c 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java @@ -67,14 +67,19 @@ public class DraftContentFromDTO implements Serializable { */ private String draftContentId; /** - * 内容 + * 内容 当为非文字时,存放oss链接地址 */ @Length(max = 1000, message = "每段文字最长为1000个字") private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;附件:attachment */ private String contentType; + + /** + * 附件名称 + */ + private String attachmentName; } -} \ No newline at end of file +} From 1fb901c1a791ba2ab6ba4f83a327261988cbc557 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 29 Mar 2021 17:47:35 +0800 Subject: [PATCH 204/234] =?UTF-8?q?ext=E6=96=B0=E5=A2=9Eapi:=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=BD=93=E5=89=8D=E5=AE=A2=E6=88=B7=E4=B8=8B=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=AB=AF=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/CustomerRoleResultDTO.java | 21 +++++++++++++ .../epmet/controller/OpenUpController.java | 13 ++++++++ .../java/com/epmet/service/OpenUpService.java | 9 ++++++ .../epmet/service/impl/OpenUpServiceImpl.java | 17 ++++++++++ .../epmet/dto/result/RoleInfoResultDTO.java | 2 ++ .../epmet/feign/EpmetUserOpenFeignClient.java | 10 ++++++ .../EpmetUserOpenFeignClientFallback.java | 13 ++++++++ .../controller/GovStaffRoleController.java | 12 +++++++ .../epmet/service/GovStaffRoleService.java | 10 ++++++ .../service/impl/GovStaffRoleServiceImpl.java | 31 ++++++++++++++++--- 10 files changed, 133 insertions(+), 5 deletions(-) create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java new file mode 100644 index 0000000000..a8fe59a2f8 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/3/29 15:26 + */ +@Data +public class CustomerRoleResultDTO implements Serializable { + private static final long serialVersionUID = 4933114432141586045L; + + private String roleName; + private String roleKey; + private String roleId; + private Boolean fullTimeOnly; +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 4fd89b0dbc..c0535b648b 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -147,5 +147,18 @@ public class OpenUpController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(openUpService.queryStaffPermissionV2(formDTO)); } + + /** + * @return + * @param formDTO 客户id + * @author yinzuomei + * @description 010、获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:25 + **/ + @PostMapping("govrolelist") + public Result> queryCustomerGovRoleList(@RequestBody CustomerInfoQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(openUpService.queryCustomerGovRoleList(formDTO.getCustomerId())); + } } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java index 6fbe32afe6..8047ec9f8c 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java @@ -62,4 +62,13 @@ public interface OpenUpService { * @Date 2021/2/3 20:59 **/ StaffPermissionResultDTO queryStaffPermissionV2(StaffPermissionFormDTO formDTO); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 010、获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:27 + **/ + List queryCustomerGovRoleList(String customerId); } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java index 43f50a34c9..0f6cb365b3 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -210,4 +210,21 @@ public class OpenUpServiceImpl implements OpenUpService { return resultDTO; } + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 010、获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:27 + **/ + @Override + public List queryCustomerGovRoleList(String customerId) { + Result> userRes = epmetUserOpenFeignClient.queryCustomerGovRoleList(customerId); + if (!userRes.success() || CollectionUtils.isEmpty(userRes.getData())) { + log.error(String.format("获取当前客户下,工作端角色列表失败,customerId:%s", customerId)); + return new ArrayList<>(); + } + return ConvertUtils.sourceToTarget(userRes.getData(), CustomerRoleResultDTO.class); + } + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java index c2378a87a5..81498e5586 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java @@ -29,4 +29,6 @@ public class RoleInfoResultDTO implements Serializable{ * */ @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean fullTimeOnly = false; + + private String roleKey; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index d48703ffb4..3332aec3a1 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -486,4 +486,14 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping(value = "/epmetuser/user/saveuserinfo") Result saveUserInfo(@RequestBody UserInfoFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param customerId + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:35 + **/ + @GetMapping(value = "/epmetuser/govstaffrole/querycustomergovrolelist/{customerId}") + Result> queryCustomerGovRoleList(@PathVariable("customerId")String customerId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 195f1a0c38..c1944b43a3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -337,8 +337,21 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveUserInfo", formDTO); } + /** + * @param customerId + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:35 + **/ + @Override + public Result> queryCustomerGovRoleList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryCustomerGovRoleList", customerId); + } + @Override public Result initGovStaffRolesForCustomer(String customerId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "initGovStaffRolesForCustomer", customerId); } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java index 40cab6cb5a..37df7c9140 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java @@ -9,6 +9,7 @@ import com.epmet.dto.form.GovStaffRoleFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; import com.epmet.dto.result.ResiGovRoleListResultDTO; +import com.epmet.dto.result.RoleInfoResultDTO; import com.epmet.service.GovStaffRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; @@ -112,4 +113,15 @@ public class GovStaffRoleController { return new Result>().ok(roles); } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param customerId + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:37 + **/ + @GetMapping("querycustomergovrolelist/{customerId}") + Result> queryCustomerGovRoleList(@PathVariable("customerId") String customerId){ + return new Result>().ok(govStaffRoleService.queryCustomerGovRoleList(customerId)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index 346fad61b2..6ee17905c2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -23,6 +23,7 @@ import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; import com.epmet.dto.result.ResiGovRoleListResultDTO; +import com.epmet.dto.result.RoleInfoResultDTO; import com.epmet.entity.GovStaffRoleEntity; import java.util.List; @@ -140,4 +141,13 @@ public interface GovStaffRoleService extends BaseService { void saveSortOrder(List roleIdList); List listRolesByRoleKey(String roleKey); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:37 + **/ + List queryCustomerGovRoleList(String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index 16c6a375e2..15a8b10483 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -20,20 +20,17 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.GovStaffRoleDao; import com.epmet.dao.GovStaffRoleTemplateDao; import com.epmet.dao.RoleDao; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.InitDefaultOperationsFormDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.GovStaffRoleTemplateDTO; -import com.epmet.dto.result.ResiGovRoleListResultDTO; -import com.epmet.dto.result.ResiGovRoleResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.feign.GovAccessFeignClient; import com.epmet.redis.GovStaffRoleRedis; @@ -242,4 +239,28 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl listRolesByRoleKey(String roleKey) { return govStaffRoleDao.listRolesByRoleKey(roleKey); } + + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:37 + **/ + @Override + public List queryCustomerGovRoleList(String customerId) { + List resultList=new ArrayList<>(); + GovStaffRoleDTO govStaffRoleDTO=new GovStaffRoleDTO(); + govStaffRoleDTO.setCustomerId(customerId); + List roleList = this.getGovStaffRoleList(govStaffRoleDTO); + roleList.forEach(role->{ + RoleInfoResultDTO resultDTO=new RoleInfoResultDTO(); + resultDTO.setFullTimeOnly(role.getFullTimeOnly()); + resultDTO.setRoleId(role.getId()); + resultDTO.setRoleName(role.getRoleName()); + resultDTO.setRoleKey(role.getRoleKey()); + resultList.add(resultDTO); + }); + return resultList; + } } \ No newline at end of file From 5ba2a90b36bdb6c3401ca7bc57a4ce9df3474048 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Mar 2021 17:52:10 +0800 Subject: [PATCH 205/234] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B7=BB=E5=8A=A0Pdf=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/ArticleContentDTO.java | 16 +++++++++++++--- .../main/java/com/epmet/dto/DraftContentDTO.java | 7 ++++--- .../com/epmet/dto/form/DraftContentFromDTO.java | 6 +++--- .../epmet/dto/result/GovArticleContentDTO.java | 7 ++++++- .../com/epmet/dto/result/GovDraftContentDTO.java | 7 ++++++- .../com/epmet/entity/ArticleContentEntity.java | 10 ++++++---- .../com/epmet/entity/DraftContentEntity.java | 10 ++++++---- .../resources/db/migration/V0.0.3__addpdf.sql | 6 ++++++ .../src/main/resources/mapper/ArticleDao.xml | 7 +++++-- 9 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.3__addpdf.sql diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java index 88aa05b3a8..a8269648f3 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -54,10 +55,19 @@ public class ArticleContentDTO implements Serializable { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; + /** + * desc: 请描述类的业务用途 + * + * @param null + * @return + * @author LiuJanJun + * @date 2021/3/29 5:42 下午 + */ + /** * 审核状态 通过:pass;失败:fail;审核中:auditing */ @@ -103,4 +113,4 @@ public class ArticleContentDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java index b0699b4c59..ee29b969c7 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -54,7 +55,7 @@ public class DraftContentDTO implements Serializable { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; @@ -103,4 +104,4 @@ public class DraftContentDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java index d85f17cf7c..09c6818ac2 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java @@ -73,13 +73,13 @@ public class DraftContentFromDTO implements Serializable { private String content; /** - * 内容类型 图片:img;文字:text;附件:attachment + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; /** - * 附件名称 + * 文件名称 */ - private String attachmentName; + private String fileName; } } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java index dbb98d9d3d..18844917ea 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java @@ -14,10 +14,15 @@ import java.io.Serializable; public class GovArticleContentDTO implements Serializable { private static final long serialVersionUID = 1519014754254863006L; /** - * 内容类型,图片:img;文字:text + * 内容类型,图片:img;文字:text; 文件:file */ private String contentType; + /** + * 文件名称 + */ + private String fileName; + /** * 内容 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java index 4b4ae98c07..c575c4a561 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java @@ -15,10 +15,15 @@ public class GovDraftContentDTO implements Serializable { private static final long serialVersionUID = 5653062658148122552L; /** - * 内容类型,图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; + /** + * 文件名称 + */ + private String fileName; + /** * 内容 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java index f4a961b974..29661c7350 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 文章内容表 * @@ -54,10 +51,15 @@ public class ArticleContentEntity extends BaseEpmetEntity { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; + /** + * 文件名称 + */ + private String fileName; + /** * 审核状态 通过:pass;失败:fail;审核中:auditing */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java index a5ab64db0e..15a7ba4e76 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 草稿内容表 * @@ -54,7 +51,7 @@ public class DraftContentEntity extends BaseEpmetEntity { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; @@ -73,4 +70,9 @@ public class DraftContentEntity extends BaseEpmetEntity { */ private Integer orderNum; + /** + * 文件名称 + */ + private String fileName; + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.3__addpdf.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.3__addpdf.sql new file mode 100644 index 0000000000..51189752dd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.3__addpdf.sql @@ -0,0 +1,6 @@ +ALTER TABLE `epmet_gov_voice`.`draft_content` + MODIFY COLUMN `CONTENT_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容类型 图片:img;文字:text;文件:file;' AFTER `CONTENT`, + ADD COLUMN `FILE_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件名称' AFTER `CONTENT_TYPE`; +ALTER TABLE `epmet_gov_voice`.`article_content` + MODIFY COLUMN `CONTENT_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容类型 图片:img;文字:text;文件:file;' AFTER `CONTENT`, + ADD COLUMN `FILE_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件名称' AFTER `CONTENT_TYPE`; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index f4d41ffa88..97be456470 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -25,7 +25,8 @@ - \ No newline at end of file + From e110eda3057ebd7c06995874b42da83af5da5555 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Mar 2021 18:02:39 +0800 Subject: [PATCH 206/234] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B7=BB=E5=8A=A0Pdf=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/DraftContentDetailDTO.java | 7 ++++++- .../src/main/resources/mapper/DraftDao.xml | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java index d468ffb81a..21fce8fd5d 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java @@ -24,10 +24,15 @@ public class DraftContentDetailDTO implements Serializable { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; + /** + * 文件名称 + */ + private String fileName; + /** * 内容序号 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index 823e936884..483c05319e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -28,6 +28,7 @@ dc.ID, dc.CONTENT, dc.CONTENT_TYPE, + dc.FILE_NAME, dc.ORDER_NUM, (case when dc.AUDIT_STATUS is null then "" @@ -190,4 +191,4 @@ where id=#{draftId,jdbcType=VARCHAR} - \ No newline at end of file + From d2f9bdd5cc8f0bae76c9d37b41d51627849cc55a Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 09:11:03 +0800 Subject: [PATCH 207/234] ossController --- .../src/main/java/com/epmet/controller/OssController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 34a94378ec..863ce98a09 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -14,6 +14,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AliyunGroup; @@ -62,6 +63,8 @@ public class OssController { private OssService ossService; @Autowired private ParamsRemoteService paramsRemoteService; + @Autowired + private RedisUtils redisUtils; private final static String KEY = ModuleConstant.CLOUD_STORAGE_CONFIG_KEY; @@ -226,13 +229,14 @@ public class OssController { , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); } if (ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { - // 校验文件体积,不超过2m + // 校验文件体积,不超过5m long maxSize = 5 * 1024 * 1024; long size = file.getSize(); if (size > maxSize) { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } + //todo 获取url 缓存半小时 删除时获取并调用删除方法 } else { // 校验文件体积,不超过2m long maxSize = 2 * 1024 * 1024; From f14d04ba77e4b0e56791393995ac0baafd04228f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 30 Mar 2021 09:50:03 +0800 Subject: [PATCH 208/234] =?UTF-8?q?=E5=A4=A7=E6=A6=82=E6=98=AF=E7=9D=A1?= =?UTF-8?q?=E7=9D=80=E4=BA=86=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dataaggre/service/resigroup/ResiGroupService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java index 1e15dce4fa..0b3b4d1891 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java @@ -1,7 +1,6 @@ package com.epmet.dataaggre.service.resigroup; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; -import org.apache.ibatis.annotations.Param; import java.util.List; @@ -10,5 +9,5 @@ import java.util.List; * @DateTime 2020/12/25 上午9:21 */ public interface ResiGroupService { - List selectTopicInfoByIds(@Param("topicIds") List topicIds); + List selectTopicInfoByIds(List topicIds); } From 40fb288fc0ed60aea81d1ec8afc0985c7afa0965 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 30 Mar 2021 09:58:49 +0800 Subject: [PATCH 209/234] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=AF=B9?= =?UTF-8?q?=E5=A4=96=E5=BC=80=E6=94=BEapi=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=8D=B3=E5=8F=AF=E8=AE=BF=E9=97=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 201573688e..d78d225cda 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -457,6 +457,9 @@ epmet: - /gov/project/** - /resi/home/** - /data/report/** + - /epmet/ext/** + - /data/stats/** + - /data/aggregator/** # 内部认证url白名单(在白名单中的,就不会再校验登录了) internalAuthUrlsWhiteList: From 83c152008fd51ce6bbfcbd032059cb695aead2a1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 10:12:42 +0800 Subject: [PATCH 210/234] =?UTF-8?q?oss=E8=BF=94=E5=9B=9Edomain=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E7=94=A8=E4=BA=8E=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 12 ++++++++++++ .../epmet/dto/result/UploadImgResultDTO.java | 6 ++++++ .../cloud/AbstractCloudStorageService.java | 12 +++++++++++- .../cloud/AliyunCloudStorageService.java | 19 ++++++++++++++++++- .../com/epmet/controller/OssController.java | 11 +++++++++++ .../epmet/service/impl/OssServiceImpl.java | 8 +++++++- 6 files changed, 65 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index faee6de155..716e22a223 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -386,4 +386,16 @@ public class RedisKeys { public static String getResiUserBadgeKey(String customerId, String userId) { return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat(StringUtils.isBlank(userId) ? "*" : userId); } + + /** + * desc: 根据文件路径获取oss 文件缓存key + * + * @param path + * @return java.lang.String + * @author LiuJanJun + * @date 2021/3/30 9:56 上午 + */ + public static String getOssFileKey(String path) { + return rootPrefix.concat("oss:temp:").concat(path); + } } diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java index b93b58bb39..cbd2797bfb 100644 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -12,4 +13,9 @@ import java.io.Serializable; @Data public class UploadImgResultDTO implements Serializable { private String url; + /** + * 域名 + */ + @JsonIgnore + private String domain; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index 0eabc11add..383312c312 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -25,7 +25,17 @@ import java.util.UUID; public abstract class AbstractCloudStorageService { /** 云存储配置信息 */ CloudStorageConfig config; - + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJun + * @date 2021/3/30 10:05 上午 + */ + public String getOssDomain(String privacy){ + return null; + }; /** * 文件路径 * @param prefix 前缀 diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 472609fbcd..6f29e056df 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -36,7 +36,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { * @author wxz * @date 2021.01.04 13:49 */ - private CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) { + public CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) { if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { return config.getAliyun().getInternal(); } else { @@ -44,6 +44,23 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { } } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJun + * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + if (PrivacyType.INTERNAL.equalsIgnoreCase(privacy)) { + return config.getAliyun().getInternal().getAliyunDomain(); + } else { + return config.getAliyun().getExternal().getAliyunDomain(); + } + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 863ce98a09..2673461209 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -11,9 +11,11 @@ package com.epmet.controller; import com.epmet.cloud.CloudStorageConfig; import com.epmet.cloud.OssFactory; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -33,6 +35,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; @@ -246,6 +249,14 @@ public class OssController { , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } } + Result result = ossService.uploadImg(file, null); + if (result != null && result.success() ){ + UploadImgResultDTO data = result.getData(); + if ( data!= null && StringUtils.isNotBlank(data.getUrl())){ + String path = data.getUrl().replace(data.getUrl(), StrConstant.EPMETY_STR); + redisUtils.set(RedisKeys.getOssFileKey(path),path,RedisUtils.MINUTE_THIRTY_EXPIRE); + } + } return ossService.uploadImg(file, null); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 3effd64fb8..5a5a74ba37 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -10,6 +10,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.cloud.AbstractCloudStorageService; import com.epmet.cloud.OssFactory; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; @@ -56,8 +57,11 @@ public class OssServiceImpl extends BaseServiceImpl implement //上传文件 String extension = FilenameUtils.getExtension(file.getOriginalFilename()); String url = null; + String ossDomain = null; try { - url = OssFactory.build().uploadSuffix(file.getBytes(), extension, privacy); + AbstractCloudStorageService storageService = OssFactory.build(); + url = storageService.uploadSuffix(file.getBytes(), extension, privacy); + ossDomain = storageService.getOssDomain(privacy); } catch (IOException e) { e.printStackTrace(); logger.error("图片上传异常"); @@ -67,10 +71,12 @@ public class OssServiceImpl extends BaseServiceImpl implement //保存文件信息 OssEntity ossEntity = new OssEntity(); ossEntity.setUrl(url); + baseDao.insert(ossEntity); //文件信息 UploadImgResultDTO dto = new UploadImgResultDTO(); dto.setUrl(url); + dto.setDomain(ossDomain); return new Result().ok(dto); } From 6b6f0ce09280ed27dd0f022d8f99a5f3758bc700 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 10:26:59 +0800 Subject: [PATCH 211/234] =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=BF=94=E5=9B=9Efilename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/ArticleContentResultDTO.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java index 9b12f89213..38222f8295 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java @@ -15,7 +15,7 @@ public class ArticleContentResultDTO implements Serializable { private static final long serialVersionUID = 2853197212163051558L; /** - * 内容类型(图片:img;文字:text) + * 内容类型(图片:img;文字:text;文件:file) * */ private String contentType; @@ -23,4 +23,9 @@ public class ArticleContentResultDTO implements Serializable { * 内容 * */ private String content; + + /** + * 文件名称 + * */ + private String fileName; } From 4183d436dfb64a5b9f5cce048d94f32bfcbc26bf Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 11:18:43 +0800 Subject: [PATCH 212/234] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=B8=BA=E6=96=87=E4=BB=B6=20=E5=88=99?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=96=87=E4=BB=B6=E5=90=8D=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/exception/EpmetErrorCode.java | 8 +++++--- .../src/main/java/com/epmet/constant/DraftConstant.java | 6 +++++- .../java/com/epmet/service/impl/ArticleServiceImpl.java | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ac6d50bd9f..fb12799b4b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -125,9 +125,11 @@ public enum EpmetErrorCode { // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), - ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"), - REPEATED_SUBMIT_ERROR(8998, "请勿重复提交"), - CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"), + DRAFT_CONTENT_FILENAME_NULL(8802, "附件名称不能为空"), + ARTICLE_PUBLISH_ERROR(8803, "发布文章失败,请刷新重试"), + REPEATED_SUBMIT_ERROR(8804, "请勿重复提交"), + CUSTOMER_VALIDATE_ERROR(8805, "内部数据校验异常"), + CATEGORY_IS_NULL(8806, "请设置分类"), //公众号 865..开头的码 PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"), diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java index 6ee205ec7d..4556654b51 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java @@ -10,7 +10,7 @@ package com.epmet.constant; /** * 常量 - * + * * @author sun * @since 1.0.0 */ @@ -66,6 +66,10 @@ public interface DraftConstant { * 内容类型-文字 */ String TEXT = "text"; + /** + * 内容类型-文件 + */ + String FILE = "file"; /** * 草稿预览内容大小长度 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 5c8ed40e39..e95a7dadf8 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -460,6 +460,9 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Tue, 30 Mar 2021 13:39:38 +0800 Subject: [PATCH 213/234] =?UTF-8?q?=20=E8=AF=84=E4=BB=B7=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=E5=86=85=E8=A2=AB=E5=90=B9=E5=93=A8=E4=B8=94=E8=A2=AB=E5=8A=9E?= =?UTF-8?q?=E7=BB=93=E7=9A=84=E9=A1=B9=E7=9B=AE=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectLogDailyDao.xml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 2db8a97d58..0fe89ad0e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -198,15 +198,22 @@ COUNT(DISTINCT log.PROJECT_ID) AS count FROM fact_origin_project_log_daily log - LEFT JOIN fact_origin_project_main_daily project ON log.PROJECT_ID = project.ID AND project.DEL_FLAG = '0' AND project.CUSTOMER_ID = #{customerId} WHERE log.DEL_FLAG = '0' - AND project.PROJECT_STATUS LIKE 'close%' AND log.CUSTOMER_ID = #{customerId} AND log.IS_ACTIVE = '0' - AND log.MONTH_ID = #{dimId} + AND EXISTS ( + select id from fact_origin_project_log_daily where del_flag = '0' + and customer_id = #{customerId} and month_id = #{dimId} + and action_code like 'close%' + + + AGENCY_ID = #{agencyId} + + ) + log.AGENCY_ID = #{agencyId} From 4845bf3f0311d9e4f07cd61722e74953541f8254 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 14:06:13 +0800 Subject: [PATCH 214/234] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=B8=BA=E6=96=87=E4=BB=B6=20=E5=88=99?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=96=87=E4=BB=B6=E5=90=8D=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/ArticleServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index e95a7dadf8..d00baf70d3 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -460,7 +460,7 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Tue, 30 Mar 2021 14:35:42 +0800 Subject: [PATCH 215/234] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 2 ++ .../gov-voice-server/src/main/resources/mapper/DraftDao.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 201573688e..7d762a9d49 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -457,6 +457,8 @@ epmet: - /gov/project/** - /resi/home/** - /data/report/** + - /gov/voice/** + - /resi/voice/** # 内部认证url白名单(在白名单中的,就不会再校验登录了) internalAuthUrlsWhiteList: diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index 483c05319e..a6675ddb4e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -166,6 +166,7 @@ SELECT dc.CONTENT_TYPE, dc.CONTENT, + dc.FILE_NAME, dc.AUDIT_STATUS, dc.AUDIT_REASON FROM From c0ec3f3a36018c80d95878fc699dda433a8586d8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 14:52:53 +0800 Subject: [PATCH 216/234] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-voice-server/src/main/resources/mapper/ArticleDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 97be456470..924f52a59f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -276,6 +276,7 @@ + From c67d86d16d431cfab72135fde23263b52ab7d8d6 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 30 Mar 2021 15:29:54 +0800 Subject: [PATCH 217/234] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E5=A3=B0=E9=9F=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/RemoveFileFormDTO.java | 16 ++++++++ .../epmet/dto/result/RemoveFileResultDTO.java | 16 ++++++++ .../cloud/AbstractCloudStorageService.java | 9 ++++ .../cloud/AliyunCloudStorageService.java | 15 +++++++ .../cloud/FastDFSCloudStorageService.java | 13 ++++++ .../epmet/cloud/LocalCloudStorageService.java | 13 ++++++ .../cloud/QcloudCloudStorageService.java | 13 ++++++ .../epmet/cloud/QiniuCloudStorageService.java | 13 ++++++ .../com/epmet/controller/OssController.java | 9 ++++ .../src/main/java/com/epmet/dao/OssDao.java | 4 +- .../java/com/epmet/service/OssService.java | 10 +++++ .../epmet/service/impl/OssServiceImpl.java | 41 +++++++++++++++++++ .../src/main/resources/mapper/SysOssDao.xml | 6 +++ 13 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java create mode 100644 epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java new file mode 100644 index 0000000000..7f01fc9936 --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/3/30 9:51 + */ +@Data +public class RemoveFileFormDTO implements Serializable { + private static final long serialVersionUID = 3889369412733647229L; + private String url; +} diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java new file mode 100644 index 0000000000..e8a39a8a96 --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/3/30 9:52 + */ +@Data +public class RemoveFileResultDTO implements Serializable { + private static final long serialVersionUID = 6509372741520843201L; + private Boolean delSuccess; +} diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index 383312c312..8cd699e5e9 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -107,4 +107,13 @@ public abstract class AbstractCloudStorageService { */ public abstract void down(String privacyType) throws IOException; + /** + * 文件删除 + * @author zhaoqifeng + * @date 2021/3/30 11:05 + * @param objectName + * @return boolean + */ + public abstract boolean delete(String objectName); + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 6f29e056df..c8d30d1c7d 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -81,6 +81,21 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { return props.getAliyunDomain() + "/" + path; } + @Override + public boolean delete(String objectName) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(null); + OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + props.getAliyunAccessKeySecret()); + try { + client.deleteObject(props.getAliyunBucketName(), props.getAliyunPrefix() + objectName); + client.shutdown(); + } catch (Exception e){ + return false; + } + + return true; + } + @Override public String uploadSuffix(byte[] data, String suffix, String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java index b5493c02b2..41ceb4024e 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java @@ -65,4 +65,17 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService { public void down(String privacyType) throws IOException { } + + /** + * 文件删除 + * + * @param objectName + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 11:05 + */ + @Override + public boolean delete(String objectName) { + return false; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java index 8143edaa0b..76968ff118 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java @@ -58,4 +58,17 @@ public class LocalCloudStorageService extends AbstractCloudStorageService { public void down(String privacyType) throws IOException { } + + /** + * 文件删除 + * + * @param objectName + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 11:05 + */ + @Override + public boolean delete(String objectName) { + return false; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java index 80c5e494f4..5b91aa84c0 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java @@ -88,4 +88,17 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService { public void down(String privacyType) throws IOException { } + + /** + * 文件删除 + * + * @param objectName + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 11:05 + */ + @Override + public boolean delete(String objectName) { + return false; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java index 16515203dd..3b2035c89e 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java @@ -82,4 +82,17 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService { public void down(String privacyType) throws IOException { } + + /** + * 文件删除 + * + * @param objectName + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 11:05 + */ + @Override + public boolean delete(String objectName) { + return false; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 2673461209..53c8befb84 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -23,6 +23,8 @@ import com.epmet.commons.tools.validator.group.AliyunGroup; import com.epmet.commons.tools.validator.group.QcloudGroup; import com.epmet.commons.tools.validator.group.QiniuGroup; import com.epmet.dto.UploadDTO; +import com.epmet.dto.form.RemoveFileFormDTO; +import com.epmet.dto.result.RemoveFileResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; import com.epmet.enums.OssTypeEnum; @@ -354,4 +356,11 @@ public class OssController { return ossService.uploadVoice(file); } + @PostMapping("article/remove/file") + public Result articleRemoveFile(@RequestBody RemoveFileFormDTO formDTO) { + RemoveFileResultDTO resultDTO = new RemoveFileResultDTO(); + resultDTO.setDelSuccess(ossService.articleRemoveFile(formDTO)); + return new Result().ok(resultDTO); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java index 79f8b14823..0be20abd16 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java @@ -11,6 +11,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.OssEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文件上传 @@ -19,5 +20,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface OssDao extends BaseDao { - + OssEntity selectByUrl(@Param("url") String url); + void deleteDataById(@Param("id") String id); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java index 3253f78527..4f4171df0e 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java @@ -11,6 +11,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.RemoveFileFormDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; import org.springframework.web.multipart.MultipartFile; @@ -35,4 +36,13 @@ public interface OssService extends BaseService { Result uploadVariedFile(MultipartFile file); Result uploadVoice(MultipartFile file); + + /** + * 删除附件 + * @author zhaoqifeng + * @date 2021/3/30 9:55 + * @param formDTO + * @return boolean + */ + boolean articleRemoveFile(RemoveFileFormDTO formDTO); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 5a5a74ba37..f1f236e7e6 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -14,11 +14,16 @@ import com.epmet.cloud.AbstractCloudStorageService; import com.epmet.cloud.OssFactory; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constants.PrivacyType; import com.epmet.dao.OssDao; +import com.epmet.dto.form.RemoveFileFormDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; import com.epmet.exception.ModuleErrorCode; @@ -26,15 +31,22 @@ import com.epmet.service.OssService; import org.apache.commons.io.FilenameUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.util.Date; import java.util.Map; +import java.util.Objects; @Service public class OssServiceImpl extends BaseServiceImpl implements OssService { private static final Logger logger = LoggerFactory.getLogger(OssServiceImpl.class); + + @Autowired + private RedisUtils redisUtils; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -161,6 +173,7 @@ public class OssServiceImpl extends BaseServiceImpl implement } //保存文件信息 OssEntity ossEntity = new OssEntity(); + ossEntity.setUrl(url); baseDao.insert(ossEntity); //文件信息 @@ -169,4 +182,32 @@ public class OssServiceImpl extends BaseServiceImpl implement return new Result().ok(dto); } + /** + * 删除附件 + * + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 9:55 + * @param formDTO + */ + @Override + public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { + String[] strings = formDTO.getUrl().split(StrConstant.SEPARATOR); + String fileName = strings[strings.length - 1]; + OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); + long thirty = 30*60*1000; + Date now = new Date(); + long time = now.getTime() - entity.getCreatedTime().getTime(); + if (time > thirty) { + return false; + } + baseDao.deleteDataById(entity.getId()); + String dateStr = DateUtils.format(entity.getCreatedTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; + String key = RedisKeys.getOssFileKey(formDTO.getUrl()); + redisUtils.delete(key); + return Objects.requireNonNull(OssFactory.build()).delete(fileName); + } + + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml index 2531640cb1..a7489f514b 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml @@ -2,5 +2,11 @@ + + delete from sys_oss where id = #{id} + + From bb2238013cccd0e3e1a6d789d9641dc0c8f23ff9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 15:50:53 +0800 Subject: [PATCH 218/234] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/DraftContentDao.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml index 906a248e3c..cd90573da5 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml @@ -9,6 +9,7 @@ CUSTOMER_ID, CONTENT, CONTENT_TYPE, + FILE_NAME, AUDIT_STATUS, AUDIT_REASON, ORDER_NUM @@ -28,7 +29,8 @@ SELECT ID, CONTENT, - CONTENT_TYPE + CONTENT_TYPE, + FILE_NAME FROM DRAFT_CONTENT WHERE @@ -41,4 +43,4 @@ DELETE FROM draft_content WHERE DRAFT_ID = #{draftId,jdbcType=VARCHAR} - \ No newline at end of file + From 33c23917987f59906878455323ab3d6db2686df3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 15:52:12 +0800 Subject: [PATCH 219/234] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/cloud/AbstractCloudStorageService.java | 2 +- .../main/java/com/epmet/cloud/AliyunCloudStorageService.java | 4 ++-- .../src/main/java/com/epmet/service/impl/OssServiceImpl.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index 8cd699e5e9..74a38551d0 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -114,6 +114,6 @@ public abstract class AbstractCloudStorageService { * @param objectName * @return boolean */ - public abstract boolean delete(String objectName); + public abstract boolean delete(String objectName, String privacyType); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index c8d30d1c7d..4938319ecd 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -82,8 +82,8 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { } @Override - public boolean delete(String objectName) { - CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(null); + public boolean delete(String objectName,String privacyType) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), props.getAliyunAccessKeySecret()); try { diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index f1f236e7e6..8cced9932a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -206,7 +206,7 @@ public class OssServiceImpl extends BaseServiceImpl implement fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; String key = RedisKeys.getOssFileKey(formDTO.getUrl()); redisUtils.delete(key); - return Objects.requireNonNull(OssFactory.build()).delete(fileName); + return Objects.requireNonNull(OssFactory.build()).delete(fileName,null); } From 7a28485378ccbaa75e00c199ec3ea41d4025c0b1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 16:03:22 +0800 Subject: [PATCH 220/234] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/cloud/FastDFSCloudStorageService.java | 3 ++- .../main/java/com/epmet/cloud/LocalCloudStorageService.java | 3 ++- .../main/java/com/epmet/cloud/QcloudCloudStorageService.java | 3 ++- .../main/java/com/epmet/cloud/QiniuCloudStorageService.java | 3 ++- .../src/main/java/com/epmet/service/impl/OssServiceImpl.java | 3 +++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java index 41ceb4024e..08a591e86d 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java @@ -70,12 +70,13 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService { * 文件删除 * * @param objectName + * @param privacyType * @return boolean * @author zhaoqifeng * @date 2021/3/30 11:05 */ @Override - public boolean delete(String objectName) { + public boolean delete(String objectName, String privacyType) { return false; } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java index 76968ff118..7317bbd780 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java @@ -63,12 +63,13 @@ public class LocalCloudStorageService extends AbstractCloudStorageService { * 文件删除 * * @param objectName + * @param privacyType * @return boolean * @author zhaoqifeng * @date 2021/3/30 11:05 */ @Override - public boolean delete(String objectName) { + public boolean delete(String objectName, String privacyType) { return false; } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java index 5b91aa84c0..5d657ba318 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java @@ -93,12 +93,13 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService { * 文件删除 * * @param objectName + * @param privacyType * @return boolean * @author zhaoqifeng * @date 2021/3/30 11:05 */ @Override - public boolean delete(String objectName) { + public boolean delete(String objectName, String privacyType) { return false; } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java index 3b2035c89e..2fe73cddeb 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java @@ -87,12 +87,13 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService { * 文件删除 * * @param objectName + * @param privacyType * @return boolean * @author zhaoqifeng * @date 2021/3/30 11:05 */ @Override - public boolean delete(String objectName) { + public boolean delete(String objectName, String privacyType) { return false; } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 8cced9932a..03e30b4da3 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -8,6 +8,7 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.cloud.AbstractCloudStorageService; @@ -192,6 +193,7 @@ public class OssServiceImpl extends BaseServiceImpl implement */ @Override public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { + logger.info("articleRemoveFile param:{}", JSON.toJSONString(formDTO)); String[] strings = formDTO.getUrl().split(StrConstant.SEPARATOR); String fileName = strings[strings.length - 1]; OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); @@ -206,6 +208,7 @@ public class OssServiceImpl extends BaseServiceImpl implement fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; String key = RedisKeys.getOssFileKey(formDTO.getUrl()); redisUtils.delete(key); + logger.info("articleRemoveFile oss delete fileName:{}", JSON.toJSONString(fileName)); return Objects.requireNonNull(OssFactory.build()).delete(fileName,null); } From 366ee1edfdaa64127b535b5e3acd8e0e45ff312a Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 17:02:07 +0800 Subject: [PATCH 221/234] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=20=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 --- .../epmet/dto/result/RemoveFileResultDTO.java | 16 --------- .../cloud/AliyunCloudStorageService.java | 2 +- .../com/epmet/controller/OssController.java | 13 ++++---- .../epmet/service/impl/OssServiceImpl.java | 33 +++++++++---------- 4 files changed, 23 insertions(+), 41 deletions(-) delete mode 100644 epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java deleted file mode 100644 index e8a39a8a96..0000000000 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @author zhaoqifeng - * @dscription - * @date 2021/3/30 9:52 - */ -@Data -public class RemoveFileResultDTO implements Serializable { - private static final long serialVersionUID = 6509372741520843201L; - private Boolean delSuccess; -} diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 4938319ecd..151e70f979 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -87,7 +87,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), props.getAliyunAccessKeySecret()); try { - client.deleteObject(props.getAliyunBucketName(), props.getAliyunPrefix() + objectName); + client.deleteObject(props.getAliyunBucketName(), objectName); client.shutdown(); } catch (Exception e){ return false; diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 53c8befb84..be8513438e 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -24,7 +24,6 @@ import com.epmet.commons.tools.validator.group.QcloudGroup; import com.epmet.commons.tools.validator.group.QiniuGroup; import com.epmet.dto.UploadDTO; import com.epmet.dto.form.RemoveFileFormDTO; -import com.epmet.dto.result.RemoveFileResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; import com.epmet.enums.OssTypeEnum; @@ -241,7 +240,6 @@ public class OssController { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } - //todo 获取url 缓存半小时 删除时获取并调用删除方法 } else { // 校验文件体积,不超过2m long maxSize = 2 * 1024 * 1024; @@ -255,7 +253,10 @@ public class OssController { if (result != null && result.success() ){ UploadImgResultDTO data = result.getData(); if ( data!= null && StringUtils.isNotBlank(data.getUrl())){ - String path = data.getUrl().replace(data.getUrl(), StrConstant.EPMETY_STR); + String path = data.getUrl().replace(data.getDomain(), StrConstant.EPMETY_STR); + if (path.startsWith(StrConstant.SEPARATOR)){ + path = path.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); + } redisUtils.set(RedisKeys.getOssFileKey(path),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } @@ -357,10 +358,8 @@ public class OssController { } @PostMapping("article/remove/file") - public Result articleRemoveFile(@RequestBody RemoveFileFormDTO formDTO) { - RemoveFileResultDTO resultDTO = new RemoveFileResultDTO(); - resultDTO.setDelSuccess(ossService.articleRemoveFile(formDTO)); - return new Result().ok(resultDTO); + public Result articleRemoveFile(@RequestBody RemoveFileFormDTO formDTO) { + return new Result().ok(ossService.articleRemoveFile(formDTO)); } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 03e30b4da3..83eeb2949d 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -20,7 +20,6 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constants.PrivacyType; import com.epmet.dao.OssDao; @@ -37,9 +36,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; -import java.util.Date; import java.util.Map; -import java.util.Objects; @Service public class OssServiceImpl extends BaseServiceImpl implements OssService { @@ -194,22 +191,24 @@ public class OssServiceImpl extends BaseServiceImpl implement @Override public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { logger.info("articleRemoveFile param:{}", JSON.toJSONString(formDTO)); - String[] strings = formDTO.getUrl().split(StrConstant.SEPARATOR); - String fileName = strings[strings.length - 1]; + AbstractCloudStorageService build = OssFactory.build(); + String ossDomain = build.getOssDomain(null); + String fileName = formDTO.getUrl().replace(ossDomain, StrConstant.EPMETY_STR); + if (fileName.startsWith(StrConstant.SEPARATOR)){ + fileName = fileName.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); + } + String key = RedisKeys.getOssFileKey(fileName); + Object o = redisUtils.get(key); + if (o == null){ + //return false; + } + logger.info("articleRemoveFile oss delete fileName:{}", fileName); + OssFactory.build().delete(fileName,null); OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); - long thirty = 30*60*1000; - Date now = new Date(); - long time = now.getTime() - entity.getCreatedTime().getTime(); - if (time > thirty) { - return false; + if (entity != null){ + baseDao.deleteDataById(entity.getId()); } - baseDao.deleteDataById(entity.getId()); - String dateStr = DateUtils.format(entity.getCreatedTime(), DateUtils.DATE_PATTERN_YYYYMMDD); - fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; - String key = RedisKeys.getOssFileKey(formDTO.getUrl()); - redisUtils.delete(key); - logger.info("articleRemoveFile oss delete fileName:{}", JSON.toJSONString(fileName)); - return Objects.requireNonNull(OssFactory.build()).delete(fileName,null); + return true; } From bdcb8947dd6e23af8aec9ffb37ce458d9790550e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 17:13:40 +0800 Subject: [PATCH 222/234] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=20=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 --- .../com/epmet/controller/OssController.java | 3 ++- .../com/epmet/service/impl/OssServiceImpl.java | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index be8513438e..8a52849edf 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -257,7 +257,8 @@ public class OssController { if (path.startsWith(StrConstant.SEPARATOR)){ path = path.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); } - redisUtils.set(RedisKeys.getOssFileKey(path),path,RedisUtils.MINUTE_THIRTY_EXPIRE); + String fileName = data.getUrl().substring(data.getUrl().lastIndexOf(StrConstant.SEPARATOR)); + redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } return ossService.uploadImg(file, null); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 83eeb2949d..21c82039e4 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.entity.OssEntity; import com.epmet.exception.ModuleErrorCode; import com.epmet.service.OssService; import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -191,17 +192,23 @@ public class OssServiceImpl extends BaseServiceImpl implement @Override public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { logger.info("articleRemoveFile param:{}", JSON.toJSONString(formDTO)); + if (StringUtils.isBlank(formDTO.getUrl())){ + logger.warn("articleRemoveFile param is empty"); + return false; + } + String key = RedisKeys.getOssFileKey(formDTO.getUrl().substring(formDTO.getUrl().lastIndexOf(StrConstant.SEPARATOR))); + Object o = redisUtils.get(key); + if (o == null){ + return false; + } + redisUtils.delete(key); AbstractCloudStorageService build = OssFactory.build(); String ossDomain = build.getOssDomain(null); String fileName = formDTO.getUrl().replace(ossDomain, StrConstant.EPMETY_STR); if (fileName.startsWith(StrConstant.SEPARATOR)){ fileName = fileName.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); } - String key = RedisKeys.getOssFileKey(fileName); - Object o = redisUtils.get(key); - if (o == null){ - //return false; - } + logger.info("articleRemoveFile oss delete fileName:{}", fileName); OssFactory.build().delete(fileName,null); OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); From 78bcaea9e6b76f9d761fd55abfb13824722e041e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 17:20:44 +0800 Subject: [PATCH 223/234] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=20=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 --- .../src/main/java/com/epmet/controller/OssController.java | 2 +- .../src/main/java/com/epmet/service/impl/OssServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 8a52849edf..72f934756d 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -257,7 +257,7 @@ public class OssController { if (path.startsWith(StrConstant.SEPARATOR)){ path = path.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); } - String fileName = data.getUrl().substring(data.getUrl().lastIndexOf(StrConstant.SEPARATOR)); + String fileName = data.getUrl().substring(data.getUrl().lastIndexOf(StrConstant.SEPARATOR)+1); redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 21c82039e4..ce0928f3e9 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -196,7 +196,7 @@ public class OssServiceImpl extends BaseServiceImpl implement logger.warn("articleRemoveFile param is empty"); return false; } - String key = RedisKeys.getOssFileKey(formDTO.getUrl().substring(formDTO.getUrl().lastIndexOf(StrConstant.SEPARATOR))); + String key = RedisKeys.getOssFileKey(formDTO.getUrl().substring(formDTO.getUrl().lastIndexOf(StrConstant.SEPARATOR) +1)); Object o = redisUtils.get(key); if (o == null){ return false; From fee3efa95c0f370ee8faa48891e39f3342a0d767 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 17:36:09 +0800 Subject: [PATCH 224/234] =?UTF-8?q?oss=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/OssController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 72f934756d..7410f81b6a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -261,7 +261,7 @@ public class OssController { redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } - return ossService.uploadImg(file, null); + return result; } From 63725e21cfdb553128b9bc6d6b4b8073d7bc2d59 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 09:31:32 +0800 Subject: [PATCH 225/234] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/GovLoginServiceImpl.java | 2 +- .../com/epmet/service/impl/ThirdLoginServiceImpl.java | 2 +- .../main/java/com/epmet/service/impl/OssServiceImpl.java | 8 +------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index ee60b3c22f..88f9f1a5a2 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -362,7 +362,7 @@ public class GovLoginServiceImpl implements GovLoginService { } //密码错误 if(!passwordRightFlag){ - logger.error(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile())); + logger.warn(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile())); throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode()); } StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO(); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index d1cc70552e..4363556cf9 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -484,7 +484,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { } //密码错误 if(!passwordRightFlag){ - logger.error(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile())); + logger.warn(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile())); throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode()); } StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO(); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index ce0928f3e9..f112dc69b1 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -202,13 +202,7 @@ public class OssServiceImpl extends BaseServiceImpl implement return false; } redisUtils.delete(key); - AbstractCloudStorageService build = OssFactory.build(); - String ossDomain = build.getOssDomain(null); - String fileName = formDTO.getUrl().replace(ossDomain, StrConstant.EPMETY_STR); - if (fileName.startsWith(StrConstant.SEPARATOR)){ - fileName = fileName.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); - } - + String fileName = (String) o; logger.info("articleRemoveFile oss delete fileName:{}", fileName); OssFactory.build().delete(fileName,null); OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); From 86caa3708e74ea47624d9330ee82434b1eba5470 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 13:39:43 +0800 Subject: [PATCH 226/234] =?UTF-8?q?oss=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cloud/AliyunCloudStorageService.java | 38 +++++++++++++++++-- .../main/java/com/epmet/cloud/OssFactory.java | 31 +++++++-------- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 151e70f979..1a2864d6e1 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -26,16 +26,47 @@ import java.io.InputStream; */ public class AliyunCloudStorageService extends AbstractCloudStorageService { + private OSSClient internalClient = null; + private OSSClient externalClient = null; + + { + + } + public AliyunCloudStorageService(CloudStorageConfig config){ this.config = config; } /** - * @Description 根据隐私类型获取属性。传递internal的时候会返回内部的,否则返回外部的,即公开的 + * @Description 根据隐私类型获取属性。获取client * @return * @author wxz * @date 2021.01.04 13:49 */ + public OSSClient getOssClient(String privacyType) { + if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { + if (internalClient == null){ + CloudStorageConfig.AliyunCloudStorageConfigProps props = config.getAliyun().getInternal(); + internalClient = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + props.getAliyunAccessKeySecret()); + } + return internalClient; + } else { + if (externalClient == null) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = config.getAliyun().getExternal(); + externalClient = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + props.getAliyunAccessKeySecret()); + } + return externalClient; + } + } + + /** + * @Description 根据隐私类型获取属性。传递internal的时候会返回内部的,否则返回外部的,即公开的 + * @return + * @author wxz + * @date 2021.01.04 13:49 + */ public CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) { if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { return config.getAliyun().getInternal(); @@ -69,11 +100,10 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public String upload(InputStream inputStream, String path, String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), - props.getAliyunAccessKeySecret()); + OSSClient client = getOssClient(privacyType); try { client.putObject(props.getAliyunBucketName(), path, inputStream); - client.shutdown(); + //client.shutdown(); } catch (Exception e){ throw new RenException(ModuleErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java index 7febe43644..3d69543784 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java @@ -20,28 +20,29 @@ import com.epmet.utils.ModuleConstant; */ public final class OssFactory { private static ParamsRemoteService paramsRemoteService; + private static AbstractCloudStorageService abstractCloudStorageService; static { OssFactory.paramsRemoteService = SpringContextUtils.getBean(ParamsRemoteService.class); } public static AbstractCloudStorageService build(){ - //获取云存储配置信息 - CloudStorageConfig config = paramsRemoteService.getValueObject(ModuleConstant.CLOUD_STORAGE_CONFIG_KEY, CloudStorageConfig.class); - - if(config.getType() == OssTypeEnum.QINIU.value()){ - return new QiniuCloudStorageService(config); - }else if(config.getType() == OssTypeEnum.ALIYUN.value()){ - return new AliyunCloudStorageService(config); - }else if(config.getType() == OssTypeEnum.QCLOUD.value()){ - return new QcloudCloudStorageService(config); - }else if(config.getType() == OssTypeEnum.FASTDFS.value()){ - return new FastDFSCloudStorageService(config); - }else if(config.getType() == OssTypeEnum.LOCAL.value()){ - return new LocalCloudStorageService(config); + if (abstractCloudStorageService == null){ + //获取云存储配置信息 + CloudStorageConfig config = paramsRemoteService.getValueObject(ModuleConstant.CLOUD_STORAGE_CONFIG_KEY, CloudStorageConfig.class); + if(config.getType() == OssTypeEnum.QINIU.value()){ + abstractCloudStorageService = new QiniuCloudStorageService(config); + }else if(config.getType() == OssTypeEnum.ALIYUN.value()){ + abstractCloudStorageService = new AliyunCloudStorageService(config); + }else if(config.getType() == OssTypeEnum.QCLOUD.value()){ + abstractCloudStorageService = new QcloudCloudStorageService(config); + }else if(config.getType() == OssTypeEnum.FASTDFS.value()){ + abstractCloudStorageService = new FastDFSCloudStorageService(config); + }else if(config.getType() == OssTypeEnum.LOCAL.value()){ + abstractCloudStorageService = new LocalCloudStorageService(config); + } } - - return null; + return abstractCloudStorageService; } } From d655c70fa0e26dbd83b0b57fa76e45a249efb49e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 13:42:02 +0800 Subject: [PATCH 227/234] =?UTF-8?q?oss=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/cloud/AliyunCloudStorageService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 1a2864d6e1..53a49f0034 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -114,8 +114,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public boolean delete(String objectName,String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), - props.getAliyunAccessKeySecret()); + OSSClient client = getOssClient(privacyType); try { client.deleteObject(props.getAliyunBucketName(), objectName); client.shutdown(); @@ -141,8 +140,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public void down(String privacyType) throws IOException { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), - props.getAliyunAccessKeySecret()); + OSSClient client = getOssClient(privacyType); try { /* From f903f933681a9ac930dfa2ff9c4c7f55e6bef0af Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 31 Mar 2021 14:36:27 +0800 Subject: [PATCH 228/234] =?UTF-8?q?/epmet/ext/user/userinfo=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=97=A5=E5=BF=97=E9=99=8D=E7=BA=A7=EF=BC=8C=E4=B8=94?= =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/UserBaseInfoServiceImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 852ca55843..e779487861 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -383,11 +383,10 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl govOrgResult = govOrgOpenFeignClient.userInfoExt(result); - if(govOrgResult.success() && null != govOrgResult.getData()){ - return govOrgResult.getData();} - + if (govOrgResult.success() && null != govOrgResult.getData()) { + return govOrgResult.getData(); + } return result; } } From a4a1790ff52e6a150d171edd3cb4efd75ff0d631 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 14:41:30 +0800 Subject: [PATCH 229/234] =?UTF-8?q?oss=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/cloud/AliyunCloudStorageService.java | 4 ++-- .../main/java/com/epmet/controller/OssController.java | 7 +++---- .../main/java/com/epmet/service/impl/OssServiceImpl.java | 9 +++------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 53a49f0034..d270023543 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -117,7 +117,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { OSSClient client = getOssClient(privacyType); try { client.deleteObject(props.getAliyunBucketName(), objectName); - client.shutdown(); + //client.shutdown(); } catch (Exception e){ return false; } @@ -178,7 +178,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { downloadRes.getObjectMetadata(); // 关闭OSSClient。 - client.shutdown(); + //client.shutdown(); } catch (Exception e){ throw new RenException(ModuleErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); } catch (Throwable throwable) { diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 7410f81b6a..04889584db 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -232,18 +232,17 @@ public class OssController { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); } + long size = file.getSize(); if (ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { - // 校验文件体积,不超过5m + // 校验文件大小,不超过5m long maxSize = 5 * 1024 * 1024; - long size = file.getSize(); if (size > maxSize) { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } } else { - // 校验文件体积,不超过2m + // 校验文件大小,不超过2m long maxSize = 2 * 1024 * 1024; - long size = file.getSize(); if (size > maxSize) { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index f112dc69b1..eb38a6520a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -74,8 +74,7 @@ public class OssServiceImpl extends BaseServiceImpl implement url = storageService.uploadSuffix(file.getBytes(), extension, privacy); ossDomain = storageService.getOssDomain(privacy); } catch (IOException e) { - e.printStackTrace(); - logger.error("图片上传异常"); + logger.error("图片上传异常", e); throw new RenException("图片上传异常"); } @@ -134,8 +133,7 @@ public class OssServiceImpl extends BaseServiceImpl implement try { url = OssFactory.build().uploadSuffix(file.getBytes(), extension, PrivacyType.INTERNAL); } catch (IOException e) { - e.printStackTrace(); - logger.error("文件上传异常"); + logger.error("文件上传异常", e); throw new RenException("文件上传异常"); } //保存文件信息 @@ -165,8 +163,7 @@ public class OssServiceImpl extends BaseServiceImpl implement try { url = OssFactory.build().uploadSuffix(file.getBytes(), extension, null); } catch (IOException e) { - e.printStackTrace(); - logger.error("语音上传异常"); + logger.error("语音上传异常", e); throw new RenException("语音上传异常"); } From ff8bea4200738e2167cbdf1ccf16b5d163e8dd05 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 15:10:49 +0800 Subject: [PATCH 230/234] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/SysDeptController.java | 4 - .../controller/SysDictDataController.java | 4 - .../controller/SysDictTypeController.java | 4 - .../controller/SysLogErrorController.java | 2 - .../controller/SysLogLoginController.java | 2 - .../controller/SysLogOperationController.java | 2 - .../epmet/controller/SysMenuController.java | 4 - .../epmet/controller/SysParamsController.java | 5 - .../epmet/controller/SysRegionController.java | 10 +- .../epmet/controller/SysRoleController.java | 4 - .../epmet/controller/SysUserController.java | 6 - .../main/java/com/epmet/log/LogConsumer.java | 95 ----------- .../epmet/service/impl/AuthServiceImpl.java | 8 - .../tools/annotation/LogOperation.java | 24 --- .../commons/tools/aop/NoRepeatSubmitAop.java | 13 +- .../tools/aspect/LogOperationAspect.java | 121 -------------- .../tools/exception/RenExceptionHandler.java | 153 ------------------ .../tools/log/producer/LogProducer.java | 43 ----- .../epmet/commons/tools/redis/RedisKeys.java | 7 - .../epmet/controller/ActModelController.java | 6 - .../controller/ActProcessController.java | 6 - .../controller/ActRunningController.java | 4 - .../epmet/controller/ActTaskController.java | 2 - .../demo/controller/CorrectionController.java | 5 - .../controller/ScheduleJobController.java | 19 +-- .../controller/MailTemplateController.java | 1 - .../com/epmet/controller/OssController.java | 2 + .../epmet/service/impl/OssServiceImpl.java | 7 + 28 files changed, 20 insertions(+), 543 deletions(-) delete mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java delete mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java delete mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java delete mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java delete mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java index 62374c4bb9..49f4889c29 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysDeptDTO; import com.epmet.service.SysDeptService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -56,7 +55,6 @@ public class SysDeptController { @PostMapping @ApiOperation("保存") - @LogOperation("Save Dept") public Result save(@RequestBody SysDeptDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -68,7 +66,6 @@ public class SysDeptController { @PutMapping @ApiOperation("修改") - @LogOperation("Update Dept") public Result update(@RequestBody SysDeptDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -80,7 +77,6 @@ public class SysDeptController { @DeleteMapping("{id}") @ApiOperation("删除") - @LogOperation("Delete Dept") public Result delete(@PathVariable("id") Long id){ //效验数据 AssertUtils.isNull(id, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java index c136a05cde..005c205f46 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysDictDataDTO; import com.epmet.service.SysDictDataService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -67,7 +66,6 @@ public class SysDictDataController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") public Result save(@RequestBody SysDictDataDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, DefaultGroup.class); @@ -79,7 +77,6 @@ public class SysDictDataController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") public Result update(@RequestBody SysDictDataDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -91,7 +88,6 @@ public class SysDictDataController { @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java index 9d54f1e138..f6289329ab 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysDictTypeDTO; import com.epmet.service.SysDictTypeService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -69,7 +68,6 @@ public class SysDictTypeController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") public Result save(@RequestBody SysDictTypeDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, DefaultGroup.class); @@ -81,7 +79,6 @@ public class SysDictTypeController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") public Result update(@RequestBody SysDictTypeDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -93,7 +90,6 @@ public class SysDictTypeController { @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java index e6260f7fd4..a000b0bebd 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysLogErrorDTO; import com.epmet.service.SysLogErrorService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -59,7 +58,6 @@ public class SysLogErrorController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export Log Error") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = sysLogErrorService.list(params); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java index 6df2a4ca9b..e503be46c2 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysLogLoginDTO; import com.epmet.service.SysLogLoginService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -60,7 +59,6 @@ public class SysLogLoginController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export Log Login") @ApiImplicitParams({ @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功 2:账号已锁定", paramType = "query", dataType="int"), @ApiImplicitParam(name = "creatorName", value = "用户名", paramType = "query", dataType="String") diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java index 85ec7cd34f..429375ffb4 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysLogOperationDTO; import com.epmet.service.SysLogOperationService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -63,7 +62,6 @@ public class SysLogOperationController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export Log Operation") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = sysLogOperationService.list(params); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java index 90c1ca5d63..2b60b0b25c 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java @@ -12,7 +12,6 @@ import com.epmet.dto.MenuResourceDTO; import com.epmet.dto.SysMenuDTO; import com.epmet.service.SysMenuService; import com.epmet.service.SysResourceService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.security.user.UserDetail; import com.epmet.commons.tools.utils.Result; @@ -83,7 +82,6 @@ public class SysMenuController { @PostMapping @ApiOperation("保存") - @LogOperation("Save Menu") public Result save(@RequestBody SysMenuDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, DefaultGroup.class); @@ -95,7 +93,6 @@ public class SysMenuController { @PutMapping @ApiOperation("修改") - @LogOperation("Update Menu") public Result update(@RequestBody SysMenuDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, DefaultGroup.class); @@ -107,7 +104,6 @@ public class SysMenuController { @DeleteMapping("{id}") @ApiOperation("删除") - @LogOperation("Delete Menu") public Result delete(@PathVariable("id") Long id){ //效验数据 AssertUtils.isNull(id, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java index 0185e12b0e..419d168392 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysParamsDTO; import com.epmet.service.SysParamsService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -72,7 +71,6 @@ public class SysParamsController { @PostMapping @ApiOperation("保存") - @LogOperation("Save Params") public Result save(@RequestBody SysParamsDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -84,7 +82,6 @@ public class SysParamsController { @PutMapping @ApiOperation("修改") - @LogOperation("Update Params") public Result update(@RequestBody SysParamsDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -96,7 +93,6 @@ public class SysParamsController { @DeleteMapping @ApiOperation("删除") - @LogOperation("Delete Params") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -108,7 +104,6 @@ public class SysParamsController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export Params") @ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = sysParamsService.list(params); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java index c3bc399a57..b61c522004 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java @@ -11,7 +11,6 @@ package com.epmet.controller; import com.epmet.dto.SysRegionDTO; import com.epmet.dto.region.RegionProvince; import com.epmet.service.SysRegionService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; @@ -71,8 +70,7 @@ public class SysRegionController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") - public Result save(@RequestBody SysRegionDTO dto){ + public Result save(@RequestBody SysRegionDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -83,8 +81,7 @@ public class SysRegionController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") - public Result update(@RequestBody SysRegionDTO dto){ + public Result update(@RequestBody SysRegionDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -95,8 +92,7 @@ public class SysRegionController { @DeleteMapping("{id}") @ApiOperation("删除") - @LogOperation("删除") - public Result delete(@PathVariable("id") Long id){ + public Result delete(@PathVariable("id") Long id){ //效验数据 AssertUtils.isNull(id, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java index 67be9b29c9..6093e3ec4e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysRoleDTO; import com.epmet.service.SysRoleService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -94,7 +93,6 @@ public class SysRoleController { @PostMapping @ApiOperation("保存") - @LogOperation("Save Role") public Result save(@RequestBody SysRoleDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -106,7 +104,6 @@ public class SysRoleController { @PutMapping @ApiOperation("修改") - @LogOperation("Update Role") public Result update(@RequestBody SysRoleDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -118,7 +115,6 @@ public class SysRoleController { @DeleteMapping @ApiOperation("删除") - @LogOperation("Delete Role") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java index 6618195db8..a7f9fb9eef 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java @@ -13,7 +13,6 @@ import com.epmet.dto.PasswordDTO; import com.epmet.dto.SysUserDTO; import com.epmet.service.SysResourceService; import com.epmet.service.SysUserService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; @@ -98,7 +97,6 @@ public class SysUserController { @PostMapping @ApiOperation("保存") - @LogOperation("Save User") public Result save(@RequestBody SysUserDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -110,7 +108,6 @@ public class SysUserController { @PutMapping @ApiOperation("修改") - @LogOperation("Update User") public Result update(@RequestBody SysUserDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -122,7 +119,6 @@ public class SysUserController { @PutMapping("password") @ApiOperation("修改密码") - @LogOperation("Password User") public Result password(@RequestBody PasswordDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto); @@ -141,7 +137,6 @@ public class SysUserController { @DeleteMapping @ApiOperation("删除") - @LogOperation("Delete User") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -153,7 +148,6 @@ public class SysUserController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export User") @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType="String") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = sysUserService.list(params); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java deleted file mode 100644 index 67f6f8d051..0000000000 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.log; - -import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.log.BaseLog; -import com.epmet.commons.tools.log.enums.LogTypeEnum; -import com.epmet.commons.tools.redis.RedisKeys; -import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.entity.SysLogErrorEntity; -import com.epmet.entity.SysLogLoginEntity; -import com.epmet.entity.SysLogOperationEntity; -import com.epmet.service.SysLogErrorService; -import com.epmet.service.SysLogLoginService; -import com.epmet.service.SysLogOperationService; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.CommandLineRunner; -import org.springframework.stereotype.Component; - -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * 从Redis队列中获取Log,保存到DB - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Slf4j -@Component -public class LogConsumer implements CommandLineRunner { - @Autowired - private RedisUtils redisUtils; - @Autowired - private SysLogErrorService sysLogErrorService; - @Autowired - private SysLogLoginService sysLogLoginService; - @Autowired - private SysLogOperationService sysLogOperationService; - private ScheduledExecutorService scheduledService = new ScheduledThreadPoolExecutor(1, - new BasicThreadFactory.Builder().namingPattern("log-consumer-schedule-pool-%d").daemon(true).build()); - - @Override - public void run(String... args) { - //上次任务结束后,等待10秒钟,再执行下次任务 - scheduledService.scheduleWithFixedDelay(() -> { - try { - receiveQueue(); - }catch (Exception e){ - log.error("LogConsumer Error:"+ ExceptionUtils.getErrorStackTrace(e)); - } - }, 1, 10, TimeUnit.SECONDS); - } - - private void receiveQueue() { - String key = RedisKeys.getSysLogKey(); - //每次插入100条 - int count = 100; - for(int i = 0; i < count; i++){ - BaseLog log = (BaseLog) redisUtils.rightPop(key); - if(log == null){ - return; - } - - //登录日志 - if(log.getType() == LogTypeEnum.LOGIN.value()){ - SysLogLoginEntity entity = ConvertUtils.sourceToTarget(log, SysLogLoginEntity.class); - sysLogLoginService.save(entity); - } - - //操作日志 - if(log.getType() == LogTypeEnum.OPERATION.value()){ - SysLogOperationEntity entity = ConvertUtils.sourceToTarget(log, SysLogOperationEntity.class); - sysLogOperationService.save(entity); - } - - //异常日志 - if(log.getType() == LogTypeEnum.ERROR.value()){ - SysLogErrorEntity entity = ConvertUtils.sourceToTarget(log, SysLogErrorEntity.class); - sysLogErrorService.save(entity); - } - } - } - -} diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java index d8bdd0548a..67ef6c0e90 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java @@ -14,7 +14,6 @@ import com.epmet.commons.tools.log.SysLogLogin; import com.epmet.commons.tools.log.enums.LogTypeEnum; import com.epmet.commons.tools.log.enums.LoginOperationEnum; import com.epmet.commons.tools.log.enums.LoginStatusEnum; -import com.epmet.commons.tools.log.producer.LogProducer; import com.epmet.commons.tools.redis.UserDetailRedis; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.security.user.SecurityUser; @@ -49,8 +48,6 @@ public class AuthServiceImpl implements AuthService { @Autowired private UserDetailRedis userDetailRedis; @Autowired - private LogProducer logProducer; - @Autowired private JwtUtils jwtUtils; @Autowired private JwtProperties jwtProperties; @@ -76,7 +73,6 @@ public class AuthServiceImpl implements AuthService { if(user == null){ log.setStatus(LoginStatusEnum.FAIL.value()); log.setCreatorName(login.getUsername()); - logProducer.saveLog(log); throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); } @@ -86,7 +82,6 @@ public class AuthServiceImpl implements AuthService { log.setStatus(LoginStatusEnum.FAIL.value()); log.setCreator(user.getId()); log.setCreatorName(user.getUsername()); - logProducer.saveLog(log); throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); } @@ -96,7 +91,6 @@ public class AuthServiceImpl implements AuthService { log.setStatus(LoginStatusEnum.LOCK.value()); log.setCreator(user.getId()); log.setCreatorName(user.getUsername()); - logProducer.saveLog(log); throw new RenException(ErrorCode.ACCOUNT_DISABLE); } @@ -116,7 +110,6 @@ public class AuthServiceImpl implements AuthService { log.setCreator(user.getId()); log.setCreatorName(user.getUsername()); log.setStatus(LoginStatusEnum.SUCCESS.value()); - logProducer.saveLog(log); return authorization; } @@ -138,7 +131,6 @@ public class AuthServiceImpl implements AuthService { log.setCreator(user.getId()); log.setCreatorName(user.getUsername()); log.setCreateDate(new Date()); - logProducer.saveLog(log); userDetailRedis.logout(userId); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java deleted file mode 100644 index a93a9ef538..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.annotation; - -import java.lang.annotation.*; - -/** - * 操作日志注解 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface LogOperation { - String value() default ""; -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java index 42f1950d5f..f887dd1aab 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java @@ -6,19 +6,14 @@ import com.epmet.commons.tools.exception.RenException; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; import org.springframework.context.annotation.Configuration; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; -import java.util.Objects; import java.util.concurrent.TimeUnit; /** @@ -35,16 +30,12 @@ public class NoRepeatSubmitAop { /** * 重复提交判断时间为2s */ - private static final Cache CACHES = CacheBuilder.newBuilder() + private static final Cache CACHES = CacheBuilder.newBuilder() // 最大缓存 100 个 .maximumSize(1000) // 设置写缓存后 5 秒钟过期 .expireAfterWrite(5, TimeUnit.SECONDS) .build(); - @Before("execution(public * com.epmet..*Controller.*(..))") - public void before(JoinPoint joinPoint) { - System.out.println(joinPoint.getSignature().getName()); - } @Around("execution(public * com.epmet..*Controller.*(..)) && @annotation(com.epmet.commons.tools.aop.NoRepeatSubmit)") public Object around(ProceedingJoinPoint pjp) { @@ -79,4 +70,4 @@ public class NoRepeatSubmitAop { } -} \ No newline at end of file +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java deleted file mode 100644 index d51d147a8e..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.aspect; - -import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.annotation.LogOperation; -import com.epmet.commons.tools.config.ModuleConfig; -import com.epmet.commons.tools.security.user.SecurityUser; -import com.epmet.commons.tools.log.SysLogOperation; -import com.epmet.commons.tools.log.enums.LogTypeEnum; -import com.epmet.commons.tools.log.enums.OperationStatusEnum; -import com.epmet.commons.tools.log.producer.LogProducer; -import com.epmet.commons.tools.security.user.UserDetail; -import com.epmet.commons.tools.utils.HttpContextUtils; -import com.epmet.commons.tools.utils.IpUtils; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpHeaders; -import org.springframework.stereotype.Component; - -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; -import java.util.Date; - -/** - * 操作日志,切面处理类 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Aspect -@Component -public class LogOperationAspect { - @Autowired - private ModuleConfig moduleConfig; - @Autowired - private LogProducer logProducer; - - @Pointcut("@annotation(com.epmet.commons.tools.annotation.LogOperation)") - public void logPointCut() { - - } - - @Around("logPointCut()") - public Object around(ProceedingJoinPoint point) throws Throwable { - long beginTime = System.currentTimeMillis(); - try { - //执行方法 - Object result = point.proceed(); - - //执行时长(毫秒) - long time = System.currentTimeMillis() - beginTime; - //保存日志 - saveLog(point, time, OperationStatusEnum.SUCCESS.value()); - - return result; - }catch(Exception e) { - //执行时长(毫秒) - long time = System.currentTimeMillis() - beginTime; - //保存日志 - saveLog(point, time, OperationStatusEnum.FAIL.value()); - - throw e; - } - } - - - private void saveLog(ProceedingJoinPoint joinPoint, long time, Integer status) { - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - Method method = signature.getMethod(); - - SysLogOperation log = new SysLogOperation(); - LogOperation annotation = method.getAnnotation(LogOperation.class); - if(annotation != null){ - //注解上的描述 - log.setOperation(annotation.value()); - } - - //登录用户信息 - UserDetail user = SecurityUser.getUser(); - if(user != null){ - log.setCreator(user.getId()); - log.setCreatorName(user.getUsername()); - } - - log.setType(LogTypeEnum.OPERATION.value()); - log.setModule(moduleConfig.getName()); - log.setStatus(status); - log.setRequestTime((int)time); - log.setCreateDate(new Date()); - - //请求相关信息 - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - log.setIp(IpUtils.getIpAddr(request)); - log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); - log.setRequestUri(request.getRequestURI()); - log.setRequestMethod(request.getMethod()); - - //请求参数 - Object[] args = joinPoint.getArgs(); - try{ - String params = JSON.toJSONString(args[0]); - log.setRequestParams(params); - }catch (Exception e){ - - } - - //保存到Redis队列里 - logProducer.saveLog(log); - } -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java deleted file mode 100644 index 035ec89088..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.exception; - -import cn.hutool.core.map.MapUtil; -import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.config.ModuleConfig; -import com.epmet.commons.tools.log.SysLogError; -import com.epmet.commons.tools.log.enums.LogTypeEnum; -import com.epmet.commons.tools.log.producer.LogProducer; -import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.HttpContextUtils; -import com.epmet.commons.tools.utils.IpUtils; -import com.epmet.commons.tools.utils.Result; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DuplicateKeyException; -import org.springframework.http.HttpHeaders; -import org.springframework.web.bind.annotation.ExceptionHandler; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.Map; - - -/** - * 异常处理器 - * 暂停使用,改用BaseRequestLogAspect - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -//@RestControllerAdvice -public class RenExceptionHandler { - private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class); - @Autowired - private ModuleConfig moduleConfig; - @Autowired - private LogProducer logProducer; - @Autowired - private LoginUserUtil loginUserUtil; - - /** - * 处理自定义异常 - * "code": 8000, - * "msg": "服务器开小差了...", - */ - @ExceptionHandler(RenException.class) - public Result handleRRException(RenException ex){ - if (ex.getCode() > 8000) { - Result result=new Result().error(ex.getCode()); - result.setData(ex.getInternalMsg()); - return result; - } - logger.error(ExceptionUtils.getErrorStackTrace(ex)); - Result result=new Result().error(); - result.setData(ex.getInternalMsg()); - return result; -// return new Result().error(); - } - - - /** - * 处理自定义异常 - * "code": 8000, - * "msg": "服务器开小差了...", - */ - @ExceptionHandler(ValidateException.class) - public Result handleVException(ValidateException ex){ - logger.error(ExceptionUtils.getErrorStackTrace(ex)); - Result result=new Result(); - result.setCode(ex.getCode()); - result.setMsg(ex.getMsg()); - return result; -// return new Result().error(); - } - - /** - * 运行时异常拦截 - * "code": 8000, - * "msg": "服务器开小差了...", - */ - @ExceptionHandler(RuntimeException.class) - public Result handleRuntimeException(RuntimeException ex){ - logger.error(ExceptionUtils.getErrorStackTrace(ex)); - Result result=new Result().error(); - result.setData(ex.getMessage()); - return result; -// return new Result().error(); - } - - /** - * 处理自定义异常 - * "code": 10002, - * "msg": "数据库中已存在该记录", - */ - @ExceptionHandler(DuplicateKeyException.class) - public Result handleDuplicateKeyException(DuplicateKeyException ex){ - logger.error(ExceptionUtils.getErrorStackTrace(ex)); - return new Result().error(ErrorCode.DB_RECORD_EXISTS); - } - - /** - * 异常 - * "code": 8000, - * "msg": "服务器开小差了...", - */ - @ExceptionHandler(Exception.class) - public Result handleException(Exception ex){ - logger.error(ExceptionUtils.getErrorStackTrace(ex)); -// saveLog(ex); - Result result=new Result().error(); - result.setData(ex.getMessage()); - return result; -// return new Result().error(); - } - - /** - * 保存异常日志 - */ - private void saveLog(Exception ex){ - SysLogError log = new SysLogError(); - log.setType(LogTypeEnum.ERROR.value()); - log.setModule(moduleConfig.getName()); - - //请求相关信息 - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); - log.setRequestUri(request.getRequestURI()); - log.setRequestMethod(request.getMethod()); - log.setIp(IpUtils.getIpAddr(request)); - Map params = HttpContextUtils.getParameterMap(request); - if(MapUtil.isNotEmpty(params)){ - log.setRequestParams(JSON.toJSONString(params)); - } - - //登录用户ID - - log.setCreator(loginUserUtil.getLoginUserId()); - //异常信息 - log.setErrorInfo(ExceptionUtils.getErrorStackTrace(ex)); - - //保存到Redis队列里 - log.setCreateDate(new Date()); - logProducer.saveLog(log); - } -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java deleted file mode 100644 index 4712a5c5a9..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.log.producer; - -import com.google.common.util.concurrent.ThreadFactoryBuilder; -import com.epmet.commons.tools.log.BaseLog; -import com.epmet.commons.tools.redis.RedisKeys; -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.concurrent.*; - -/** - * 日志通过redis队列,异步保存到数据库 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Component -public class LogProducer { - @Autowired - private RedisUtils redisUtils; - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("log-producer-pool-%d").build(); - ExecutorService pool = new ThreadPoolExecutor(5, 200, 0L,TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); - - /** - * 保存Log到Redis消息队列 - */ - public void saveLog(BaseLog log){ - String key = RedisKeys.getSysLogKey(); - - //异步保存到队列 - pool.execute(() -> redisUtils.leftPush(key, log, RedisUtils.NOT_EXPIRE)); - } -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 716e22a223..d7aa1ca071 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -43,13 +43,6 @@ public class RedisKeys { return rootPrefix.concat("sys:security:user:").concat(String.valueOf(id)); } - /** - * 系统日志Key - */ - public static String getSysLogKey() { - return rootPrefix.concat("sys:log"); - } - /** * 系统资源Key */ diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java index 8d3b0db55f..6ef0f13807 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java @@ -8,7 +8,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -55,7 +54,6 @@ public class ActModelController { @PostMapping @ApiOperation("新增模型") - @LogOperation("新增模型") public Result save(@RequestBody ModelDTO dto) throws Exception{ //效验数据 ValidatorUtils.validateEntity(dto); @@ -67,7 +65,6 @@ public class ActModelController { @PostMapping("deploy/{id}") @ApiOperation("部署") - @LogOperation("部署") public Result deploy(@PathVariable("id") String id) { actModelService.deploy(id); return new Result(); @@ -75,14 +72,12 @@ public class ActModelController { @GetMapping("export/{id}") @ApiOperation("导出") - @LogOperation("导出") public void export(@PathVariable("id") String id, @ApiIgnore HttpServletResponse response) { actModelService.export(id, response); } @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") public Result delete(@RequestBody String[] ids) { for(String id : ids) { actModelService.delete(id); @@ -92,7 +87,6 @@ public class ActModelController { @GetMapping("image/{deploymentId}") @ApiOperation(value = "查看流程图", produces="application/octet-stream") - @LogOperation("查看流程图") public void viewDeployImage(@PathVariable("deploymentId") String deploymentId, @ApiIgnore HttpServletResponse response){ actModelService.deployImage(deploymentId, response); } diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java index e317d0f4fc..6615e815f6 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java @@ -8,7 +8,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; @@ -82,7 +81,6 @@ public class ActProcessController { @PostMapping("deploy") @ApiOperation("部署流程文件") - @LogOperation("部署流程文件") @ApiImplicitParam(name = "processFile", value = "流程文件", paramType = "query", dataType="file") public Result deploy(@RequestParam("processFile") MultipartFile file) throws IOException { if (file.isEmpty()) { @@ -95,7 +93,6 @@ public class ActProcessController { } @PutMapping("active/{id}") - @LogOperation("激活流程") public Result active(@PathVariable("id") String id) { actProcessService.active(id); @@ -104,7 +101,6 @@ public class ActProcessController { @PutMapping("suspend/{id}") @ApiOperation("挂起流程") - @LogOperation("挂起流程") public Result suspend(@PathVariable("id") String id) { actProcessService.suspend(id); @@ -113,7 +109,6 @@ public class ActProcessController { @PostMapping("convertToModel/{id}") @ApiOperation("将部署的流程转换为模型") - @LogOperation("将部署的流程转换为模型") public Result convertToModel(@PathVariable("id") String id) throws Exception { actProcessService.convertToModel(id); @@ -122,7 +117,6 @@ public class ActProcessController { @DeleteMapping @ApiOperation("删除流程") - @LogOperation("删除流程") public Result delete(@RequestBody String[] deploymentIds) { for(String deploymentId : deploymentIds) { actProcessService.deleteDeployment(deploymentId); diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java index 6d938406fc..65b7da62f4 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java @@ -8,7 +8,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -53,7 +52,6 @@ public class ActRunningController { @DeleteMapping("{id}") @ApiOperation("删除") - @LogOperation("删除") @ApiImplicitParam(name = "id", value = "ID", paramType = "query", dataType="String") public Result deleteInstance(@PathVariable("id") String id) { actRunningService.delete(id); @@ -62,7 +60,6 @@ public class ActRunningController { @PostMapping("start") @ApiOperation("启动流程实例,依据流程定义KEY,启动流程实例") - @LogOperation("启动流程实例,依据流程定义KEY,启动流程实例") @ApiImplicitParam(name = "key", value = "流程定义标识key", paramType = "query", dataType="String") public Result start(String key){ ProcessInstanceDTO dto = actRunningService.startProcess(key); @@ -71,7 +68,6 @@ public class ActRunningController { @PostMapping("startOfBusinessKey") @ApiOperation("启动流程实例,依据流程定义ID和业务唯一标示启动实例") - @LogOperation("启动流程实例,依据流程定义ID和业务唯一标示启动实例") public Result startOfBusinessKey(@RequestBody ProcessStartDTO processStartDTO){ ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO); return new Result().ok(dto); diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java index c0a9ee2bec..e7fbf44ca1 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; @@ -82,7 +81,6 @@ public class ActTaskController { */ @GetMapping("task/{id}") @ApiOperation("获取任务详情") - @LogOperation("获取任务详情") public Result getTaskById(@PathVariable("id") String id){ TaskDTO task = actTaskService.taskDetail(id); return new Result().ok(task); diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java index 85c0557e31..ae24d55c6f 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java @@ -1,6 +1,5 @@ package com.epmet.demo.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -59,7 +58,6 @@ public class CorrectionController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") public Result save(@RequestBody CorrectionDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -72,7 +70,6 @@ public class CorrectionController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") public Result update(@RequestBody CorrectionDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -84,7 +81,6 @@ public class CorrectionController { @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -96,7 +92,6 @@ public class CorrectionController { @PostMapping("updateInstanceId") @ApiOperation("更新实例ID") - @LogOperation("更新实例ID") @ApiImplicitParams({ @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", required = true, dataType="String"), @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query",required = true, dataType="String") diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java index 5c12cd27bf..ecd1b10718 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java @@ -8,7 +8,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -66,8 +65,7 @@ public class ScheduleJobController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") - public Result save(@RequestBody ScheduleJobDTO dto){ + public Result save(@RequestBody ScheduleJobDTO dto){ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); scheduleJobService.save(dto); @@ -77,8 +75,7 @@ public class ScheduleJobController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") - public Result update(@RequestBody ScheduleJobDTO dto){ + public Result update(@RequestBody ScheduleJobDTO dto){ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); scheduleJobService.update(dto); @@ -88,8 +85,7 @@ public class ScheduleJobController { @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") - public Result delete(@RequestBody Long[] ids){ + public Result delete(@RequestBody Long[] ids){ scheduleJobService.deleteBatch(ids); return new Result(); @@ -97,8 +93,7 @@ public class ScheduleJobController { @PutMapping("/run") @ApiOperation("立即执行") - @LogOperation("立即执行") - public Result run(@RequestBody Long[] ids){ + public Result run(@RequestBody Long[] ids){ scheduleJobService.run(ids); return new Result(); @@ -106,8 +101,7 @@ public class ScheduleJobController { @PutMapping("/pause") @ApiOperation("暂停") - @LogOperation("暂停") - public Result pause(@RequestBody Long[] ids){ + public Result pause(@RequestBody Long[] ids){ scheduleJobService.pause(ids); return new Result(); @@ -115,8 +109,7 @@ public class ScheduleJobController { @PutMapping("/resume") @ApiOperation("恢复") - @LogOperation("恢复") - public Result resume(@RequestBody Long[] ids){ + public Result resume(@RequestBody Long[] ids){ scheduleJobService.resume(ids); return new Result(); diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java index 550a83c112..56fd837daf 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java @@ -9,7 +9,6 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 04889584db..23751d3b87 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -249,6 +249,7 @@ public class OssController { } } Result result = ossService.uploadImg(file, null); + long start = System.currentTimeMillis(); if (result != null && result.success() ){ UploadImgResultDTO data = result.getData(); if ( data!= null && StringUtils.isNotBlank(data.getUrl())){ @@ -260,6 +261,7 @@ public class OssController { redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } + log.info("service setRedis:{}",System.currentTimeMillis()-start); return result; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index eb38a6520a..c39c9b5b47 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -69,9 +69,14 @@ public class OssServiceImpl extends BaseServiceImpl implement String extension = FilenameUtils.getExtension(file.getOriginalFilename()); String url = null; String ossDomain = null; + long start = System.currentTimeMillis(); try { + AbstractCloudStorageService storageService = OssFactory.build(); + logger.info("build service:{}",System.currentTimeMillis()-start); + start = System.currentTimeMillis(); url = storageService.uploadSuffix(file.getBytes(), extension, privacy); + logger.info("service uploadSuffix:{}",System.currentTimeMillis()-start); ossDomain = storageService.getOssDomain(privacy); } catch (IOException e) { logger.error("图片上传异常", e); @@ -82,7 +87,9 @@ public class OssServiceImpl extends BaseServiceImpl implement OssEntity ossEntity = new OssEntity(); ossEntity.setUrl(url); + start = System.currentTimeMillis(); baseDao.insert(ossEntity); + logger.info("service insert:{}",System.currentTimeMillis()-start); //文件信息 UploadImgResultDTO dto = new UploadImgResultDTO(); dto.setUrl(url); From 568c600c90fcda91dc7f10de0ae87a978d2554c4 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 15:20:27 +0800 Subject: [PATCH 231/234] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BD=BF=E7=94=A8@Before=E6=B3=A8=E8=A7=A3->=E8=BF=98=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E4=BC=98=E5=8C=96=20=E6=9C=AC=E5=9C=B0=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E8=A7=A3=E5=86=B3=E4=B8=8D=E4=BA=86=20=E5=88=86?= =?UTF-8?q?=E5=B8=83=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/aop/NoRepeatSubmitAop.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java index f887dd1aab..7dfbd88a75 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java @@ -6,9 +6,10 @@ import com.epmet.commons.tools.exception.RenException; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; import org.springframework.context.annotation.Configuration; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -32,13 +33,18 @@ public class NoRepeatSubmitAop { */ private static final Cache CACHES = CacheBuilder.newBuilder() // 最大缓存 100 个 - .maximumSize(1000) + .maximumSize(100) // 设置写缓存后 5 秒钟过期 .expireAfterWrite(5, TimeUnit.SECONDS) .build(); - @Around("execution(public * com.epmet..*Controller.*(..)) && @annotation(com.epmet.commons.tools.aop.NoRepeatSubmit)") - public Object around(ProceedingJoinPoint pjp) { + @Pointcut("@annotation(com.epmet.commons.tools.aop.NoRepeatSubmit)") + public void doAspect() { + + } + + @Before("doAspect()") + public void around(JoinPoint pjp) { try { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); assert attributes != null; @@ -46,9 +52,7 @@ public class NoRepeatSubmitAop { String key = getKey(request.getRequestURI(), pjp.getArgs()); // 如果缓存中有这个url视为重复提交 if (CACHES.getIfPresent(key) == null) { - Object o = pjp.proceed(); CACHES.put(key, NumConstant.ZERO); - return o; } else { log.error("重复提交"); throw new RenException(EpmetErrorCode.REPEATED_SUBMIT_ERROR.getCode()); @@ -59,7 +63,6 @@ public class NoRepeatSubmitAop { log.error("验证重复提交时出现未知异常!"); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } - } private String getKey(String keyExpress, Object[] args) { From 7d0333004a11360c55dc42a8f4ff631cea90349b Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 31 Mar 2021 16:22:11 +0800 Subject: [PATCH 232/234] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E5=91=A8=E6=9C=9F=E5=86=85=E8=A2=AB=E5=90=B9=E5=93=A8=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=95=B0=E4=B8=8E=E8=AF=84=E4=BB=B7=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=E5=86=85=E8=A2=AB=E5=8A=9E=E7=BB=93=E9=A1=B9=E7=9B=AE=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectLogDailyDao.xml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 0fe89ad0e9..1d5b5c6e79 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -165,7 +165,7 @@ AGENCY_ID, COUNT(DISTINCT PROJECT_ID) AS count FROM - fact_origin_project_log_daily + fact_origin_project_log_daily log WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND IS_ACTIVE = '0' @@ -173,13 +173,14 @@ AND MONTH_ID = #{dimId} AND NOT EXISTS( SELECT ID - FROM fact_origin_project_log_daily + FROM fact_origin_project_log_daily innerLog WHERE DEL_FLAG = '0' AND MONTH_ID #{dimId} AND IS_ACTIVE = '0' + AND log.project_id = innerLog.project_id - AGENCY_ID = #{agencyId} + innerLog.AGENCY_ID = #{agencyId} ) @@ -204,13 +205,10 @@ AND log.MONTH_ID = #{dimId} AND EXISTS ( - select id from fact_origin_project_log_daily where del_flag = '0' - and customer_id = #{customerId} and month_id = #{dimId} - and action_code like 'close%' - - - AGENCY_ID = #{agencyId} - + select innerLog.id from fact_origin_project_log_daily innerLog where innerLog.del_flag = '0' + and innerLog.customer_id = #{customerId} and innerLog.month_id = #{dimId} + and innerLog.action_code like 'close%' + and innerLog.project_id = log.project_id ) From 7f22d27e2b18ed922fe69ee14f211705f7a1f1f0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 16:31:48 +0800 Subject: [PATCH 233/234] =?UTF-8?q?=E5=8D=87=E7=BA=A7aliyun-sdk-oss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-oss/epmet-oss-server/pom.xml | 8 +------- .../cloud/AliyunCloudStorageService.java | 20 +++++++++---------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index a29c4474cc..2264f855e4 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -14,8 +14,7 @@ 7.2.22 - 2.8.3 - 3.2.2 + 3.10.2 5.4.4 1.26.2 @@ -82,11 +81,6 @@ - - com.aliyun - aliyun-java-sdk-core - ${aliyun.core.version} - com.github.tobato fastdfs-client diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index d270023543..c1865d8234 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -8,7 +8,9 @@ package com.epmet.cloud; +import com.aliyun.oss.OSS; import com.aliyun.oss.OSSClient; +import com.aliyun.oss.OSSClientBuilder; import com.aliyun.oss.model.DownloadFileRequest; import com.aliyun.oss.model.DownloadFileResult; import com.epmet.commons.tools.exception.RenException; @@ -26,12 +28,8 @@ import java.io.InputStream; */ public class AliyunCloudStorageService extends AbstractCloudStorageService { - private OSSClient internalClient = null; - private OSSClient externalClient = null; - - { - - } + private OSS internalClient = null; + private OSS externalClient = null; public AliyunCloudStorageService(CloudStorageConfig config){ this.config = config; @@ -43,11 +41,11 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { * @author wxz * @date 2021.01.04 13:49 */ - public OSSClient getOssClient(String privacyType) { + public OSS getOssClient(String privacyType) { if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { if (internalClient == null){ CloudStorageConfig.AliyunCloudStorageConfigProps props = config.getAliyun().getInternal(); - internalClient = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + internalClient = new OSSClientBuilder().build(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), props.getAliyunAccessKeySecret()); } return internalClient; @@ -100,7 +98,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public String upload(InputStream inputStream, String path, String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = getOssClient(privacyType); + OSS client = getOssClient(privacyType); try { client.putObject(props.getAliyunBucketName(), path, inputStream); //client.shutdown(); @@ -114,7 +112,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public boolean delete(String objectName,String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = getOssClient(privacyType); + OSS client = getOssClient(privacyType); try { client.deleteObject(props.getAliyunBucketName(), objectName); //client.shutdown(); @@ -140,7 +138,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public void down(String privacyType) throws IOException { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = getOssClient(privacyType); + OSS client = getOssClient(privacyType); try { /* From d798d0fcd38b7a25d11b6d9259fc70749dbf2f16 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 17:24:47 +0800 Subject: [PATCH 234/234] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/OssController.java | 2 -- .../main/java/com/epmet/service/impl/OssServiceImpl.java | 6 ------ 2 files changed, 8 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 23751d3b87..04889584db 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -249,7 +249,6 @@ public class OssController { } } Result result = ossService.uploadImg(file, null); - long start = System.currentTimeMillis(); if (result != null && result.success() ){ UploadImgResultDTO data = result.getData(); if ( data!= null && StringUtils.isNotBlank(data.getUrl())){ @@ -261,7 +260,6 @@ public class OssController { redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } - log.info("service setRedis:{}",System.currentTimeMillis()-start); return result; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index c39c9b5b47..6e9e8e2d90 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -69,14 +69,10 @@ public class OssServiceImpl extends BaseServiceImpl implement String extension = FilenameUtils.getExtension(file.getOriginalFilename()); String url = null; String ossDomain = null; - long start = System.currentTimeMillis(); try { AbstractCloudStorageService storageService = OssFactory.build(); - logger.info("build service:{}",System.currentTimeMillis()-start); - start = System.currentTimeMillis(); url = storageService.uploadSuffix(file.getBytes(), extension, privacy); - logger.info("service uploadSuffix:{}",System.currentTimeMillis()-start); ossDomain = storageService.getOssDomain(privacy); } catch (IOException e) { logger.error("图片上传异常", e); @@ -87,9 +83,7 @@ public class OssServiceImpl extends BaseServiceImpl implement OssEntity ossEntity = new OssEntity(); ossEntity.setUrl(url); - start = System.currentTimeMillis(); baseDao.insert(ossEntity); - logger.info("service insert:{}",System.currentTimeMillis()-start); //文件信息 UploadImgResultDTO dto = new UploadImgResultDTO(); dto.setUrl(url);