diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index c654d59aa7..613d5411c5 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -18,6 +18,11 @@ + + com.epmet + epmet-commons-thirdplat + 2.0.0 + com.epmet epmet-admin-client @@ -193,6 +198,11 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc @@ -237,6 +247,11 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc @@ -276,6 +291,11 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc @@ -319,6 +339,11 @@ SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + https://jcytc.lzjczl.com:21009 + 2cy0a9lA + 6hU3PQgxLcXr27SE diff --git a/epmet-auth/src/main/java/com/epmet/constant/SsoConstant.java b/epmet-auth/src/main/java/com/epmet/constant/SsoConstant.java new file mode 100644 index 0000000000..e7da64ccff --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/constant/SsoConstant.java @@ -0,0 +1,21 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/1/19 上午10:26 + */ +public interface SsoConstant { + + /** + * 酒城e通appId + */ + String WINE_CITY_E_OPEN_APP_ID = "64929543"; + + String USER_INFO_IS_NULL = "【jcetApiService.getUserInfoByTicket(formDTO.getTicket()】结果为空......"; + + String INSERT_UPDATE_USER_FAILURE = "新增或更新user_weChat失败......"; + + String USER_ID_IS_NULL = "userId为空,生成token失败......"; + String CUSTOMER_ID_IS_NULL = "customerId为空,缓存放置token失败......"; + +} diff --git a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java new file mode 100644 index 0000000000..61468e9ea4 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java @@ -0,0 +1,91 @@ +package com.epmet.controller; + +import com.epmet.commons.thirdplat.apiservice.jcet.JcetApiService; +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.SsoEnteOrgFormDTO; +import com.epmet.dto.form.SsoLoginFormDTO; +import com.epmet.dto.form.SsoLoginOperFormDTO; +import com.epmet.dto.result.SsoLoginResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.service.SsoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午4:33 + */ +@RestController +@RequestMapping("sso") +public class SsoController { + + @Autowired + private SsoService ssoService; + + @Autowired + private JcetApiService jcetApiService; + + /** + * @Description 0、泸州app登陆入口:得到token + * @Param formDTO + * @author zxc + * @date 2021/1/18 下午4:59 + */ + @PostMapping("resi/login") + 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() { + ThirdPlatUserInfo userInfoByTicket = null; + try { + userInfoByTicket = jcetApiService.getUserInfoByTicket("ssoTicket-vYtMRuXAQZri3wpA2vyq5D8n3Q9oO7ui"); + } catch (Exception e) { + e.printStackTrace(); + } + return new Result().ok(userInfoByTicket); + } + + /** + * @param formDTO + * @Author sun + * @Description 1、ticket自动登录获取内部token + **/ + @PostMapping("work/login") + public Result ssoWorkLogin(@RequestBody SsoLoginFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SsoLoginFormDTO.SsoLoginForm.class); + return new Result().ok(ssoService.ssoWorkLogin(formDTO)); + } + + /** + * @param formDTO + * @Author sun + * @Description 4、自动进入组织-返回token + **/ + @PostMapping(value = "work/enterorg") + public Result enterOrg(@RequestBody SsoEnteOrgFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SsoEnteOrgFormDTO.AddUserShowGroup.class, SsoEnteOrgFormDTO.AddUserInternalGroup.class); + UserTokenResultDTO userTokenResultDTO = ssoService.enterOrg(formDTO); + return new Result().ok(userTokenResultDTO); + } + +} 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 new file mode 100644 index 0000000000..4706061267 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoEnteOrgFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 4、自动进入组织-返回token + * @Author sun + */ +@Data +public class SsoEnteOrgFormDTO implements Serializable { + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + /** + * wxCode + */ + @NotBlank(message = "ticket不能为空",groups = {AddUserInternalGroup.class}) + private String ticket; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空",groups = {AddUserShowGroup.class}) + private String mobile; + + /** + * 选择的组织所属的id + */ + @NotBlank(message = "客户id不能为空",groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 选择的要进入的组织(根组织id) + */ + @NotBlank(message = "组织id不能为空",groups = {AddUserInternalGroup.class}) + private String rootAgencyId; + + /** + * resi;居民段,gov:工作端 + */ + @NotBlank(message = "app不能为空",groups = SsoLoginFormDTO.SsoLoginForm.class) + private String app; + + /** + * app;居民段,app:工作端 + */ + @NotBlank(message = "client不能为空",groups = SsoLoginFormDTO.SsoLoginForm.class) + private String client; +} + 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 new file mode 100644 index 0000000000..0e2ee7cf40 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginFormDTO.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 SsoLoginFormDTO implements Serializable { + + private static final long serialVersionUID = -6543952487970013031L; + + public interface SsoLoginForm{} + + /** + * sso票据,有效期为300秒 + */ + @NotBlank(message = "sso票据不能为空", groups = {SsoLoginForm.class}) + private String ticket; + + /** + * 三方平台应用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/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/dto/result/SsoLoginResultDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/SsoLoginResultDTO.java new file mode 100644 index 0000000000..09e4bdb32d --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/result/SsoLoginResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午4:45 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class SsoLoginResultDTO implements Serializable { + + private static final long serialVersionUID = 3491079788196180035L; + + private String token = ""; +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java index 8e4b715422..c7ce124a75 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java @@ -17,4 +17,5 @@ public class UserTokenResultDTO implements Serializable { * 令牌 */ private String token; + private String customerId; } diff --git a/epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java b/epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java new file mode 100644 index 0000000000..d64df0fd1a --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java @@ -0,0 +1,50 @@ +package com.epmet.enums; + +/** + * 系统环境变量枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum ThirdPlatformEnum { + /** + * 平阴联动指挥平台 + */ + PINGYIN_LIANDONG("pyld", "平阴联动指挥平台", "pyldApiService"), + ; + + private String code; + private String name; + private String apiService; + + + ThirdPlatformEnum(String code, String name, String apiService) { + this.code = code; + this.name = name; + this.apiService = apiService; + } + + public static ThirdPlatformEnum getEnum(String code) { + ThirdPlatformEnum[] values = ThirdPlatformEnum.values(); + for (ThirdPlatformEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + public String getApiService() { + return apiService; + } +} diff --git a/epmet-auth/src/main/java/com/epmet/redis/SsoRedis.java b/epmet-auth/src/main/java/com/epmet/redis/SsoRedis.java new file mode 100644 index 0000000000..16ee7ab3ce --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/redis/SsoRedis.java @@ -0,0 +1,39 @@ +package com.epmet.redis; + +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.security.dto.TokenDto; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午5:09 + */ +@Component +public class SsoRedis { + + @Autowired + private RedisUtils redisUtils; + + /** + * @Description token放入缓存 + * @Param user + * @Param expire + * @author zxc + * @date 2021/1/18 下午5:10 + */ + public void set(TokenDto user, long expire) { + if (user == null) { + return; + } + String key = RedisKeys.getCpUserKey(user.getApp(), user.getClient(), user.getUserId()); + //bean to map + Map map = BeanUtil.beanToMap(user, false, true); + redisUtils.hMSet(key, map, expire); + } + +} diff --git a/epmet-auth/src/main/java/com/epmet/service/SsoService.java b/epmet-auth/src/main/java/com/epmet/service/SsoService.java new file mode 100644 index 0000000000..e9f9fac2b7 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/SsoService.java @@ -0,0 +1,45 @@ +package com.epmet.service; + +import com.epmet.dto.form.SsoEnteOrgFormDTO; +import com.epmet.dto.form.SsoLoginFormDTO; +import com.epmet.dto.form.SsoLoginOperFormDTO; +import com.epmet.dto.result.SsoLoginResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午4:34 + */ +public interface SsoService { + + /** + * @Description 0、入口:得到token + * @Param formDTO + * @author zxc + * @date 2021/1/18 下午4:59 + */ + SsoLoginResultDTO ssoLogin(SsoLoginFormDTO formDTO); + + /** + * @param formDTO + * @Author sun + * @Description 1、ticket自动登录获取内部token + **/ + UserTokenResultDTO ssoWorkLogin(SsoLoginFormDTO formDTO); + + /** + * @param formDTO + * @Author sun + * @Description 4、自动进入组织-返回token + **/ + UserTokenResultDTO enterOrg(SsoEnteOrgFormDTO formDTO); + /** + * desc: sso登陆运营端 + * + * @param formDTO + * @return com.epmet.dto.result.UserTokenResultDTO + * @author LiuJanJun + * @date 2021/2/24 1:28 下午 + */ + UserTokenResultDTO 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 new file mode 100644 index 0000000000..98702d2216 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -0,0 +1,546 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +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; +import com.epmet.commons.tools.security.dto.GovTokenDto; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.*; +import com.epmet.dto.*; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.enums.ThirdPlatformEnum; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; +import com.epmet.jwt.JwtTokenProperties; +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 org.springframework.util.CollectionUtils; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午4:35 + */ +@Service +@Slf4j +public class SsoServiceImpl implements SsoService { + + Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private SsoRedis ssoRedis; + + @Autowired + private JwtTokenUtils jwtTokenUtils; + + @Autowired + private JwtTokenProperties jwtTokenProperties; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + /** + * @Description 0、入口:得到token + * @Param formDTO + * @author zxc + * @date 2021/1/18 下午4:59 + */ + @Override + public SsoLoginResultDTO ssoLogin(SsoLoginFormDTO formDTO) { + String customerId = getCustomerId(formDTO.getAppId()); + String userId = ""; + + Result apiServiceResult = operCrmOpenFeignClient.getApiServiceByCustomerId(new ApiServiceFormDTO(customerId)); + if (!apiServiceResult.success()) { + throw new RenException("【SSO登录】调用OperCrm获取ApiService接口失败:", apiServiceResult.getInternalMsg()); + } + + if (apiServiceResult.getData() == null || StringUtils.isBlank(apiServiceResult.getData().getApiServiceName())) { + throw new RenException("【SSO登录】调用OperCrm获取ApiService,查询到的结果为空:", apiServiceResult.toString()); + } + + ThirdPlatUserInfo userInfo; + try { + AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(apiServiceResult.getData().getApiServiceName()); + userInfo = apiService.getUserInfoByTicket(formDTO.getTicket()); + } catch (Exception e) { + throw new RenException(e.getMessage()); + } + + if (null == userInfo){ + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), + "【SSO登录】调用第三方平台查询用户信息失败,用户信息为空"); + } + UserInfoFormDTO userInfoFormDTO = new UserInfoFormDTO(); + userInfoFormDTO.setApp(formDTO.getApp()); + userInfoFormDTO.setUid(userInfo.getOpenId()); + userInfoFormDTO.setName(userInfo.getName()); + userInfoFormDTO.setMobile(userInfo.getMobile()); + + Result userDTOResult = epmetUserOpenFeignClient.saveUserInfo(userInfoFormDTO); + if (!userDTOResult.success()){ + throw new RenException("【SSO登录】新增或更新user_weChat失败"); + } + userId = userDTOResult.getData().getId(); + + if (StringUtils.isBlank(userId)){ + throw new RenException("【SSO登录】userId为空,生成token失败"); + } + //生成业务token + String token = this.generateToken(formDTO.getApp(), formDTO.getClient(), userId); + //存放Redis + + if (StringUtils.isBlank(customerId)) { + throw new RenException("【SSO登录】customerId为空,缓存放置token失败"); + } + 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 (RenException e) { + throw new RenException(e.getCode(), e.getMessage()); + } catch (Exception e) { + throw new RenException(e.getMessage()); + } + if (thirdUser == null) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), PyldConstants.REPONSE_USER_NOT_LOGIN); + } + //获取用户信息 + GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO(); + form.setCustomerId(thirdUser.getCustomerId()); + form.setMobile(thirdUser.getMobile()); + Result result = epmetUserFeignClient.getStaffIdAndPwd(form); + //todo userId 写死测试 3f7f852ce22c511aa67ecb695395295d start + GovWebOperLoginResultDTO demo = new GovWebOperLoginResultDTO(); + demo.setUserId("3f7f852ce22c511aa67ecb695395295d"); + result = new Result<>(); + result.ok(demo); + //test end + + if (!result.success() || null == result.getData() || null == result.getData().getUserId()) { + logger.error("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在"); + throw new RenException(EpmetErrorCode.ERR10003.getCode()); + } + + //4、生成token返回,且将TokenDto存到redis + //生成业务token + GovWebOperLoginResultDTO epmetUser = result.getData(); + + + String token = this.generateToken(formDTO.getApp(), formDTO.getClient(), epmetUser.getUserId()); + //存放Redis + + this.disposeTokenDto(formDTO.getApp(), formDTO.getClient(), epmetUser.getUserId(), token, thirdUser.getCustomerId()); + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + userTokenResultDTO.setCustomerId(thirdUser.getCustomerId()); + return userTokenResultDTO; + } + + /** + * @Description token放缓存 + * @Param formDTO + * @Param userId + * @Param token + * @Param customerId + * @author zxc + * @date 2021/1/18 下午5:32 + */ + 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(app); + tokenDto.setClient(client); + tokenDto.setUserId(userId); + tokenDto.setToken(token); + tokenDto.setUpdateTime(System.currentTimeMillis()); + tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + ssoRedis.set(tokenDto, expire); + log.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); + } + + /** + * @Description 居民端登陆生成业务token的key + * @Param app + * @Param client + * @Param userId + * @author zxc + * @date 2021/1/18 下午5:14 + */ + private String generateToken(String app, String client, String userId) { + Map map = new HashMap<>(16); + map.put("app", app); + map.put("client", client); + map.put("userId", userId); + String token = jwtTokenUtils.createToken(map); + log.info("app:" + app + ";client:" + client + ";userId:" + userId + ";生成token[" + token + "]"); + return token; + } + + /** + * @Description 获取customerId + * @Param appId + * @author zxc + * @date 2021/1/19 下午1:47 + */ + public String getCustomerId(String appId){ + JSONObject jsonObject = new JSONObject(); + String customerMsgUrl = "https://epmet-cloud.elinkservice.cn/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); + Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class); + if (null != toResult.get("code")) { + mapToResult.setCode(((Integer) toResult.get("code")).intValue()); + } + if (!mapToResult.success()) { + log.error(String.format("根据appId查询客户信息失败,对应appId->" + appId)); + throw new RenException(mapToResult.getMsg()); + } + Object publicCustomerResultDTO = mapToResult.getData(); + JSONObject json = JSON.parseObject(publicCustomerResultDTO.toString()); + Map map = (Map) json.get("customer"); + PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); + log.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->" + customer); + return customer.getId(); + } + + /** + * @param formDTO + * @Author sun + * @Description 1、ticket自动登录获取内部token + **/ + @Override + public UserTokenResultDTO ssoWorkLogin(SsoLoginFormDTO formDTO) { + + //1.根据appId查询客户id + String customerId = getCustomerId(formDTO.getAppId()); + + //2.客户Id换取第三方apiService,根据ticket换取华为Id + Result apiServiceResult = operCrmOpenFeignClient.getApiServiceByCustomerId(new ApiServiceFormDTO(customerId)); + if (!apiServiceResult.success()) { + throw new RenException("【SSO登录】调用OperCrm获取ApiService接口失败:", apiServiceResult.getInternalMsg()); + } + if (apiServiceResult.getData() == null || StringUtils.isBlank(apiServiceResult.getData().getApiServiceName())) { + throw new RenException("【SSO登录】调用OperCrm获取ApiService,查询到的结果为空:", apiServiceResult.toString()); + } + ThirdPlatUserInfo userInfo; + try { + AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(apiServiceResult.getData().getApiServiceName()); + userInfo = apiService.getUserInfoByTicket(formDTO.getTicket()); + } catch (Exception e) { + throw new RenException(e.getMessage()); + } + if (null == userInfo){ + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), + "【SSO登录】调用第三方平台查询用户信息失败,用户信息为空"); + } + + //3.根据华为openId查询用户是否存在历史登陆信息 + Result latestStaffWechat = epmetUserOpenFeignClient.getLatestStaffWechatLoginRecord(userInfo.getOpenId()); + if (!latestStaffWechat.success() || null == latestStaffWechat.getData()) { + logger.error(String.format("没有获取到用户最近一次登录账户信息,code[%s],msg[%s]", EpmetErrorCode.PLEASE_LOGIN.getCode(), EpmetErrorCode.PLEASE_LOGIN.getMsg())); + throw new RenException(EpmetErrorCode.PLEASE_LOGIN.getCode()); + } + StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData(); + + //4.记录staff_wechat + this.savestaffwechat(staffLatestAgencyResultDTO.getStaffId(), userInfo.getOpenId()); + + //5.记录登录日志 + this.saveStaffLoginRecord(staffLatestAgencyResultDTO); + + //6.获取用户token + String token = this.generateGovWxmpToken(staffLatestAgencyResultDTO.getStaffId(), formDTO.getApp(), formDTO.getClient()); + + //7.保存到redis + this.saveLatestGovTokenDto(staffLatestAgencyResultDTO, userInfo, token); + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + + return userTokenResultDTO; + + } + + /** + * @param userId openid + * @Author sun + * @Description 保存微信和当前登录用户关系 + **/ + private Result savestaffwechat(String userId, String openid) { + StaffWechatFormDTO staffWechatFormDTO = new StaffWechatFormDTO(); + staffWechatFormDTO.setUserId(userId); + staffWechatFormDTO.setWxOpenId(openid); + return epmetUserOpenFeignClient.saveStaffWechat(staffWechatFormDTO); + } + /** + * @param latestStaffWechatLoginDTO + * @Author sun + * @Description 保存登录日志 + **/ + private Result saveStaffLoginRecord(StaffLatestAgencyResultDTO latestStaffWechatLoginDTO) { + StaffLoginAgencyRecordFormDTO staffLoginAgencyRecordFormDTO = new StaffLoginAgencyRecordFormDTO(); + staffLoginAgencyRecordFormDTO.setCustomerId(latestStaffWechatLoginDTO.getCustomerId()); + staffLoginAgencyRecordFormDTO.setStaffId(latestStaffWechatLoginDTO.getStaffId()); + staffLoginAgencyRecordFormDTO.setWxOpenId(latestStaffWechatLoginDTO.getWxOpenId()); + staffLoginAgencyRecordFormDTO.setMobile(latestStaffWechatLoginDTO.getMobile()); + staffLoginAgencyRecordFormDTO.setAgencyId(latestStaffWechatLoginDTO.getAgencyId()); + Result staffLoginRecordResult = epmetUserOpenFeignClient.saveStaffLoginRecord(staffLoginAgencyRecordFormDTO); + return staffLoginRecordResult; + } + /** + * @Description 生成政府端小程序业务token Key + * @Author sun + **/ + private String generateGovWxmpToken(String staffId, String app, String client) { + Map map = new HashMap<>(); + map.put("app", app); + map.put("client", client); + map.put("userId", staffId); + String token = jwtTokenUtils.createToken(map); + logger.info("app:" + app + ";client:" + client + ";userId:" + staffId + ";生成token[" + token + "]"); + return token; + } + /** + * @Description 保存tokenDto到redis + * @Author sun + **/ + private void saveLatestGovTokenDto(StaffLatestAgencyResultDTO staffLatestAgency, ThirdPlatUserInfo userInfo, String token) { + int expire = jwtTokenProperties.getExpire(); + GovTokenDto govTokenDto = new GovTokenDto(); + govTokenDto.setApp(LoginConstant.APP_GOV); + govTokenDto.setClient(LoginConstant.CLIENT_WXMP); + govTokenDto.setUserId(staffLatestAgency.getStaffId()); + govTokenDto.setOpenId(userInfo.getOpenId()); + govTokenDto.setSessionKey(""); + govTokenDto.setUnionId(""); + govTokenDto.setToken(token); + govTokenDto.setUpdateTime(System.currentTimeMillis()); + govTokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + govTokenDto.setRootAgencyId(staffLatestAgency.getAgencyId()); + govTokenDto.setCustomerId(staffLatestAgency.getCustomerId()); + + //设置部门,网格,角色列表 + govTokenDto.setDeptIdList(getDeptartmentIdList(staffLatestAgency.getStaffId())); + govTokenDto.setGridIdList(getGridIdList(staffLatestAgency.getStaffId())); + CustomerAgencyDTO agency = getAgencyByStaffId(staffLatestAgency.getStaffId()); + if (agency != null) { + govTokenDto.setAgencyId(agency.getId()); + govTokenDto.setRoleList(queryGovStaffRoles(staffLatestAgency.getStaffId(), agency.getId())); + } + govTokenDto.setOrgIdPath(getOrgIdPath(staffLatestAgency.getStaffId())); + + cpUserDetailRedis.set(govTokenDto, expire); + logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); + } + public Set getDeptartmentIdList(String staffId) { + try { + Result> deptListResult = govOrgOpenFeignClient.getDepartmentListByStaffId(staffId); + if (deptListResult.success()) { + if (!CollectionUtils.isEmpty(deptListResult.getData())) { + Set deptIdLists = deptListResult.getData().stream().map(dept -> dept.getDepartmentId()).collect(Collectors.toSet()); + return deptIdLists; + } + } else { + logger.error("登录:查询部门列表,远程调用返回错误:{}", deptListResult.getMsg()); + } + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error("登录:查询部门列表异常:{}", errorStackTrace); + } + return null; + } + /** + * 根据工作人员ID查询网格ID列表 + * @param staffId + */ + public Set getGridIdList(String staffId) { + Result> result = govOrgOpenFeignClient.listGridsbystaffid(staffId); + if (!result.success()) { + logger.error("登录:查询网格列表,远程调用返回错误:{}", result.getMsg()); + return null; + } else { + List grids = result.getData(); + return grids.stream().map(grid -> grid.getGridId()).collect(Collectors.toSet()); + } + } + /** + * 根据staffId查询所属的组织机构 + * + * @param staffId + */ + public CustomerAgencyDTO getAgencyByStaffId(String staffId) { + Result result = govOrgOpenFeignClient.getAgencyByStaff(staffId); + if (!result.success()) { + logger.error("登录:查询登录人所属的机关OrgIdPath失败:{}", result.getMsg()); + return null; + } + return result.getData(); + } + /** + * 查询人员在某机关单位下的角色列表 + * @param staffId orgId + */ + public List queryGovStaffRoles(String staffId, String orgId) { + StaffRoleFormDTO formDTO = new StaffRoleFormDTO(); + formDTO.setStaffId(staffId); + formDTO.setOrgId(orgId); + Result> gridResult = epmetUserOpenFeignClient.getRolesOfStaff(formDTO); + if (!CollectionUtils.isEmpty(gridResult.getData())) { + //return gridResult.getData().stream().map(role -> role.getId()).collect(Collectors.toSet()); + return ConvertUtils.sourceToTarget(gridResult.getData(), GovTokenDto.Role.class); + } + return null; + } + /** + * 查询工作人员的OrgIdPath + * @param staffId + */ + public String getOrgIdPath(String staffId) { + Result result = govOrgOpenFeignClient.getAgencyByStaff(staffId); + if (!result.success()) { + logger.error("登录:查询登录人所属的机关OrgIdPath失败:{}", result.getMsg()); + return null; + } + CustomerAgencyDTO agency = result.getData(); + if (agency != null) { + if ("0".equals(agency.getPid())) { + // 顶级 + return agency.getId(); + } else { + return agency.getPids().concat(":").concat(agency.getId()); + } + } + return null; + } + + /** + * @param formDTO + * @Author sun + * @Description 4、自动进入组织-返回token + **/ + @Override + public UserTokenResultDTO enterOrg(SsoEnteOrgFormDTO formDTO) { + //1、需要校验要登录的客户,是否被禁用 + CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); + customerStaffFormDTO.setCustomerId(formDTO.getCustomerId()); + customerStaffFormDTO.setMobile(formDTO.getMobile()); + Result customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfo(customerStaffFormDTO); + if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { + logger.error(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + throw new RenException(customerStaffDTOResult.getCode()); + } + CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); + + //2.客户Id换取第三方apiService,根据ticket换取华为Id + Result apiServiceResult = operCrmOpenFeignClient.getApiServiceByCustomerId(new ApiServiceFormDTO(formDTO.getCustomerId())); + if (!apiServiceResult.success()) { + throw new RenException("【SSO登录】调用OperCrm获取ApiService接口失败:", apiServiceResult.getInternalMsg()); + } + if (apiServiceResult.getData() == null || StringUtils.isBlank(apiServiceResult.getData().getApiServiceName())) { + throw new RenException("【SSO登录】调用OperCrm获取ApiService,查询到的结果为空:", apiServiceResult.toString()); + } + ThirdPlatUserInfo userInfo; + try { + AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(apiServiceResult.getData().getApiServiceName()); + userInfo = apiService.getUserInfoByTicket(formDTO.getTicket()); + } catch (Exception e) { + throw new RenException(e.getMessage()); + } + if (null == userInfo){ + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), + "【SSO登录】调用第三方平台查询用户信息失败,用户信息为空"); + } + + //3、记录staff_wechat,并记录用户激活状态,激活时间 + this.savestaffwechat(customerStaff.getUserId(), userInfo.getOpenId()); + + //4、记录登录日志 + StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = new StaffLatestAgencyResultDTO(); + staffLatestAgencyResultDTO.setCustomerId(formDTO.getCustomerId()); + staffLatestAgencyResultDTO.setStaffId(customerStaff.getUserId()); + staffLatestAgencyResultDTO.setWxOpenId(userInfo.getOpenId()); + staffLatestAgencyResultDTO.setMobile(formDTO.getMobile()); + staffLatestAgencyResultDTO.setAgencyId(formDTO.getRootAgencyId()); + this.saveStaffLoginRecord(staffLatestAgencyResultDTO); + + //5.1、获取用户token + String token = this.generateGovWxmpToken(customerStaff.getUserId(), formDTO.getApp(), formDTO.getClient()); + //5.2、保存到redis + StaffLatestAgencyResultDTO staffLatestAgency = new StaffLatestAgencyResultDTO(); + staffLatestAgency.setAgencyId(formDTO.getRootAgencyId()); + staffLatestAgency.setCustomerId(formDTO.getCustomerId()); + staffLatestAgency.setStaffId(customerStaff.getUserId()); + this.saveLatestGovTokenDto(staffLatestAgency, userInfo, token); + + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + return userTokenResultDTO; + } + + + public static void main(String[] args) { + String url = "https://epmet-ext9.elinkservice.cn/platform/unifiedAuth/loginCheck"; + String platformToken = "1348803062424166401_dd08e23b0d524879a5c67e7f2ffd1468"; + String appId = "7a5aec009ba4eba8e254ee64fe3775e1"; + String appKey = "14faef9af508d1c253b720ea5a43f9de"; + String appSecret = "38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595"; + long ts = System.currentTimeMillis(); + String message = appId + appKey + appSecret + ts; + String accessToken = DigestUtils.md5Hex(message.getBytes(StandardCharsets.UTF_8)); + //ThirdPlatformEnum platformEnum = ThirdPlatformEnum.getEnum("pyld"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("platformToken", platformToken); + + Map headerMap = new HashMap<>(4); + headerMap.put("AppKey", appKey); + headerMap.put("Timestamp", ts); + headerMap.put("AccessToken", accessToken); + Result stringResult = HttpClientManager.getInstance().sendPost(url, url.startsWith("https://"), jsonObject.toJSONString(), headerMap); + System.out.println(stringResult); + } +} diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index e7fa54d000..412dba2dc3 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -131,4 +131,16 @@ dingTalk: shutdown: graceful: enable: true #是否开启优雅停机 - waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 \ No newline at end of file + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 + +# 调用第三方平台相关参数 +thirdplat: + jcet: + domain: @thirdplat.jcet.domain@ + appkey: @thirdplat.jcet.appkey@ + appsecret: @thirdplat.jcet.appsecret@ + pyld: + domain: https://epmet-ext9.elinkservice.cn/platform + appId: 7a5aec009ba4eba8e254ee64fe3775e1 + appKey: 14faef9af508d1c253b720ea5a43f9de + appSecret: 38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595 diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java index 17cb456a1a..c10e346e9c 100644 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java @@ -40,4 +40,9 @@ public interface LoginConstant { * E事通服务号 */ String CLIENT_MP = "mp"; + + /** + * 手机App + */ + String CLIENT_APP = "app"; } diff --git a/epmet-commons/epmet-commons-thirdplat/pom.xml b/epmet-commons/epmet-commons-thirdplat/pom.xml new file mode 100644 index 0000000000..8689c09054 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/pom.xml @@ -0,0 +1,22 @@ + + + + epmet-commons + com.epmet + 2.0.0 + + 4.0.0 + + epmet-commons-thirdplat + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + + \ 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 new file mode 100644 index 0000000000..43b27e385b --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/DemoApp.java @@ -0,0 +1,36 @@ +package com.epmet.commons.thirdplat; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.thirdplat.dto.form.jcet.SsoTicketFormDTO; +import com.epmet.commons.thirdplat.dto.form.jcet.SsoTokenFormDTO; +import com.epmet.commons.thirdplat.encrypt.SignUtils; + +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +public class DemoApp { + + private static String appid = "soXDEoM1"; + private static String appsecret = "V7ea0KnlYt7eSyzc"; + + public static void main(String[] args) throws UnsupportedEncodingException { + + //SsoToken ssoToken = new SsoToken(); + //ssoToken.setSsoToken("wxz"); + + SsoTicketFormDTO ssoTicket = new SsoTicketFormDTO(); + ssoTicket.setSsoTicket("wxz"); + + int bodyLength = JSON.toJSONString(ssoTicket).getBytes("utf-8").length; + + Map headers = new HashMap(); + long timestamp = System.currentTimeMillis(); + headers.put("openTimestamp", String.valueOf(timestamp)); + headers.put("openAppId", appid); + String encryptContent = appid + timestamp + bodyLength; + headers.put("openSign", SignUtils.generate(encryptContent, appsecret)); + System.out.println(headers); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..150d99b2da --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/AbstractApiService.java @@ -0,0 +1,44 @@ +package com.epmet.commons.thirdplat.apiservice; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.thirdplat.bean.ThirdPlatUserInfo; +import com.epmet.commons.thirdplat.dto.result.jcet.JcetResult; +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.Result; + +public abstract class AbstractApiService { + + protected ThirdplatProps thirdplatProps; + + /** + * 通过ticket查询用户信息 + * @param ticket + * @return + * @throws Exception + */ + public abstract ThirdPlatUserInfo getUserInfoByTicket(String ticket) throws Exception; + + /** + * @Description 解析请求结果 + * @return + * @author wxz + * @date 2021.01.19 09:53 + */ + protected R parseResult(Result thResult, Class resultType) { + if (!thResult.success()) { + 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(), + jcetResult.getMsg().concat(",错误码:") + jcetResult.getCode()); + } + + JSONObject jo = (JSONObject) jcetResult.getData(); + return jo.toJavaObject(resultType); + } +} 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 new file mode 100644 index 0000000000..7dd811425d --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/jcet/JcetApiService.java @@ -0,0 +1,117 @@ +package com.epmet.commons.thirdplat.apiservice.jcet; + +import com.alibaba.fastjson.JSON; +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.encrypt.SignUtils; +import com.epmet.commons.thirdplat.properties.JcetThirdplatProps; +import com.epmet.commons.thirdplat.properties.ThirdplatProps; +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()); + + private JcetThirdplatProps jcetThirdplatProps; + + public JcetApiService(ThirdplatProps props) { + this.thirdplatProps = props; + jcetThirdplatProps = props.getJcet(); + } + + /** + * @return + * @Description 通过第三方平台ticket获取用户信息 + * @author wxz + * @date 2021.01.19 10:26 + */ + @Override + public ThirdPlatUserInfo getUserInfoByTicket(String ticket) throws UnsupportedEncodingException { + + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口入参 ticket:{}", ticket); + + SsoTicketFormDTO ssoTicket = new SsoTicketFormDTO(); + ssoTicket.setSsoTicket(ticket); + + String domain = jcetThirdplatProps.getDomain(); + Result result = HttpClientManager.getInstance().sendPost( + domain.concat(JcetConstants.URL_GET_USER_BY_TICKET), + domain.startsWith("https://"), + JSON.toJSONString(ssoTicket), + getHeaders(ssoTicket)); + + try { + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); + } catch (Exception e) { + //e.printStackTrace(); + } + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<"); + + JcetUserInfoResultDTO resultDTO = parseResult(result, JcetUserInfoResultDTO.class); + + ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo(); + userInfo.setOpenId(resultDTO.getId()); + userInfo.setName(resultDTO.getName()); + userInfo.setMobile(resultDTO.getMobile()); + return userInfo; + } + + /** + * @return + * @Description 通过token获取用户信息 + * @author wxz + * @date 2021.01.19 10:28 + */ + //public JcetUserInfoResultDTO getUserInfoByToken(String token) throws UnsupportedEncodingException { + // SsoTokenFormDTO ssoToken = new SsoTokenFormDTO(); + // ssoToken.setSsoToken(token); + // + // HashMap paramMap = new HashMap<>(); + // paramMap.put(JcetConstants.PLAT_TOKEN_NAME, token); + // + // String domain = jcetThirdplatProps.getDomain(); + // + // Result result = HttpClientManager.getInstance().sendGet( + // domain.concat(JcetConstants.URL_GET_USER_BY_TOKEN), + // domain.startsWith("https://"), + // paramMap, + // getHeaders(ssoToken)); + // + // JcetUserInfoResultDTO resultDTO = parseResult(result, JcetUserInfoResultDTO.class); + // return resultDTO; + //} + + /** + * 获取请求所需要的头信息 + * + * @param contentObject + * @return + * @throws UnsupportedEncodingException + */ + private Map getHeaders(Object contentObject) throws UnsupportedEncodingException { + int bodyLength = JSON.toJSONString(contentObject).getBytes(StandardCharsets.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())); + return headers; + } + +} 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..c5f176b073 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java @@ -0,0 +1,122 @@ +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); + + + JSONObject jsonParam = new JSONObject(); + jsonParam.put(PyldConstants.PLAT_PARAM_TOKEN, platformToken); + jsonParam.put(PyldConstants.PLAT_PARAM_MANAGEMENTKEY, PyldConstants.PLAT_PARAM_MANAGEMENTKEY_VALUE); + + String domain = pyldThirdplatProps.getDomain(); + Result result = HttpClientManager.getInstance().sendPost( + domain.concat(PyldConstants.METHOD_CHECK_LOGIN), + domain.startsWith("https://"), + jsonParam.toJSONString(), + buildHeaders()); + + logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); + + logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<"); + + PyldUserInfoResultDTO resultDTO = this.parseResult(result); + + ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo(); + userInfo.setMobile(resultDTO.getMobile()); + userInfo.setCustomerId(resultDTO.getReserved()); + return userInfo; + + } + + + /** + * 构建请求头信息 + * + * @return + */ + private Map buildHeaders() { + Map headers = new HashMap(); + long timestamp = System.currentTimeMillis(); + headers.put(PyldConstants.PLAT_HEADER_TIMESTAMP, timestamp); + headers.put(PyldConstants.PLAT_HEADER_APP_KEY, pyldThirdplatProps.getAppkey()); + String encryptContent = pyldThirdplatProps.getAppId() + pyldThirdplatProps.getAppkey() + pyldThirdplatProps.getAppSecret() + timestamp; + headers.put(PyldConstants.PLAT_HEADER_ACCESS_TOKEN, DigestUtils.md5Hex(encryptContent.getBytes(StandardCharsets.UTF_8))); + return headers; + } + + /** + * desc: 解析结果 + * + * @param thResult + * @return com.epmet.commons.thirdplat.dto.result.jcet.JcetUserInfoResultDTO + * @author LiuJanJun + * @date 2021/2/24 10:11 上午 + */ + private PyldUserInfoResultDTO parseResult(Result thResult) { + if (!thResult.success()) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), + EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(thResult.getInternalMsg())); + } + JSONObject jcetResult = JSON.parseObject(thResult.getData()); + Integer code = jcetResult.getInteger("code"); + String msg = jcetResult.getString("msg"); + if (code == null || code != 0) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), msg.concat(",错误码:") + code); + } + JSONObject data = jcetResult.getJSONObject("data"); + if (data == null) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), + EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(PyldConstants.REPONSE_USER_NOT_LOGIN)); + } + PyldUserInfoResultDTO userInfo = data.getObject("userInfo", PyldUserInfoResultDTO.class); + if (userInfo == null || StringUtils.isBlank(userInfo.getMobile()) || StringUtils.isBlank(userInfo.getReserved())) { + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), PyldConstants.REPONSE_USER_NOT_LOGIN); + } + return userInfo; + } + + +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java new file mode 100644 index 0000000000..7d9fa4aabf --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java @@ -0,0 +1,11 @@ +package com.epmet.commons.thirdplat.bean; + +import lombok.Data; + +@Data +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/config/ThirdplatConfig.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/config/ThirdplatConfig.java new file mode 100644 index 0000000000..11e941ab93 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/config/ThirdplatConfig.java @@ -0,0 +1,28 @@ +package com.epmet.commons.thirdplat.config; + +import com.epmet.commons.thirdplat.apiservice.jcet.JcetApiService; +import com.epmet.commons.thirdplat.constants.ApiServiceBeansConstants; +import com.epmet.commons.thirdplat.properties.ThirdplatProps; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 第三方平台的相关配置 + */ +@Configuration +@EnableConfigurationProperties(ThirdplatProps.class) +public class ThirdplatConfig { + + /** + * @Description 酒城e通的apiService,这个name需要注册进数据库,使用的时候去数据库根据客户id找对应的apiService出来用 + * @return + * @author wxz + * @date 2021.01.20 13:50 + */ + @Bean(name = ApiServiceBeansConstants.JCET_API_SERVICE) + public JcetApiService JcetApiService(ThirdplatProps props) { + return new JcetApiService(props); + } + +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/ApiServiceBeansConstants.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/ApiServiceBeansConstants.java new file mode 100644 index 0000000000..2d79aebcfa --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/ApiServiceBeansConstants.java @@ -0,0 +1,9 @@ +package com.epmet.commons.thirdplat.constants; + +/** + * ApiService常量 + */ +public interface ApiServiceBeansConstants { + // 酒城e通apiService + String JCET_API_SERVICE = "jcetApiService"; +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/JcetConstants.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/JcetConstants.java new file mode 100644 index 0000000000..34d4995bd7 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/JcetConstants.java @@ -0,0 +1,14 @@ +package com.epmet.commons.thirdplat.constants; + +public interface JcetConstants { + + String URL_GET_USER_BY_TICKET = "/openapi-cgw/openapi-login/sso/getUserInfoByTicket"; + String URL_GET_USER_BY_TOKEN = "/openapi-cgw/openapi-login/sso/getUserInfoByToken"; + + String PLAT_TICKET_NAME = "ssoTicket"; + String PLAT_TOKEN_NAME = "ssoToken"; + + String PLAT_HEADER_OPEN_TIMESTAMP = "openTimestamp"; + String PLAT_HEADER_OPEN_APP_ID = "openAppId"; + String PLAT_HEADER_OPEN_SIGN = "openSign"; +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java new file mode 100644 index 0000000000..ffb6dbde97 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java @@ -0,0 +1,18 @@ +package com.epmet.commons.thirdplat.constants; + +public interface PyldConstants { + + String METHOD_CHECK_LOGIN = "/unifiedAuth/loginCheck"; + + + String PLAT_HEADER_TIMESTAMP = "timestamp"; + String PLAT_HEADER_APP_KEY = "appkey"; + String PLAT_HEADER_ACCESS_TOKEN = "accessToken"; + + + String PLAT_PARAM_TOKEN = "platformToken"; + String PLAT_PARAM_MANAGEMENTKEY = "managementKey"; + String PLAT_PARAM_MANAGEMENTKEY_VALUE = "epmet_work"; + + String REPONSE_USER_NOT_LOGIN = "token失效,请重新登陆"; +} diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/form/jcet/SsoTicketFormDTO.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/form/jcet/SsoTicketFormDTO.java new file mode 100644 index 0000000000..b0f905d972 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/form/jcet/SsoTicketFormDTO.java @@ -0,0 +1,8 @@ +package com.epmet.commons.thirdplat.dto.form.jcet; + +import lombok.Data; + +@Data +public class SsoTicketFormDTO { + private String ssoTicket; +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/form/jcet/SsoTokenFormDTO.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/form/jcet/SsoTokenFormDTO.java new file mode 100644 index 0000000000..f3a7707082 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/form/jcet/SsoTokenFormDTO.java @@ -0,0 +1,8 @@ +package com.epmet.commons.thirdplat.dto.form.jcet; + +import lombok.Data; + +@Data +public class SsoTokenFormDTO { + private String ssoToken; +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetResult.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetResult.java new file mode 100644 index 0000000000..aea748f51a --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetResult.java @@ -0,0 +1,13 @@ +package com.epmet.commons.thirdplat.dto.result.jcet; + +import lombok.Data; + +@Data +public class JcetResult { + + private boolean success; + private String msg; + private Object data; + private int code; + +} 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/JcetUserInfoResultDTO.java new file mode 100644 index 0000000000..8c025e5b9b --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetUserInfoResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.commons.thirdplat.dto.result.jcet; + +import lombok.Data; + +@Data +public class JcetUserInfoResultDTO { + private String id; + /** + * 用户名称 + */ + private String userName; + /** + * 手机号码 + */ + private String mobile; + /** + * 姓名 + */ + private String name; + /** + * 邮箱 + */ + private String email; + + /** + * sessionId,用于维持在线状态 + */ + private String oaSessionId; +} 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/encrypt/EncryptUtils.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/encrypt/EncryptUtils.java new file mode 100644 index 0000000000..699d12ea40 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/encrypt/EncryptUtils.java @@ -0,0 +1,51 @@ +package com.epmet.commons.thirdplat.encrypt; + + +import com.epmet.commons.tools.exception.RenException; + +import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +public class EncryptUtils { + private final static char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + /** + * 32位 MD5加密 + * + * @param s + * @return + */ + public static String md5Hex(String s) throws UnsupportedEncodingException { + byte[] result = digest("MD5", s.getBytes(Charset.defaultCharset())); + return hex(result); + } + /** + * 32 位 sha256加密 + * + * @param s + * @return + */ + public static String sha256(String s) { + byte[] result = digest("SHA-256", s.getBytes(Charset.defaultCharset())); + return hex(result); + } + private static byte[] digest(String algorithm, byte[] data) { + try { + MessageDigest digest = MessageDigest.getInstance(algorithm); + digest.update(data, 0, data.length); + return digest.digest(); + } catch (NoSuchAlgorithmException e) { + throw new RenException(algorithm + " error", e); + } + } + private static String hex(byte[] data) { + char[] result = new char[data.length * 2]; + int c = 0; + for (byte b : data) { + result[c++] = HEX_DIGITS[(b >> 4) & 0xf]; + result[c++] = HEX_DIGITS[b & 0xf]; + } + return new String(result); + } +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/encrypt/SignUtils.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/encrypt/SignUtils.java new file mode 100644 index 0000000000..1c45e44b6b --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/encrypt/SignUtils.java @@ -0,0 +1,15 @@ +package com.epmet.commons.thirdplat.encrypt; + +import java.io.UnsupportedEncodingException; + +public class SignUtils { + public static String generate(String content, String secret) throws UnsupportedEncodingException { + String sign = EncryptUtils.sha256(content); + sign = EncryptUtils.md5Hex(sign + secret); + return sign; + } + + public static void main(String[] args) { + System.out.println(777); + } +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/JcetThirdplatProps.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/JcetThirdplatProps.java new file mode 100644 index 0000000000..1682a86fce --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/JcetThirdplatProps.java @@ -0,0 +1,13 @@ +package com.epmet.commons.thirdplat.properties; + +import lombok.Data; + +/** + * 酒城e通三方平台配置 + */ +@Data +public class JcetThirdplatProps { + private String domain; + private String appkey; + private String appsecret; +} 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 new file mode 100644 index 0000000000..4c9b46b9e0 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/ThirdplatProps.java @@ -0,0 +1,18 @@ +package com.epmet.commons.thirdplat.properties; + +import lombok.Data; +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/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index b66c3c33d2..e104c83e54 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -119,6 +119,11 @@ public interface ServiceConstant { */ String DATA_STATISTICAL_SERVER = "data-statistical-server"; + /** + * 数据统计结果查询 + */ + String DATA_REPORT_SERVER="data-report-server"; + /** * 微信第三方平台 */ 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/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 6dfc185e18..0af5769e43 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 @@ -72,6 +72,7 @@ public enum EpmetErrorCode { NOT_DEL_AGENCY_GRID(8207, "该机关存在网格,不允许删除"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), + THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), NOT_ADD_GRID(8401,"您当前的网格名称已存在,请重新修改"), MOBILE_USED(8402,"该手机号已注册"), @@ -145,7 +146,6 @@ public enum EpmetErrorCode { TOPIC_IS_HIDDEN(9006,"该话题已被屏蔽,请先解除屏蔽"), TOPIC_IS_CLOSED(9008,"该话题已关闭,无法转为议题"); - private int code; private String msg; 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 7a16b837ad..e4f5a8cbae 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 @@ -361,4 +361,14 @@ public class RedisKeys { public static String getResiUserKey(String userId){ return rootPrefix.concat("resi:user:").concat(userId); } + + /** + * @Description 客户的ApiService + * @return + * @author wxz + * @date 2021.01.20 16:56 + */ + public static String getCustomerApiServiceKey(String customerId) { + return rootPrefix.concat("customer:thirdplat:apiservice:").concat(customerId); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoScanParamDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoScanParamDTO.java new file mode 100644 index 0000000000..07f0962a89 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoScanParamDTO.java @@ -0,0 +1,35 @@ +package com.epmet.commons.tools.scan.param; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * (异步检测)请求参数 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/10 21:05 + */ +@Data +public class VideoScanParamDTO implements Serializable { + private static final long serialVersionUID = -7261993744367287072L; + /** + * 是否开启回调 + */ + @NotNull(message = "openCallBack必填,true开启;false不开启") + private Boolean openCallBack; + + /** + * 异步检测结果回调地址,执行异步审查内容时 必填 + * openCallBack=true时,callback必填 + */ + private String callback; + + @Valid + @NotEmpty(message = "任务列表不能为空") + private List tasks; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoTaskDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoTaskDTO.java new file mode 100644 index 0000000000..6a71d5daf4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VideoTaskDTO.java @@ -0,0 +1,32 @@ +package com.epmet.commons.tools.scan.param; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * (异步检测)请求参数 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/10 21:06 + */ +@Data +public class VideoTaskDTO implements Serializable { + private static final long serialVersionUID = -5268462578193403270L; + /** + * 不必填 + * 要检测的数据id 非必填 + * 检测对象对应的数据ID。 + * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。 + * */ + @NotBlank(message = "dataId不能为空") + private String dataId; + + /** + * 必填 + * 待检测视频的URL。该字段不能和frames同时为空,也不能和frames同时有值。 + */ + @NotBlank(message = "音频URL不能为空") + private String url; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java index 77cabbfed7..6f8c33aa5c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java @@ -8,7 +8,7 @@ import java.util.List; /** * 语音异步检测 返参 - * + * 视频异步检测 返参通用 * @author yinzuomei@elink-cn.com * @date 2020/12/18 10:09 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoAsyncScanResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoAsyncScanResultDTO.java new file mode 100644 index 0000000000..86445a83e5 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoAsyncScanResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.commons.tools.scan.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 视频异步检测结果查询接口返参 + * 正在检测中的不返回,调用方继续轮询查询结果 + * @author yinzuomei@elink-cn.com + * @date 2020/12/29 15:37 + */ +@Data +public class VideoAsyncScanResultDTO implements Serializable { + private static final long serialVersionUID = -7302168989456734818L; + /** + * 执行成功的任务Id集合 + * code=200,且所有语音+视频所有场景返回结果都为pass时则为成功 + */ + private List passDataIds = new ArrayList<>(); + /** + * 执行失败的任务Id集合 + */ + private List noPassDataIds = new ArrayList<>(); + + private List passTaskIds = new ArrayList<>(); + private List noPassTaskIds = new ArrayList<>(); + + /** + * desc:阿里内容审核API返回结果详情 + */ + private List details = new ArrayList<>(); + + /** + * 本地是否全部通过 + */ + private Boolean isAllPass; + + public boolean isAllPass() { + if (noPassTaskIds.isEmpty() && !passTaskIds.isEmpty()) { + return true; + } + return isAllPass; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoScanDetailDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoScanDetailDTO.java new file mode 100644 index 0000000000..59b047a73b --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VideoScanDetailDTO.java @@ -0,0 +1,56 @@ +package com.epmet.commons.tools.scan.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/10 21:24 + */ +@Data +public class VideoScanDetailDTO implements Serializable { + /** + * 错误码,和HTTP状态码一致。 + * 更多信息,请参见公共错误码。 + */ + private Integer code; + + private String codeDesc; + + /** + * 错误描述信息。 + */ + private String msg; + /** + * 检测对象对应的数据ID。 + */ + private String dataId; + + /** + * 检测任务的ID + */ + private String taskId; + + /** + * 返回结果,调用成功时(code=200),返回结果中包含一个或多个元素。每个元素是个结构体,具体结构描述,请参见result。 + * 说明 视频流检测场景中,code返回280表示在检测中,返回200表示检测完成。在检测中状态时,检测结果中包含从开始检测到当前时间的检测到结果。 + */ + private List results; + + /** + * 视频语音检测结果。具体结构描述,请参见audioScanResult。 + */ + private List audioScanResults; + + + @Data + public static class ResultDetail { + private String scene; + private String label; + private String suggestion; + private Float rate; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/BaseTokenDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/BaseTokenDto.java index c3065c7200..f50f2f1d2d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/BaseTokenDto.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/dto/BaseTokenDto.java @@ -24,6 +24,8 @@ public class BaseTokenDto { */ private String token; + private String customerId; + public BaseTokenDto() { } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyNode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyNode.java new file mode 100644 index 0000000000..e6346d7e50 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyNode.java @@ -0,0 +1,26 @@ +package com.epmet.commons.tools.utils; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/4 20:49 + */ +@Data +public class AgencyNode implements Serializable { + + private String areaCode; + + private String parentAreaCode; + + /** + * 子节点列表 + */ + private List subAgencyList = new ArrayList<>(); +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyTreeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyTreeUtils.java new file mode 100644 index 0000000000..80ad231f47 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyTreeUtils.java @@ -0,0 +1,73 @@ +package com.epmet.commons.tools.utils; + + +import com.epmet.commons.tools.validator.AssertUtils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/4 20:49 + */ +public class AgencyTreeUtils { + + /** + * 根据pid,构建树节点 + */ + public static List build(List agencyNodes, String parentAreaCode) { + //pid不能为空 + AssertUtils.isNull(parentAreaCode, "parentAreaCode"); + + List treeList = new ArrayList<>(); + for (T agencyNode : agencyNodes) { + if (parentAreaCode.equals(agencyNode.getParentAreaCode())) { + treeList.add(findChildren(agencyNodes, agencyNode)); + } + } + + return treeList; + } + + /** + * 查找子节点 + */ + private static T findChildren(List agencyNodes, T rootNode) { + for (T agencyNode : agencyNodes) { + if (rootNode.getAreaCode().equals(agencyNode.getParentAreaCode())) { + rootNode.getSubAgencyList().add(findChildren(agencyNodes, agencyNode)); + } + } + return rootNode; + } + + /** + * 构建树节点 + */ + public static List build(List agencyNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(agencyNodes.size()); + for (T agencyNode : agencyNodes) { + nodeMap.put(agencyNode.getAreaCode(), agencyNode); + } + + for (T node : nodeMap.values()) { + T parent = nodeMap.get(node.getParentAreaCode()); + if (parent != null && !(node.getAreaCode().equals(parent.getAreaCode()))) { + parent.getSubAgencyList().add(node); + continue; + } + + result.add(node); + } + + return result; + } + +} 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 e4a6cf94cb..8c6432aadd 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 @@ -729,4 +729,38 @@ public class DateUtils { LocalDate ldn = new LocalDate(date); return ldn.dayOfMonth().withMaximumValue().toDate(); } + + /** + * @return ["202002","202003","202004","202005","202006","202007","202008","202009","202010","202011","202012","202101"] + * @param monthId 202101 + * @param num 11 + * @description 截止到当前monthId,近12个月的坐标 + * @Date 2021/2/1 17:20 + **/ + public static List getMonthIdList(String monthId,int num) { + List monthIdList = new ArrayList<>(); + for (int i = num; i >= NumConstant.ZERO; i--) { + Calendar c = Calendar.getInstance(); + c.setTime(com.epmet.commons.tools.utils.DateUtils.stringToDate(monthId.concat("01"), com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMMDD)); + c.add(Calendar.MONTH, -i); + Date date = c.getTime(); + String month = com.epmet.commons.tools.utils.DateUtils.format(date, com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMM); + // monthIdList.add(month.substring(4, 6).concat("月")); + monthIdList.add(month); + } + return monthIdList; + } + + /** + * @author yinzuomei + * @description 获取当前时间的山个月monthId + * @Date 2021/2/1 17:41 + **/ + public static String getCurrentTimeBeforeMonthId(){ + Calendar c = Calendar.getInstance(); + c.setTime(new Date()); + c.add(Calendar.MONTH, -1); + Date nowDate = c.getTime(); + return com.epmet.commons.tools.utils.DateUtils.format(nowDate, com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMM); + } } 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 ff83e56210..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,6 +188,30 @@ public class HttpClientManager { } + 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) -> { + if (v != null) + httppost.addHeader(k, v.toString()); + }); + } + if (StringUtils.isNotEmpty(jsonStrParam)) { + StringEntity se = new StringEntity(jsonStrParam, UTF8); + httppost.setEntity(se); + } + return execute(httppost, isHttps); + } catch (Exception e) { + log.error("send exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + } + /** * 上传临时素材 * @author zhaoqifeng @@ -325,6 +349,31 @@ public class HttpClientManager { } } + public Result sendGet(String url, boolean isHttps, Map params, Map headerMap) { + + try { + URIBuilder builder = new URIBuilder(url); + if (!CollectionUtils.isEmpty(params)) { + Set set = params.keySet(); + for (String key : set) { + builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key))); + } + } + + HttpGet httpGet = new HttpGet(builder.build()); + httpGet.setConfig(requestConfig); + if (null != headerMap){ + headerMap.forEach((k,v) -> { + httpGet.addHeader(k,v); + }); + } + return execute(httpGet, isHttps); + } catch (Exception e) { + log.error("sendGet exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + private Result execute(HttpRequestBase httpMethod, boolean isHttps) { CloseableHttpResponse response = null; try { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index effd25ccd6..6427301a18 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -8,6 +8,7 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.*; import com.epmet.commons.tools.scan.result.AsyncScanResult; import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.scan.result.VideoAsyncScanResultDTO; import com.epmet.commons.tools.scan.result.VoiceResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -136,6 +137,65 @@ public class ScanContentUtils { } } + /** + * @param url 视频地址 + * @param param + * @author yinzuomei + * @description 异步检测-提交检测任务 + **/ + public static Result videoAsyncScan(String url, VideoScanParamDTO param){ + log.debug("videoAsyncScan param:{}", JSON.toJSONString(param)); + if (StringUtils.isBlank(url) || param == null) { + throw new RenException("参数错误"); + } + if (param.getOpenCallBack() && StringUtils.isBlank(param.getCallback())) { + throw new RenException("参数错误,开启回调,callback必填"); + } + try { + Result result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(param)); + log.debug("videoAsyncScan result:{}", JSON.toJSONString(result)); + if (result.success()) { + return JSON.parseObject(result.getData(),new TypeReference>(){}); + } + Result resultResult = new Result<>(); + resultResult.error(result.getCode(),result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.error("videoAsyncScan exception:", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + } + + /** + * @param url + * @param taskIds + * @author yinzuomei + * @description 查询视频检测结果 + **/ + public static Result videoResults(String url, List taskIds) { + if (StringUtils.isBlank(url) || CollectionUtils.isEmpty(taskIds)) { + throw new RenException("参数错误"); + } + if (taskIds.size() > NumConstant.ONE_HUNDRED) { + throw new RenException("参数错误,查询检测任务最大不能超过100"); + } + try { + Result result = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(taskIds)); + log.debug("videoResults result:{}", JSON.toJSONString(result)); + if (result.success()) { + return JSON.parseObject(result.getData(), new TypeReference>() { + }); + } + Result resultResult = new Result<>(); + resultResult.error(result.getCode(), result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.error("voiceResults exception:", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + } public static void main(String[] args) { //测试文本检测 @@ -143,7 +203,11 @@ public class ScanContentUtils { //测试语音检测 // testVoiceAsyncScan(); //语音检测结果 - testVoiceResults(); + // testVoiceResults(); + //视频检测任务提交 + // testVideoAsyncScan(); + //查询视频检测结果 + testVideoResults(); } public static void testTextSyncScan(){ @@ -200,4 +264,26 @@ public class ScanContentUtils { Result> asyncScanResultResult = ScanContentUtils.voiceResults(url, taskIds); System.out.println("================" + JSON.toJSONString(asyncScanResultResult)); } + + public static void testVideoAsyncScan(){ + String url = "http://localhost:8107/epmetscan/api/videoAsyncScan"; + VideoTaskDTO p = new VideoTaskDTO(); + p.setDataId("1"); + p.setUrl("https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20210111/e996a68b9f0144a3843666c430f73086.mp4"); + List list = new ArrayList<>(); + list.add(p); + VideoScanParamDTO param = new VideoScanParamDTO(); + param.setTasks(list); + param.setOpenCallBack(false); + Result asyncScanResultResult = ScanContentUtils.videoAsyncScan(url, param); + System.out.println(JSON.toJSONString(asyncScanResultResult)); + } + + public static void testVideoResults(){ + String url = "http://localhost:8107/epmetscan/api/videoResults"; + List taskIds=new ArrayList<>(); + taskIds.add("vi6ZatqnJEkqf5m@FZ7Ka0AU-1tKYdk"); + Result result = ScanContentUtils.videoResults(url, taskIds); + System.out.println("================" + JSON.toJSONString(result)); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java index c9003a3655..7d9889d77b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java @@ -7,7 +7,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.mq.EventClassDto; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqReturnBaseResult; -import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.enums.MqMethodPathEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ValidateException; @@ -29,85 +28,91 @@ import java.util.Map; @Slf4j @Component public class SendMqMsgUtils { - private static MqConfig mqConfig; + private static MqConfig mqConfig; - /** - * desc:发送mq消息 - * - * @return - */ - public static Result sendMsg(MqBaseMsgDTO msg) { - if (mqConfig == null) { - mqConfig = SpringContextUtils.getBean(MqConfig.class); - } - log.debug("sendMsg param:{}", JSON.toJSONString(msg)); - try { - // TODO - ValidatorUtils.validateEntity(msg, DefaultGroup.class); - } catch (ValidateException e) { - return new Result().error(e.getMsg()); - } - msg.setAppId(mqConfig.getAppId()); - msg.setRequestUrl(mqConfig.getHost().concat(MqMethodPathEnum.SEND_MSG.getCode())); - msg.setToken(mqConfig.getToken()); - try { - Result result = HttpClientManager.getInstance().sendPostByHttps(msg.getRequestUrl(), JSON.toJSONString(msg)); - log.debug("sendMsg result:{}", JSON.toJSONString(result)); - if (result.success()) { - MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); - if (resultResult.getErrCode().equals(NumConstant.ZERO)) { - JSONObject jsonObject = JSON.parseObject(resultResult.getData()); - return new Result().ok(jsonObject.getString("msgId")); - } else { - log.error("sendMsg fail,resultData:{}", JSON.toJSONString(resultResult)); - return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), resultResult.getErrMsg()); - } - } - Result resultResult = new Result<>(); - resultResult.error(result.getCode(), result.getMsg()); - resultResult.setInternalMsg(result.getInternalMsg()); - return resultResult; - } catch (Exception e) { - log.debug("sendMsg exception", e); - return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); - } - } + /** + * desc:发送mq消息(如果失败重试1次) + * + * @return + */ + public static Result sendMsg(MqBaseMsgDTO msg) { + if (mqConfig == null) { + mqConfig = SpringContextUtils.getBean(MqConfig.class); + } + log.info("sendMsg param:{}", JSON.toJSONString(msg)); + try { + // TODO + ValidatorUtils.validateEntity(msg, DefaultGroup.class); + } catch (ValidateException e) { + return new Result().error(e.getMsg()); + } + msg.setAppId(mqConfig.getAppId()); + msg.setRequestUrl(mqConfig.getHost().concat(MqMethodPathEnum.SEND_MSG.getCode())); + msg.setToken(mqConfig.getToken()); + try { + int retryTime = 0; + Result result = null; + do { + retryTime++; + result = HttpClientManager.getInstance().sendPostByHttps(msg.getRequestUrl(), JSON.toJSONString(msg)); + log.info("sendMsg retryTime:{},result:{}", retryTime, JSON.toJSONString(result)); + } while ((!result.success()) && retryTime < 2); + if (result.success()) { + MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); + if (resultResult.getErrCode().equals(NumConstant.ZERO)) { + JSONObject jsonObject = JSON.parseObject(resultResult.getData()); + return new Result().ok(jsonObject.getString("msgId")); + } else { + log.error("sendMsg fail,resultData:{}", JSON.toJSONString(resultResult)); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), resultResult.getErrMsg()); + } + } + Result resultResult = new Result<>(); + resultResult.error(result.getCode(), result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.error("sendMsg exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } - /** - * desc:发送mq消息 - * - * @return - */ - public static Result> getEventClassList() { - if (mqConfig == null) { - mqConfig = SpringContextUtils.getBean(MqConfig.class); - } - Map param = new HashMap<>(); - param.put("appId", mqConfig.getAppId()); - param.put("token", mqConfig.getToken()); - String requestUrl = mqConfig.getHost().concat(MqMethodPathEnum.GET_EVENT_LIST.getCode()); - try { - Result result = HttpClientManager.getInstance().sendPostByHttps(requestUrl, JSON.toJSONString(param)); - log.debug("getEventClassList result:{}", JSON.toJSONString(result)); - if (result.success()) { - MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); - if (resultResult.getErrCode().equals(NumConstant.ZERO)) { - List eventClassDto = JSON.parseArray(resultResult.getData(), EventClassDto.class); - return new Result>().ok(eventClassDto); - } else { - log.error("sendMsg fail,resultData:{}", JSON.toJSONString(resultResult)); - return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), resultResult.getErrMsg()); - } - } - Result> resultResult = new Result<>(); - resultResult.error(result.getCode(), result.getMsg()); - resultResult.setInternalMsg(result.getInternalMsg()); - return resultResult; - } catch (Exception e) { - log.debug("sendMsg exception", e); - return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); - } - } + /** + * desc:发送mq消息 + * + * @return + */ + public static Result> getEventClassList() { + if (mqConfig == null) { + mqConfig = SpringContextUtils.getBean(MqConfig.class); + } + Map param = new HashMap<>(); + param.put("appId", mqConfig.getAppId()); + param.put("token", mqConfig.getToken()); + String requestUrl = mqConfig.getHost().concat(MqMethodPathEnum.GET_EVENT_LIST.getCode()); + + try { + Result result = HttpClientManager.getInstance().sendPostByHttps(requestUrl, JSON.toJSONString(param)); + log.info("getEventClassList result:{}", JSON.toJSONString(result)); + if (result.success()) { + MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); + if (resultResult.getErrCode().equals(NumConstant.ZERO)) { + List eventClassDto = JSON.parseArray(resultResult.getData(), EventClassDto.class); + return new Result>().ok(eventClassDto); + } else { + log.error("sendMsg fail,resultData:{}", JSON.toJSONString(resultResult)); + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), resultResult.getErrMsg()); + } + } + Result> resultResult = new Result<>(); + resultResult.error(result.getCode(), result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.error("sendMsg exception", e); + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } } diff --git a/epmet-commons/pom.xml b/epmet-commons/pom.xml index 0bf8dd9c9f..636480c48f 100644 --- a/epmet-commons/pom.xml +++ b/epmet-commons/pom.xml @@ -23,6 +23,7 @@ epmet-commons-tools-wx-mp epmet-commons-service-call epmet-commons-extapp-auth + epmet-commons-thirdplat epmet-commons-rocketmq diff --git a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java index 2ee22426f6..bd7d740297 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -105,13 +105,17 @@ public class InternalAuthProcessor extends AuthProcessor { if (baseTokenDto != null) { String redisKey = baseTokenDto.getApp() + "-" + baseTokenDto.getClient() + "-" + baseTokenDto.getUserId(); logger.info("redisKey=" + redisKey); - exchange.getRequest().mutate() - .header(Constant.APP_USER_KEY, redisKey) - .header(AppClientConstant.APP,baseTokenDto.getApp()) - .header(AppClientConstant.CLIENT,baseTokenDto.getClient()) - .header(AppClientConstant.USER_ID,baseTokenDto.getUserId()); - if (StringUtils.equals(baseTokenDto.getApp(), "gov")) {//工作端 + ServerHttpRequest.Builder builder = exchange.getRequest().mutate(); + builder.header(Constant.APP_USER_KEY, redisKey); + builder.header(AppClientConstant.APP,baseTokenDto.getApp()); + builder.header(AppClientConstant.CLIENT,baseTokenDto.getClient()); + builder.header(AppClientConstant.USER_ID,baseTokenDto.getUserId()); + if (StringUtils.isNotBlank(baseTokenDto.getCustomerId())) { + builder.header(AppClientConstant.CUSTOMER_ID,baseTokenDto.getCustomerId()); + } + + if (StringUtils.equalsAny(baseTokenDto.getApp(), AppClientConstant.APP_GOV, AppClientConstant.APP_RESI)) {//工作端/居民端 if(StringUtils.isNotBlank(customerId)){ exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); } diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 28f31cd59b..a0c1c35811 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -468,7 +468,7 @@ epmet: - /epmet/ext/** - /epmetuser/customerstaff/customerlist - /message/template/** - + - /data/aggregator/project/projectdistribution swaggerUrls: jwt: diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueInfoDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueInfoDTO.java new file mode 100644 index 0000000000..4fc0e2e224 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueInfoDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dataaggre.dto.govissue.result; + +import lombok.Data; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/24 12:12 + */ +@Data +public class IssueInfoDTO { + private String issueId; + private String gridId; + private String topicId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java index c3a6f3d697..4b98fb899f 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java @@ -128,4 +128,8 @@ public class CustomerAgencyDTO implements Serializable { */ private String district; + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; } \ No newline at end of file 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 new file mode 100644 index 0000000000..f1f25aeb05 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectDistributionFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dataaggre.dto.govproject.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 项目分布(实时只适用于e事通客户)入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/24 11:04 + */ +@Data +public class ProjectDistributionFormDTO implements Serializable { + private String gridId; + @NotBlank(message = "customerId不能为空") + private String customerId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectDistributionResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectDistributionResultDTO.java new file mode 100644 index 0000000000..ba0340c66e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectDistributionResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 项目分布(实时只适用于e事通客户)返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/24 11:05 + */ +@Data +public class ProjectDistributionResultDTO implements Serializable { + private String projectId; + private String projectTitle; + private String statusDesc; + private String longitude; + private String latitude; + // @JsonIgnore + private String issueId; + // @JsonIgnore + private String statusCode; + private String gridId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicDTO.java index 87692d1263..19c44136fb 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicDTO.java @@ -17,9 +17,10 @@ package com.epmet.dataaggre.dto.resigroup; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -128,4 +129,8 @@ public class ResiTopicDTO implements Serializable { */ private String issueId; + /** + * 话题所属网格id + */ + private String gridId; } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java index 8ba7cadc7d..18aa5a924c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java @@ -5,14 +5,16 @@ import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; import com.epmet.dataaggre.service.govproject.GovProjectService; 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; /** * @Author zxc @@ -39,4 +41,19 @@ public class GovProjectController { AllProjectResultDTO result = govProjectService.allProjectList(tokenDto, formDTO); return new Result().ok(result); } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei 项目分布(实时只适用于e事通客户)返参 + * @description 目前在用:龙湾大屏调用此接口;接口内写死了 按照立项时间降序,取前100个项目 + * @Date 2021/2/24 13:17 + **/ + @PostMapping("projectdistribution") + public Result> queryProjectDistribution(@RequestHeader("CustomerId") String customerId, + @RequestBody ProjectDistributionFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(govProjectService.queryProjectDistribution(formDTO)); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java index 2bb40f4c8d..1e85e06366 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO; import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO; import com.epmet.dataaggre.dto.govissue.form.VotingIssueListFormDTO; -import com.epmet.dataaggre.dto.govissue.result.ClosedIssueListResultDTO; -import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; -import com.epmet.dataaggre.dto.govissue.result.IssueShiftProjectResultDTO; -import com.epmet.dataaggre.dto.govissue.result.VotingIssueListResultDTO; +import com.epmet.dataaggre.dto.govissue.result.*; import com.epmet.dataaggre.entity.govissue.IssueEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -75,4 +72,6 @@ public interface IssueDao extends BaseDao { List selectClosedListGov(ClosedIssueListFormDTO fromDTO); Integer selectIssueCount(@Param("gridIds") List gridIds,@Param("issueType")String issueType); + + List selectShiftProjectIssueList(@Param("customerId") String customerId, @Param("gridId") String gridId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java index 7b0ae9a6fe..cc3f3d9e7e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java @@ -18,18 +18,17 @@ package com.epmet.dataaggre.dao.govproject; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; -import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO; import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; import com.epmet.dataaggre.dto.govproject.ProjectDTO; +import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO; import com.epmet.dataaggre.entity.govproject.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; -import java.util.List; - /** * 项目表 * @@ -68,4 +67,5 @@ public interface ProjectDao extends BaseDao { **/ List selectDepartmentNameList(ProjectDTO project); + List selectList(@Param("customerId") String customerId,@Param("list")List issueIds); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java index 5ba256bde6..cd57936e2f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.java @@ -18,8 +18,12 @@ package com.epmet.dataaggre.dao.resigroup; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; import com.epmet.dataaggre.entity.resigroup.ResiTopicEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 话题信息表 @@ -29,5 +33,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ResiTopicDao extends BaseDao { - + + List selectTopicInfoByIds(@Param("list") List topicIds); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java index 1f7dc21bea..79f226ca2f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java @@ -94,4 +94,8 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private String district; + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; } 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 2c80898675..b3a96f917c 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 @@ -5,10 +5,7 @@ import com.epmet.dataaggre.dto.govissue.form.AllIssueFormDTO; import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO; import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO; import com.epmet.dataaggre.dto.govissue.form.VotingIssueListFormDTO; -import com.epmet.dataaggre.dto.govissue.result.AllIssueResultDTO; -import com.epmet.dataaggre.dto.govissue.result.ClosedIssueListResultDTO; -import com.epmet.dataaggre.dto.govissue.result.ShiftProjectIssueListResultDTO; -import com.epmet.dataaggre.dto.govissue.result.VotingIssueListResultDTO; +import com.epmet.dataaggre.dto.govissue.result.*; import java.util.List; @@ -46,4 +43,6 @@ public interface GovIssueService { * @author sun **/ List closedIssueList(ClosedIssueListFormDTO fromDTO); + + List selectShiftProjectIssueList(String customerId,String gridId); } 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 87ff2a6dd9..e379b75a38 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 @@ -313,4 +313,9 @@ public class GovIssueServiceImpl implements GovIssueService { return resultList; } + @Override + public List selectShiftProjectIssueList(String customerId,String gridId) { + return issueDao.selectShiftProjectIssueList(customerId,gridId); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java index ecfdfed1cb..38192cd035 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java @@ -1,12 +1,11 @@ package com.epmet.dataaggre.service.govproject; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; - -import java.util.List; - -import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; import com.epmet.dataaggre.dto.govproject.result.ShiftProjectResultDTO; import java.util.List; @@ -41,4 +40,5 @@ public interface GovProjectService { List getProjectByIssue(List issueIdList); + List queryProjectDistribution(ProjectDistributionFormDTO formDTO); } 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 8c9f6bc8e8..cc664bf225 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 @@ -8,17 +8,21 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.ProjectConstant; -import com.epmet.dataaggre.dao.govorg.CustomerStaffAgencyDao; import com.epmet.dataaggre.dao.govproject.ProjectDao; +import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO; import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; -import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.dto.govproject.ProjectDTO; import com.epmet.dataaggre.dto.govproject.form.AllProjectFormDTO; +import com.epmet.dataaggre.dto.govproject.form.ProjectDistributionFormDTO; import com.epmet.dataaggre.dto.govproject.result.AllProjectResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO; import com.epmet.dataaggre.dto.govproject.result.ShiftProjectResultDTO; +import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; +import com.epmet.dataaggre.service.govissue.GovIssueService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.govproject.GovProjectService; +import com.epmet.dataaggre.service.resigroup.ResiGroupService; import com.epmet.dto.form.TimestampIntervalFormDTO; import com.epmet.dto.form.WorkMinuteFormDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -46,6 +50,10 @@ public class GovProjectServiceImpl implements GovProjectService { private GovOrgService govOrgService; @Autowired private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private GovIssueService govIssueService; + @Autowired + private ResiGroupService resiGroupService; /** * @Description 查询项目信息 @@ -103,6 +111,33 @@ public class GovProjectServiceImpl implements GovProjectService { return resultList; } + @Override + public List queryProjectDistribution(ProjectDistributionFormDTO formDTO) { + List resultDTOList = new ArrayList<>(); + List issueInfoDTOList = govIssueService.selectShiftProjectIssueList(formDTO.getCustomerId(), formDTO.getGridId()); + if (CollectionUtils.isNotEmpty(issueInfoDTOList)) { + List topicIds = issueInfoDTOList.stream().map(data -> data.getTopicId()).collect(Collectors.toList()); + // log.info("话题id集合:" + JSON.toJSONString(topicIds, true)); + List topicInfoDTOList = resiGroupService.selectTopicInfoByIds(topicIds); + List issueIds = issueInfoDTOList.stream().map(data -> data.getIssueId()).collect(Collectors.toList()); + // log.info("议题id集合:" + JSON.toJSONString(issueIds, true)); + resultDTOList = projectDao.selectList(formDTO.getCustomerId(),issueIds); + for (ProjectDistributionResultDTO project : resultDTOList) { + for (ResiTopicDTO topicInfoDTO : topicInfoDTOList) { + if (project.getIssueId().equals(topicInfoDTO.getIssueId())) { + //维度 + project.setLatitude(topicInfoDTO.getDimension()); + //经度 + project.setLongitude(topicInfoDTO.getLongitude()); + project.setGridId(topicInfoDTO.getGridId()); + break; + } + } + } + } + return resultDTOList; + } + /** * 全部项目 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 872188f23c..1e15dce4fa 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,8 +1,14 @@ package com.epmet.dataaggre.service.resigroup; +import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + /** * @Author zxc * @DateTime 2020/12/25 上午9:21 */ public interface ResiGroupService { + List selectTopicInfoByIds(@Param("topicIds") List topicIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index d22d43dbf5..931c13ffbb 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -2,10 +2,15 @@ package com.epmet.dataaggre.service.resigroup.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.resigroup.ResiTopicDao; +import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; import com.epmet.dataaggre.service.resigroup.ResiGroupService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * @Author zxc * @DateTime 2020/12/25 上午9:21 @@ -14,4 +19,11 @@ import org.springframework.stereotype.Service; @DataSource(DataSourceConstant.RESI_GROUP) @Slf4j public class ResiGroupServiceImpl implements ResiGroupService { + @Autowired + private ResiTopicDao resiTopicDao; + + @Override + public List selectTopicInfoByIds(List topicIds) { + return resiTopicDao.selectTopicInfoByIds(topicIds); + } } 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 96475ca863..44c2924ba8 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 @@ -107,4 +107,21 @@ ) + \ 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 a85b784273..f171a790e3 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 @@ -124,4 +124,22 @@ AND p.id = #{id} + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml index 17415f1321..bd46639c94 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml @@ -2,5 +2,24 @@ - + \ No newline at end of file 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/ScreenProjectQuantityOrgMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectQuantityOrgMonthlyDTO.java new file mode 100644 index 0000000000..0019aed057 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectQuantityOrgMonthlyDTO.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectQuantityOrgMonthlyDTO implements Serializable { + private static final long serialVersionUID = 6821188282305837207L; + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 组织id + */ + private String orgId; + + /** + * 当前组织内,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + +} \ 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/form/screen/EfficiencyAnalysisFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/EfficiencyAnalysisFormDTO.java new file mode 100644 index 0000000000..0bf1c1556f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/EfficiencyAnalysisFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form.screen; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 【事件分析】效率分析 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/1 18:27 + */ +@Data +public class EfficiencyAnalysisFormDTO extends ScreenCommonFormDTO{ + /** + * 网格:grid; 街道:street + */ + @NotBlank(message = "type不能为空:网格:grid; 街道:street") + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/QueryQuantityMonthlyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/QueryQuantityMonthlyFormDTO.java new file mode 100644 index 0000000000..7ee3cade33 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/QueryQuantityMonthlyFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form.screen; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 近12个月【事件分析】月度数量分析 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/1 16:34 + */ +@Data +public class QueryQuantityMonthlyFormDTO extends ScreenCommonFormDTO{ + private static final long serialVersionUID = 8848067533647648347L; + + /** + * 每月项目增量:incr;累计项目数量:sum + */ + @NotBlank(message = "type不能为空:每月项目增量:incr;累计项目数量:sum") + private String type ; + + /** + * 截止到某月格式:yyyyMM;可为空 + */ + private String endMonthId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/ScreenCommonFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/ScreenCommonFormDTO.java new file mode 100644 index 0000000000..f2e4e45533 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/ScreenCommonFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form.screen; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 大屏通用入参 + * + * @author yinzuomei@elink-cn.com + */ +@Data +public class ScreenCommonFormDTO implements Serializable { + private static final long serialVersionUID = -5959152175751211940L; + /** + * 来源于请求头中的customerId + */ + private String customerId; + /** + * 当前要查询的组织id + */ + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java new file mode 100644 index 0000000000..5ceeca49a7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 组织机构信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +public class ScreenCustomerAgencyDTO implements Serializable { + private static final long serialVersionUID = 6328123559936824470L; + /** + * 客户id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 机关级别(社区级:community, + 乡(镇、街道)级:street, + 区县级: district, + 市级: city + 省级:province) + */ + private String level; + + /** + * 行政地区编码 + */ + private String areaCode; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/commonservice/AddAreaCodeDictResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/commonservice/AddAreaCodeDictResultDTO.java new file mode 100644 index 0000000000..d3d0e59442 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/commonservice/AddAreaCodeDictResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.commonservice; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 003、新增街道或者社区地区编码 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/5 17:39 + */ +@Data +public class AddAreaCodeDictResultDTO implements Serializable { + private static final long serialVersionUID = 7505566589581480619L; + private String code; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/AgencyNodeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/AgencyNodeDTO.java new file mode 100644 index 0000000000..2890092b80 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/AgencyNodeDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result.plugins; + +import com.epmet.commons.tools.utils.AgencyNode; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 008、当前用户的数据权限(多客户版本) 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 20:33 + */ +@Data +public class AgencyNodeDTO extends AgencyNode implements Serializable { + + private static final long serialVersionUID = -3745920378557792529L; + /** + * 直属机关Id + * */ + private String agencyId; + + /** + * 直属机关名称 + * */ + private String agencyName; + + /** + * 机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + * */ + private String level; + + /** + * 当前agencyId所属的客户id add02.03 + * */ + private String customerId; + + /** + * 直属机关直属网格列表 + * */ + private List gridList = new ArrayList<>(); + + /** + * 直属机关直属部门列表 + * */ + private List departmentList = new ArrayList<>(); + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/BidInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/BidInfoResultDTO.java new file mode 100644 index 0000000000..5dc420ecde --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/BidInfoResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result.plugins; + +import lombok.Data; + +/** + * 【146体系】竞标管理-列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 13:37 + */ +@Data +public class BidInfoResultDTO { + private String bidName; + private String statusDesc; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/ContractResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/ContractResultDTO.java new file mode 100644 index 0000000000..e8a655284f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/ContractResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result.plugins; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * 【146体系】合同监督-列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 13:30 + */ +@Data +public class ContractResultDTO { + private String contractListName; + @JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8") + private Date dueDate; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/DeptNodeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/DeptNodeDTO.java new file mode 100644 index 0000000000..ed105f71c9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/DeptNodeDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 部门信息 + * @ClassName ExtDeptResultDTO + * @Auth wangc + * @Date 2020-08-17 17:16 + */ +@Data +public class DeptNodeDTO implements Serializable { + private static final long serialVersionUID = 1792371558965832432L; + + /** + * 部门Id + * */ + private String deptId; + + /** + * 部门名称 + * */ + private String deptName; + + /** + * 当前deptId所属的customerId add02.03 + * */ + private String customerId; + + /** + * 当前deptId对应的地区编码 add02.03 + * */ + private String areaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/GridNodeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/GridNodeDTO.java new file mode 100644 index 0000000000..9199f6fb91 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/GridNodeDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 008、当前用户的数据权限(多客户版本) 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 20:33 + */ +@Data +public class GridNodeDTO implements Serializable { + private static final long serialVersionUID = -4531574240525562587L; + + /** + * 网格Id + * */ + private String gridId; + + /** + * 网格名称 + * */ + private String gridName; + + /** + * 当前gridId所属的客户id add02.03 + * */ + private String customerId; + + /** + * 当前gridId对应的地区编码 add02.03 + * */ + private String areaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/OneListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/OneListResultDTO.java new file mode 100644 index 0000000000..f59006896a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/OneListResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 【146体系】清单列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 13:23 + */ +@Data +public class OneListResultDTO implements Serializable { + private static final long serialVersionUID = -1578923862757670664L; + private String listName; + private String listId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java new file mode 100644 index 0000000000..da023e6c0b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/2/23 15:28 + */ +@NoArgsConstructor +@Data +public class CategoryAnalysisResultDTO implements Serializable { + + private static final long serialVersionUID = 4500337306142206855L; + /** + * 类别名称 + */ + private String categoryName; + /** + * 项目总数 + */ + private Integer projectTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/EfficiencyAnalysisResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/EfficiencyAnalysisResultDTO.java new file mode 100644 index 0000000000..9924e7f041 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/EfficiencyAnalysisResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 【事件分析】效率分析 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/1 18:23 + */ +@Data +public class EfficiencyAnalysisResultDTO implements Serializable { + private static final long serialVersionUID = 7291513498972998552L; + + /** + * 可能是网格名,也可能是组织名 + */ + private String name; + + /** + * 解决率: 带%:90.74% + */ + private String resolvedRatioStr; + + /** + * 解决率数值 90.74 + */ + private BigDecimal resolvedRatio; + + /** + * 方便查找日志 + */ + private String customerId; + private String agencyId; + private String gridId; + private String dateId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/ProjectQuantityResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/ProjectQuantityResultDTO.java new file mode 100644 index 0000000000..89f55620cc --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/ProjectQuantityResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; + +/** + * 【事件分析】数量统计查询 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/29 16:39 + */ +@Data +public class ProjectQuantityResultDTO { + /** + * 事件总数 + */ + private Integer projectTotal; + + /** + * 已解决数 + */ + private Integer resolvedNum; + + /** + * 解决率,带%号的字符串 + */ + private String resolvedRatio; + + /** + * 事件总数,带%号的字符串 + */ + private String satisfactionRatio; + + /** + * 方便查找日志 + */ + private String customerId; + private String agencyId; + private String dateId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/QueryQuantityMonthlyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/QueryQuantityMonthlyResultDTO.java new file mode 100644 index 0000000000..283c24a977 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/QueryQuantityMonthlyResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 近12个月【事件分析】月度数量分析 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/1 16:57 + */ +@Data +public class QueryQuantityMonthlyResultDTO implements Serializable { + private static final long serialVersionUID = -9214182002720799008L; + + /** + * 横坐标集合 + */ + private List xAxis; + + /** + * 每个月的项目增量或者累计数量,根据入参type决定 + */ + private List yAxis; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java index e9729e7a23..2da4370f64 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java @@ -24,4 +24,21 @@ public interface ScreenConstant { String GET_AREA_TREE_FAILURE = "查询行政地区编码树失败......"; + String STREET = "street"; + + String DISTRICT = "district"; + + String CITY = "city"; + + String PROVINCE = "province"; + + String LEVEL = "level"; + + String STR_NULL = ""; + + String ENGLISH_COMMA = ","; + + String GRID = "grid"; + + String AGENCY = "agency"; } 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-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java index 224ab623db..f028fffeff 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java @@ -26,4 +26,9 @@ public class MonthBarchartFormDTO implements Serializable { * 月份ID,如果此列有值,查询截止到当前monthId的近12个月数据 */ private String monthId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java index a5e9c53f26..8b3a973153 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java @@ -21,4 +21,9 @@ public class MonthPieChartFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {MonthPieChart.class}) private String agencyId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java new file mode 100644 index 0000000000..be3585067d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 16:12 + */ +@Data +public class ScreenProjectDetailFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "projectId不能为空") + private String projectId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java new file mode 100644 index 0000000000..69da09b886 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 15:22 + */ +@Data +public class ScreenProjectDistributionFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String areaCode; + + private String level; + + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java index 608c6b0492..b1ffd9243d 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 @@ -30,4 +30,9 @@ public class SubAgencyIndexRankFormDTO implements Serializable { private Integer topNum; private String yearId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java index e973fefa50..ebfea119a4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java @@ -53,4 +53,9 @@ public class SubAgencyIndexRankYMFormDTO implements Serializable { * 组织类型 组织:agency 网格:grid */ private String orgType; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java index e53a94cfa9..a9da3253cf 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java @@ -21,4 +21,9 @@ public class YearAverageIndexFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {YearAverageIndex.class}) private String agencyId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java new file mode 100644 index 0000000000..7ec31acd09 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java @@ -0,0 +1,124 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 16:15 + */ +@Data +public class ScreenProjectDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 项目id + */ + private String projectId; + /** + * 议题内容,其实就是项目内容 + */ + private String projectContent; + /** + * 上报时间,对应的是立项时间;格式:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private String reportTime; + /** + * 所属类别名称 + */ + private String categoryName; + /** + * 上报人名 + */ + private String reportUserName; + /** + * 上报人电话 + */ + private String mobile; + /** + * 上报位置 + */ + private String reportAddress; + /** + * 图片列表 + */ + private List imgList; + /** + * 处理进展列表(返回的是按时间升序的集合) + */ + private List processList; + + @Data + public static class processDTO{ + @JsonIgnore + private String processId; + /** + * 处理部门名称 + */ + private String handleDeptName; + /** + * 公开处理意见 + */ + private String suggestion; + /** + * 处理时间:yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reponseTime; + /** + * 关闭:close; 回应 response,结案closed_case,退回return,部门流转transfer,创建项目created + */ + private String operation; + /** + * 被吹哨部门;如果是多个以逗号隔开返给前端。 + */ + private String whistleDeptName; + + private List attachments; + + @Data + public static class AttachmentDTO{ + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件名 + */ + private String fileName; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 附件大小 字节为单位 + */ + private String attachmentSize; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV) + */ + private String attachmentFormat; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + /** + * url地址 + */ + private String attachmentUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 语音或视频时长,秒 + */ + private String duration; + } + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java new file mode 100644 index 0000000000..839870a4ab --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 15:26 + */ +@Data +public class ScreenProjectDistributionResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键id + */ + private String id; + /** + * 项目标题 + */ + private String projectTitle; + /** + * 项目等级 1:红色事件;2:黄色事件;3:绿色事件 + */ + private String level; + /** + * 经纬度 + */ + private String longitude; + private String latitude; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/DataReportOpenFeignClient.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/DataReportOpenFeignClient.java new file mode 100644 index 0000000000..d3466126a4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/DataReportOpenFeignClient.java @@ -0,0 +1,27 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.plugins.AgencyNodeDTO; +import com.epmet.feign.impl.DataReportOpenFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 22:05 + */ +// @FeignClient(name = ServiceConstant.DATA_REPORT_SERVER, fallback = DataReportOpenFeignClientFallBack.class,url = "localhost:8109") +@FeignClient(name = ServiceConstant.DATA_REPORT_SERVER, fallback = DataReportOpenFeignClientFallBack.class) +public interface DataReportOpenFeignClient { + /** + * @param agencyId + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:05 + **/ + @GetMapping("/data/report/screen/agency/querystaffagencytree/{agencyId}") + Result queryStaffAgencyTree(@PathVariable("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBack.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBack.java new file mode 100644 index 0000000000..64a9f66d0f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBack.java @@ -0,0 +1,21 @@ +package com.epmet.feign.impl; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.plugins.AgencyNodeDTO; +import com.epmet.feign.DataReportOpenFeignClient; +import org.springframework.stereotype.Component; + +@Component +public class DataReportOpenFeignClientFallBack implements DataReportOpenFeignClient { + /** + * @param agencyId + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:05 + **/ + @Override + public Result queryStaffAgencyTree(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_REPORT_SERVER, "queryStaffAgencyTree",agencyId); + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenCustomerWorkRecordDictDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenCustomerWorkRecordDictDTO.java new file mode 100644 index 0000000000..9b524337d9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenCustomerWorkRecordDictDTO.java @@ -0,0 +1,127 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.plugins; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenCustomerWorkRecordDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(客户每次上传,直接根据customerId全删全增) + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至日期eg:20200101 + */ + private String dateId; + + /** + * 资源id + */ + private String dictId; + + /** + * 父资源ID;如果是一级分类pid=0 + */ + private String pid; + + /** + * 资源类型 + */ + private String resourceType; + + /** + * 资源编码 + */ + private String resourceCode; + + /** + * 资源标签名 + */ + private String resourceLabel; + + /** + * 显示标识:0否,1是 + */ + private String showFlag; + + /** + * 排序 + */ + private Integer sort; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice;所有的一级分类需要对应到这三个key中 + */ + private String dataType; + + /** + * 当前资源属于几级,例如:1、2、3、4.... + */ + private Integer level; + + /** + * 逻辑删除标识 + */ + 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/plugins/ScreenWorkRecordOrgDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgDailyDTO.java new file mode 100644 index 0000000000..55e9c883d0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgDailyDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.plugins; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenWorkRecordOrgDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 日期Id:yyyyMMdd + */ + private String dateId; + + /** + * 组织Idor网格id + */ + private String orgId; + + /** + * 组织名称或者网格名 + */ + private String orgName; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + + /** + * 删除标识 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-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgMonthlyDTO.java new file mode 100644 index 0000000000..168e0296d4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/ScreenWorkRecordOrgMonthlyDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.plugins; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 工作日志-组织按月统计(增量) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenWorkRecordOrgMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月份Id:yyyyMM + */ + private String monthId; + + /** + * 组织Idor网格id + */ + private String orgId; + + /** + * 组织名称或者网格名 + */ + private String orgName; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + + /** + * 删除标识 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-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 new file mode 100644 index 0000000000..3bbcb2973b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.plugins.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 5、【工作日志】本机及下级排名 通用入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/23 23:08 + */ +@Data +public class WorkRecordRankFormDTO 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; + + /** + * 默认显示前3 + */ + @NotNull(message = "topRow不能为空") + private Integer topRow; + + @NotBlank(message = "customerId不能为空") + private String customerId; +} 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/WorkRecordRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java new file mode 100644 index 0000000000..08c8df3ff2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.plugins.result; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 5、【工作日志】本机及下级排名 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/23 23:11 + */ +@AllArgsConstructor +@Data +public class WorkRecordRankResultDTO implements Serializable { + /** + * 总参与人数 + */ + private Integer participateUserTotal; + + /** + *组织次数 + */ + private Integer participateTotal; + + /** + *下级排行列表 + */ + private List subRankList; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java new file mode 100644 index 0000000000..91f3d027e9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java @@ -0,0 +1,34 @@ +package com.epmet.plugins.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 下级排行列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/23 23:21 + */ +@Data +public class WorkRecordSubRank implements Serializable { + + private static final long serialVersionUID = -2450978606865910110L; + + private String orgId; + + /** + * 组织名称或者是网格名称 + */ + private String name; + + /** + * 总参与人数 + */ + private Integer participateUserTotal; + + /** + * 组织次数 + */ + private Integer participateTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java new file mode 100644 index 0000000000..eb5df34e99 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.plugins.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 6、【工作日志】近12月趋势图 + * + * @author sun + */ +@Data +public class WorkRecordTrendResultDTO implements Serializable { + /** + * 横轴 过去十二个月份 + * ['1月', '2月', '3月', '4月', '5月','6月','7月','8月','9月','10月','11月','12月'] + */ + private List xAxis = new ArrayList<>(); + /** + * 资源标签名 + * ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀'] + */ + private List legend = new ArrayList<>(); + + /** + *各项资源对应数据对象 + */ + private List series = new ArrayList<>(); + + @Data + public static class SeriesResultDTO { + /** + * 资源标签名 + * ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀'] + */ + private String name; + /** + * 各项资源对应12月份数据 + */ + private List data = new ArrayList<>(); + /** + * 数据对应的月份Id + */ + @JsonIgnore + private String monthId; + /** + * 各项资源对应某一月份数据 + */ + @JsonIgnore + private Integer value; + } + +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 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 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/OfsController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/OfsController.java new file mode 100644 index 0000000000..9a2cbb121b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/OfsController.java @@ -0,0 +1,65 @@ +package com.epmet.datareport.controller.plugins; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.service.plugins.OfsService; +import com.epmet.dto.result.plugins.BidInfoResultDTO; +import com.epmet.dto.result.plugins.ContractResultDTO; +import com.epmet.dto.result.plugins.OneListResultDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 146体系数据查询 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 12:58 + */ +@RestController +@RequestMapping("plugins/ofs") +public class OfsController { + @Autowired + private OfsService ofsService; + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】清单列表 + * @Date 2021/1/22 13:36 + **/ + @PostMapping("list") + public Result> oneList(@RequestHeader("CustomerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + return new Result().ok(ofsService.queryOneList(customerId)); + } + return new Result(); + } + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】合同监督-列表 + * @Date 2021/1/22 13:36 + **/ + @PostMapping("contractlist") + public Result> queryContractList(@RequestHeader("CustomerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + return new Result().ok(ofsService.queryContractList(customerId)); + } + return new Result(); + } + + @PostMapping("bidlist") + public Result> bidList(@RequestHeader("CustomerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + return new Result().ok(ofsService.queryBidList(customerId)); + } + return new Result(); + } + +} 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 new file mode 100644 index 0000000000..592ea4ebc2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java @@ -0,0 +1,52 @@ +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.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.*; + +/** + * 大屏工作日志相关输出接口 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/21 19:51 + */ +@RestController +@RequestMapping("screen/plugins/workrecord") +public class WorkRecordController { + @Autowired + private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService; + //todo 工作日志是否要添加area_code、parent_area_code、orgType;插件是否可以提供;也可以采集的时候赋值 + //5、【工作日志】本机及下级排名 + //NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348966 + //返参中的当前组织的参与人数、组织次数 直接sum所有下级的值; + //下级根据当前组织的areaCode查询下级列表,再去查询screen_work_record_org_daily + //legend来源于screen_customer_work_record_dict表 level=2,dataType=party + + @PostMapping("ranklist") + public Result rankList(@RequestHeader("CustomerId")String customerId, @RequestBody WorkRecordRankFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(screenWorkRecordOrgDailyService.rankList(formDTO)); + } + + + //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/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java index 07064da4f2..88fa5c31b8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java @@ -5,19 +5,21 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.*; import com.epmet.datareport.service.project.ProjectService; import com.epmet.dto.form.ProcessListFormDTO; -import com.epmet.datareport.service.project.ProjectService; -import com.epmet.dto.form.ProcessListFormDTO; +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.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.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; @@ -31,7 +33,14 @@ public class ProjectController { @Autowired private ProjectService projectService; - + @Autowired + private ScreenProjectGridDailyService projectGridDailyService; + @Autowired + private ScreenProjectOrgDailyService projectOrgDailyService; + @Autowired + private ScreenProjectQuantityGridMonthlyService projectQuantityGridMonthlyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; /** * @Author sun @@ -121,6 +130,42 @@ public class ProjectController { return new Result>().ok(projectService.getMyNextAgency(tokenDto)); } + /** + * @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)); + } + //todo 【事件类型分析】NEI接口地址: https://nei.netease.com/interface/detail/?pid=57068&id=346721 } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 53646ee6dc..1eba0b727c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -3,13 +3,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.AgencyService; +import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -27,7 +31,6 @@ public class AgencyController { @Autowired private AgencyService agencyService; - /** * @param * @Description 1、组织机构树 只返回 is_display = '1'的 @@ -81,4 +84,30 @@ public class AgencyController { return new Result>().ok(agencyService.areaCodeDictTree(formDTO)); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 003、新增街道或者社区地区编码 + * @Date 2021/2/5 17:39 + **/ + @PostMapping("addstreetcomm") + public Result addStreetCommAreaCode(@RequestBody AddAreaCodeDictFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(agencyService.addStreetCommAreaCode(formDTO)); + } + /** + * @param agencyId + * @author yinzuomei + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:19 + **/ + @GetMapping("querystaffagencytree/{agencyId}") + public Result queryStaffAgencyTree(@PathVariable("agencyId") String agencyId) { + //todo 单独校验下此方法 + if (StringUtils.isNotBlank(agencyId)) { + return new Result().ok(agencyService.queryStaffAgencyTree(agencyId)); + } + return new Result<>(); + } } 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/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 00fc8046a5..5ebeef980d 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 @@ -6,6 +6,7 @@ import com.epmet.datareport.eum.OrgTypeEnum; import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -17,6 +18,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:13 */ +@Slf4j @RestController @RequestMapping("/screen/index") public class IndexController { @@ -31,7 +33,9 @@ public class IndexController { * @date 2020/8/19 2:53 下午 */ @PostMapping("yearaverageindex") - public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ + public Result yearAverageIndex(@RequestHeader("CustomerId") String customerId,@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ + //area_code升级,新增此参数 + yearAverageIndexFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); return new Result().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO)); } @@ -43,7 +47,9 @@ public class IndexController { * @date 2020/8/19 3:17 下午 */ @PostMapping("monthindexanalysis/piechart") - public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ + public Result monthPieChart(@RequestHeader("CustomerId") String customerId,@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ + //area_code升级,新增此参数 + monthPieChartFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); return new Result().ok(indexService.monthPieChart(monthPieChartFormDTO)); } @@ -55,7 +61,9 @@ public class IndexController { * @date 2020/8/19 5:27 下午 */ @PostMapping("monthindexanalysis/barchart") - public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ + public Result monthBarchart(@RequestHeader("CustomerId") String customerId,@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ + //area_code升级,新增此参数 + monthBarchartFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO)); } @@ -67,7 +75,9 @@ public class IndexController { * @date 2020/8/20 10:02 上午 */ @PostMapping("subagencyindexrank") - public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ + public Result> subAgencyIndexRank(@RequestHeader("CustomerId") String customerId,@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ + //area_code升级,新增此参数 + subAgencyIndexRankFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); return new Result>().ok(indexService.subAgencyIndexRank(subAgencyIndexRankFormDTO)); } @@ -81,7 +91,9 @@ public class IndexController { * @Date 13:39 2020-09-11 **/ @PostMapping("dataclient/subagencyindexrank") - public Result> getSubAgencyIndexRank(@RequestBody SubAgencyIndexRankYMFormDTO formDTO) { + public Result> getSubAgencyIndexRank(@RequestHeader("CustomerId") String customerId,@RequestBody SubAgencyIndexRankYMFormDTO formDTO) { + //area_code升级,新增此参数 + formDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(formDTO, SubAgencyIndexRankYMFormDTO.SubAgencyIndexRank.class); return new Result>().ok(indexService.getSubAgencyIndexRank(formDTO)); } @@ -118,7 +130,7 @@ public class IndexController { /** * @param formDTO - * @Description 组织月度指数得分 + * @Description 数据改版:组织月度指数得分 * @author sun */ @PostMapping("month/indexscore") @@ -129,7 +141,7 @@ public class IndexController { /** * @param formDTO - * @Description 先进排行-先进支部排行 + * @Description 数据改版:先进排行-先进支部排行 * @author sun */ @PostMapping("advancedbranchrank") 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/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 483e3edcc1..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,13 +3,18 @@ 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.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 +41,38 @@ 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 + * @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/ScreenCpcBaseDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index e752fe40dd..effc1dce93 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -39,6 +39,7 @@ public interface ScreenCpcBaseDataDao{ * @date 2020.08.18 17:47 **/ PartymemberAgeDistributionResultDTO selectPartymemberAgeDistribution(@Param("agencyId") String agencyId); + PartymemberAgeDistributionResultDTO selectPartymemberAgeDistributionNew(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 52ddea4bd0..af4b0b7af2 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 @@ -17,6 +17,10 @@ package com.epmet.datareport.dao.evaluationindex.screen; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.result.plugins.AgencyNodeDTO; +import com.epmet.dto.result.plugins.DeptNodeDTO; +import com.epmet.dto.result.plugins.GridNodeDTO; import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -112,4 +116,38 @@ public interface ScreenCustomerAgencyDao { * @date 2020/10/28 10:33 上午 */ List selectSubAgencyId(@Param("agencyId") String agencyId); + + /** + * @param agencyId + * @author yinzuomei + * @description 查询组织基本信息 + **/ + ScreenCustomerAgencyDTO selectByAgencyId(@Param("agencyId") String agencyId); + + /** + * @param areaCode + * @author yinzuomei + * @description 根据areaCode查询组织机构 + * @Date 2021/2/4 21:51 + **/ + List queryStaffAgencyTree(@Param("areaCode")String areaCode); + + /** + * @param areaCode + * @param agencyId + * @author yinzuomei + * @description 查找组织下的部门 + * @Date 2021/2/4 21:51 + **/ + List selectDeptList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + + /** + * @param areaCode + * @param agencyId + * @author yinzuomei + * @description 查找组织下的网格 + * @Date 2021/2/4 21:52 + **/ + List selectGridList(@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/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 92177ec52c..5bc3077e85 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -21,6 +21,8 @@ import com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 党建引领-先锋模范数据 * @@ -37,5 +39,16 @@ public interface ScreenPioneerDataDao{ * @date 2020/8/20 5:22 下午 */ FineExampleResultDTO selectFineExample(@Param("agencyId")String agencyId); + + /** + * @Description 根据地区码查询先锋模范 + * @param areaCode + * @param customerId + * @param customerIds - 子级客户列表 + * @return com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO + * @author wangc + * @date 2021.02.24 15:39 + */ + FineExampleResultDTO selectFineExampleByAreaCode(@Param("areaCode")String areaCode,@Param("customerId")String customerId,@Param("list") List customerIds); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java new file mode 100644 index 0000000000..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/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java new file mode 100644 index 0000000000..6ac5ef48ea --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -0,0 +1,24 @@ +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface ScreenProjectDataDao { + + List projectDistribution(@Param("agencyId") String agencyId, @Param("ids") List ids, @Param("level") String level); + + List selectIdsByAreaCode(@Param("areaCode") String areaCode); + + List projectDistributionDetail(@Param("projectId") String projectId); + + List selectProjectImgs(@Param("projectId") String projectId); + + List selectProjectProcess(@Param("projectId") String projectId); + + List selectProjectProcessAttachments(@Param("processId") String processId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java new file mode 100644 index 0000000000..1eada75ab4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +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-01-27 + */ +@Mapper +public interface ScreenProjectGridDailyDao{ + + /** + * @param customerId + * @param areaCode + * @author yinzuomei + * @description 下级网格的效率(解决率)列表 + **/ + List queryGridEfficiencyAnalysis(@Param("customerId") String customerId, @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/ScreenProjectOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java new file mode 100644 index 0000000000..2a26119d9c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +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-01-27 + */ +@Mapper +public interface ScreenProjectOrgDailyDao { + + /** + * @author yinzuomei + * @description 【事件分析】数量统计查询 + **/ + ProjectQuantityResultDTO queryQuantity(@Param("customerId") String customerId, @Param("agencyId")String agencyId); + + /** + * @param areaCode + * @author yinzuomei + * @description 下级组织的效率(解决率)列表 + **/ + List queryEfficiencyAnalysis(@Param("customerId")String customerId,@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/ScreenProjectQuantityGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java new file mode 100644 index 0000000000..02c9545001 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectQuantityGridMonthlyDao { + + +} \ 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/ScreenProjectQuantityOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java new file mode 100644 index 0000000000..205c648f36 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.dto.ScreenProjectQuantityOrgMonthlyDTO; +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-01-27 + */ +@Mapper +public interface ScreenProjectQuantityOrgMonthlyDao { + + /** + * @return java.util.List + * @param customerId 当前客户id + * @param agencyId 当前要查询的组织 + * @param endMonthId 截止月份yyyyMM + * @author yinzuomei + * @description 近12个月【事件分析】月度数量分析 + **/ + List selectList(@Param("customerId") String customerId, @Param("agencyId")String agencyId, @Param("endMonthId")String endMonthId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenBidInfoDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenBidInfoDao.java new file mode 100644 index 0000000000..b379de0b24 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenBidInfoDao.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.plugins; + +import com.epmet.dto.result.plugins.BidInfoResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 146:竞标管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenBidInfoDao{ + + + List selectList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenContractInfoDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenContractInfoDao.java new file mode 100644 index 0000000000..2c597dff06 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenContractInfoDao.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.datareport.dao.plugins; + +import com.epmet.dto.result.plugins.ContractResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 146:合同基本信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenContractInfoDao { + + List selectList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java new file mode 100644 index 0000000000..7b2bf609c7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@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/ScreenListInfoDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenListInfoDao.java new file mode 100644 index 0000000000..2b368a041f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenListInfoDao.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.datareport.dao.plugins; + +import com.epmet.dto.result.plugins.OneListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 146:一张清单列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenListInfoDao { + + List selectList(String customerId); +} \ 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 new file mode 100644 index 0000000000..ca0bc02fda --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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; + +import java.util.List; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@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, + @Param("dateId")String dateId); + + String selectLatestDateId(String customerId); + + 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/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java new file mode 100644 index 0000000000..6514c58fbf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.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.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; + +/** + * 工作日志-组织按月统计(增量) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@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/entity/plugins/ScreenCustomerWorkRecordDictEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenCustomerWorkRecordDictEntity.java new file mode 100644 index 0000000000..a4f5fa180a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenCustomerWorkRecordDictEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_work_record_dict") +public class ScreenCustomerWorkRecordDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至日期eg:20200101 + */ + private String dateId; + + /** + * 资源id + */ + private String dictId; + + /** + * 父资源ID;如果是一级分类pid=0 + */ + private String pid; + + /** + * 资源类型 + */ + private String resourceType; + + /** + * 资源编码 + */ + private String resourceCode; + + /** + * 资源标签名 + */ + private String resourceLabel; + + /** + * 显示标识:0否,1是 + */ + private String showFlag; + + /** + * 排序 + */ + private Integer sort; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice;所有的一级分类需要对应到这三个key中 + */ + private String dataType; + + /** + * 当前资源属于几级,例如:1、2、3、4.... + */ + private Integer level; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgDailyEntity.java new file mode 100644 index 0000000000..f5dab21989 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgDailyEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_work_record_org_daily") +public class ScreenWorkRecordOrgDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 日期Id:yyyyMMdd + */ + private String dateId; + + /** + * 组织Idor网格id + */ + private String orgId; + + /** + * 组织名称或者网格名 + */ + private String orgName; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java new file mode 100644 index 0000000000..47f9f6ddfe --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作日志-组织按月统计(增量) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_work_record_org_monthly") +public class ScreenWorkRecordOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月份Id:yyyyMM + */ + private String monthId; + + /** + * 组织Idor网格id + */ + private String orgId; + + /** + * 组织名称或者网格名 + */ + private String orgName; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + +} 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 144e12fe1a..8e265fb34b 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,7 +1,11 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; @@ -47,4 +51,14 @@ public interface AgencyService { */ List areaCodeDictTree(AreaCodeDictFormDTO formDTO); + AddAreaCodeDictResultDTO addStreetCommAreaCode(AddAreaCodeDictFormDTO formDTO); + /** + * @param agencyId + * @author yinzuomei + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:19 + **/ + AgencyNodeDTO queryStaffAgencyTree(String agencyId); + + ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java index 41c8fafc28..09e94717b6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java @@ -34,7 +34,7 @@ public interface GrassrootsPartyDevService { * @author wangc * @date 2020.08.18 17:54 **/ - PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param); + PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId); /** * @Description 3、支部建设情况|联建共建情况-折线图 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectGridDailyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectGridDailyService.java new file mode 100644 index 0000000000..d9eb13c55f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectGridDailyService.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; + +import java.util.List; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectGridDailyService { + /** + * @param customerId + * @param areaCode + * @author yinzuomei + * @description 【事件分析】效率分析 网格的解决率 + **/ + List efficiencyAnalysis(String customerId, 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/ScreenProjectOrgDailyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectOrgDailyService.java new file mode 100644 index 0000000000..ee1c9e85fb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectOrgDailyService.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.datareport.service.evaluationindex.screen; + +import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; +import com.epmet.dto.form.screen.ScreenCommonFormDTO; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; + +import java.util.List; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectOrgDailyService { + /** + * @param formDTO + * @author yinzuomei + * @description 【事件分析】数量统计查询 + **/ + ProjectQuantityResultDTO queryQuantity(ScreenCommonFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 【事件分析】效率分析 + **/ + List efficiencyAnalysis(EfficiencyAnalysisFormDTO formDTO); +} \ 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/ScreenProjectQuantityGridMonthlyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java new file mode 100644 index 0000000000..2e965971f5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java @@ -0,0 +1,28 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.service.evaluationindex.screen; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectQuantityGridMonthlyService { + +} \ 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/ScreenProjectQuantityOrgMonthlyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java new file mode 100644 index 0000000000..182feb83bd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectQuantityOrgMonthlyService { + + /** + * @param formDTO + * @author yinzuomei + * @description 近12个月【事件分析】月度数量分析 + **/ + QueryQuantityMonthlyResultDTO queryQuantityMonthly(QueryQuantityMonthlyFormDTO formDTO); +} \ 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..b4b0fe8725 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java @@ -1,8 +1,15 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.commons.tools.utils.Result; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import java.util.List; + /** * 项目 * @@ -19,4 +26,17 @@ public interface ScreenProjectService { */ ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO); + /** + * 【事件分析】类型分析 + * @author zhaoqifeng + * @date 2021/2/23 15:37 + * @param customerId + * @param formDTO + * @return java.util.List + */ + List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO); + + Result projectDistribution(ScreenProjectDistributionFormDTO formDTO); + + Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 880e07f357..23d960354f 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 @@ -1,15 +1,21 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.AgencyTreeUtils; import com.epmet.commons.tools.utils.Result; 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.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; @@ -18,6 +24,8 @@ import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.exceptions.TooManyResultsException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -32,6 +40,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:18 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class AgencyServiceImpl implements AgencyService { @@ -241,11 +250,51 @@ public class AgencyServiceImpl implements AgencyService { public List areaCodeDictTree(AreaCodeDictFormDTO formDTO) { Result> listResult = commonServiceOpenFeignClient.areaCodeDictTree(formDTO); if (!listResult.success()){ - throw new RenException(ScreenConstant.GET_AREA_TREE_FAILURE); + throw new RenException(listResult.getInternalMsg()); } if (!CollectionUtils.isEmpty(listResult.getData())){ return listResult.getData(); } return new ArrayList<>(); } + + @Override + public AddAreaCodeDictResultDTO addStreetCommAreaCode(AddAreaCodeDictFormDTO formDTO) { + Result res = commonServiceOpenFeignClient.addStreetCommAreaCode(formDTO); + if (res.success() && null != res.getData()) { + AddAreaCodeDictResultDTO resultDTO = new AddAreaCodeDictResultDTO(); + resultDTO.setCode(res.getData()); + return resultDTO; + } + throw new RenException(res.getMsg() + res.getInternalMsg()); + } + + /** + * @param agencyId + * @author yinzuomei + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:19 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public AgencyNodeDTO queryStaffAgencyTree(String agencyId) { + ScreenCustomerAgencyDTO agencyDTO = screenCustomerAgencyDao.selectByAgencyId(agencyId); + if (null == agencyDTO || StringUtils.isBlank(agencyDTO.getAreaCode())) { + throw new RenException(String.format("当前agencyId%s所属的area_code为空", agencyId)); + } + List list = screenCustomerAgencyDao.queryStaffAgencyTree(agencyDTO.getAreaCode()); + for (AgencyNodeDTO agencyNodeDTO : list) { + agencyNodeDTO.setGridList(screenCustomerAgencyDao.selectGridList(agencyNodeDTO.getAreaCode(), agencyNodeDTO.getAgencyId())); + agencyNodeDTO.setDepartmentList(screenCustomerAgencyDao.selectDeptList(agencyNodeDTO.getAreaCode(), agencyNodeDTO.getAgencyId())); + } + List treeList = AgencyTreeUtils.build(list); + log.info(JSON.toJSONString(treeList)); + return treeList.get(NumConstant.ZERO); + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId) { + return screenCustomerAgencyDao.selectByAgencyId(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 e33e7c9334..afdbf95f82 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 @@ -2,6 +2,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.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.*; @@ -13,6 +14,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 com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -87,6 +89,11 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); List 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); + } + } if(null == result) return new ArrayList<>(); return result; } 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/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/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java new file mode 100644 index 0000000000..a1f8a0c9fd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectGridDailyDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenProjectGridDailyServiceImpl implements ScreenProjectGridDailyService { + @Autowired + private ScreenProjectGridDailyDao screenProjectGridDailyDao; + + /** + * @param customerId + * @param areaCode + * @author yinzuomei + * @description 【事件分析】效率分析 网格的解决率 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public List efficiencyAnalysis(String customerId, String areaCode) { + return screenProjectGridDailyDao.queryGridEfficiencyAnalysis(customerId,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/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java new file mode 100644 index 0000000000..b4518096dc --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectOrgDailyDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; +import com.epmet.dto.form.screen.ScreenCommonFormDTO; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectOrgDailyServiceImpl implements ScreenProjectOrgDailyService { + @Autowired + private ScreenProjectOrgDailyDao baseDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenProjectGridDailyService screenProjectGridDailyService; + /** + * @param formDTO + * @author yinzuomei + * @description 【事件分析】数量统计查询 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public ProjectQuantityResultDTO queryQuantity(ScreenCommonFormDTO formDTO) { + //客户id、agencyId都不能为空 + ProjectQuantityResultDTO resultDTO = baseDao.queryQuantity(formDTO.getCustomerId(), formDTO.getAgencyId()); + if (null != resultDTO) { + return resultDTO; + } + log.warn("【事件分析】数量统计查询 结果为空"); + ProjectQuantityResultDTO defaultDto = new ProjectQuantityResultDTO(); + defaultDto.setCustomerId(formDTO.getCustomerId()); + defaultDto.setAgencyId(formDTO.getAgencyId()); + defaultDto.setProjectTotal(NumConstant.ZERO); + defaultDto.setResolvedNum(NumConstant.ZERO); + defaultDto.setResolvedRatio("0%"); + defaultDto.setSatisfactionRatio("0%"); + return defaultDto; + } + + /** + * @param formDTO + * @author yinzuomei + * @description 【事件分析】效率分析 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public List efficiencyAnalysis(EfficiencyAnalysisFormDTO formDTO) { + ScreenCustomerAgencyDTO agencyDTO = screenCustomerAgencyDao.selectByAgencyId(formDTO.getAgencyId()); + if (null != agencyDTO) { + if (ScreenConstant.STREET.equals(formDTO.getType())) { + // 查询当前入参的下一级 + // type=street查询screen_project_org_daily + return baseDao.queryEfficiencyAnalysis(formDTO.getCustomerId(), agencyDTO.getAreaCode()); + } else if (ScreenConstant.GRID.equals(formDTO.getType())) { + // type=grid查询组织下的网格 + return screenProjectGridDailyService.efficiencyAnalysis(formDTO.getCustomerId(), agencyDTO.getAreaCode()); + } + } + return new ArrayList<>(); + } +} \ 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/ScreenProjectQuantityGridMonthlyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..49f991a29a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService; +import org.springframework.stereotype.Service; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenProjectQuantityGridMonthlyServiceImpl implements ScreenProjectQuantityGridMonthlyService { + + +} \ 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/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..1e4855604d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.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.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; +import com.epmet.dto.ScreenProjectQuantityOrgMonthlyDTO; +import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenProjectQuantityOrgMonthlyServiceImpl implements ScreenProjectQuantityOrgMonthlyService { + @Autowired + private ScreenProjectQuantityOrgMonthlyDao baseDao; + + /** + * @param formDTO + * @author yinzuomei + * @description 近12个月【事件分析】月度数量分析 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public QueryQuantityMonthlyResultDTO queryQuantityMonthly(QueryQuantityMonthlyFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getEndMonthId())) { + formDTO.setEndMonthId(DateUtils.getCurrentTimeBeforeMonthId()); + } + QueryQuantityMonthlyResultDTO resultDTO = new QueryQuantityMonthlyResultDTO(); + //近12个月的monthId集合,["202002","202003","202004","202005","202006","202007","202008","202009","202010","202011","202012","202101"] + List monthIdList = DateUtils.getMonthIdList(formDTO.getEndMonthId(), NumConstant.ELEVEN); + //要返回的横坐标:["02月","03月","04月","05月","06月","07月","08月","09月","10月","11月","12月","01月"] + List xAxis = new ArrayList<>(); + List yAxis = new ArrayList<>(); + //查询近12个月的数据 + List dtoList = baseDao.selectList(formDTO.getCustomerId(), formDTO.getAgencyId(), formDTO.getEndMonthId()); + + Map dtoMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(dtoList)) { + dtoMap = dtoList.stream().collect(Collectors.toMap(ScreenProjectQuantityOrgMonthlyDTO::getMonthId, Function.identity(), (key1, key2) -> key2)); + } + for (String monthId : monthIdList) { + //202101=>01月 + xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH)); + if (!CollectionUtils.isEmpty(dtoList)) { + if ("incr".equals(formDTO.getType())) { + yAxis.add(dtoMap.get(monthId).getProjectIncr()); + } else if ("sum".equals(formDTO.getType())) { + yAxis.add(dtoMap.get(monthId).getProjectTotal()); + } + continue; + } + //没有数据默认赋值0 + yAxis.add(0); + } + resultDTO.setXAxis(xAxis); + resultDTO.setYAxis(yAxis); + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/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..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,15 +1,27 @@ 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; +import java.util.Date; import java.util.List; /** @@ -26,6 +38,11 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { private ScreenEventDataDao screenEventDataDao; @Autowired private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenProjectDataDao screenProjectDataDao; + + @Autowired + private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; /** * @Description 3、项目详情 @@ -44,4 +61,56 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { projectDetailResultDTO.setImgList(imgList); return projectDetailResultDTO; } -} \ No newline at end of file + + /** + * @Description 中央区事件分析-项目分布 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/24 15:25 + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) { + List areaIds = null; + if (StringUtils.isNotBlank(formDTO.getAreaCode())){ + areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode()); + } + List resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel()); + return new Result().ok(resultDTOS); + } + + @Override + public Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO) { + List resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId()); + resultDTOS.forEach(item -> { + //项目图片 + List imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId()); + item.setImgList(imgList); + //项目处理流程 + List processDTOS = screenProjectDataDao.selectProjectProcess(formDTO.getProjectId()); + //流程附件 + processDTOS.forEach(processDTO -> { + List attachmentDTOS = screenProjectDataDao.selectProjectProcessAttachments(processDTO.getProcessId()); + processDTO.setAttachments(attachmentDTOS); + }); + item.setProcessList(processDTOS); + }); + return new Result().ok(resultDTOS); + } + + /** + * 【事件分析】类型分析 + * + * @param customerId + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/2/23 15:37 + */ + @Override + public List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO) { + String dateId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId(), dateId); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/OfsService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/OfsService.java new file mode 100644 index 0000000000..71185ba723 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/OfsService.java @@ -0,0 +1,34 @@ +package com.epmet.datareport.service.plugins; + +import com.epmet.dto.result.plugins.BidInfoResultDTO; +import com.epmet.dto.result.plugins.ContractResultDTO; +import com.epmet.dto.result.plugins.OneListResultDTO; + +import java.util.List; + +/** + * 146体系数据查询 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:18 + */ +public interface OfsService { + + List queryOneList(String customerId); + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】合同监督-列表 + * @Date 2021/1/22 13:36 + **/ + List queryContractList(String customerId); + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】竞标管理-列表 + * @Date 2021/1/22 13:38 + **/ + List queryBidList(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenCustomerWorkRecordDictService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenCustomerWorkRecordDictService.java new file mode 100644 index 0000000000..d6d91ad5d0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenCustomerWorkRecordDictService.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.datareport.service.plugins; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity; +import com.epmet.plugins.ScreenCustomerWorkRecordDictDTO; + +import java.util.List; +import java.util.Map; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenCustomerWorkRecordDictService 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 ScreenCustomerWorkRecordDictDTO + * @author generator + * @date 2021-02-23 + */ + ScreenCustomerWorkRecordDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenCustomerWorkRecordDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenCustomerWorkRecordDictDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); +} \ 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 new file mode 100644 index 0000000000..df795a2065 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.plugins; + +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.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; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenWorkRecordOrgDailyService 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 ScreenWorkRecordOrgDailyDTO + * @author generator + * @date 2021-02-23 + */ + ScreenWorkRecordOrgDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenWorkRecordOrgDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenWorkRecordOrgDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO); + + /** + * @Description 6、【工作日志】近12月趋势图 + * @author sun + */ + WorkRecordTrendResultDTO trend(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/ScreenWorkRecordOrgMonthlyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgMonthlyService.java new file mode 100644 index 0000000000..1b302b1ee6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgMonthlyService.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.epmet.datareport.service.plugins; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +import com.epmet.plugins.ScreenWorkRecordOrgMonthlyDTO; + +import java.util.List; +import java.util.Map; + +/** + * 工作日志-组织按月统计(增量) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenWorkRecordOrgMonthlyService 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 ScreenWorkRecordOrgMonthlyDTO + * @author generator + * @date 2021-02-23 + */ + ScreenWorkRecordOrgMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenWorkRecordOrgMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenWorkRecordOrgMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); +} \ 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/OfsServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java new file mode 100644 index 0000000000..7ae8b62e43 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java @@ -0,0 +1,59 @@ +package com.epmet.datareport.service.plugins.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.plugins.ScreenBidInfoDao; +import com.epmet.datareport.dao.plugins.ScreenContractInfoDao; +import com.epmet.datareport.dao.plugins.ScreenListInfoDao; +import com.epmet.datareport.service.plugins.OfsService; +import com.epmet.dto.result.plugins.BidInfoResultDTO; +import com.epmet.dto.result.plugins.ContractResultDTO; +import com.epmet.dto.result.plugins.OneListResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 146体系数据查询 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:20 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class OfsServiceImpl implements OfsService { + @Autowired + private ScreenBidInfoDao screenBidInfoDao; + @Autowired + private ScreenContractInfoDao screenContractInfoDao; + @Autowired + private ScreenListInfoDao screenListInfoDao; + + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public List queryOneList(String customerId) { + return screenListInfoDao.selectList(customerId); + } + + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public List queryContractList(String customerId) { + return screenContractInfoDao.selectList(customerId); + } + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】竞标管理-列表 + * @Date 2021/1/22 13:38 + **/ + @Override + public List queryBidList(String customerId) { + return screenBidInfoDao.selectList(customerId); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java new file mode 100644 index 0000000000..47e4b8bb3e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.plugins.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao; +import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity; +import com.epmet.datareport.service.plugins.ScreenCustomerWorkRecordDictService; +import com.epmet.plugins.ScreenCustomerWorkRecordDictDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Slf4j +@Service +public class ScreenCustomerWorkRecordDictServiceImpl extends BaseServiceImpl implements ScreenCustomerWorkRecordDictService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenCustomerWorkRecordDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenCustomerWorkRecordDictDTO.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 ScreenCustomerWorkRecordDictDTO get(String id) { + ScreenCustomerWorkRecordDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenCustomerWorkRecordDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenCustomerWorkRecordDictDTO dto) { + ScreenCustomerWorkRecordDictEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCustomerWorkRecordDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenCustomerWorkRecordDictDTO dto) { + ScreenCustomerWorkRecordDictEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCustomerWorkRecordDictEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-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 new file mode 100644 index 0000000000..0d662c87e1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java @@ -0,0 +1,200 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.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; +import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao; +import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao; +import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao; +import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; +import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; +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 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 java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Slf4j +@Service +public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgDailyService { + @Autowired + private AgencyService agencyService; + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenCustomerWorkRecordDictDao screenCustomerWorkRecordDictDao; + @Autowired + private ScreenWorkRecordOrgMonthlyDao screenWorkRecordOrgMonthlyDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenWorkRecordOrgDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenWorkRecordOrgDailyDTO.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 ScreenWorkRecordOrgDailyDTO get(String id) { + ScreenWorkRecordOrgDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenWorkRecordOrgDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenWorkRecordOrgDailyDTO dto) { + ScreenWorkRecordOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenWorkRecordOrgDailyDTO dto) { + ScreenWorkRecordOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO) { + ////todo 待完善 直属网格是否显示? + ScreenCustomerAgencyDTO agencyDTO = agencyService.queryAgencyInfo(formDTO.getAgencyId()); + if (null == agencyDTO) { + throw new RenException(String.format("获取组织信息异常,agencyId:%s", formDTO.getAgencyId())); + } + String dateId = baseDao.selectLatestDateId(formDTO.getCustomerId()); + log.info(String.format("最近一次上传dateId:%s", dateId)); + if (agencyDTO.getLevel().equals("community")) { + log.warn("【工作日志】本机及下级排名接口待完善"); + //todo + return new WorkRecordRankResultDTO(0, 0, new ArrayList<>()); + } else { + //非社区的 + WorkRecordRankResultDTO resultDTO = baseDao.selectCurrentAgency(agencyDTO.getAreaCode(), formDTO.getDataType(), dateId); + resultDTO.setSubRankList(baseDao.selectSubList(agencyDTO.getAreaCode(), agencyDTO.getAgencyId(), formDTO.getDataType(), formDTO.getTopRow(), dateId)); + return resultDTO; + } + } + + /** + * @Description 6、【工作日志】近12月趋势图 + * 查询当前组织及所有下级某项数据(组织次数、参与人数、平均参与人数)的某个资源(支部建设、联建共建、党员志愿服务)对应的每个类型的指标过去12个月的汇总数据,某个月份没数据的补0 + * @author sun + */ + @Override + @DataSource(DataSourceConstant.STATS_DISPLAY) + public WorkRecordTrendResultDTO trend(WorkRecordTrendFormDTO formDTO) { + WorkRecordTrendResultDTO resultDTO = new WorkRecordTrendResultDTO(); + + //1.根据资源编码查询资源名称集合,按sort升序 + List legendList = screenCustomerWorkRecordDictDao.selectListByDataType(formDTO.getCustomerId(), formDTO.getDataType()); + resultDTO.setLegend(legendList); + if (null == legendList || legendList.size() < NumConstant.ONE) { + return resultDTO; + } + + //2.查询当前月过去12个月份 + Map map = dateUtils.getXpro(); + resultDTO.setXAxis(map.values().stream().collect(Collectors.toList())); + List monthIdList = map.keySet().stream().collect(Collectors.toList()); + + //3-1.查询当前组织及所有下级过去12个月份某项数据所有资源的统计数据 + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMM"); + LocalDate today = LocalDate.now(); + formDTO.setStartMonth(today.minusMonths(NumConstant.TWELVE).format(fmt)); + formDTO.setEndMonth(today.minusMonths(NumConstant.ZERO).format(fmt)); + List list = screenWorkRecordOrgMonthlyDao.selectMonthList(formDTO); + + //3-2.遍历封装数据并返回 + LinkedList seriesList = new LinkedList<>(); + //按资源类型封装每一个资源类型对应的过去12个月的汇总数据,某个月份没有数据的补0 + legendList.forEach(le -> { + WorkRecordTrendResultDTO.SeriesResultDTO dto = new WorkRecordTrendResultDTO.SeriesResultDTO(); + dto.setName(le); + LinkedList dataList = new LinkedList<>(); + monthIdList.forEach(m->{ + AtomicInteger num = new AtomicInteger(0); + list.forEach(l -> { + if (m.equals(l.getMonthId())&&le.equals(l.getName())) { + //dataList.add(l.getValue()); + num.set(l.getValue()); + } + }); + dataList.add(num.get()); + }); + dto.setData(dataList); + seriesList.add(dto); + }); + + resultDTO.setSeries(seriesList); + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..66f8eab095 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.plugins.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao; +import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgMonthlyService; +import com.epmet.plugins.ScreenWorkRecordOrgMonthlyDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作日志-组织按月统计(增量) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Slf4j +@Service +public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgMonthlyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenWorkRecordOrgMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenWorkRecordOrgMonthlyDTO.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 ScreenWorkRecordOrgMonthlyDTO get(String id) { + ScreenWorkRecordOrgMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenWorkRecordOrgMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenWorkRecordOrgMonthlyDTO dto) { + ScreenWorkRecordOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenWorkRecordOrgMonthlyDTO dto) { + ScreenWorkRecordOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-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 d48f83b142..be4be3fd15 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 @@ -27,6 +27,7 @@ import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.result.ProjectDetailResultDTO; import com.epmet.project.dto.result.*; import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -42,6 +43,7 @@ import java.util.List; * @Author sun * @Description 数据-项目 **/ +@Slf4j @Service public class ProjectServiceImpl implements ProjectService { @@ -197,9 +199,21 @@ public class ProjectServiceImpl implements ProjectService { */ @Override public ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO) { - ProjectDetailResultDTO projectDetailResultDTO = screenDifficultyDataService.projectDetail(processListFormDTO); + /*ProjectDetailResultDTO projectDetailResultDTO = screenDifficultyDataService.projectDetail(processListFormDTO); if (null == projectDetailResultDTO) { 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())); } Result processList = govProjectOpenFeignClient.getProcessList(processListFormDTO); if (!processList.success()) { diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml new file mode 100644 index 0000000000..ea22e57743 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml new file mode 100644 index 0000000000..9c66e72c65 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml new file mode 100644 index 0000000000..d6379ed76d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml new file mode 100644 index 0000000000..647ff94bd4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml @@ -0,0 +1,17 @@ + + + + + + \ 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 new file mode 100644 index 0000000000..f09b5f3f51 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..8902fda9f0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml @@ -0,0 +1,38 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml index 06e501b713..e08a490372 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -18,5 +18,20 @@ DEL_FLAG = '0' AND ORG_ID = #{agencyId} + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index c63fc774a1..cf3b1a7631 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 @@ -216,4 +216,60 @@ AND IS_DISPLAY = 1 AND pid = #{agencyId} + + + + + + + + + + + + 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 505ca018a8..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 @@ -7,17 +7,17 @@ + + + + + + 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-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-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml new file mode 100644 index 0000000000..2011413015 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..f050e5dd1b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityGridMonthlyDao.xml new file mode 100644 index 0000000000..98b140e175 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityGridMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityOrgMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityOrgMonthlyDao.xml new file mode 100644 index 0000000000..6e836f4df4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityOrgMonthlyDao.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/PingYinConstants.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/PingYinConstants.java new file mode 100644 index 0000000000..836e68c786 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/PingYinConstants.java @@ -0,0 +1,22 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/1/28 下午3:20 + */ +public interface PingYinConstants { + + String GRID_INFO_IS_ZERO = "客户【%s】下的网格信息为空......"; + String AGENCY_INFO_IS_ZERO = "客户【%s】下的组织信息为空......"; + String SELECT_GRID_INFO_BY_ORG_IS_NULL = "客户【%s】根据orgId查询网格项目信息为空......"; + + String EVALUATE_BAD = "bad"; + String EVALUATE_GOOD = "good"; + String EVALUATE_PERFECT = "perfect"; + + String UN_CLOSED = "unClosed"; + String CLOSED = "closed"; + + String CREATED_BY = "APP_USER"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java index cfdc9f2ec9..03c5ae0ddb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -5,6 +5,8 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * 指标计算通用入参DTO @@ -29,6 +31,17 @@ public class CalculateCommonFormDTO implements Serializable { @NotBlank(message = "客户id不能为空", groups = { CancelCalculateGroup.class }) private String customerId; + /** + * 当前客户所属的地区编码 add 01.14 + */ + private String customerAreaCode = ""; + + /** + * 当前客户下的需要汇聚的子客户列表 add 01.14 + * 暂不使用 + */ + private List subCustomerIds = new ArrayList<>(); + public CalculateCommonFormDTO() { super(); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java new file mode 100644 index 0000000000..0e9f0c961e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 查询当前客户的area_code信息、以及下一级客户列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/14 16:17 + */ +@Data +public class CustomerSubInfoDTO implements Serializable { + private String customerId; + + private String customerName; + /** + * 当前客户所属的地区编码 add 01.14 + */ + private String customerAreaCode; + + /** + * 当前客户下的需要汇聚的子客户列表 add 01.14 + * 暂不使用 + */ + private List subCustomerIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java index 3db0986065..bd156d2aaf 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java @@ -4,6 +4,8 @@ import lombok.Data; import javax.validation.constraints.Min; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * 分页查询网格列表 @@ -36,13 +38,25 @@ public class PageQueryGridFormDTO implements Serializable { private Integer pageIndex; + /** + * 当前客户所属的地区编码 add 01.14 + */ + private String customerAreaCode = ""; + + /** + * 当前客户下的需要汇聚的子客户列表 add 01.14 + * 暂不使用 + */ + private List subCustomerIds = new ArrayList<>(); - public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize){ + public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize,String customerAreaCode,List subCustomerIds){ this.customerId=customerId; this.monthId=monthId; this.pageIndex=pageIndex; this.pageNo=pageNo; this.pageSize=pageSize; + this.customerAreaCode=customerAreaCode; + this.subCustomerIds=subCustomerIds; } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java index b35ca1537a..fac962754f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java @@ -69,4 +69,52 @@ public class DeptGovrnAbilityFormDTO implements Serializable { * 办结项目满意度 */ private BigDecimal satisfactionRatio; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java index 021533fe59..1d2f1e7202 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java @@ -79,4 +79,40 @@ public class GridGovrnAbilityFormDTO implements Serializable { * 网格自治项目数 统计期网格自身内办结的项目数目 */ private Integer selfSolveProjectCount; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal transferRightRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal transferRightRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal issueToProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal issueToProjectRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java index 3aa816cafd..c7acdf1827 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java @@ -104,4 +104,16 @@ public class GridPartyAbilityFormDTO implements Serializable { * 党员参加三会一课人次 */ private Integer joinThreeMeetsCount; + + /** + * V2升级字段:issueToProjectRatio的分子:评价周期内转为项目的数量 + * 2020-01-07 新增 + */ + private Integer shiftedProjectTotal; + + /** + * V2升级字段:issueToProjectRatio的分母:评价周期内网格内居民提出的议题数目 + * 2020-01-07 新增 + */ + private Integer issueTotal; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java index 02b7906a36..fe34aaa150 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java @@ -55,4 +55,27 @@ public class GridServiceAbilityFormDTO implements Serializable { */ private BigDecimal partyVolunteerRatio; + /** + * V2升级字段:partyVolunteerRatio的分子:网格党员志愿者数 + * 2020-01-07 + */ + private Integer partyVolunteerTotal; + + /** + * V2升级字段:partyVolunteerRatio的分母:志愿者总数 + * 2020-01-07 + */ + private Integer volunteerTotal; + + /** + * V2升级字段:volunteerRatio的分子:居民且注册志愿者的总人数 + * 2020-01-07 + */ + private Integer volunteerUserTotal; + + /** + * V2升级字段:volunteerRatio的分母:网格内注册居民数 + * 2020-01-07 + */ + private Integer regUserTotal; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java index dc91df6e08..afcb201303 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java @@ -80,4 +80,64 @@ public class OrgGovrnAbilityFormDTO implements Serializable { * 街道办结项目的处理效率, data_type=street时有值 */ private BigDecimal handleProjectRatio; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal overdueProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal overdueProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAreaCodeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAreaCodeResultDTO.java new file mode 100644 index 0000000000..f3b4a73048 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAreaCodeResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.org.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/14 上午11:05 + */ +@Data +public class CustomerAreaCodeResultDTO implements Serializable { + + private static final long serialVersionUID = -4722604654441455214L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 行政区域编码 + */ + private String areaCode; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java new file mode 100644 index 0000000000..d1f9083b30 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/2/1 上午9:22 + */ +@Data +public class ClosedIncrResultDTO implements Serializable { + + private static final long serialVersionUID = 4907953818631953766L; + + private String gridId; + + private Integer closedIncr; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/EvaluateTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/EvaluateTotalResultDTO.java new file mode 100644 index 0000000000..3eb30a3887 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/EvaluateTotalResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.pingyin.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/29 上午9:08 + */ +@Data +public class EvaluateTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -4734985200452228738L; + + private String orgId; + + private Integer evaluateCount = NumConstant.ZERO; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java new file mode 100644 index 0000000000..6200eb8add --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/29 下午2:28 + */ +@Data +public class ProjectIncrResultDTO implements Serializable { + + private static final long serialVersionUID = -1452144390062903633L; + + private String gridId; + + private Integer projectIncr; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgDailyResultDTO.java new file mode 100644 index 0000000000..a19749c5e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgDailyResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.pingyin.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/2/1 下午3:34 + */ +@Data +public class ProjectOrgDailyResultDTO implements Serializable { + + private static final long serialVersionUID = -6838351691873050562L; + + /** + * 行政区域编码 + */ + private String areaCode; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 不满意总次数 + */ + private Integer badTotal; + + public ProjectOrgDailyResultDTO() { + this.projectTotal = NumConstant.ZERO; + this.resolvedNum = NumConstant.ZERO; + this.evaluateTotal = NumConstant.ZERO; + this.goodTotal = NumConstant.ZERO; + this.badTotal = NumConstant.ZERO; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgMonthlyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgMonthlyResultDTO.java new file mode 100644 index 0000000000..8829d379c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgMonthlyResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/2/2 上午11:01 + */ +@Data +public class ProjectOrgMonthlyResultDTO implements Serializable { + + private static final long serialVersionUID = 4917301916897636586L; + + /** + * 行政区域编码 + */ + private String areaCode; + + /** + * 本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 累计项目总数 + */ + private Integer projectTotal; + + /** + * 累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectTotalResultDTO.java new file mode 100644 index 0000000000..a356c0ccdb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectTotalResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/28 下午3:15 + */ +@Data +public class ProjectTotalResultDTO implements Serializable { + + private static final long serialVersionUID = 6071988402600005617L; + + private String gridId; + private Integer projectTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ResolvedNumResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ResolvedNumResultDTO.java new file mode 100644 index 0000000000..6710de4469 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ResolvedNumResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/28 下午3:15 + */ +@Data +public class ResolvedNumResultDTO implements Serializable { + + private static final long serialVersionUID = 607198840261205617L; + + private String gridId; + private Integer resolvedNum; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java new file mode 100644 index 0000000000..d31e85ec28 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/29 下午2:59 + */ +@Data +public class UnClosedTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -722723608888414454L; + + private String gridId; + + private Integer projectCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/BidFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/BidFormDTO.java new file mode 100644 index 0000000000..154d6c87a0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/BidFormDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.plugins; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * 【146】竞标管理 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:54 + */ +@Data +public class BidFormDTO implements Serializable { + private static final long serialVersionUID = -9132608534627587213L; + /** + * 竞标项目id + */ + private String bidId; + + /** + * 竞标项目名称 + */ + private String bidName; + + /** + * 状态编码 + */ + private String statusCode; + + /** + * 状态描述eg:已中标、未中标、投标中、 + */ + private String statusDesc; + + /** + * 金额单位万元 + */ + private Double amount; + + /** + * 发布时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date releaseTime; + + /** + * 发布村镇,以英文逗号隔开 + */ + private String townIds; + + /** + * 发布村镇名称,以英文逗号隔开 + */ + private String townNames; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ContractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ContractFormDTO.java new file mode 100644 index 0000000000..445885e04c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ContractFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.plugins; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * 【146】合同监管入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:43 + */ +@Data +public class ContractFormDTO implements Serializable { + private static final long serialVersionUID = 971064596156093552L; + /** + * 合同id + */ + private String contractId; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同所属类别编码 + */ + private String categoryCode; + + /** + * 合同所属类别名称 + */ + private String categoryName; + + /** + * 合同到期日期:2020-12-31 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date dueDate; + + /** + * 发布村镇,以英文逗号隔开 + */ + private String townIds; + + /** + * 发布村镇名称,以英文逗号隔开 + */ + private String townNames; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/OneListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/OneListFormDTO.java new file mode 100644 index 0000000000..992e62d2d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/OneListFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 【146】一张清单 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:12 + */ +@Data +public class OneListFormDTO implements Serializable { + private static final long serialVersionUID = 8350552654881582654L; + /** + * 清单id + */ + private String listId; + + /** + * 清单编码 + */ + private String listCode; + + /** + * 名称 + */ + private String listName; + + /** + * 排序 + */ + private Integer sort; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenCustomerWorkRecordDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenCustomerWorkRecordDictDTO.java new file mode 100644 index 0000000000..9718304450 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenCustomerWorkRecordDictDTO.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.dto.plugins; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Data +public class ScreenCustomerWorkRecordDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(客户每次上传,直接根据customerId全删全增) + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至日期eg:20200101 + */ + private String dateId; + + /** + * 资源id + */ + private String dictId; + + /** + * 父资源ID;如果是一级分类pid=0 + */ + private String pid; + + /** + * 资源类型 + */ + private String resourceType; + + /** + * 资源编码 + */ + private String resourceCode; + + /** + * 资源标签名 + */ + private String resourceLabel; + + /** + * 显示标识:0否,1是 + */ + private String showFlag; + + /** + * 排序 + */ + private Integer sort; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice;所有的一级分类需要对应到这三个key中 + */ + private String dataType; + + /** + * 当前资源属于几级,例如:1、2、3、4.... + */ + private Integer level; + + /** + * 逻辑删除标识 + */ + 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/plugins/ScreenWorkRecordCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java new file mode 100644 index 0000000000..f72d2f3667 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 工作日志-数据采集通用DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/21 18:49 + */ +@Data +public class ScreenWorkRecordCommonFormDTO implements Serializable { + private static final long serialVersionUID = 819322082786098071L; + + /** + * 组织Id或者网格id + */ + private String orgId; + + /** + * 组织名称或者网格名 + */ + private String orgName; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + +} 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-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/ScreenProjectGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java new file mode 100644 index 0000000000..c1f5f2ed12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java @@ -0,0 +1,152 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectGridDailyDTO 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; + + /** + * 截止到当前日期,网格内项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前日期,网格内已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 对当前网格内项目,参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 对当前网格内项目,满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 对当前网格内项目,不满意总次数 + */ + private Integer badTotal; + + /** + * 满意率=good_total/evaluate_total + */ + private BigDecimal goodRatio; + + /** + * 不满意率=bad_total/evaluate_total + */ + private BigDecimal badRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public ScreenProjectGridDailyDTO() { + this.projectTotal = NumConstant.ZERO; + this.resolvedNum = NumConstant.ZERO; + this.resolvedRatio = NumConstant.ZERO_DECIMAL; + this.evaluateTotal = NumConstant.ZERO; + this.goodTotal = NumConstant.ZERO; + this.badTotal = NumConstant.ZERO; + this.goodRatio = NumConstant.ZERO_DECIMAL; + this.badRatio = NumConstant.ZERO_DECIMAL; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + } +} \ No newline at end of file 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/ScreenProjectOrgDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.java new file mode 100644 index 0000000000..7b449b50fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.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.screen; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectOrgDailyDTO 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; + + /** + * 截止到当前日期,网格内项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前日期,网格内已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 对当前组织内项目,参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 对当前组织内项目,满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 对当前组织内项目,不满意总次数 + */ + private Integer badTotal; + + /** + * 满意率=good_total/evaluate_total + */ + private BigDecimal goodRatio; + + /** + * 不满意率=bad_total/evaluate_total + */ + private BigDecimal badRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 行政区域编码 + */ + private String areaCode; + +} \ No newline at end of file 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/ScreenProjectQuantityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityGridMonthlyDTO.java new file mode 100644 index 0000000000..b735ed6e27 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityGridMonthlyDTO.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.dto.screen; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectQuantityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 当前网格,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前月份:累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 截止到当前月份:累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public ScreenProjectQuantityGridMonthlyDTO() { + this.projectIncr = NumConstant.ZERO; + this.projectTotal = NumConstant.ZERO; + this.unClosedTotal = NumConstant.ZERO; + this.closedTotal = NumConstant.ZERO; + this.closedIncr = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityOrgMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityOrgMonthlyDTO.java new file mode 100644 index 0000000000..0355ec4a8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityOrgMonthlyDTO.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectQuantityOrgMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 当前组织内,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前月份:累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 截止到当前月份:累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private String areaCode; + + public ScreenProjectQuantityOrgMonthlyDTO() { + this.projectIncr = NumConstant.ZERO; + this.projectTotal = NumConstant.ZERO; + this.unClosedTotal = NumConstant.ZERO; + this.closedTotal = NumConstant.ZERO; + this.closedIncr = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/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<>(); +} 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-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 760e48b3da..fa3e97d11d 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 @@ -45,4 +45,9 @@ public class ScreenCollFormDTO implements Serializable { public String toString() { return JSON.toJSONString(this); } + + /** + * 当前客户id + */ + private String customerId; } 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 a9f9d34697..0ef8749799 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 @@ -73,4 +73,9 @@ public class CustomerAgencyFormDTO implements Serializable { * 是否显示 */ private String isDisplay; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java index a99713701a..e39b6e1644 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java @@ -48,4 +48,10 @@ public class CustomerDeptFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; + + /** + * V2升级必传参数:当前网格所属行政地区编码,去除末尾0 + * 2020-01-07 + */ + private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java index 75eb13a0fa..ad9277c0d8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java @@ -53,4 +53,10 @@ public class CustomerGridFormDTO implements Serializable { * 所有上级ID,用英文逗号分开(8.26新增) */ private String allParentIds; + + /** + * V2升级必传参数:当前网格所属行政地区编码,去除末尾0 + * 2020-01-07 + */ + private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java index 86aff5d046..d9de52d3e7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto.stats; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -73,4 +74,8 @@ public class DimCustomerDTO implements Serializable { */ private Date updatedTime; + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ + private String areaCode; } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 4be6144bc2..27a471f2d4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -7,6 +7,7 @@ import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; @@ -227,4 +228,12 @@ public interface DataStatisticalOpenFeignClient { **/ @PostMapping("/data/stats/screenextract/extractmonthlyall") Result extractMonthlyAll(ExtractScreenFormDTO extractScreenFormDTO); + + /** + * @Description 新客户初始化评价指标 权重 + * @author sun + */ + @PostMapping(value = "/data/stats/indexdict/initCustomerIndex") + Result initCustomerIndex(@RequestBody InitCustomerIndexForm formDTO); + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 0f09dc88b9..88574dbd8d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -8,6 +8,7 @@ import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import org.springframework.stereotype.Component; @@ -224,4 +225,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result extractMonthlyAll(ExtractScreenFormDTO extractScreenFormDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "screenExtractMonthly", extractScreenFormDTO); } + + @Override + public Result initCustomerIndex(InitCustomerIndexForm formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initCustomerIndex", formDTO); + } } 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 755705a6ce..5d340fa7f3 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 @@ -36,6 +36,10 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.*; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; +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.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; @@ -175,8 +179,8 @@ public class DemoController { } @PostMapping("zxc2") - public Result getZxc2(){ - indexCalculateCommunityService.calCommunityAll("45687aa479955f9d06204d415238f7cc", "202008"); + public Result getZxc2(@RequestBody CalculateCommonFormDTO formDTO){ + indexCalculateCommunityService.calCommunityAll(formDTO); return new Result(); } @@ -484,17 +488,13 @@ public class DemoController { } @PostMapping("streetZxc") - public void getStreet(){ - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - String monthId = "202009"; - indexCalculateStreetService.calStreetAll(customerId,monthId); + public void getStreet(@RequestBody CalculateCommonFormDTO form){ + indexCalculateStreetService.calStreetAll(form); } @PostMapping("districtZxc") - public void getDistrict(){ - String customerId = "45687aa479955f9d06204d415238f7cc"; - String monthId = "202009"; - indexCalculateDistrictService.calDistrictAll(customerId,monthId); + public void getDistrict(@RequestBody CalculateCommonFormDTO form){ + indexCalculateDistrictService.calDistrictAll(form); } @PostMapping("gridZxc") public void getGrid(){ @@ -747,4 +747,40 @@ public class DemoController { log.info("影响行数="+updateNum); return new Result(); } + + @Autowired + private ScreenProjectGridDailyService screenProjectGridDailyService; + + @Autowired + private ScreenProjectQuantityGridMonthlyService screenProjectQuantityGridMonthlyService; + + @Autowired + private ScreenProjectOrgDailyService screenProjectOrgDailyService; + + @Autowired + private ScreenProjectQuantityOrgMonthlyService screenProjectQuantityOrgMonthlyService; + + @PostMapping("screenProjectGridDaily") + public Result screenProjectGridDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){ + screenProjectGridDailyService.extractionProjectGridDaily(customerId,dateId); + return new Result(); + } + + @PostMapping("screenProjectQuantityGrid") + public Result screenProjectQuantityGrid(@RequestParam("customerId")String customerId,@RequestParam("monthId")String monthId){ + screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId,monthId); + return new Result(); + } + + @PostMapping("screenProjectOrgDaily") + public Result screenProjectOrgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){ + screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); + return new Result(); + } + + @PostMapping("screenProjectQuantityOrgMonthly") + public Result screenProjectQuantityOrgMonthly(@RequestParam("customerId")String customerId,@RequestParam("monthId")String monthId){ + screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId,monthId); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 11e082057a..1bf83298cc 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 @@ -84,6 +84,9 @@ public class IndexCalculateController { CalculateCommonFormDTO form = new CalculateCommonFormDTO(); form.setCustomerId(flag.getForm().getCustomerId()); form.setMonthId(flag.getForm().getMonthId()); + //01.14 add + form.setCustomerAreaCode(flag.getForm().getCustomerAreaCode()); + form.setSubCustomerIds(flag.getForm().getSubCustomerIds()); indexCalculate(form); } }); 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 new file mode 100644 index 0000000000..cfb2a30536 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -0,0 +1,165 @@ +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; +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; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Description 事件/项目采集接口入口 + * @ClassName ScreenProjectDataCollController + * @Auth wangc + * @Date 2021-01-27 17:10 + */ +@Slf4j +@RestController +@RequestMapping("project") +public class ScreenProjectDataCollController { + + @Autowired + private ScreenProjectGridDailyService projectGridDailyService; + @Autowired + private ScreenProjectOrgDailyService projectOrgDailyService; + @Autowired + private ScreenProjectQuantityGridMonthlyService projectQuantityGridMonthlyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; + @Autowired + private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; + @Autowired + private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; + @Autowired + private ScreenProjectDataService projectDataService; + @Autowired + private ScreenProjectProcessService projectProcessService; + + /** + * @author wangc + * @description 【事件/项目分析】网格内月度数量统计 + **/ + @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); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】组织内月度数量统计 + **/ + @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); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】网格内事件 + **/ + @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); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】组织内事件 + **/ + @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); + return new Result(); + } + + /** + *【事件/项目分析】按类别统计-网格 + * + * @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计算 + + /** + * @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/controller/plugins/OfsController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java new file mode 100644 index 0000000000..09f5942c5c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java @@ -0,0 +1,66 @@ +package com.epmet.controller.plugins; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.dto.plugins.OneListFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.service.plugins.OfsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 146体系数据采集 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:10 + */ +@RestController +@RequestMapping("plugins/ofs") +public class OfsController { + + @Autowired + private OfsService ofsService; + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【146】一张清单 + * @Date 2021/1/22 10:19 + **/ + @PostMapping("onelist-daily") + public Result collOneList(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ofsService.collOneList(formDTO); + return new Result(); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【146】合同监管 + * @Date 2021/1/22 10:42 + **/ + @PostMapping("contract-daily") + public Result collContract(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ofsService.collContract(formDTO); + return new Result(); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【146】竞标管理 + * @Date 2021/1/22 10:53 + **/ + @PostMapping("bid-daily") + public Result collBid(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + 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 new file mode 100644 index 0000000000..314a814ade --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java @@ -0,0 +1,93 @@ +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.dto.plugins.ScreenCustomerWorkRecordDictDTO; +import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +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.*; + +/** + * 工作日志数据采集 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:10 + */ +@RestController +@RequestMapping("plugins/workrecord") +@Slf4j +public class WorkRecordColController { + + @Autowired + ScreenCustomerWorkRecordDictService dictService; + @Autowired + private ScreenWorkRecordOrgMonthlyService screenWorkRecordOrgMonthlyService; + @Autowired + private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService; + /** + * @Description 【工作日志】客户资源字典信息上传 + * + * 按月上传工作日志统计数据时,同步调用此接口上传字典信息 + * @param customerId + * @param data + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2021.02.04 16:16 + */ + @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不可为空"); + } + dictService.collect(customerId,data); + return new Result(); + } + + /** + * @Description 【工作日志】组织按月统计 + * @param customerId + * @param data + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2021.02.04 16:16 + */ + @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不可为空"); + } + screenWorkRecordOrgMonthlyService.collect(customerId,data); + return new Result(); + } + + /** + * @Description 【工作日志】组织按日统计 累计值 + * @param customerId + * @param data + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2021.02.04 16:16 + */ + @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不可为空"); + } + screenWorkRecordOrgDailyService.collectOrgDaily(customerId,data); + 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 new file mode 100644 index 0000000000..87a8db63bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.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.crm; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.entity.crm.CustomerRelationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +@Mapper +public interface CustomerRelationDao extends BaseDao { + + /** + * @param customerId + * @author yinzuomei + * @description 查询当前客户的area_code信息、以及下一级客户列表 + * @Date 2021/1/21 11:27 + **/ + CustomerSubInfoDTO selectCustomerSubInfo(@Param("customerId")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/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index ebbbe5e84b..12b747d206 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 @@ -23,6 +23,7 @@ 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.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -217,4 +218,59 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getOrgProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("level") String level); + + /** + * @Description 查询项目总数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午4:01 + */ + List selectProjectTotal(@Param("customerId")String customerId, @Param("dateId")String dateId, @Param("monthId")String monthId); + + /** + * @Description 查询已解决项目数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午4:15 + */ + List selectResolvedNum(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @Description 查询 满意度评价次数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/29 上午9:10 + */ + List selectEvaluateCount(@Param("customerId")String customerId, @Param("dateId")String dateId, @Param("activeCodes") List activeCodes); + + /** + * @Description 查询本月新增项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午2:31 + */ + List selectProjectIncr(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 根据状态查询项目数 + * @Param customerId + * @Param monthId + * @Param status + * @author zxc + * @date 2021/1/29 下午3:25 + */ + List selectProjectCount(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("status") String status); + + /** + * @Description 本月新增结案项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/1 上午9:25 + */ + List selectClosedIncr(@Param("customerId")String customerId, @Param("monthId")String monthId); } \ 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 d107e0e2fe..70a1fee036 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 @@ -63,7 +63,7 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao list); + void deleteByProjectIds(@Param("list") List list,@Param("customerId") String customerId); /** * @Description 批量插入 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 3046923a98..5e0d0585be 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 @@ -62,6 +62,16 @@ public interface AgencyScoreDao extends BaseDao { */ List selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType); + /** + * @Description 查询【fact_index_agency_score】相关信息 存在下级客户 + * @Param areaCode + * @Param monthId + * @Param dataType + * @author zxc + * @date 2021/1/15 下午4:23 + */ + List selectAgencyScoreInfoExistsSub(@Param("areaCode") String areaCode,@Param("areaCodeLength") Integer areaCodeLength, @Param("monthId")String monthId, @Param("dataType")String dataType); + /** * @Description 区下级街道得分平均值 * @param customerId @@ -71,6 +81,17 @@ public interface AgencyScoreDao extends BaseDao { */ List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + /** + * @Description 区下级街道得分平均值 存在下级客户 + * @Param monthId + * @Param indexCode + * @Param dataType + * @Param areaCode + * @author zxc + * @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); + /** * 根据入参查询 区/街道相关分数表 记录 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 95d0f60e84..1e653e61a7 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 @@ -61,6 +61,15 @@ public interface CommunityScoreDao extends BaseDao selectCommunityInfo(@Param("customerId") String customerId,@Param("monthId")String monthId); + /** + * @Description 查询社区相关信息 存在下级客户 + * @Param areaCode + * @Param monthId + * @author zxc + * @date 2021/1/15 下午2:18 + */ + List selectCommunityInfoExistsSub(@Param("areaCode") String areaCode,@Param("monthId")String monthId); + /** * 根据入参查询 查询社区相关信息 * @param customerId @@ -79,6 +88,16 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** + * @Description 街道下级所有社区得分平均值 存在下级客户 + * @Param monthId + * @Param indexCode + * @Param areaCode + * @author zxc + * @date 2021/1/15 下午3:19 + */ + List selectSubCommAvgScoreExistSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); + /** * 根据入参查询 查询社区id * @param customerId 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 c236c31e6c..a22317c371 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 @@ -68,6 +68,16 @@ public interface DeptScoreDao extends BaseDao { */ List selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** + * @Description 所有直属部门治理能力平均值 存在下级客户 + * @Param areaCode + * @Param monthId + * @Param indexCode + * @author zxc + * @date 2021/1/18 上午9:31 + */ + List selectGovernDeptScoreAvgExistsSub(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** * @return int * @param customerId 客户id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java index e4eef189fd..0435005a88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java @@ -78,6 +78,16 @@ public interface GridScoreDao extends BaseDao { */ List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** + * @Description 所有网格的平均值 + * @Param monthId + * @Param indexCode + * @Param areaCode + * @author zxc + * @date 2021/1/15 上午9:24 + */ + List selectSubGridAvgScoreByAreaCode(@Param("monthId")String monthId, @Param("indexCode")String indexCode, @Param("areaCode")String areaCode); + /** * 根据入参查询 网格相关分值记录 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index b4f79644d0..b53a2d7a83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -18,7 +18,6 @@ package com.epmet.dao.evaluationindex.indexcoll; /** import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -90,7 +89,9 @@ public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao> selectListByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, - @Param("pageSize") Integer pageSize); + @Param("pageSize") Integer pageSize, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds") List subCustomerIds); /** * @return com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 2e047268de..a47ebdc88d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; @@ -44,11 +43,7 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao - * @param customerId - * @param monthId * @author yinzuomei * @description 查询治理能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 13:10 **/ - Map selectGovrnAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + Map selectGovrnAblityGridMinAndMax(CalculateCommonFormDTO formDTO); /** * @return int 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 5d172d1e06..48d156cc81 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 @@ -67,6 +67,15 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + /** + * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、【街道办结项目的处理效率,level为street时存在】、办结项目率、办结项目满意度】存在下级客户时 + * @Param areaCode + * @Param monthId + * @author zxc + * @date 2021/1/15 下午1:27 + */ + List> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + /** * 根据组织类型删除数据 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 619b621d7a..1102a159b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcollect.form.GridPartyMemberDataDetailFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -59,9 +60,29 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list, @Param("customerId") String customerId); - List> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); + /** + * @return java.util.List> + * @param customerId 当前计算的客户id + * @param monthId yyyyMM + * @param offset + * @param pageSize + * @param customerAreaCode 当前计算的客户所属的area_code + * @param subCustomerIds 当前计算的客户下的子客户id + * @description 分页查询党建能力-党员相关 指标原始数据 + * @Date 2021/1/15 10:04 + **/ + List> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("offset") Integer offset, @Param("pageSize") Integer pageSize, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds") List subCustomerIds); - Map getExtremeValue(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * @return java.util.Map + * @param formDTO: customerId 当前计算的客户id;monthId yyyyMM;customerAreaCode 当前计算的客户所属的area_code;subCustomerIds 当前计算的客户下的子客户id + * @description 党员相关-党建能力各个指标值的最大值、最小值(1)有子客户时按照area_code查询(2)没有子客户按照customerId查询 + * @Date 2021/1/15 9:44 + **/ + Map getExtremeValue(CalculateCommonFormDTO formDTO); /** * @return int diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index e15e5cc90b..ec9404e36b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -73,13 +73,12 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao - * @param customerId - * @param monthId + * @param formDTO * @author yinzuomei * @description 查询党建能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:51 **/ - Map selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + Map selectPartyAblityGridMinAndMax(CalculateCommonFormDTO formDTO); /** * @return java.lang.Integer 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 f9ab1ba754..ebbdc9424f 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 @@ -78,6 +78,25 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + /** + * @Description 查询社区下的发文数 Map 存在下级客户 + * @Param monthId + * @Param areaCode + * @author zxc + * @date 2021/1/15 下午3:31 + */ + List> selectPublishArticleCountMapExistSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); + + /** + * @Description 查询社区下的发文数 Map【根据areaCode】 + * @Param customerId + * @Param monthId + * @Param level + * @author zxc + * @date 2021/1/15 上午9:48 + */ + List> selectPublishArticleCountMapbyAreaCode(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + /** * 根据组织类型删除数据 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java index 10cabe11f1..ebb543d4b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -71,13 +71,11 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao - * @param customerId - * @param monthId * @author yinzuomei * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 13:15 **/ - Map selectServiceAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + Map selectServiceAblityGridMinAndMax(CalculateCommonFormDTO formDTO); /** * @return int 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 c7ea1d7795..bacc7b77ed 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 @@ -79,6 +79,15 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + /** + * @Description 社区活动组织次数 存在下级客户 + * @Param monthId + * @Param areaCode + * @author zxc + * @date 2021/1/15 下午1:53 + */ + List> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + /** * 根据组织类型删除数据 * @author zhaoqifeng 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 3b43d23c4d..de96e0abd3 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 @@ -24,6 +24,7 @@ import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -71,7 +72,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListMismatcCommunityAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds); + List selectListMismatcCommunityAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * 根据客户id,查询区/街道 组织名称、id @@ -81,7 +84,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListAgencyInfo(@Param("customerId") String customerId); + List selectListAgencyInfo(@Param("customerId") String customerId, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * @param agencyId @@ -100,7 +105,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListMismatcStreetAndDistrictAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds); + List selectListMismatcStreetAndDistrictAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * desc:获取客户的组织条数 @@ -177,4 +184,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectOrgNameAgency(@Param("agencyIds") List agencyIds); Boolean initBizOrg(CustomerBizOrgFormDTO formDTO); + + /** + * @Description 根据客户ID查询组织信息 + * @Param customerId + * @author zxc + * @date 2021/2/1 下午2:03 + */ + List selectAgencyByCustomer(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index 3a992c7ca6..5f8e0555c1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -57,14 +57,13 @@ public interface ScreenCustomerDeptDao extends BaseDao void batchInsertCustomerDept(@Param("list") List list, @Param("customerId")String customerId); /** - * @param customerId * @param deptId * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity * @author yinzuomei * @description 查询部门所属组织id * @Date 2020/9/3 16:32 **/ - ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId); + ScreenCustomerDeptEntity selectParentAgencyId(@Param("deptId") String deptId); /** * 返回当前客户下,未匹配到的区直部门信息 @@ -76,7 +75,9 @@ public interface ScreenCustomerDeptDao extends BaseDao * @Date 10:45 2020-09-04 **/ List selectListMismatchDeptInfo(@Param("customerId") String customerId, - @Param("deptIds") String[] deptIds); + @Param("deptIds") String[] deptIds, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * 根据客户id 查询部门 信息 @@ -85,7 +86,9 @@ public interface ScreenCustomerDeptDao extends BaseDao * @Author zhangyong * @Date 16:57 2020-09-03 **/ - List selectListDeptInfo(@Param("customerId")String customerId); + List selectListDeptInfo(@Param("customerId")String customerId, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * 查询最后一次添加的部门 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index b0e405eace..c06e189d7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -23,6 +23,7 @@ import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.dto.screencoll.form.CustomerGridFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -88,14 +89,13 @@ public interface ScreenCustomerGridDao extends BaseDao List pageListByCustomerId(PageQueryGridFormDTO formDTO); /** - * @param customerId 客户id * @param gridId 网格id * @return java.lang.String * @author yinzuomei * @description 查询网格所属的组织id * @Date 2020/8/31 12:35 **/ - ScreenCustomerGridDTO selectParentAgencyId(@Param("customerId") String customerId, @Param("gridId") String gridId); + ScreenCustomerGridDTO selectParentAgencyId(@Param("gridId") String gridId); /** * 返回当前客户下,未匹配到的网格信息 @@ -107,7 +107,9 @@ public interface ScreenCustomerGridDao extends BaseDao * @Date 10:45 2020-09-04 **/ List selectListMismatchGridInfo(@Param("customerId") String customerId, - @Param("gridIds") String[] gridIds); + @Param("gridIds") String[] gridIds, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * 根据客户id 查询网格(党支部)详细信息 @@ -116,7 +118,9 @@ public interface ScreenCustomerGridDao extends BaseDao * @Author zhangyong * @Date 16:57 2020-09-03 **/ - List selectListGridInfo(@Param("customerId")String customerId); + List selectListGridInfo(@Param("customerId")String customerId, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * @Description 根据agencyId查询网格ID @@ -182,4 +186,12 @@ public interface ScreenCustomerGridDao extends BaseDao * @date 2020/9/18 10:47 上午 */ List selectAllGridInfo(@Param("customerId") String customerId); + + /** + * @Description 查询客户下的网格信息 + * @Param customerId + * @author zxc + * @date 2021/1/28 下午3:18 + */ + List selectGridInfoByCustomerId(@Param("customerId") String customerId); } 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/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/ScreenProjectGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java new file mode 100644 index 0000000000..f9cbac7ffe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.ScreenProjectGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectGridDailyEntity; +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-01-27 + */ +@Mapper +public interface ScreenProjectGridDailyDao extends BaseDao { + + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("createdBy") String createdBy, @Param("timeId") String timeId); + + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 插入 + * @Param list + * @author zxc + * @date 2021/1/29 上午10:44 + */ + void insertScreenProjectGridDaily(@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/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/ScreenProjectOrgDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java new file mode 100644 index 0000000000..731347f2a6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.pingyin.result.ProjectOrgDailyResultDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectOrgDailyEntity; +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-01-27 + */ +@Mapper +public interface ScreenProjectOrgDailyDao extends BaseDao { + + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("createdBy") String createdBy, @Param("timeId") String timeId); + + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 项目(事件)分析按组织_按天统计 + * @Param agencyInfos + * @author zxc + * @date 2021/2/1 下午3:51 + */ + List selectOrgProject(@Param("agencyInfos") List agencyInfos, @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/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/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java new file mode 100644 index 0000000000..13b8c56630 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectQuantityGridMonthlyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityGridMonthlyEntity; +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-01-27 + */ +@Mapper +public interface ScreenProjectQuantityGridMonthlyDao extends BaseDao { + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("createdBy") String createdBy, @Param("timeId") String timeId); + + int deleteByMonthIdAndCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java new file mode 100644 index 0000000000..a11d394821 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.pingyin.result.ProjectOrgMonthlyResultDTO; +import com.epmet.dto.screen.ScreenProjectQuantityOrgMonthlyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyEntity; +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-01-27 + */ +@Mapper +public interface ScreenProjectQuantityOrgMonthlyDao extends BaseDao { + + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("createdBy") String createdBy, @Param("timeId") String timeId); + + int deleteByMonthIdAndCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 项目(事件)数量查询【当月】 + * @Param agencyInfos + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/2 上午11:09 + */ + List selectQuantityOrgMonthly(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); + + /** + * @Description 项目(事件)数量查询【本月之前的累计】 + * @Param agencyInfos + * @Param monthId + * @author zxc + * @date 2021/2/2 下午3:03 + */ + List selectQuantityGrandOrgMonthly(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); + + +} \ No newline at end of file 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 eb02051e91..9c1217bd02 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 @@ -2,6 +2,7 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.org.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -22,4 +23,12 @@ public interface StatsCustomerAgencyDao extends BaseDao { List selectSubAgencyByPid(@Param("pid")String pid); List listAgenciesByUpdatedTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime); + + /** + * @Description 查询客户所属区域编码 + * @Param customerIds + * @author zxc + * @date 2021/1/14 上午11:07 + */ + List selectCustomerAreaCodeById(@Param("customerIds") List customerIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenBidInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenBidInfoDao.java new file mode 100644 index 0000000000..b269279cfb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenBidInfoDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.entity.plugins.ScreenBidInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 146:竞标管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenBidInfoDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list, @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/plugins/ScreenContractInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenContractInfoDao.java new file mode 100644 index 0000000000..c24ae1026e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenContractInfoDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.entity.plugins.ScreenContractInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 146:合同基本信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenContractInfoDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list, @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/plugins/ScreenCustomerWorkRecordDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenCustomerWorkRecordDictDao.java new file mode 100644 index 0000000000..9a1cd92056 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenCustomerWorkRecordDictDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; +import com.epmet.entity.plugins.ScreenCustomerWorkRecordDictEntity; +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-04 + */ +@Mapper +public interface ScreenCustomerWorkRecordDictDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list,@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/plugins/ScreenListInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenListInfoDao.java new file mode 100644 index 0000000000..45627c662b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenListInfoDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.OneListFormDTO; +import com.epmet.entity.plugins.ScreenListInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 146:一张清单列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenListInfoDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list, @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/plugins/ScreenWorkRecordOrgDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgDailyDao.java new file mode 100644 index 0000000000..2bf23d6a6b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgDailyDao.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.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgDailyEntity; +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 ScreenWorkRecordOrgDailyDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId, @Param("dateId") String dateId); + + void insertBatch(@Param("list") List list, + @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/plugins/ScreenWorkRecordOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java new file mode 100644 index 0000000000..16f4a763e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.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.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +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-04 + */ +@Mapper +public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId, @Param("monthId") String monthId); + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("monthId") String monthId); + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java index a2fa408a43..c6dc6dba64 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java @@ -17,6 +17,7 @@ package com.epmet.entity.crm; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -88,4 +89,6 @@ public class CustomerEntity extends BaseEpmetEntity { */ private String logo; + @TableField(exist = false) + private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java new file mode 100644 index 0000000000..9de6f223d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.crm; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_relation") +public class CustomerRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 父级客户id;如果是顶级客户,此列=0 + */ + private String parentCustomerId; + + /** + * 当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0 + */ + private String pids; + + /** + * 当前客户类型取值: external:外部客户,internal:内部客户 + */ + private String customerType; + + /** + * 父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0 + */ + private String parentCustomerType; + + /** + * open,closed是否启用 + */ + private String status; + + /** + * 当前客户级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + private String level; + + /** + * 当前客户的地区编码,实际就是根组织的area_code + */ + private String areaCode; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java index 47501f13f4..e1d90758ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** - * 治理能力-部门相关数据 + * 治理能力-部门相关数据 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -97,4 +97,51 @@ public class FactIndexGovrnAblityDeptMonthlyEntity extends BaseEpmetEntity { */ private BigDecimal satisfactionRatio; + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java index 7b0c61a9fd..e8e9177ed1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** - * 治理能力-网格相关事实表 + * 治理能力-网格相关事实表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -107,4 +107,39 @@ public class FactIndexGovrnAblityGridMonthlyEntity extends BaseEpmetEntity { */ private BigDecimal satisfactionRatio; + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal transferRightRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal transferRightRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal issueToProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal issueToProjectRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java index fe8ee990b8..90a8245ab5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -106,4 +106,64 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { * 街道办结项目的处理效率, data_type=street时有值 */ private BigDecimal handleProjectRatio; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal overdueProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal overdueProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java index b38d4c4d7a..c19656db68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** - * 党建能力-网格相关事实表 + * 党建能力-网格相关事实表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -132,4 +132,16 @@ public class FactIndexPartyAblityGridMonthlyEntity extends BaseEpmetEntity { */ private Integer joinThreeMeetsCount; + + /** + * V2升级字段:issueToProjectRatio的分子:评价周期内转为项目的数量 + * 2020-01-07 新增 + */ + private Integer shiftedProjectTotal; + + /** + * V2升级字段:issueToProjectRatio的分母:评价周期内网格内居民提出的议题数目 + * 2020-01-07 新增 + */ + private Integer issueTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java index fedcaf1637..c296fb4a42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java @@ -82,4 +82,27 @@ public class FactIndexServiceAblityGridMonthlyEntity extends BaseEpmetEntity { */ private BigDecimal partyVolunteerRatio; + /** + * V2升级字段:partyVolunteerRatio的分子:网格党员志愿者数 + * 2020-01-07 + */ + private Integer partyVolunteerTotal; + + /** + * V2升级字段:partyVolunteerRatio的分母:志愿者总数 + * 2020-01-07 + */ + private Integer volunteerTotal; + + /** + * V2升级字段:volunteerRatio的分子:居民且注册志愿者的总人数 + * 2020-01-07 + */ + private Integer volunteerUserTotal; + + /** + * V2升级字段:volunteerRatio的分母:网格内注册居民数 + * 2020-01-07 + */ + private Integer regUserTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java index e75d36927b..f8e3831864 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupDetailTemplateEntity.java @@ -17,6 +17,8 @@ package com.epmet.entity.evaluationindex.screen; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java index f8cdc843c5..0db5a3da18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexGroupTemplateEntity.java @@ -17,6 +17,8 @@ package com.epmet.entity.evaluationindex.screen; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java index 46903b52b5..ba06221d17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java @@ -105,4 +105,13 @@ public class ScreenCustomerAgencyEntity extends BaseEpmetEntity { */ private String isDisplay; + /** + * desc: 是否参与上级计算yes:参与;no:不参与 add 01.14 + */ + private String upToCal; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701 + */ + private String parentAreaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java index 474243815a..d8adca7a34 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java @@ -77,4 +77,14 @@ public class ScreenCustomerDeptEntity extends BaseEpmetEntity { private String sourceType; + /** + * V2升级必传参数:当前网格所属行政地区编码,去除末尾0 + * 2020-01-07 + */ + private String areaCode; + + /** + * desc: 是否参与上级计算yes:参与;no:不参与 add 01.14 + */ + private String upToCal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java index 0b98a125eb..4a0d8e53c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java @@ -81,4 +81,15 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity { private String allParentIds; private String sourceType; + + /** + * V2升级必传参数:当前网格所属行政地区编码,去除末尾0 + * 2020-01-07 + */ + private String areaCode; + + /** + * desc: 是否参与上级计算yes:参与;no:不参与 add 01.14 + */ + private String upToCal; } 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 469670b67f..ea60d69e09 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 @@ -1,5 +1,7 @@ package com.epmet.entity.evaluationindex.screen; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.AllArgsConstructor; @@ -26,4 +28,5 @@ public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity { private String eventImgUrl; private Integer sort; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java index 8609b4f1b9..2096860d60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenEventImgDataEntity.java @@ -17,6 +17,8 @@ package com.epmet.entity.evaluationindex.screen; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; 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/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/ScreenProjectGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectGridDailyEntity.java new file mode 100644 index 0000000000..485e9e9d41 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectGridDailyEntity.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_grid_daily") +public class ScreenProjectGridDailyEntity 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; + + /** + * 截止到当前日期,网格内项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前日期,网格内已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 对当前网格内项目,参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 对当前网格内项目,满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 对当前网格内项目,不满意总次数 + */ + private Integer badTotal; + + /** + * 满意率=good_total/evaluate_total + */ + private BigDecimal goodRatio; + + /** + * 不满意率=bad_total/evaluate_total + */ + private BigDecimal badRatio; + +} 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/ScreenProjectOrgDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectOrgDailyEntity.java new file mode 100644 index 0000000000..59dada8436 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectOrgDailyEntity.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.math.BigDecimal; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_org_daily") +public class ScreenProjectOrgDailyEntity 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; + + /** + * 截止到当前日期,网格内项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前日期,网格内已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 对当前组织内项目,参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 对当前组织内项目,满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 对当前组织内项目,不满意总次数 + */ + private Integer badTotal; + + /** + * 满意率=good_total/evaluate_total + */ + private BigDecimal goodRatio; + + /** + * 不满意率=bad_total/evaluate_total + */ + private BigDecimal badRatio; + +} 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/entity/evaluationindex/screen/ScreenProjectQuantityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityGridMonthlyEntity.java new file mode 100644 index 0000000000..03e3183037 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityGridMonthlyEntity.java @@ -0,0 +1,88 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_quantity_grid_monthly") +public class ScreenProjectQuantityGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 当前网格,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前月份:累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 截止到当前月份:累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyEntity.java new file mode 100644 index 0000000000..4d798ad314 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_quantity_org_monthly") +public class ScreenProjectQuantityOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 当前组织内,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前月份:累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 截止到当前月份:累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java index 7381034578..eaf0c0d52a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java @@ -94,4 +94,8 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private String district; + /** + * 当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701 + */ + private String parentAreaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java index 0f46e25ffd..7e3f481d11 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java @@ -60,4 +60,8 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity { */ private Integer totalUser; + /** + * 扩展属性:V2升级必传参数:当前部门所属行政地区编码,来源于部门所属组织的地区编码 + */ + private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenBidInfoEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenBidInfoEntity.java new file mode 100644 index 0000000000..c9d8658f10 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenBidInfoEntity.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.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 146:竞标管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_bid_info") +public class ScreenBidInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 截止日期eg:20200101 + */ + private String dateId; + + /** + * 竞标项目id + */ + private String bidId; + + /** + * 竞标项目名称 + */ + private String bidName; + + /** + * 状态编码 + */ + private String statusCode; + + /** + * 状态描述eg:已中标、未中标、投标中、 + */ + private String statusDesc; + + /** + * 金额单位万元 + */ + private Double amount; + + /** + * 发布时间 + */ + private Date releaseTime; + + /** + * 发布村镇,以英文逗号隔开 + */ + private String townIds; + + /** + * 发布村镇名称,以英文逗号隔开 + */ + private String townNames; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenContractInfoEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenContractInfoEntity.java new file mode 100644 index 0000000000..6d7d69ce3e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenContractInfoEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 146:合同基本信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_contract_info") +public class ScreenContractInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 截止日期eg:20200101 + */ + private String dateId; + + /** + * 合同id + */ + private String contractId; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同所属类别编码 + */ + private String categoryCode; + + /** + * 合同所属类别名称 + */ + private String categoryName; + + /** + * 合同到期日期:2020-12-31 + */ + private Date dueDate; + + /** + * 发布村镇,以英文逗号隔开 + */ + private String townIds; + + /** + * 发布村镇名称,以英文逗号隔开 + */ + private String townNames; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenCustomerWorkRecordDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenCustomerWorkRecordDictEntity.java new file mode 100644 index 0000000000..067a349205 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenCustomerWorkRecordDictEntity.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.entity.plugins; + +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-02-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_work_record_dict") +public class ScreenCustomerWorkRecordDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至日期eg:20200101 + */ + private String dateId; + + /** + * 资源id + */ + private String dictId; + + /** + * 父资源ID;如果是一级分类pid=0 + */ + private String pid; + + /** + * 资源类型 + */ + private String resourceType; + + /** + * 资源编码 + */ + private String resourceCode; + + /** + * 资源标签名 + */ + private String resourceLabel; + + /** + * 显示标识:0否,1是 + */ + private String showFlag; + + /** + * 排序 + */ + private Integer sort; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice;所有的一级分类需要对应到这三个key中 + */ + private String dataType; + + /** + * 当前资源属于几级,例如:1、2、3、4.... + */ + private Integer level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenListInfoEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenListInfoEntity.java new file mode 100644 index 0000000000..08e7c7e7ff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenListInfoEntity.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 146:一张清单列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_list_info") +public class ScreenListInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 截止日期eg:20200101 + */ + private String dateId; + + /** + * 清单id + */ + private String listId; + + /** + * 清单编码 + */ + private String listCode; + + /** + * 名称 + */ + private String listName; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgDailyEntity.java new file mode 100644 index 0000000000..148c742f91 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgDailyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_work_record_org_daily") +public class ScreenWorkRecordOrgDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 日期Id:yyyyMMdd + */ + private String dateId; + + /** + * 组织Idor网格id + */ + private String orgId; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java new file mode 100644 index 0000000000..a7bf893b08 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作日志-组织按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_work_record_org_monthly") +public class ScreenWorkRecordOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月份Id:yyyyMM + */ + private String monthId; + + /** + * 组织Id + */ + private String orgId; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java index a287006414..ef839eca62 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java @@ -43,4 +43,9 @@ public class DimCustomerEntity extends BaseEpmetEntity { */ private String customerName; + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ + private String areaCode; + } 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 new file mode 100644 index 0000000000..25e3272436 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.crm; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.entity.crm.CustomerRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +public interface CustomerRelationService extends BaseService { + + /** + * @return java.util.Map + * @param customerIds + * @author yinzuomei + * @description 查询每个客户的area_code、以及下一级客户列表 + * @Date 2021/1/14 16:22 + **/ + Map getCustomerInfoMap(List customerIds); +} \ 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 new file mode 100644 index 0000000000..440491f8a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.crm.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.crm.CustomerRelationDao; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.dto.stats.DimCustomerDTO; +import com.epmet.entity.crm.CustomerRelationEntity; +import com.epmet.service.crm.CustomerRelationService; +import com.epmet.service.stats.DimCustomerService; +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.stream.Collectors; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +@DataSource(DataSourceConstant.OPER_CRM) +@Service +public class CustomerRelationServiceImpl extends BaseServiceImpl implements CustomerRelationService { + + @Autowired + private DimCustomerService dimCustomerService; + /** + * @param customerIds + * @return java.util.Map + * @author yinzuomei + * @description 查询每个客户的area_code、以及下一级客户列表 + * @Date 2021/1/14 16:22 + **/ + @Override + public Map getCustomerInfoMap(List customerIds) { + List list=new ArrayList<>(); + for(String customerId:customerIds){ + CustomerSubInfoDTO customerSubInfoDTO = baseDao.selectCustomerSubInfo(customerId); + if(null!=customerSubInfoDTO){ + DimCustomerDTO dimCustomerDTO=dimCustomerService.get(customerId); + if(null!=dimCustomerDTO){ + customerSubInfoDTO.setCustomerName(dimCustomerDTO.getCustomerName()); + } + list.add(customerSubInfoDTO); + } + } + if(CollectionUtils.isEmpty(list)){ + return new HashMap<>(); + } + return list.stream().collect(Collectors.toMap(CustomerSubInfoDTO::getCustomerId, customer -> customer)); + } +} \ 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 8b7e1ae06c..3cb5f6e0e7 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 @@ -24,6 +24,7 @@ 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.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -263,4 +264,59 @@ public interface FactOriginProjectMainDailyService extends BaseService getNewProject(String customerId, List list); + + /** + * @Description 查询项目总数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午3:59 + */ + List selectProjectTotal(String customerId,String dateId,String monthId); + + /** + * @Description 查询已解决项目数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午4:15 + */ + List selectResolvedNum(String customerId, String dateId); + + /** + * @Description 查询 满意度评价次数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/29 上午9:10 + */ + List selectEvaluateCount(String customerId, String dateId,List activeCodes); + + /** + * @Description 查询本月新增项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午2:29 + */ + List selectProjectIncr(String customerId, String monthId); + + /** + * @Description 根据状态查询项目数 + * @Param customerId + * @Param monthId + * @Param status + * @author zxc + * @date 2021/1/29 下午3:25 + */ + List selectProjectCount(String customerId, String monthId, String status); + + /** + * @Description 本月新增结案项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/1 上午9:24 + */ + List selectClosedIncr(String customerId, String monthId); } \ 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 bdc82b519d..c5aaa76daa 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 @@ -32,6 +32,7 @@ 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.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -41,6 +42,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; @@ -259,4 +261,101 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getNewProject(String customerId, List list) { return baseDao.selectNewProject(customerId,list); } + + /** + * @Description 查询项目总数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午3:59 + */ + @Override + public List selectProjectTotal(String customerId, String dateId,String monthId) { + if (StringUtils.isNotBlank(customerId)){ + List projectTotalResultDTOS = baseDao.selectProjectTotal(customerId, dateId, monthId); + return projectTotalResultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 查询已解决项目数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午4:15 + */ + @Override + public List selectResolvedNum(String customerId, String dateId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)){ + List resolvedNumResultDTOS = baseDao.selectResolvedNum(customerId, dateId); + return resolvedNumResultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 查询 满意度评价次数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/29 上午9:10 + */ + @Override + public List selectEvaluateCount(String customerId, String dateId, List activeCodes) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId) && !CollectionUtils.isEmpty(activeCodes)){ + List evaluateTotalResultDTOS = baseDao.selectEvaluateCount(customerId, dateId, activeCodes); + return evaluateTotalResultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 查询本月新增项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午2:29 + */ + @Override + public List selectProjectIncr(String customerId, String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)){ + List projectIncrResultDTOS = baseDao.selectProjectIncr(customerId, monthId); + return projectIncrResultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 根据状态查询项目数 + * @Param customerId + * @Param monthId + * @Param status + * @author zxc + * @date 2021/1/29 下午3:25 + */ + @Override + public List selectProjectCount(String customerId, String monthId, String status) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)){ + List resultDTOS = baseDao.selectProjectCount(customerId, monthId, status); + return resultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 本月新增结案项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/1 上午9:24 + */ + @Override + public List selectClosedIncr(String customerId, String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)){ + List result = baseDao.selectClosedIncr(customerId, monthId); + return result; + } + return new ArrayList<>(); + } } \ 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/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index 63b158e72c..35b5bbd577 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 @@ -439,7 +439,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { if(!CollectionUtils.isEmpty(formattingData)) { List projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList()); if (!CollectionUtils.isEmpty(projectIds)) { - factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(projectIds); + factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(null,param.getCustomerId()); factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData); } } 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 d0ab7c49a8..05ab26289b 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 @@ -163,10 +163,11 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr Map contentMap = topicService.getTopicContent(projectSourceMap); difficulties.forEach( diff -> { - if(!CollectionUtils.isEmpty(imgMap)) { - List figureList = imgMap.get(diff.getEventId()); + + List figureList = CollectionUtils.isEmpty(imgMap) ? null : imgMap.get(diff.getEventId()); diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl()); - } + + if(!CollectionUtils.isEmpty(contentMap)) { diff.setEventContent(contentMap.get(diff.getEventId())); } @@ -184,6 +185,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr List imgList = new LinkedList<>(); imgMap.values().forEach(list -> {imgList.addAll(list);}); + difficulties.removeIf( diff -> StringUtils.isBlank(diff.getLatestOperateDesc())); + screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList); log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}",param.getCustomerId(),JSON.toJSONString(difficulties)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java index 09d344dd47..cf1e5f19eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.indexcal; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + /** * @Author zxc * @DateTime 2020/8/26 10:33 上午 @@ -8,10 +10,9 @@ public interface IndexCalculateCommunityService { /** * @Description 计算社区相关总分 - * @param customerId - * @param monthId + * @param formDTO * @author zxc * @date 2020/9/1 4:12 下午 */ - Boolean calCommunityAll(String customerId, String monthId); + Boolean calCommunityAll(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java index 0e8ce09ccf..0ece36742b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.indexcal; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + /** * @Author zxc * @DateTime 2020/9/4 9:03 上午 @@ -8,11 +10,10 @@ public interface IndexCalculateDistrictService { /** * @Description 计算全区相关总分 - * @param customerId - * @param monthId + * @param form * @author zxc * @date 2020/9/2 3:12 下午 */ - Boolean calDistrictAll(String customerId, String monthId); + Boolean calDistrictAll(CalculateCommonFormDTO form); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java index c27b6db508..2e44de4a4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.indexcal; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + /** * @Author zxc * @DateTime 2020/9/2 3:11 下午 @@ -8,11 +10,10 @@ public interface IndexCalculateStreetService { /** * @Description 计算街道相关总分 - * @param customerId - * @param monthId + * @param form * @author zxc * @date 2020/9/2 3:12 下午 */ - Boolean calStreetAll(String customerId, String monthId); + Boolean calStreetAll(CalculateCommonFormDTO form); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index b2e0158aa4..d52c6891c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -201,7 +201,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { private void calculatePartScore(CalculateCommonFormDTO formDTO) { //计算最大最小值 - Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId(), formDTO.getMonthId()); + Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.warn("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); return; @@ -219,7 +219,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { List> list = null; groupIndexDetailsMap.keySet().forEach(indexCode -> deleteOldData(formDTO, indexCode)); do { - list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(),(pageNo - 1) * pageSize, pageSize, + formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); if (!CollectionUtils.isEmpty(list)) { //遍历指标分组 计算分数 for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { @@ -232,6 +233,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } while (!CollectionUtils.isEmpty(list) && list.size() == pageSize); } + /** + * @return void + * @param formDTO + * @param indexCode 当前计算指标编码 + * @description 根据客户id、月id、indexCode、allParentCode删除旧数据 + * @Date 2021/1/15 9:52 + **/ @Transactional(rollbackFor = Exception.class) public void deleteOldData(CalculateCommonFormDTO formDTO, String indexCode) { int effectRow; @@ -275,6 +283,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); cpcScoreEntity.setYearId(String.valueOf(cpcCount.get(IndexCalConstant.YEAR_ID))); + //一定要赋值当前正在计算的客户id cpcScoreEntity.setCustomerId(formDTO.getCustomerId()); cpcScoreEntity.setAgencyId(String.valueOf(cpcCount.get(IndexCalConstant.AGENCY_ID))); cpcScoreEntity.setGridId(String.valueOf(cpcCount.get(IndexCalConstant.GRID_ID))); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 00ebad6b5d..dd4219e170 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -228,7 +228,9 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> list = null; do { - list = factIndexGovrnAblityDeptMonthlyDao.selectListByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + list = factIndexGovrnAblityDeptMonthlyDao.selectListByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize, + formDTO.getCustomerAreaCode(), + formDTO.getSubCustomerIds()); if (!CollectionUtils.isEmpty(list)) { //遍历指标分组 计算分数 List> crrentFactRecordList = list; @@ -378,7 +380,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.warn("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; @@ -218,7 +218,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { formDTO.getMonthId(), pageIndex, pageNo, - IndexCalConstant.PAGE_SIZE)); + IndexCalConstant.PAGE_SIZE, + formDTO.getCustomerAreaCode(), + formDTO.getSubCustomerIds())); //遍历每一个网格的记录 recordList.forEach(recordMap -> { //遍历所有的指标 @@ -430,11 +432,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { for (HashMap resultMap : resultMapList) { resultMap.forEach((gridId, calculateResult) -> { GridScoreEntity gridScoreEntity = new GridScoreEntity(); + //一定要赋值当前正在计算的客户id gridScoreEntity.setCustomerId(formDTO.getCustomerId()); gridScoreEntity.setGridId(gridId); gridScoreEntity.setIsTotal(isTotal); gridScoreEntity.setIndexCode(indexCode); - ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId); + ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(gridId); if (null != screenCustomerGridDTO) { if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){ gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); @@ -610,7 +613,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX - Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.warn("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; @@ -626,7 +629,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { formDTO.getMonthId(), pageIndex, pageNo, - IndexCalConstant.PAGE_SIZE)); + IndexCalConstant.PAGE_SIZE, + formDTO.getCustomerAreaCode(), + formDTO.getSubCustomerIds())); //遍历每一个网格的记录 recordList.forEach(recordMap -> { //遍历所有的指标 @@ -683,7 +688,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX - Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.warn("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; @@ -699,7 +704,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { formDTO.getMonthId(), pageIndex, pageNo, - IndexCalConstant.PAGE_SIZE)); + IndexCalConstant.PAGE_SIZE, + formDTO.getCustomerAreaCode(), + formDTO.getSubCustomerIds())); //遍历每一个网格的记录 recordList.forEach(recordMap -> { //遍历所有的指标 @@ -838,15 +845,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { 党员参加“三会一课”人次*/ /** - * @param customerId - * @param monthId + * @param formDTO * @return java.util.Map * @author yinzuomei * @description 查询党建能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:47 **/ - public Map queryPartyAblityGridMinAndMax(String customerId, String monthId) { - return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId, monthId); + public Map queryPartyAblityGridMinAndMax(CalculateCommonFormDTO formDTO) { + return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(formDTO); } @@ -863,15 +869,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** - * @param customerId - * @param monthId * @return java.util.Map * @author yinzuomei * @description 查询治理能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:48 **/ - public Map queryGovrnAblityGridMinAndMax(String customerId, String monthId) { - return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(customerId, monthId); + public Map queryGovrnAblityGridMinAndMax(CalculateCommonFormDTO formDTO) { + return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(formDTO); } /** @@ -886,15 +890,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } /** - * @param customerId - * @param monthId + * @param formDTO * @return java.util.Map * @author yinzuomei * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:50 **/ - public Map queryServiceAblityGridMinAndMax(String customerId, String monthId) { - return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(customerId, monthId); + public Map queryServiceAblityGridMinAndMax(CalculateCommonFormDTO formDTO) { + return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(formDTO); } 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 fa0fc396b3..8c03bf53f5 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 @@ -81,29 +81,52 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni private CommunitySelfSubScoreDao communitySelfSubScoreDao; /** - * @param customerId - * @param monthId + * @param form * @Description 计算社区相关总分 * @author zxc * @date 2020/9/1 4:12 下午 */ @Override - public Boolean calCommunityAll(String customerId, String monthId) { - Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 - if (!aBoolean.equals(true)) { - throw new RenException("calculate community-party-ability failure ......"); - } - Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 - if (!bBoolean.equals(true)) { - throw new RenException("calculate community-govern-ability failure ......"); - } - Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 - if (!cBoolean.equals(true)) { - throw new RenException("calculate community-service-ability failure ......"); - } - Boolean dBoolean = communityRelate(customerId, monthId); - if (!dBoolean.equals(true)) { - throw new RenException("calculate community-all insert failure ......"); + public Boolean calCommunityAll(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + if (StringUtils.isEmpty(form.getCustomerAreaCode())) { + Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate community-party-ability failure ......"); + } + Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate community-govern-ability failure ......"); + } + Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate community-service-ability failure ......"); + } + Boolean dBoolean = communityRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate community-all insert failure ......"); + } + }else { + // 党建能力 + Boolean aBoolean = communityPartyCalculateExistsSub(form); + if (!aBoolean.equals(true)) { + throw new RenException("calculate community-party-ability-exists-sub failure ......"); + } + // 治理能力 + Boolean bBoolean = communityGovernAbilityCalculateExistsSub(form); + if (!bBoolean.equals(true)) { + throw new RenException("calculate community-govern-ability-exists-sub failure ......"); + } + // 服务能力 + Boolean cBoolean = communityServiceAbilityCalculateExistsSub(form); + if (!cBoolean.equals(true)) { + throw new RenException("calculate community-service-ability-exists-sub failure ......"); + } + Boolean dBoolean = communityRelateExistsSub(form); + if (!dBoolean.equals(true)) { + throw new RenException("calculate community-all-exists-sub insert failure ......"); + } } //计算自身和下级 CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); @@ -565,4 +588,269 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni result.setFiveLevel(resultFive); return result; } + + /** + * @Description 社区名义发文数量计算【党建能力】存在下级客户 + * @Param form + * @author zxc + * @date 2021/1/15 上午9:18 + */ + public Boolean communityPartyCalculateExistsSub(CalculateCommonFormDTO form) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //下属所有网格的党建能力平均值 + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { + List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { + log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL); + } else { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); + subPartyAvgList.forEach(party -> { + List index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 社区名义发文数量 + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapbyAreaCode( form.getMonthId(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(publishArticleCountList)) { + log.warn(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityPartyCalculateExistsSub getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityPartyCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteOldRecord(form.getCustomerId(),form.getMonthId()); + deleteAndInsert(result); + return true; + } + + /** + * @Description 社区治理能力 存在下级客户 + * @Param form + * @author zxc + * @date 2021/1/15 上午10:56 + */ + public Boolean communityGovernAbilityCalculateExistsSub(CalculateCommonFormDTO form) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + // 社区下属所有网格治理能力汇总(平均值) + if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.warn("社区下级治理能力平均分集合为空"); + }else{ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSub(form.getMonthId(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(communityGovernAbility)){ + log.warn(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); + }else{ + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); + governAbilityList.forEach(governAbility -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); + return true; + } + + + /** + * @Description 社区服务能力 存在下级客户 + * @Param form + * @author zxc + * @date 2021/1/15 下午1:42 + */ + public Boolean communityServiceAbilityCalculateExistsSub(CalculateCommonFormDTO form) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { + List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subGridServiceAvg)) { + log.warn("查询社区下级所有网格服务能力得分平均值集合为空"); + } else { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(form.getMonthId(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(communityActivityCountList)) { + log.warn(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); + }else{ + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); + communityActivityList.forEach(communityActivity -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + communityActivity.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); + return true; + } + + /** + * @Description 社区相关计算 存在下级客户 + * @Param form + * @author zxc + * @date 2021/1/15 下午1:47 + */ + public Boolean communityRelateExistsSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfoExistsSub(form.getCustomerAreaCode(),form.getMonthId()); + detailListByParentCode.forEach(detail -> { + factIndexCommunityScoreEntities.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = factIndexCommunityScoreEntities.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + value.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); + }); + result.add(score); + }); + if (!CollectionUtils.isEmpty(result)){ + factIndexCommunityScoreDao.insertCommunityPartyRecord(result); + } + return true; + } + + } 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 5b18396a66..592c114fd4 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 @@ -79,29 +79,52 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private AgencySelfSubScoreDao agencySelfSubScoreDao; /** - * @param customerId - * @param monthId + * @param form * @Description 计算全区相关总分 * @author zxc * @date 2020/9/2 3:12 下午 */ @Override - public Boolean calDistrictAll(String customerId, String monthId) { - Boolean aBoolean = districtPartyCalculate(customerId, monthId);//党建能力 - if (!aBoolean.equals(true)) { - throw new RenException("calculate district-party-ability failure ......"); - } - Boolean bBoolean = districtGovernAbilityCalculate(customerId, monthId);// 治理能力 - if (!bBoolean.equals(true)) { - throw new RenException("calculate district-govern-ability failure ......"); - } - Boolean cBoolean = districtServiceAbilityCalculate(customerId, monthId);// 服务能力 - if (!cBoolean.equals(true)) { - throw new RenException("calculate district-service-ability failure ......"); - } - Boolean dBoolean = districtRelate(customerId, monthId); - if (!dBoolean.equals(true)) { - throw new RenException("calculate district-all insert failure ......"); + public Boolean calDistrictAll(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + if (StringUtils.isEmpty(form.getCustomerAreaCode())) { + Boolean aBoolean = districtPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate district-party-ability failure ......"); + } + Boolean bBoolean = districtGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate district-govern-ability failure ......"); + } + Boolean cBoolean = districtServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate district-service-ability failure ......"); + } + Boolean dBoolean = districtRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate district-all insert failure ......"); + } + }else { + //党建能力 + Boolean aBoolean = districtPartyCalculateExistSub(form); + if (!aBoolean.equals(true)) { + throw new RenException("calculate district-party-ability-exists-sub failure ......"); + } + // 治理能力 + Boolean bBoolean = districtGovernAbilityCalculateExistSub(form); + if (!bBoolean.equals(true)) { + throw new RenException("calculate district-govern-ability-exists-sub failure ......"); + } + // 服务能力 + Boolean cBoolean = districtServiceAbilityCalculateExistSub(form); + if (!cBoolean.equals(true)) { + throw new RenException("calculate district-service-ability-exists-sub failure ......"); + } + Boolean dBoolean = districtRelateExistSub(form); + if (!dBoolean.equals(true)) { + throw new RenException("calculate district-all-exists-sub insert failure ......"); + } } //计算自身和下级 CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); @@ -562,4 +585,269 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return result; } + + /** + * @param form + * @Description 全区名义发文数量计算【党建能力】 存在下级客户 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean districtPartyCalculateExistSub(CalculateCommonFormDTO form) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexDetailList)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //党建能力平均值 + indexDetailList.forEach(detail -> { + if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { + log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); + } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); + subPartyAvgList.forEach(party -> { + List index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + 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); + indexInputVOS.add(index1VO); + }); + } + } else { + // 区名义发文数量 + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSub(monthId,form.getCustomerAreaCode(),NumConstant.SIX); + if (CollectionUtils.isEmpty(publishArticleCountList)) { + log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtPartyAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtPartyAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL); + insertDetail(result); + return true; + } + + /** + * @param form + * @Description 全区治理能力 存在下级客户 + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean districtGovernAbilityCalculateExistSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + for (int i = 0; i < districtGovernAvgList.size(); i++) { + if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + districtGovernAvgList.remove(districtGovernAvgList.get(i)); + } + } + if (CollectionUtils.isEmpty(districtGovernAvgList)) { + log.warn("查询所有街道治理能力平均值集合为空"); + } else{ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + 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); + indexInputVOS.add(index1VO); + }); + } + } 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()); + for (int i = 0; i < deptScoreAvgList.size(); i++) { + if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + deptScoreAvgList.remove(deptScoreAvgList.get(i)); + } + } + if (CollectionUtils.isEmpty(deptScoreAvgList)) { + log.warn("查询所有直属部门治理能力平均值集合为空"); + } else{ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + }else{ + // TODO 治理能力暂无自身级别 + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtGovernAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + insertDetail(result); + return true; + } + + /** + * @param form + * @Description 全区服务能力 存在下级客户 + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean districtServiceAbilityCalculateExistSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + for (int i = 0; i < subStreetAvgList.size(); i++) { + if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + subStreetAvgList.remove(subStreetAvgList.get(i)); + } + } + if (CollectionUtils.isEmpty(subStreetAvgList)) { + log.warn("查询区下属街道服务能力汇总平均值集合为空"); + } else{ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + 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); + }); + } + } else { + // todo 暂时没有自身级别 + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + if (!CollectionUtils.isEmpty(indexInputVOS)) { + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtServiceAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + insertDetail(result); + } + return true; + } + + /** + * @param form + * @Description 区相关计算 存在下级客户 + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + public Boolean districtRelateExistSub(CalculateCommonFormDTO form) { + 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); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + value.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); + }); + result.add(score); + }); + if (!CollectionUtils.isEmpty(result)){ + agencyScoreDao.insertStreetRecord(result); + } + return true; + } + + } 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 753dc70726..db48bb1214 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 @@ -8,8 +8,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.redis.IndexCalRedis; +import com.epmet.service.crm.CustomerRelationService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.util.DimIdGenerator; @@ -21,6 +23,7 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; /** * @author liujianjun @@ -50,7 +53,8 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private FactIndexCollectService factIndexCollectService; @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; - + @Autowired + private CustomerRelationService customerRelationService; @Override public Boolean indexCalculate(CalculateCommonFormDTO formDTO) { @@ -71,15 +75,26 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } else { customerIds.add(formDTO.getCustomerId()); } + + //查询客户编码、以及下一级客户列表 add01.14 + Map customerInfoMap=this.getCustomerInfoMap(customerIds); + Boolean flag = false; for (String customerId : customerIds) { CalculateCommonFormDTO param = new CalculateCommonFormDTO(); param.setCustomerId(customerId); param.setMonthId(formDTO.getMonthId()); + //01.14 add + if (!customerInfoMap.isEmpty() && null != customerInfoMap.get(customerId)) { + param.setCustomerAreaCode(customerInfoMap.get(customerId).getCustomerAreaCode()); + param.setSubCustomerIds(customerInfoMap.get(customerId).getSubCustomerIds()); + } flag = calulateCustomerIndexScore(param); } return flag; } catch (Exception e) { + e.printStackTrace(); + log.warn("indexCalculate exception:{}",e); log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); } finally { //清除缓存 @@ -122,7 +137,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { //计算社区 start = System.currentTimeMillis(); try { - flag = indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); + flag = indexCalculateCommunityService.calCommunityAll(formDTO); log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calCommunityAll exception", e); @@ -131,7 +146,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { //计算街道 start = System.currentTimeMillis(); try { - flag = indexCalculateStreetService.calStreetAll(customerId, formDTO.getMonthId()); + flag = indexCalculateStreetService.calStreetAll(formDTO); log.info("客户Id:{}【街道相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calStreetAll exception", e); @@ -149,7 +164,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { //计算全区 start = System.currentTimeMillis(); try { - flag = indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); + flag = indexCalculateDistrictService.calDistrictAll(formDTO); log.info("客户Id:{}【全区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calDistrictAll exception", e); @@ -163,7 +178,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { if (insertFlag || currentMonthId.equals(formDTO.getMonthId())) { start = System.currentTimeMillis(); try { - factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId()); + factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO); log.info("客户Id:{}分数插入到大屏显示库完毕,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000); } catch (Exception e) { log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e); @@ -178,4 +193,14 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } return false; } + + /** + * @param customerIds + * @author yinzuomei + * @description 查询当前客户的area_code信息、以及下一级客户列表 + * @Date 2021/1/21 11:28 + **/ + private Map getCustomerInfoMap(List customerIds) { + return customerRelationService.getCustomerInfoMap(customerIds); + } } 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 4669ae0cda..c2d488ea41 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 @@ -82,29 +82,52 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ private AgencySelfSubScoreDao agencySelfSubScoreDao; /** - * @param customerId - * @param monthId + * @param form * @Description 计算街道相关总分 * @author zxc * @date 2020/9/2 3:12 下午 */ @Override - public Boolean calStreetAll(String customerId, String monthId) { - Boolean aBoolean = streetPartyCalculate(customerId, monthId);//党建能力 - if (!aBoolean.equals(true)) { - throw new RenException("calculate street-party-ability failure ......"); - } - Boolean bBoolean = streetGovernAbilityCalculate(customerId, monthId);// 治理能力 - if (!bBoolean.equals(true)) { - throw new RenException("calculate street-govern-ability failure ......"); - } - Boolean cBoolean = streetServiceAbilityCalculate(customerId, monthId);// 服务能力 - if (!cBoolean.equals(true)) { - throw new RenException("calculate street-service-ability failure ......"); - } - Boolean dBoolean = streetRelate(customerId, monthId); - if (!dBoolean.equals(true)) { - throw new RenException("calculate street-all insert failure ......"); + public Boolean calStreetAll(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + if (StringUtils.isEmpty(form.getCustomerAreaCode())) { + Boolean aBoolean = streetPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate street-party-ability failure ......"); + } + Boolean bBoolean = streetGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate street-govern-ability failure ......"); + } + Boolean cBoolean = streetServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate street-service-ability failure ......"); + } + Boolean dBoolean = streetRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate street-all insert failure ......"); + } + }else { + //党建能力 + Boolean aBoolean = streetPartyCalculateExistsSub(form); + if (!aBoolean.equals(true)) { + throw new RenException("calculate street-party-ability-exists-sub failure ......"); + } + // 治理能力 + Boolean bBoolean = streetGovernAbilityCalculateExistsSub(form); + if (!bBoolean.equals(true)) { + throw new RenException("calculate street-govern-ability-exists-sub failure ......"); + } + // 服务能力 + Boolean cBoolean = streetServiceAbilityCalculateExistsSub(form); + if (!cBoolean.equals(true)) { + throw new RenException("calculate street-service-ability-exists-sub failure ......"); + } + Boolean dBoolean = streetRelateExistsSub(form); + if (!dBoolean.equals(true)) { + throw new RenException("calculate street-all-exists-sub insert failure ......"); + } } //计算自身和下级 CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); @@ -568,4 +591,273 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ result.setFiveLevel(resultFive); return result; } + + /** + * @param form + * @Description 社区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean streetPartyCalculateExistsSub(CalculateCommonFormDTO form) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //下属所有社区的党建能力平均值 + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreExistSub(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) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexEnd = NumConstant.TEN; + List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); + partition.forEach(publish -> { + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 街道名义发文数量 + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSub(monthId,form.getCustomerAreaCode(),NumConstant.NINE); + if (CollectionUtils.isEmpty(mapList)) { + log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldName)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); + List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetPartyAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetPartyAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + deleteOldRecord(customerId, monthId, IndexCalConstant.STREET_LEVEL); + insertDetail(result); + return true; + } + + /** + * @Description 街道治理能力 + * @param form + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean streetGovernAbilityCalculateExistsSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { + List subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreExistSub(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.warn("查询街道下属所有社区治理能力汇总为空"); + }else if (subGridGovernAvg.size() > NumConstant.ZERO) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSub(monthId,form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(communityGovernAbility)){ + log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); + }else{ + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); + governAbilityList.forEach(governAbility -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetGovernAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + insertDetail(result); + return true; + } + + /** + * @Description 街道服务能力 + * @param form + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean streetServiceAbilityCalculateExistsSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { + List subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreExistSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subCommServiceAvg)) { + log.warn("查询街道下属社区服务能力得分平均值为空"); + } else if (subCommServiceAvg.size() > NumConstant.ZERO) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(monthId,form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(communityActivityCountList)) { + log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); + }else{ + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); + communityActivityList.forEach(communityActivity -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + communityActivity.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetServiceAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + insertDetail(result); + return true; + } + + /** + * @Description 街道相关计算 + * @param form + * @author zxc + * @date 2020/9/3 9:21 上午 + */ + public Boolean streetRelateExistsSub(CalculateCommonFormDTO form) { + 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.NINE, monthId, IndexCalConstant.STREET_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + score.setDataType(IndexCalConstant.STREET_LEVEL); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + value.forEach(street -> { + score.setScore(score.getScore().add(street.getScore())); + score.setParentAgencyId(street.getParentAgencyId()); + }); + result.add(score); + }); + if (!CollectionUtils.isEmpty(result)){ + agencyScoreDao.insertStreetRecord(result); + } + return true; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java index 98d0fc95af..158ced77de 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java @@ -1,9 +1,8 @@ package com.epmet.service.evaluationindex.indexcoll; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcollect.form.*; -import java.util.List; - /** * 大屏数据采集api * @@ -110,11 +109,9 @@ public interface FactIndexCollectService { /** * 将网格、社区、区直部门、区/街道分支记录表中的数据,抽取到 指数-指数数据(每月数值) 指数-指数数据(按年统计) - * @param monthId 2020-8 - * @param customerId * @return void * @Author zhangyong * @Date 10:29 2020-09-03 **/ - void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId); + void insertScreenIndexDataMonthlyAndYearly(CalculateCommonFormDTO calculateCommonFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 2ea0aa08d0..a117021b91 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -18,6 +18,7 @@ import com.epmet.dao.evaluationindex.indexcoll.*; import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.DeptScoreDTO; import com.epmet.dto.indexcollect.form.*; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; @@ -44,7 +45,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -225,9 +225,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @date 2020/10/20 2:59 下午 */ @Override - public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { - if (NumConstant.SIX != monthId.length()) { - throw new RuntimeException("入参monthId格式不正确:monthId =" + monthId); + public void insertScreenIndexDataMonthlyAndYearly(CalculateCommonFormDTO formDTO) { + if (NumConstant.SIX != formDTO.getMonthId().length()) { + throw new RuntimeException("入参monthId格式不正确:monthId =" + formDTO.getMonthId()); } RLock lock = distributedLock.getLock(LockConstants.STATS_LOCK_NAME); try { @@ -236,26 +236,27 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } allParentIds.cleanUp(); // 根据网格类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.GRID); + this.batchDelIndexDataMonthly(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.GRID); // 开始处理 网格相关分值表 - this.startHandleIndexGridScore(monthId, customerId); + this.startHandleIndexGridScore(formDTO); // 根据组织类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.AGENCY); + this.batchDelIndexDataMonthly(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.AGENCY); // 开始处理 社区相关分值表 - this.startHandleIndexCommunityScore(monthId, customerId); + this.startHandleIndexCommunityScore(formDTO); // 根据部门类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.DEPARTMENT); + this.batchDelIndexDataMonthly(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DEPARTMENT); // 开始处理 区直部门分值表 - this.startHandleIndexDeptScore(monthId, customerId); + this.startHandleIndexDeptScore(formDTO); // 同样是 组织类型,所以不再重复删除了 // 开始处理 区/街道相关分数表 - this.startHandleIndexAgencyScore(monthId, customerId); + //todo + this.startHandleIndexAgencyScore(formDTO); // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly - this.insertIndexDataYear(monthId, customerId); + this.insertIndexDataYear(formDTO.getMonthId(), formDTO.getCustomerId()); allParentIds.invalidateAll(); } finally { distributedLock.unLock(lock); @@ -266,13 +267,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,插入 指数-指数数据(月表) * - * @param monthId - * @param customerId * @return void * @Author zhangyong * @Date 13:44 2020-09-04 **/ - private void startHandleIndexGridScore(String monthId, String customerId){ + private void startHandleIndexGridScore(CalculateCommonFormDTO formDTO){ + String customerId=formDTO.getCustomerId(); + String monthId=formDTO.getMonthId(); List mismatchGridList = new ArrayList<>(); // 查询网格相关分值记录 表已经存在的网格id List indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); @@ -283,9 +284,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { gridIds[i] = indexGridIds.get(i); } // 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 - mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); + mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } else { - mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); + mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } if (!CollectionUtils.isEmpty(mismatchGridList)){ @@ -295,7 +296,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // fact_index_grid_score 网格相关分值记录表 grid List gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); // 开始处理实际分数 - this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS); + this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } /** @@ -340,12 +341,12 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS) { + private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS,String customerAreaCode,List subCustomerIds) { List monthlyFormDTOList = new ArrayList<>(); // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); // 查询网格的 上级组织id 和 组织名称 - List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); + List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId,customerAreaCode,subCustomerIds); if (!CollectionUtils.isEmpty(parentGridList)) { parentGridList.forEach(o -> { allParentIds.put(o.getGridId(), o.getAllParentIds()); @@ -399,13 +400,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * 目标:将社区的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入 指数-指数数据(月表) * - * @param monthId - * @param customerId * @return void * @Author zhangyong * @Date 13:44 2020-09-04 **/ - private void startHandleIndexCommunityScore(String monthId, String customerId){ + private void startHandleIndexCommunityScore(CalculateCommonFormDTO formDTO){ + String customerId=formDTO.getCustomerId(); + String monthId=formDTO.getMonthId(); List mismatchAgencyList = new ArrayList<>(); // 查询社区相关分值记录id List indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); @@ -416,9 +417,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { communityIds[i] = indexCommunityIds.get(i); } // 进行不匹配查询(即返回社区相关分值表 中不存在的【社区级】 组织信息)。 - mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, communityIds); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, communityIds,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } else { - mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, null); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, null,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } if (!CollectionUtils.isEmpty(mismatchAgencyList)){ @@ -429,7 +430,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 查询社区相关分值记录 List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); // 开始处理实际分数 - this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS); + this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } /** @@ -474,12 +475,14 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS) { + private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS, + String customerAreaCode, + List subCustomerIds) { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); // 根据客户id,查询区/街道 组织名称、id - List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId,customerAreaCode,subCustomerIds); if (!CollectionUtils.isEmpty(parentAgencyList)) { parentAgencyList.forEach(o -> { allParentIds.put(o.getAgencyId(), o.getPids()); @@ -534,13 +537,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * 目标:将区直部门的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 指数-指数数据(月表) * - * @param monthId - * @param customerId * @return void * @Author zhangyong * @Date 13:44 2020-09-04 **/ - private void startHandleIndexDeptScore(String monthId, String customerId){ + private void startHandleIndexDeptScore(CalculateCommonFormDTO formDTO){ + String customerId=formDTO.getCustomerId(); + String monthId=formDTO.getMonthId(); List mismatchDeptList = new ArrayList<>(); // 查询社 区直部门分值表 List indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); @@ -549,9 +552,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { for (int i = NumConstant.ZERO; i < indexDeptIds.size(); i++){ depeIds[i] = indexDeptIds.get(i); } - mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); + mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } else { - mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); + mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } if (!CollectionUtils.isEmpty(mismatchDeptList)) { @@ -568,7 +571,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 查询社 区直部门分值表 List deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); // 开始处理实际分数 - this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS); + this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } /** @@ -613,11 +616,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByDeptScore(String monthId, String customerId, List deptScoreDTOS){ + private void insertIndexDataMonthlyByDeptScore(String monthId, String customerId, List deptScoreDTOS, + String customerAreaCode, + List subCustomerIds){ List monthlyFormDTOList = new ArrayList<>(); // 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据 Map> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); - List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId); + List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId,customerAreaCode,subCustomerIds); for(Map.Entry> deptScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); // 给4个指数 赋默认值 @@ -666,13 +671,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * 目标:将 区/街道的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) * 如果 区/街道相关分数表 中的组织数量不全,需要从 组织机构信息 中,先查询到缺少的组织信息,赋上默认值后,在插入 区/街道相关分数表。 一对四 * - * @param monthId - * @param customerId * @return void * @Author zhangyong * @Date 13:44 2020-09-04 **/ - private void startHandleIndexAgencyScore(String monthId, String customerId){ + private void startHandleIndexAgencyScore(CalculateCommonFormDTO formDTO){ + String customerId=formDTO.getCustomerId(); + String monthId=formDTO.getMonthId(); List mismatchAgencyList = new ArrayList<>(); List indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId); if (indexAgencyIds.size() > NumConstant.ZERO){ @@ -680,9 +685,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){ agencyIds[i] = indexAgencyIds.get(i); } - mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, agencyIds); + //todo 平阴县areaCode重复 + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, agencyIds,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } else { - mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, null); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, null,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } if (!CollectionUtils.isEmpty(mismatchAgencyList)){ @@ -691,7 +697,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // fact_index_agency_score 区/街道相关分数表 agency List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); // 开始处理实际分数 - this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS); + this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } /** @@ -704,11 +710,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS) { + private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS, + String customerAreaCode, + List subCustomerIds) { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); - List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId,customerAreaCode,subCustomerIds); int j = 0; if (!CollectionUtils.isEmpty(parentAgencyList)) { parentAgencyList.forEach(o -> { 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/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/ScreenProjectGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java new file mode 100644 index 0000000000..2b710cefb3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.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.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectGridDailyDTO + * @author generator + * @date 2021-01-27 + */ + ScreenProjectGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void save(ScreenProjectGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void update(ScreenProjectGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-27 + */ + void delete(String[] ids); + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(String customerId, ScreenCollFormDTO data); + + /** + * @Description 数据抽取【网格-日】 + * @Param + * @author zxc + * @date 2021/1/28 下午3:05 + */ + void extractionProjectGridDaily(String customerId,String dateId); +} \ No newline at end of file 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/ScreenProjectOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java new file mode 100644 index 0000000000..587a6eef72 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.ScreenProjectOrgDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectOrgDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectOrgDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectOrgDailyDTO + * @author generator + * @date 2021-01-27 + */ + ScreenProjectOrgDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void save(ScreenProjectOrgDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void update(ScreenProjectOrgDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-27 + */ + void delete(String[] ids); + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(String customerId, ScreenCollFormDTO data); + + /** + * @Description 数据抽取【机关-日】 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/2/1 下午1:32 + */ + void extractionProjectOrgDaily(String customerId, String dateId); +} \ No newline at end of file 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/ScreenProjectQuantityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java new file mode 100644 index 0000000000..6d5e5b909d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.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.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectQuantityGridMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityGridMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectQuantityGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectQuantityGridMonthlyDTO + * @author generator + * @date 2021-01-27 + */ + ScreenProjectQuantityGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void save(ScreenProjectQuantityGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void update(ScreenProjectQuantityGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-27 + */ + void delete(String[] ids); + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(String customerId, ScreenCollFormDTO data); + + /** + * @Description 数据抽取 【网格-月】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午1:57 + */ + void extractionProjectGridMonthly(String customerId,String monthId); +} \ No newline at end of file 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 new file mode 100644 index 0000000000..88c451bcfc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.ScreenProjectQuantityOrgMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectQuantityOrgMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectQuantityOrgMonthlyDTO + * @author generator + * @date 2021-01-27 + */ + ScreenProjectQuantityOrgMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void save(ScreenProjectQuantityOrgMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void update(ScreenProjectQuantityOrgMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-27 + */ + void delete(String[] ids); + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(String customerId, ScreenCollFormDTO data); + + /** + * @Description 数据抽取【组织-月】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/2 上午10:43 + */ + void extractionProjectOrgMonthly(String customerId,String monthId); +} \ 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/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index 2cc97d3256..f89e48740e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -139,6 +139,7 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ exists.setIsDisplay(NumConstant.ONE_STR); } exists.setAllParentNames(e.getAllParentName()); + exists.setParentAreaCode(e.getParentAreaCode()); updateAgency(exists); } } @@ -240,6 +241,7 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ cae.setPid(e.getPid()); cae.setPids(e.getPids()); cae.setSourceType(OrgSourceTypeConstant.INTERNAL); + cae.setParentAreaCode(e.getParentAreaCode()); screenCustomerAgencyDao.insert(cae); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java index 95e7f066c0..2e12d83d45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java @@ -75,6 +75,7 @@ public class ScreenCustomerDeptServiceImpl extends BaseServiceImpl + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

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

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.PingYinConstants; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectGridDailyDao; +import com.epmet.dto.pingyin.result.EvaluateTotalResultDTO; +import com.epmet.dto.pingyin.result.ProjectTotalResultDTO; +import com.epmet.dto.pingyin.result.ResolvedNumResultDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectGridDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectGridDailyServiceImpl extends BaseServiceImpl implements ScreenProjectGridDailyService { + + @Autowired + private ScreenCustomerGridDao gridDao; + + @Autowired + private FactOriginProjectMainDailyService projectMainDailyService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectGridDailyDTO.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 ScreenProjectGridDailyDTO get(String id) { + ScreenProjectGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectGridDailyDTO dto) { + ScreenProjectGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectGridDailyDTO dto) { + ScreenProjectGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,"APP_USER",data.getDateId()); + }); + } + + /** + * @Description 数据抽取【网格-日】 + * @Param + * @author zxc + * @date 2021/1/28 下午3:05 + */ + @Override + public void extractionProjectGridDaily(String customerId, String dateId) { + // 查询客户下所有网格 + List gridInfos = gridDao.selectGridInfoByCustomerId(customerId); + if (CollectionUtils.isEmpty(gridInfos)){ + throw new RenException(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + } + // 查询 项目总数 + List projectTotal = projectMainDailyService.selectProjectTotal(customerId, dateId, null); + // 查询 项目解决数 + List resolvedNum = projectMainDailyService.selectResolvedNum(customerId, dateId); + //查询 参与满意度评价的总次数 + String[] activeCodesAll = {PingYinConstants.EVALUATE_BAD,PingYinConstants.EVALUATE_GOOD,PingYinConstants.EVALUATE_PERFECT}; + List evaluateTotal = projectMainDailyService.selectEvaluateCount(customerId, dateId, getActiveCode(activeCodesAll)); + //查询 满意+非常满意的总次数 + String[] activeCodesGood = {PingYinConstants.EVALUATE_GOOD,PingYinConstants.EVALUATE_PERFECT}; + List evaluateGood = projectMainDailyService.selectEvaluateCount(customerId, dateId, getActiveCode(activeCodesGood)); + + gridInfos.forEach(g -> { + g.setDateId(dateId); + // 项目总数赋值 + if (!CollectionUtils.isEmpty(projectTotal)){ + projectTotal.forEach(pt -> { + if (g.getGridId().equals(pt.getGridId())){ + g.setProjectTotal(pt.getProjectTotal()); + } + }); + } + // 项目解决数赋值 + if (!CollectionUtils.isEmpty(resolvedNum)){ + resolvedNum.forEach(rn -> { + if (g.getGridId().equals(rn.getGridId())){ + g.setResolvedNum(rn.getResolvedNum()); + } + }); + } + // 解决率 + g.setResolvedRatio(getRatio(g.getResolvedNum(),g.getProjectTotal())); + // 参与满意度评价的总次数 赋值 + if (!CollectionUtils.isEmpty(evaluateTotal)){ + evaluateTotal.forEach(et -> { + if (g.getGridId().equals(et.getOrgId())){ + g.setEvaluateTotal(et.getEvaluateCount()); + } + }); + } + // 满意+非常满意的总次数 赋值 + if (!CollectionUtils.isEmpty(evaluateGood)){ + evaluateGood.forEach(eg -> { + if (g.getGridId().equals(eg.getOrgId())){ + g.setGoodTotal(eg.getEvaluateCount()); + } + }); + } + // 不满意总次数 + g.setBadTotal(g.getEvaluateTotal()==NumConstant.ZERO ? NumConstant.ZERO : g.getEvaluateTotal() - g.getGoodTotal()); + // 满意率 + g.setGoodRatio(getRatio(g.getGoodTotal(),g.getEvaluateTotal())); + // 不满意率 + g.setBadRatio(getRatio(g.getBadTotal(),g.getEvaluateTotal())); + }); + log.info(gridInfos.toString()); + delScreenProjectGridDaily(customerId, dateId); + insertScreenProjectGridDaily(gridInfos); + } + + /** + * @Description activeCode处理 + * @Param actCode + * @author zxc + * @date 2021/1/29 上午9:33 + */ + public List getActiveCode(String[] actCode){ + List activeCodes = Arrays.asList(actCode); + return activeCodes; + } + + /** + * @Description + * @Param a + * @Param b 分母 + * @author zxc + * @date 2021/1/29 上午10:10 + */ + public BigDecimal getRatio(Integer a , Integer b){ + if (b==NumConstant.ZERO){ + return new BigDecimal(NumConstant.ZERO); + } + BigDecimal bigDecimalA = new BigDecimal(a); + BigDecimal bigDecimalB = new BigDecimal(b); + BigDecimal divide = bigDecimalA.divide(bigDecimalB, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP); + return divide; + } + + /** + * @Description 新增 + * @Param list + * @author zxc + * @date 2021/2/1 上午10:24 + */ + @Transactional(rollbackFor = Exception.class) + public void insertScreenProjectGridDaily(List list){ + if (!CollectionUtils.isEmpty(list)){ + List> partition = ListUtils.partition(list, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertScreenProjectGridDaily(p); + }); + } + } + + /** + * @Description 删除 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/2/1 上午10:24 + */ + @Transactional(rollbackFor = Exception.class) + public void delScreenProjectGridDaily(String customerId,String dateId){ + Integer flag; + do { + flag = baseDao.deleteByDateIdAndCustomerId(customerId,dateId); + }while (flag > NumConstant.ZERO && flag == NumConstant.ONE_THOUSAND); + } +} \ 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/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/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java new file mode 100644 index 0000000000..3f69596cd3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.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.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; +import com.epmet.constant.PingYinConstants; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectOrgDailyDao; +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.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl implements ScreenProjectOrgDailyService { + + @Autowired + private ScreenCustomerAgencyDao agencyDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectOrgDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectOrgDailyDTO.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 ScreenProjectOrgDailyDTO get(String id) { + ScreenProjectOrgDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectOrgDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectOrgDailyDTO dto) { + ScreenProjectOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectOrgDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectOrgDailyDTO dto) { + ScreenProjectOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectOrgDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,"APP_USER",data.getDateId()); + }); + } + + /** + * @Description 数据抽取【机关-日】 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/2/1 下午1:32 + */ + @Override + public void extractionProjectOrgDaily(String customerId, String dateId) { + List agencyInfos = agencyDao.selectAgencyByCustomer(customerId); + if (CollectionUtils.isEmpty(agencyInfos)){ + throw new RenException(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + } + List projectOrgDaily = baseDao.selectOrgProject(agencyInfos, dateId); + if (CollectionUtils.isEmpty(projectOrgDaily)){ + log.info(String.format(PingYinConstants.SELECT_GRID_INFO_BY_ORG_IS_NULL,customerId)); + return; + } + projectOrgDaily.forEach(p -> { + p.setBadTotal(null == p.getBadTotal() ? NumConstant.ZERO : p.getBadTotal()); + p.setEvaluateTotal(null == p.getEvaluateTotal() ? NumConstant.ZERO : p.getEvaluateTotal()); + p.setGoodTotal(null == p.getGoodTotal() ? NumConstant.ZERO : p.getGoodTotal()); + p.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + p.setResolvedNum(null == p.getResolvedNum() ? NumConstant.ZERO : p.getResolvedNum()); + }); + log.info(projectOrgDaily.toString()); + agencyInfos.forEach(a -> { + a.setDateId(dateId); + projectOrgDaily.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setResolvedRatio(getRatio(p.getResolvedNum(),p.getProjectTotal())); + a.setBadRatio(getRatio(p.getBadTotal(),p.getEvaluateTotal())); + a.setGoodRatio(getRatio(p.getGoodTotal(),p.getEvaluateTotal())); + a.setBadTotal(p.getBadTotal()); + a.setEvaluateTotal(p.getEvaluateTotal()); + a.setGoodTotal(p.getGoodTotal()); + a.setProjectTotal(p.getProjectTotal()); + a.setResolvedNum(p.getResolvedNum()); + } + }); + }); + log.info(agencyInfos.toString()); + del(customerId, dateId); + insert(agencyInfos,customerId,dateId); + } + + /** + * @Description + * @Param a + * @Param b 分母 + * @author zxc + * @date 2021/1/29 上午10:10 + */ + public BigDecimal getRatio(Integer a , Integer b){ + if (b == NumConstant.ZERO){ + return new BigDecimal(NumConstant.ZERO); + } + BigDecimal bigDecimalA = new BigDecimal(a); + BigDecimal bigDecimalB = new BigDecimal(b); + BigDecimal divide = bigDecimalA.divide(bigDecimalB, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP); + return divide; + } + + @Transactional(rollbackFor = Exception.class) + public void insert(List agencyInfos,String customerId,String dateId){ + if (!CollectionUtils.isEmpty(agencyInfos)){ + List> partition = ListUtils.partition(agencyInfos, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertBatch(p,customerId,PingYinConstants.CREATED_BY,dateId); + }); + } + } + + @Transactional(rollbackFor = Exception.class) + public void del(String customerId,String dateId){ + Integer flag; + do { + flag = baseDao.deleteByDateIdAndCustomerId(customerId, dateId); + }while (flag > NumConstant.ZERO && flag == NumConstant.ONE_THOUSAND); + } +} \ 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/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/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 new file mode 100644 index 0000000000..405c5fc3a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java @@ -0,0 +1,253 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.PingYinConstants; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectQuantityGridMonthlyDao; +import com.epmet.dto.pingyin.result.ClosedIncrResultDTO; +import com.epmet.dto.pingyin.result.ProjectIncrResultDTO; +import com.epmet.dto.pingyin.result.ProjectTotalResultDTO; +import com.epmet.dto.pingyin.result.UnClosedTotalResultDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; +import com.epmet.dto.screen.ScreenProjectQuantityGridMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityGridMonthlyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +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-01-27 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectQuantityGridMonthlyServiceImpl extends BaseServiceImpl implements ScreenProjectQuantityGridMonthlyService { + + @Autowired + private ScreenCustomerGridDao gridDao; + + @Autowired + private FactOriginProjectMainDailyService projectMainDailyService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectQuantityGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectQuantityGridMonthlyDTO.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 ScreenProjectQuantityGridMonthlyDTO get(String id) { + ScreenProjectQuantityGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectQuantityGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectQuantityGridMonthlyDTO dto) { + ScreenProjectQuantityGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectQuantityGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectQuantityGridMonthlyDTO dto) { + ScreenProjectQuantityGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectQuantityGridMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,"APP_USER",data.getMonthId()); + }); + } + + /** + * @Description 数据抽取 【网格-月】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午1:57 + */ + @Override + public void extractionProjectGridMonthly(String customerId, String monthId) { + // 查询客户下所有网格 + List screenProjectGridDailyDTOS = gridDao.selectGridInfoByCustomerId(customerId); + if (CollectionUtils.isEmpty(screenProjectGridDailyDTOS)){ + throw new RenException(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + } + List gridInfos = ConvertUtils.sourceToTarget(screenProjectGridDailyDTOS, ScreenProjectQuantityGridMonthlyDTO.class); + + // 本月新增的项目数量 转项目日期在当前月份内 + List projectIncr = projectMainDailyService.selectProjectIncr(customerId, monthId); + // 截止到当前月份:累计项目总数 + List projectTotal = projectMainDailyService.selectProjectTotal(customerId, null, monthId); + // 截止到当前月份:累计未结项目总数 + List projectUnClosed = projectMainDailyService.selectProjectCount(customerId, monthId, PingYinConstants.UN_CLOSED); + // 截止到当前月份:累计已结项目 + List projectClosed = projectMainDailyService.selectProjectCount(customerId, monthId, PingYinConstants.CLOSED); + // 本月新增结案项目数 + List closedIncr = projectMainDailyService.selectClosedIncr(customerId, monthId); + gridInfos.forEach(g -> { + g.setMonthId(monthId); + // 本月新增的项目数量 转项目日期在当前月份内 + if (!CollectionUtils.isEmpty(projectIncr)){ + projectIncr.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setProjectIncr(p.getProjectIncr()); + } + }); + } + // 截止到当前月份:累计项目总数 + if (!CollectionUtils.isEmpty(projectTotal)){ + projectTotal.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setProjectTotal(p.getProjectTotal()); + } + }); + } + // 截止到当前月份:累计未结项目总数 + if (!CollectionUtils.isEmpty(projectUnClosed)){ + projectUnClosed.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setUnClosedTotal(p.getProjectCount()); + } + }); + } + // 截止到当前月份:累计已结项目 + if (!CollectionUtils.isEmpty(projectClosed)){ + projectClosed.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setClosedTotal(p.getProjectCount()); + } + }); + } + // 本月新增结案项目数 + if (!CollectionUtils.isEmpty(closedIncr)){ + closedIncr.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setClosedIncr(p.getClosedIncr()); + } + }); + } + }); + log.info(gridInfos.toString()); + del(customerId, monthId); + insert(gridInfos,customerId,monthId); + } + + /** + * @Description 删除 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/1 上午10:13 + */ + @Transactional(rollbackFor = Exception.class) + public void del(String customerId,String monthId){ + Integer flag; + do { + flag = baseDao.deleteByMonthIdAndCustomerId(customerId, monthId); + }while (flag > NumConstant.ZERO && flag == NumConstant.ONE_THOUSAND); + } + + /** + * @Description 新增 + * @Param list + * @author zxc + * @date 2021/2/1 上午10:16 + */ + @Transactional(rollbackFor = Exception.class) + public void insert(List list,String customerId,String monthId){ + if (!CollectionUtils.isEmpty(list)){ + List> partition = ListUtils.partition(list, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertBatch(p,customerId,PingYinConstants.CREATED_BY,monthId); + }); + } + } + +} \ 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/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..15b8a46201 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -0,0 +1,213 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.PingYinConstants; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyDao; +import com.epmet.dto.pingyin.result.ProjectOrgMonthlyResultDTO; +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.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +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-01-27 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl implements ScreenProjectQuantityOrgMonthlyService { + + @Autowired + private ScreenCustomerAgencyDao agencyDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectQuantityOrgMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectQuantityOrgMonthlyDTO.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 ScreenProjectQuantityOrgMonthlyDTO get(String id) { + ScreenProjectQuantityOrgMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectQuantityOrgMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectQuantityOrgMonthlyDTO dto) { + ScreenProjectQuantityOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectQuantityOrgMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectQuantityOrgMonthlyDTO dto) { + ScreenProjectQuantityOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectQuantityOrgMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,"APP_USER",data.getMonthId()); + }); + } + + /** + * @Description 数据抽取【组织-月】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/2 上午10:43 + */ + @Override + public void extractionProjectOrgMonthly(String customerId, String monthId) { + List screenProjectOrgDailyDTOS = agencyDao.selectAgencyByCustomer(customerId); + if (CollectionUtils.isEmpty(screenProjectOrgDailyDTOS)){ + throw new RenException(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + } + List agencyInfos = ConvertUtils.sourceToTarget(screenProjectOrgDailyDTOS, ScreenProjectQuantityOrgMonthlyDTO.class); + List projectOrg = baseDao.selectQuantityOrgMonthly(agencyInfos, monthId); + if (!CollectionUtils.isEmpty(projectOrg)){ + projectOrg.forEach(p -> { + p.setClosedIncr(null == p.getClosedIncr() ? NumConstant.ZERO : p.getClosedIncr()); + p.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + }); + } + List projectGrandOrg = baseDao.selectQuantityGrandOrgMonthly(agencyInfos, monthId); + if (!CollectionUtils.isEmpty(projectGrandOrg)){ + projectGrandOrg.forEach(p -> { + p.setClosedTotal(null == p.getClosedTotal() ? NumConstant.ZERO : p.getClosedTotal()); + p.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + p.setUnClosedTotal(null == p.getUnClosedTotal() ? NumConstant.ZERO : p.getUnClosedTotal()); + }); + } + agencyInfos.forEach(a -> { + a.setMonthId(monthId); + if (!CollectionUtils.isEmpty(projectOrg)){ + projectOrg.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setClosedIncr(p.getClosedIncr()); + a.setProjectIncr(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()); + } + }); + } + }); + log.info(agencyInfos.toString()); + del(customerId, monthId); + insert(agencyInfos,customerId,monthId); + } + + @Transactional(rollbackFor = Exception.class) + public void del(String customerId,String monthId){ + Integer flag; + do { + flag = baseDao.deleteByMonthIdAndCustomerId(customerId, monthId); + }while (flag > NumConstant.ZERO && flag == NumConstant.ONE_THOUSAND); + } + + @Transactional(rollbackFor = Exception.class) + public void insert(List agencyInfos,String customerId,String monthId){ + if (!CollectionUtils.isEmpty(agencyInfos)){ + List> partition = ListUtils.partition(agencyInfos, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertBatch(p,customerId,PingYinConstants.CREATED_BY,monthId); + }); + } + } + +} \ 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/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index cd26e20bd2..774fde473b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -405,7 +405,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Transactional(rollbackFor = Exception.class) public Integer initBizOrg(CustomerBizOrgFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - List entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId()); + List entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId(),null,null); List list = new ArrayList<>(); if (CollectionUtils.isEmpty(entityList)) { return 0; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index 5c09458416..6338145260 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import com.epmet.constant.RobotConstant; +import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.crm.CustomerEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.org.CustomerDepartmentEntity; @@ -199,6 +200,14 @@ public class StatsDimServiceImpl implements StatsDimService { List customers = customerService.listValidCustomersByCreateTime(lastInitTime, initTime); + // 添加 areaCode + if (!CollectionUtils.isEmpty(customers)){ + List customerIds = customers.stream().map(m -> m.getId()).collect(Collectors.toList()); + List areaCodes = customerAgencyService.selectCustomerAreaCodeById(customerIds); + if (!CollectionUtils.isEmpty(areaCodes)){ + customers.forEach(c -> areaCodes.stream().filter(a -> c.getId().equals(a.getCustomerId())).forEach(a -> c.setAreaCode(a.getAreaCode()))); + } + } return customers; } @@ -212,6 +221,14 @@ public class StatsDimServiceImpl implements StatsDimService { if (lastCreatedDim != null) { // 说明不是首次初始化 List customers = customerService.listValidCustomersByUpdatedTime(lastCreatedDim.getUpdatedTime(), initTime); + // 添加 areaCode + if (!CollectionUtils.isEmpty(customers)){ + List customerIds = customers.stream().map(m -> m.getId()).collect(Collectors.toList()); + List areaCodes = customerAgencyService.selectCustomerAreaCodeById(customerIds); + if (!CollectionUtils.isEmpty(areaCodes)){ + customers.forEach(c -> areaCodes.stream().filter(a -> c.getId().equals(a.getCustomerId())).forEach(a -> c.setAreaCode(a.getAreaCode()))); + } + } return customers; } return new ArrayList<>(); 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 96669f2ae9..b93c4563ec 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 @@ -1,5 +1,6 @@ package com.epmet.service.org; +import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.org.CustomerAgencyEntity; import java.util.Date; @@ -9,4 +10,12 @@ public interface CustomerAgencyService { List listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime); List listAgenciesByUpdatedTime(Date updatedTime, Date now); + + /** + * @Description 查询客户所属区域编码 + * @Param customerIds + * @author zxc + * @date 2021/1/14 上午11:07 + */ + List selectCustomerAreaCodeById(List customerIds); } 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 4813309176..702da0930d 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 @@ -3,11 +3,14 @@ package com.epmet.service.org.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.StatsCustomerAgencyDao; +import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.org.CustomerAgencyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -27,4 +30,19 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { public List listAgenciesByUpdatedTime(Date startTime, Date endTime) { return customerAgencyDao.listAgenciesByUpdatedTime(startTime, endTime); } + + /** + * @Description 查询客户所属区域编码 + * @Param customerIds + * @author zxc + * @date 2021/1/14 上午11:07 + */ + @Override + public List selectCustomerAreaCodeById(List customerIds) { + if (!CollectionUtils.isEmpty(customerIds)){ + List resultDTOS = customerAgencyDao.selectCustomerAreaCodeById(customerIds); + return resultDTOS; + } + return new ArrayList<>(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/OfsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/OfsService.java new file mode 100644 index 0000000000..e2aa01aced --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/OfsService.java @@ -0,0 +1,41 @@ +package com.epmet.service.plugins; + +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.dto.plugins.OneListFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; + +/** + * 146体系数据采集 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:18 + */ +public interface OfsService { + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 【146】一张清单 + * @Date 2021/1/22 10:19 + **/ + void collOneList(ScreenCollFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 【146】合同监管 + * @Date 2021/1/22 10:19 + **/ + void collContract(ScreenCollFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 【146】竞标管理 + * @Date 2021/1/22 10:19 + **/ + void collBid(ScreenCollFormDTO formDTO); +} 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 new file mode 100644 index 0000000000..6f5ac2573e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.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.plugins; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenCustomerWorkRecordDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +public interface ScreenCustomerWorkRecordDictService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenCustomerWorkRecordDictDTO + * @author generator + * @date 2021-02-04 + */ + ScreenCustomerWorkRecordDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-04 + */ + void save(ScreenCustomerWorkRecordDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-04 + */ + void update(ScreenCustomerWorkRecordDictDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-04 + */ + void delete(String[] ids); + + /** + * @Description 数据录入 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.02.04 15:27 + */ + void collect(String customerId, 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 new file mode 100644 index 0000000000..6edbb9ba92 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.plugins; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgDailyEntity; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenWorkRecordOrgDailyService extends BaseService { + + void collectOrgDaily(String customerId, 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 new file mode 100644 index 0000000000..0e16b4b1fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.plugins; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; + +/** + * 工作日志-组织按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +public interface ScreenWorkRecordOrgMonthlyService extends BaseService { + + /** + * @Description 数据录入 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.02.04 15:27 + */ + void collect(String customerId, 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/OfsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/OfsServiceImpl.java new file mode 100644 index 0000000000..cb05167baa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/OfsServiceImpl.java @@ -0,0 +1,104 @@ +package com.epmet.service.plugins.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.plugins.ScreenBidInfoDao; +import com.epmet.dao.plugins.ScreenContractInfoDao; +import com.epmet.dao.plugins.ScreenListInfoDao; +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.dto.plugins.OneListFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.service.plugins.OfsService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:20 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class OfsServiceImpl implements OfsService { + @Autowired + private ScreenBidInfoDao screenBidInfoDao; + @Autowired + private ScreenContractInfoDao screenContractInfoDao; + @Autowired + private ScreenListInfoDao screenListInfoDao; + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 【146】一张清单 + * @Date 2021/1/22 10:19 + **/ + @Override + public void collOneList(ScreenCollFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getDataList())) { + return; + } + if (formDTO.getIsFirst()) { + int affectRows = screenListInfoDao.deleteBatch(formDTO.getCustomerId()); + while (affectRows >= NumConstant.ONE) { + affectRows = screenListInfoDao.deleteBatch(formDTO.getCustomerId()); + } + } + Lists.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + screenListInfoDao.insertBatch(list, + formDTO.getCustomerId(), + formDTO.getDateId()); + }); + } + + @Override + public void collContract(ScreenCollFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getDataList())) { + return; + } + if (formDTO.getIsFirst()) { + int affectRows = screenContractInfoDao.deleteBatch(formDTO.getCustomerId()); + while (affectRows >= NumConstant.ONE) { + affectRows = screenContractInfoDao.deleteBatch(formDTO.getCustomerId()); + } + } + Lists.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + screenContractInfoDao.insertBatch(list, + formDTO.getCustomerId(), + formDTO.getDateId()); + }); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 【146】竞标管理 + * @Date 2021/1/22 10:19 + **/ + @Override + public void collBid(ScreenCollFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getDataList())) { + return; + } + if (formDTO.getIsFirst()) { + int affectRows = screenBidInfoDao.deleteBatch(formDTO.getCustomerId()); + while (affectRows >= NumConstant.ONE) { + affectRows = screenBidInfoDao.deleteBatch(formDTO.getCustomerId()); + } + } + Lists.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + screenBidInfoDao.insertBatch(list, + formDTO.getCustomerId(), + formDTO.getDateId()); + }); + } +} 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 new file mode 100644 index 0000000000..05b1172eb7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.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.plugins.ScreenCustomerWorkRecordDictDao; +import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenCustomerWorkRecordDictEntity; +import com.epmet.service.plugins.ScreenCustomerWorkRecordDictService; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenCustomerWorkRecordDictServiceImpl extends BaseServiceImpl implements ScreenCustomerWorkRecordDictService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenCustomerWorkRecordDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenCustomerWorkRecordDictDTO.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 ScreenCustomerWorkRecordDictDTO get(String id) { + ScreenCustomerWorkRecordDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenCustomerWorkRecordDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenCustomerWorkRecordDictDTO dto) { + ScreenCustomerWorkRecordDictEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCustomerWorkRecordDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenCustomerWorkRecordDictDTO dto) { + ScreenCustomerWorkRecordDictEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCustomerWorkRecordDictEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteBatch(customerId); + while(affectedRows > 0){ + affectedRows = baseDao.deleteBatch(customerId); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,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/ScreenWorkRecordOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java new file mode 100644 index 0000000000..c517555fbc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.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.service.plugins.impl; + +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.constant.DataSourceConstant; +import com.epmet.dao.plugins.ScreenWorkRecordOrgDailyDao; +import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgDailyEntity; +import com.epmet.service.plugins.ScreenWorkRecordOrgDailyService; +import com.google.common.collect.Lists; +import org.springframework.stereotype.Service; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgDailyService { + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collectOrgDaily(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteBatch(customerId,data.getDateId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteBatch(customerId,data.getDateId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,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 new file mode 100644 index 0000000000..a27cb040aa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.plugins.impl; + +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.constant.DataSourceConstant; +import com.epmet.dao.plugins.ScreenWorkRecordOrgMonthlyDao; +import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +import com.epmet.service.plugins.ScreenWorkRecordOrgMonthlyService; +import com.google.common.collect.Lists; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 工作日志-组织按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgMonthlyService { + + /** + * @Description 数据录入 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.02.04 15:27 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteBatch(customerId,data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteBatch(customerId,data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,data.getMonthId()); + }); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java index 367b06629b..feae456fb3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java @@ -128,6 +128,7 @@ public class DimCustomerServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + \ 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 1ea4b350fd..3d21f70ce7 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 @@ -440,4 +440,98 @@ CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + + + + + + + + + + + + + + + + + + \ 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 a01747d444..d607aac0d0 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 @@ -39,9 +39,12 @@ fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' - - PROJECT_ID = #{item} - + AND CUSTOMER_ID = #{customerId} + + + PROJECT_ID = #{item} + + + + + + + + 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 8be2f83314..b028814062 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 @@ -122,4 +122,52 @@ AND MONTH_ID = #{monthId} ORDER BY 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 b70d136989..05f3193d0c 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 @@ -150,4 +150,27 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + 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 7f3912fa6f..51a1600474 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 @@ -179,4 +179,27 @@ ORDER BY GRID_ID + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index b4475c72cd..f782210785 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -52,7 +52,15 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + RESP_PROJECT_RATIO_FZ, + RESP_PROJECT_RATIO_FM, + HANDLE_PROJECT_RATIO_FZ, + HANDLE_PROJECT_RATIO_FM, + CLOSED_PROJECT_RATIO_FZ, + CLOSED_PROJECT_RATIO_FM, + SATISFACTION_RATIO_FZ, + SATISFACTION_RATIO_FM ) values ( @@ -74,7 +82,15 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.respProjectRatioFz}, + #{item.respProjectRatioFm}, + #{item.handleProjectRatioFz}, + #{item.handleProjectRatioFm}, + #{item.closedProjectRatioFz}, + #{item.closedProjectRatioFm}, + #{item.satisfactionRatioFz}, + #{item.satisfactionRatioFm} ) @@ -85,10 +101,24 @@ count( 1 ) AS total FROM fact_index_govrn_ablity_dept_monthly m + inner join screen_customer_dept scd + on( + m.DEPT_ID=scd.DEPT_ID + and scd.DEL_FLAG='0' + and scd.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID=#{monthId} + + + and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scd.CUSTOMER_ID=#{customerId} + + @@ -111,10 +141,24 @@ MAX(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MAX FROM fact_index_govrn_ablity_dept_monthly m + inner join screen_customer_dept scd + on( + m.DEPT_ID=scd.DEPT_ID + and scd.DEL_FLAG='0' + and scd.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scd.CUSTOMER_ID=#{customerId} + + @@ -132,10 +176,24 @@ SATISFACTION_RATIO FROM fact_index_govrn_ablity_dept_monthly m + inner join screen_customer_dept scd + on( + m.DEPT_ID=scd.DEPT_ID + and scd.DEL_FLAG='0' + and scd.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scd.CUSTOMER_ID=#{customerId} + + ORDER BY m.DEPT_ID ASC LIMIT #{offset},#{pageSize} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index e30d52c675..755e3aab60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -56,7 +56,13 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + TRANSFER_RIGHT_RATIO_FZ, + TRANSFER_RIGHT_RATIO_FM, + SATISFACTION_RATIO_FZ, + SATISFACTION_RATIO_FM, + ISSUE_TO_PROJECT_RATIO_FZ, + ISSUE_TO_PROJECT_RATIO_FM ) values ( @@ -80,7 +86,13 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.transferRightRatioFz}, + #{item.transferRightRatioFm}, + #{item.satisfactionRatioFz}, + #{item.satisfactionRatioFm}, + #{item.issueToProjectRatioFz}, + #{item.issueToProjectRatioFm} ) @@ -101,16 +113,30 @@ m.SATISFACTION_RATIO FROM fact_index_govrn_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and m.CUSTOMER_ID=#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + order by m.GRID_ID asc LIMIT #{pageIndex}, #{pageSize} - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -133,10 +159,24 @@ MAX(m.SATISFACTION_RATIO) AS SATISFACTION_RATIO_MAX FROM fact_index_govrn_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and m.CUSTOMER_ID=#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + 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 3a4250d1ad..7cb270630c 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 @@ -63,7 +63,17 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + RESP_PROJECT_RATIO_FZ, + RESP_PROJECT_RATIO_FM, + CLOSED_PROJECT_RATIO_FZ, + CLOSED_PROJECT_RATIO_FM, + SATISFACTION_RATIO_FZ, + SATISFACTION_RATIO_FM, + OVERDUE_PROJECT_RATIO_FZ, + OVERDUE_PROJECT_RATIO_FM, + HANDLE_PROJECT_RATIO_FZ, + HANDLE_PROJECT_RATIO_FM ) values ( @@ -87,7 +97,17 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.respProjectRatioFz}, + #{item.respProjectRatioFm}, + #{item.closedProjectRatioFz}, + #{item.closedProjectRatioFm}, + #{item.satisfactionRatioFz}, + #{item.satisfactionRatioFm}, + #{item.overdueProjectRatioFz}, + #{item.overdueProjectRatioFm}, + #{item.handleProjectRatioFz}, + #{item.handleProjectRatioFm} ) @@ -129,4 +149,29 @@ AND MONTH_ID = #{monthId} AND data_type = #{type} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 788af38336..9610514dcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -69,59 +69,85 @@ - - SELECT - MIN( CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MIN, - MAX( CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MAX, - MIN( JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MIN, - MAX( JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MAX, - MIN( SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MIN, - MAX( SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MAX, - MIN( SHIFT_PROJECT_COUNT ) SHIFT_PROJECT_COUNT_MIN, - MAX( SHIFT_PROJECT_COUNT ) SHIFT_PROJECT_COUNT_MAX, - MIN( JOIN_THREE_MEETS_COUNT ) JOIN_THREE_MEETS_COUNT_MIN, - MAX( JOIN_THREE_MEETS_COUNT ) JOIN_THREE_MEETS_COUNT_MAX, - MIN( GROUP_USER_COUNT ) GROUP_USER_COUNT_MIN, - MAX( GROUP_USER_COUNT ) GROUP_USER_COUNT_MAX, - MIN( GROUP_ACTIVE_USER_COUNT ) GROUP_ACTIVE_USER_COUNT_MIN, - MAX( GROUP_ACTIVE_USER_COUNT ) GROUP_ACTIVE_USER_COUNT_MAX, - MIN( GROUP_TOPIC_COUNT ) GROUP_TOPIC_COUNT_MIN, - MAX( GROUP_TOPIC_COUNT ) GROUP_TOPIC_COUNT_MAX, - MIN( TOPIC_TO_ISSUE_RATIO ) TOPIC_TO_ISSUE_RATIO_MIN, - MAX( TOPIC_TO_ISSUE_RATIO ) TOPIC_TO_ISSUE_RATIO_MAX + MIN( cpc.CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MIN, + MAX( cpc.CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MAX, + MIN( cpc.JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MIN, + MAX( cpc.JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MAX, + MIN( cpc.SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MIN, + MAX( cpc.SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MAX, + MIN( cpc.SHIFT_PROJECT_COUNT ) SHIFT_PROJECT_COUNT_MIN, + MAX( cpc.SHIFT_PROJECT_COUNT ) SHIFT_PROJECT_COUNT_MAX, + MIN( cpc.JOIN_THREE_MEETS_COUNT ) JOIN_THREE_MEETS_COUNT_MIN, + MAX( cpc.JOIN_THREE_MEETS_COUNT ) JOIN_THREE_MEETS_COUNT_MAX, + MIN( cpc.GROUP_USER_COUNT ) GROUP_USER_COUNT_MIN, + MAX( cpc.GROUP_USER_COUNT ) GROUP_USER_COUNT_MAX, + MIN( cpc.GROUP_ACTIVE_USER_COUNT ) GROUP_ACTIVE_USER_COUNT_MIN, + MAX( cpc.GROUP_ACTIVE_USER_COUNT ) GROUP_ACTIVE_USER_COUNT_MAX, + MIN( cpc.GROUP_TOPIC_COUNT ) GROUP_TOPIC_COUNT_MIN, + MAX( cpc.GROUP_TOPIC_COUNT ) GROUP_TOPIC_COUNT_MAX, + MIN( cpc.TOPIC_TO_ISSUE_RATIO ) TOPIC_TO_ISSUE_RATIO_MIN, + MAX( cpc.TOPIC_TO_ISSUE_RATIO ) TOPIC_TO_ISSUE_RATIO_MAX FROM - fact_index_party_ablity_cpc_monthly - WHERE - CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} - AND MONTH_ID = #{monthId,jdbcType=VARCHAR} - AND DEL_FLAG = '0' + fact_index_party_ablity_cpc_monthly cpc + inner join screen_customer_grid scg on( + cpc.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) + WHERE cpc.DEL_FLAG = '0' + AND cpc.MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and cpc.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and scg.CUSTOMER_ID=#{customerId,jdbcType=VARCHAR} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index 9208f9a533..a1d0e85e45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -66,7 +66,9 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + SHIFTED_PROJECT_TOTAL, + ISSUE_TOTAL ) values ( @@ -95,7 +97,9 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.shiftedProjectTotal}, + #{item.issueTotal} ) @@ -122,16 +126,30 @@ m.JOIN_THREE_MEETS_COUNT FROM fact_index_party_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} - order by m.GRID_ID asc + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + + order by m.GRID_ID asc LIMIT #{pageIndex}, #{pageSize} - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -164,10 +182,24 @@ MAX(m.JOIN_THREE_MEETS_COUNT) AS JOIN_THREE_MEETS_COUNT_MAX FROM fact_index_party_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + @@ -176,10 +208,24 @@ count(1) as total FROM fact_index_party_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + 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 cf9146cc1f..7454e9d0cd 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 @@ -112,4 +112,44 @@ AND month_id = #{monthId} + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index 2a4d8a7039..fa6f11e4a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -46,7 +46,11 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + PARTY_VOLUNTEER_TOTAL, + VOLUNTEER_TOTAL, + VOLUNTEER_USER_TOTAL, + REG_USER_TOTAL ) values ( @@ -65,7 +69,11 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.partyVolunteerTotal}, + #{item.volunteerTotal}, + #{item.volunteerUserTotal}, + #{item.regUserTotal} ) @@ -90,7 +98,7 @@ - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -103,10 +111,24 @@ MAX(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MAX FROM fact_index_service_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and m.CUSTOMER_ID=#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + @@ -115,10 +137,24 @@ count(1) as total FROM fact_index_service_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + 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 a72642ef9a..f4b85f33cc 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 @@ -111,4 +111,24 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 97eea5c398..31d45d2e3c 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 @@ -31,7 +31,8 @@ CREATED_TIME, UPDATED_BY, UPDATED_TIME, - DATA_END_TIME + DATA_END_TIME, + PARENT_AREA_CODE ) values ( @@ -54,7 +55,8 @@ now(), 'APP_USER', now(), - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.parentAreaCode} ) @@ -70,8 +72,15 @@ screen_customer_agency WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} AND `LEVEL` = 'community' + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + AND AGENCY_ID NOT IN @@ -90,7 +99,14 @@ screen_customer_agency WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + @@ -122,8 +138,15 @@ screen_customer_agency WHERE DEL_FLAG = '0' - AND CUSTOMER_ID = #{customerId} AND (`LEVEL` = 'street' OR `LEVEL` = 'district') + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID = #{customerId} + + ) agency WHERE agencyId NOT IN @@ -340,4 +363,18 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 26c34d328b..0f5499d456 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -26,7 +26,8 @@ CREATED_TIME, UPDATED_BY, UPDATED_TIME, - DATA_END_TIME + DATA_END_TIME, + AREA_CODE ) values ( @@ -44,7 +45,8 @@ now(), 'APP_USER', now(), - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.areaCode} ) @@ -58,7 +60,6 @@ screen_customer_dept m WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.DEPT_ID =#{deptId} @@ -71,7 +72,14 @@ screen_customer_dept WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + AND DEPT_ID NOT IN @@ -89,7 +97,14 @@ screen_customer_dept WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + @@ -113,7 +114,14 @@ screen_customer_grid WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + AND GRID_ID NOT IN @@ -132,7 +140,14 @@ screen_customer_grid WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + @@ -328,4 +343,20 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml new file mode 100644 index 0000000000..bc84c6b2df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_category_grid_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml new file mode 100644 index 0000000000..5d8cd9a73a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_category_org_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml new file mode 100644 index 0000000000..82e0587dc5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_data + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + limit 1000 + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectGridDailyDao.xml new file mode 100644 index 0000000000..9b10fe1d04 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectGridDailyDao.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_project_grid_daily + ( + id, + customer_id, + date_id, + grid_id, + pid, + pids, + project_total, + resolved_num, + resolved_ratio, + evaluate_total, + good_total, + bad_total, + good_ratio, + bad_ratio, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{timeId}, + + #{item.gridId}, + + #{item.pid}, + + #{item.pids}, + + #{item.projectTotal}, + + #{item.resolvedNum}, + + #{item.resolvedRatio}, + + #{item.evaluateTotal}, + + #{item.goodTotal}, + + #{item.badTotal}, + + #{item.goodRatio}, + + #{item.badRatio}, + + '0', + + 0, + + #{createdBy}, + + now(), + + #{createdBy}, + + now() + ) + + + + INSERT INTO screen_project_grid_daily + ( + id, + customer_id, + date_id, + grid_id, + pid, + pids, + project_total, + resolved_num, + resolved_ratio, + evaluate_total, + good_total, + bad_total, + good_ratio, + bad_ratio, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + REPLACE(UUID(), '-', ''), + #{item.customerId}, + #{item.dateId}, + #{item.gridId}, + #{item.pid}, + #{item.pids}, + #{item.projectTotal}, + #{item.resolvedNum}, + #{item.resolvedRatio}, + #{item.evaluateTotal}, + #{item.goodTotal}, + #{item.badTotal}, + #{item.goodRatio}, + #{item.badRatio}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + now(), + #{item.createdBy}, + now() + ) + + + + + + delete from screen_project_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/ScreenProjectImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml new file mode 100644 index 0000000000..3604a5df25 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml new file mode 100644 index 0000000000..6bf6208ce0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_project_org_daily + ( + id, + customer_id, + date_id, + org_id, + org_type, + pid, + pids, + project_total, + resolved_num, + resolved_ratio, + evaluate_total, + good_total, + bad_total, + good_ratio, + bad_ratio, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{timeId}, + + #{item.orgId}, + + #{item.orgType}, + + #{item.pid}, + + #{item.pids}, + + #{item.projectTotal}, + + #{item.resolvedNum}, + + #{item.resolvedRatio}, + + #{item.evaluateTotal}, + + #{item.goodTotal}, + + #{item.badTotal}, + + #{item.goodRatio}, + + #{item.badRatio}, + + '0', + + 0, + + #{createdBy}, + + now(), + + #{createdBy}, + + now() + ) + + + + + + delete from screen_project_org_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml new file mode 100644 index 0000000000..8560281d3b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml new file mode 100644 index 0000000000..06023e11b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml @@ -0,0 +1,13 @@ + + + + + + + delete from screen_project_process + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + limit 1000 + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.xml new file mode 100644 index 0000000000..00be9d5443 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_project_quantity_grid_monthly + ( + id, + customer_id, + month_id, + grid_id, + pid, + pids, + project_incr, + project_total, + un_closed_total, + closed_total, + closed_incr, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{timeId}, + + #{item.gridId}, + + #{item.pid}, + + #{item.pids}, + + #{item.projectIncr}, + + #{item.projectTotal}, + + #{item.unClosedTotal}, + + #{item.closedTotal}, + + #{item.closedIncr}, + + '0', + + 0, + + #{createdBy}, + + now(), + + #{createdBy}, + + now() + ) + + + + + + delete from screen_project_quantity_grid_monthly + where customer_id = #{customerId} + and month_id = #{monthId} + limit 1000 + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..a1a946f7ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_project_quantity_org_monthly + ( + id, + customer_id, + month_id, + org_id, + org_type, + pid, + pids, + project_incr, + project_total, + un_closed_total, + closed_total, + closed_incr, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{timeId}, + + #{item.orgId}, + + #{item.orgType}, + + #{item.pid}, + + #{item.pids}, + + #{item.projectIncr}, + + #{item.projectTotal}, + + #{item.unClosedTotal}, + + #{item.closedTotal}, + + #{item.closedIncr}, + + '0', + + 0, + + #{createdBy}, + + now(), + + #{createdBy}, + + now() + ) + + + + + + delete from screen_project_quantity_org_monthly + where customer_id = #{customerId} + and month_id = #{monthId} + limit 1000 + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml index 365ae56b8a..0e373b7d3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml @@ -4,15 +4,20 @@ @@ -20,20 +25,23 @@ \ No newline at end of file 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 268782eb3d..945b47260e 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 @@ -94,10 +94,28 @@ total_user, province, city, - district + district, + PARENT_AREA_CODE as parentAreaCode from customer_agency where UPDATED_TIME >= #{startTime} and UPDATED_TIME #{endTime} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml new file mode 100644 index 0000000000..cb3d221dc5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml @@ -0,0 +1,54 @@ + + + + + + delete from screen_bid_info where CUSTOMER_ID=#{customerId} + + + + INSERT INTO `screen_bid_info` ( + `ID`, + `CUSTOMER_ID`, + `DATE_ID`, + `BID_ID`, + `BID_NAME`, + `STATUS_CODE`, + `STATUS_DESC`, + `AMOUNT`, + `RELEASE_TIME`, + `TOWN_IDS`, + `TOWN_NAMES`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.bidId}, + #{item.bidName}, + #{item.statusCode}, + #{item.statusDesc}, + #{item.amount}, + #{item.releaseTime}, + #{item.townIds}, + #{item.townNames}, + '0', + 0, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml new file mode 100644 index 0000000000..24abf9f9f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml @@ -0,0 +1,52 @@ + + + + + + + delete from screen_contract_info where CUSTOMER_ID=#{customerId} + + + + INSERT INTO `screen_contract_info` ( + `ID`, + `CUSTOMER_ID`, + `DATE_ID`, + `CONTRACT_ID`, + `CONTRACT_NAME`, + `CATEGORY_CODE`, + `CATEGORY_NAME`, + `DUE_DATE`, + `TOWN_IDS`, + `TOWN_NAMES`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.contractId}, + #{item.contractName}, + #{item.categoryCode}, + #{item.categoryName}, + #{item.dueDate}, + #{item.townIds}, + #{item.townNames}, + '0', + 0, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml new file mode 100644 index 0000000000..d86ef25c96 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_customer_work_record_dict + ( + id, + customer_id, + date_id, + dict_id, + pid, + resource_type, + resource_code, + resource_label, + show_flag, + sort, + data_type, + `level`, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{dateId}, + + #{item.dictId}, + + #{item.pid}, + + #{item.resourceType}, + + #{item.resourceCode}, + + #{item.resourceLabel}, + + #{item.showFlag}, + + #{item.sort}, + + #{item.dataType}, + + #{item.level}, + + '0', + + 0, + + 'APP_USER', + + now(), + + 'APP_USER', + + now() + ) + + + + + delete from screen_customer_work_record_dict + where customer_id = #{customerId} + limit 1000 + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml new file mode 100644 index 0000000000..1695f1a726 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml @@ -0,0 +1,32 @@ + + + + + + + delete from screen_list_info where CUSTOMER_ID=#{customerId} + + + + INSERT INTO `screen_list_info` ( `ID`, `CUSTOMER_ID`, `DATE_ID`, `LIST_ID`, `LIST_CODE`, `LIST_NAME`, `SORT`, + `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.listId}, + #{item.listCode}, + #{item.listName}, + #{item.sort}, + '0', + 0, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml new file mode 100644 index 0000000000..9bf253e4a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml @@ -0,0 +1,54 @@ + + + + + + + delete from screen_work_record_org_daily + where customer_id = #{customerId} + and DATE_ID = #{dateId} + limit 1000 + + + + INSERT INTO screen_work_record_org_daily + ( + id, + customer_id, + DATE_ID, + org_id, + org_name, + meeting_code, + type_code, + organize_total, + participate_user_total, + avg_participate_user_total, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.orgId}, + #{item.orgName}, + #{item.meetingCode}, + #{item.typeCode}, + #{item.organizeTotal}, + #{item.participateUserTotal}, + #{item.avgParticipateUserTotal}, + '0', + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml new file mode 100644 index 0000000000..4036d053b4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_work_record_org_monthly + ( + id, + customer_id, + month_id, + org_id, + org_name, + meeting_code, + type_code, + organize_total, + participate_user_total, + avg_participate_user_total, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{monthId}, + + #{item.orgId}, + #{item.orgName}, + #{item.meetingCode}, + + #{item.typeCode}, + + #{item.organizeTotal}, + + #{item.participateUserTotal}, + + #{item.avgParticipateUserTotal}, + + '0', + + 0, + + 'APP_USER', + + now(), + + 'APP_USER', + + now() + ) + + + + + delete from screen_work_record_org_monthly + where customer_id = #{customerId} + and month_id = #{monthId} + limit 1000 + + + + + \ No newline at end of file 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 3236a09bea..9e2bd9fe1d 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 @@ -56,9 +56,10 @@ ps.ORG_ID_PATH AS pids, pp.CREATED_TIME FROM project_staff ps - INNER JOIN project_process pp ON ps.PROCESS_ID = pp.ID - INNER JOIN project p ON pp.PROJECT_ID = p.ID + INNER JOIN project_process pp ON ps.PROCESS_ID = pp.ID AND pp.DEL_FLAG = '0' + INNER JOIN project p ON pp.PROJECT_ID = p.ID AND p.DEL_FLAG = '0' WHERE p.CUSTOMER_ID = #{customerId} + AND ps.DEL_FLAG = '0' AND DATE_FORMAT(pp.CREATED_TIME, '%Y%m%d') = #{date} @@ -296,12 +297,13 @@ pp.CREATED_TIME FROM project_process pp - INNER JOIN project p ON pp.PROJECT_ID = p.ID + INNER JOIN project p ON pp.PROJECT_ID = p.ID AND p.DEL_FLAG = '0' LEFT JOIN project_staff ps ON pp.PROJECT_ID = ps.PROJECT_ID AND pp.STAFF_ID = ps.STAFF_ID AND pp.DEPARTMENT_NAME = ps.DEPARTMENT_NAME WHERE 1=1 + AND pp.DEL_FLAG = '0' AND p.CUSTOMER_ID = #{customerId} AND pp.OPERATION = 'response' diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml index 54914e24d0..457801d6b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml @@ -15,6 +15,7 @@ select * from area_code_child + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml index 5c038a2a14..6a57dcb2f7 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml @@ -5,6 +5,10 @@ + + \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/CustomerInfoQueryFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/CustomerInfoQueryFormDTO.java new file mode 100644 index 0000000000..f637cfd191 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/CustomerInfoQueryFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 009、根据客户id查询根客户信息入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/2 22:25 + */ +@Data +public class CustomerInfoQueryFormDTO { + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffPermissionFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffPermissionFormDTO.java new file mode 100644 index 0000000000..457c1bec0d --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffPermissionFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 008、当前用户的数据权限(多客户版本) 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 21:08 + */ +@Data +public class StaffPermissionFormDTO { + + /** + * 当前登录用户 + */ + @NotBlank(message = "staffId不能为空;") + private String staffId; + + /** + * 当前工作人员所属customerId,接口入参传入 + */ + @NotBlank(message = "当前工作人员所属customerId不能为空;") + private String customerId; + + + /** + * 当前工作人员所属agencyId,接口入参传入 + */ + @NotBlank(message = "当前工作人员所属agencyId不能为空") + private String agencyId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/AgencyNodeDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/AgencyNodeDTO.java new file mode 100644 index 0000000000..54ad61602e --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/AgencyNodeDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 008、当前用户的数据权限(多客户版本) 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 20:33 + */ +@Data +public class AgencyNodeDTO implements Serializable { + + private static final long serialVersionUID = -3745920378557792529L; + /** + * 直属机关Id + * */ + private String agencyId; + + /** + * 直属机关名称 + * */ + private String agencyName; + + /** + * 机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + * */ + private String level; + + /** + * 直属机关直属网格列表 + * */ + private List gridList = new ArrayList<>(); + + /** + * 直属机关直属部门列表 + * */ + private List departmentList = new ArrayList<>(); + + /** + * 子集机关列表 + * */ + private List subAgencyList = new ArrayList<>(); + + /** + * 当前agencyId所属的客户id add02.03 + * */ + private String customerId; + + /** + * 当前agencyId对应的地区编码 add02.03 + * */ + private String areaCode; + + private String parentCode; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerInfoQueryResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerInfoQueryResultDTO.java new file mode 100644 index 0000000000..b091020000 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerInfoQueryResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * 009、根据客户id查询根客户信息 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/2 22:26 + */ +@Data +public class CustomerInfoQueryResultDTO { + + /** + * 当前客户id的根级客户id,返回值0代表当前客户是根客户没有上级客户 + */ + private String rootCustomerId; + /** + * 客户id + */ + private String customerId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/DeptNodeDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/DeptNodeDTO.java new file mode 100644 index 0000000000..348a24a80f --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/DeptNodeDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 部门信息 + * @ClassName ExtDeptResultDTO + * @Auth wangc + * @Date 2020-08-17 17:16 + */ +@Data +public class DeptNodeDTO implements Serializable { + private static final long serialVersionUID = 1792371558965832432L; + + /** + * 部门Id + * */ + private String deptId; + + /** + * 部门名称 + * */ + private String deptName; + + /** + * 当前deptId所属的customerId add02.03 + * */ + private String customerId; + + /** + * 当前deptId对应的地区编码 add02.03 + * */ + @JsonIgnore + private String areaCode; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/GridNodeDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/GridNodeDTO.java new file mode 100644 index 0000000000..adcc4628e0 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/GridNodeDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 008、当前用户的数据权限(多客户版本) 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 20:33 + */ +@Data +public class GridNodeDTO implements Serializable { + private static final long serialVersionUID = -4531574240525562587L; + + /** + * 网格Id + * */ + private String gridId; + + /** + * 网格名称 + * */ + private String gridName; + + /** + * 当前gridId所属的客户id add02.03 + * */ + private String customerId; + + /** + * 当前gridId对应的地区编码 add02.03 + * */ + @JsonIgnore + private String areaCode; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffPermissionResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffPermissionResultDTO.java new file mode 100644 index 0000000000..907e40d9f0 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffPermissionResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +/** + * 008、当前用户的数据权限(多客户版本) 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 20:33 + */ +@Data +public class StaffPermissionResultDTO { + /** + * 当前用户拥有客户权限集合 + */ + private List customerIds; + /** + * 当前工作人员所属组织及下级 + */ + private AgencyNodeDTO agencyTree; +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 911e651f55..f33a428e27 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -144,6 +144,18 @@ 5.1.12.RELEASE compile + + com.epmet + oper-crm-client + 2.0.0 + compile + + + com.epmet + data-report-client + 2.0.0 + compile + 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 162b493bd3..4fd89b0dbc 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 @@ -125,5 +125,27 @@ public class OpenUpController { return new Result().ok(openUpService.organizeTree(formDTO)); } + /** + * @param formDTO + * @author yinzuomei + * @description 009、根据客户id查询根客户信息 + * @Date 2021/2/2 22:29 + **/ + @PostMapping("querycustomerinfo") + public Result queryCustomerInfo(@RequestBody CustomerInfoQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(openUpService.queryCustomerInfo(formDTO)); + } + + /** + * @author yinzuomei + * @description 008、当前用户的数据权限(多客户版本) + * @Date 2021/2/3 18:05 + **/ + @PostMapping("permissionv2") + public Result queryStaffPermissionV2(@RequestBody StaffPermissionFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(openUpService.queryStaffPermissionV2(formDTO)); + } } 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 ceecebc6c5..6fbe32afe6 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 @@ -46,4 +46,20 @@ public interface OpenUpService { * @author sun **/ OrganizeTreeResultDTO organizeTree(OrganizeTreeFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 009、根据客户id查询根客户信息 + * @Date 2021/2/2 22:30 + **/ + CustomerInfoQueryResultDTO queryCustomerInfo(CustomerInfoQueryFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 008、当前用户的数据权限(多客户版本) + * @Date 2021/2/3 20:59 + **/ + StaffPermissionResultDTO queryStaffPermissionV2(StaffPermissionFormDTO formDTO); } 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 170c3e32c4..43f50a34c9 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 @@ -1,20 +1,27 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; 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.ModuleConstant; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.DataReportOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.OpenUpService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.UUID; @@ -22,6 +29,7 @@ import java.util.UUID; * @Author zxc * @DateTime 2020/8/13 9:18 上午 */ +@Slf4j @Service public class OpenUpServiceImpl implements OpenUpService { @@ -29,7 +37,10 @@ public class OpenUpServiceImpl implements OpenUpService { private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; - + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private DataReportOpenFeignClient dataReportOpenFeignClient; /** * @Description 网格工作人员 被禁用的、未激活的不显示 * @param formDTO @@ -147,4 +158,56 @@ public class OpenUpServiceImpl implements OpenUpService { return result.getData(); } + /** + * @param formDTO + * @author yinzuomei + * @description 009、根据客户id查询根客户信息 + * @Date 2021/2/2 22:30 + **/ + @Override + public CustomerInfoQueryResultDTO queryCustomerInfo(CustomerInfoQueryFormDTO formDTO) { + //调用oper_crm查询根级客户,如果根级客户是外部客户,则需要调用commonservice获取名称 + Result crmResult = operCrmOpenFeignClient.queryCustomerInfoByCustomerId(formDTO.getCustomerId()); + if (!crmResult.success() && null == crmResult.getData()) { + throw new RenException("调用oper_crm查询客户信息异常"+crmResult.getInternalMsg()); + } + return ConvertUtils.sourceToTarget(crmResult.getData(), CustomerInfoQueryResultDTO.class); + } + + /** + * @param formDTO + * @author yinzuomei + * @description 008、当前用户的数据权限(多客户版本) + * @Date 2021/2/3 20:59 + **/ + @Override + public StaffPermissionResultDTO queryStaffPermissionV2(StaffPermissionFormDTO formDTO) { + //查询当前客户是否有子客户 + Result> crmResult = operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + if (!crmResult.success()) { + throw new RenException("获取当前客户所有子客户异常"); + } + //如果有子客户,根据area_code构造权限树 + if (!CollectionUtils.isEmpty(crmResult.getData())) { + log.warn(String.format("当前客户id%s,子客户列表%s", formDTO.getCustomerId(), JSON.toJSONString(crmResult))); + Result dataStatResult=dataReportOpenFeignClient.queryStaffAgencyTree(formDTO.getAgencyId()); + if (!dataStatResult.success() && null == dataStatResult) { + throw new RenException("调用data-stats服务的XXX接口异常"+dataStatResult.getInternalMsg()); + } + StaffPermissionResultDTO resultDTO = new StaffPermissionResultDTO(); + resultDTO.setCustomerIds(crmResult.getData()); + resultDTO.setAgencyTree(ConvertUtils.sourceToTarget(dataStatResult.getData(), AgencyNodeDTO.class)); + return resultDTO; + } + //不包含子客户走原来的接口 + Result permissionRes = govOrgOpenFeignClient.staffPermissionExt(formDTO.getStaffId()); + if (!permissionRes.success() && null == permissionRes) { + throw new RenException("调用/epmet/ext/staff/permission接口异常"+permissionRes.getInternalMsg()); + } + StaffPermissionResultDTO resultDTO = new StaffPermissionResultDTO(); + resultDTO.setCustomerIds(Arrays.asList()); + resultDTO.setAgencyTree(ConvertUtils.sourceToTarget(permissionRes.getData(), AgencyNodeDTO.class)); + return resultDTO; + } + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/UserMessageConstans.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/UserMessageConstans.java index b67f9251df..455169adf9 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/UserMessageConstans.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/UserMessageConstans.java @@ -8,4 +8,14 @@ package com.epmet.constant; public interface UserMessageConstans { String READ = "read"; String UNREAD = "unread"; + + /** + * 小程序 + */ + String MINI = "mini"; + /** + * 第三方app + */ + String APP = "app"; + } 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 f5c741a212..fe270e280c 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 @@ -253,11 +253,13 @@ public class SysSmsServiceImpl extends BaseServiceImpl } Map> groupBySwitch = parameterResult.stream().collect(Collectors.groupingBy(CrmParameterResultDTO::getSwitchStatus)); List crmParameterTrue = groupBySwitch.get(true); - Map> groupByStatus = crmParameterTrue.stream().collect(Collectors.groupingBy(CrmParameterResultDTO::getBalanceStatus)); - List crmParameterResultDTOS = groupByStatus.get(true); - // 把参数开关打开的,已发送短信的客户更新余额 - if (!CollectionUtils.isEmpty(crmParameterResultDTOS)){ - operCrmOpenFeignClient.updateParamInfo(crmParameterResultDTOS); + if (!CollectionUtils.isEmpty(crmParameterTrue)){ + Map> groupByStatus = crmParameterTrue.stream().collect(Collectors.groupingBy(CrmParameterResultDTO::getBalanceStatus)); + List crmParameterResultDTOS = groupByStatus.get(true); + // 把参数开关打开的,已发送短信的客户更新余额 + if (!CollectionUtils.isEmpty(crmParameterResultDTOS)){ + operCrmOpenFeignClient.updateParamInfo(crmParameterResultDTOS); + } } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java index c5e1bf1ec6..c533112ed2 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java @@ -26,12 +26,14 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.UserMessageConstans; import com.epmet.constant.WxMsgTemplateSubscribeStatus; import com.epmet.constant.WxmpMessageConstant; import com.epmet.dao.WxmpResiUserSubscribeDao; import com.epmet.dao.WxmpTemplateMsgSubscribeStatusDao; import com.epmet.dao.WxmpUserSubscribeRecordDao; import com.epmet.dao.WxmpWorkUserSubscribeDao; +import com.epmet.dto.PaCustomerDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; @@ -140,6 +142,13 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { if (!(msgList.size() > NumConstant.ZERO)) { throw new RenException("待发送消息不能为空"); } + //2021.1.19 根据客户类型判断是否允许推送微信消息【兼容泸州】 sun start + PaCustomerDTO pc = thirdCustomer(msgList.get(NumConstant.ZERO).getCustomerId()); + if (!pc.getType().equals(UserMessageConstans.MINI)) { + logger.warn(String.format("当前客户不允许推送微信消息,客户Id->%s", msgList.get(NumConstant.ZERO).getCustomerId())); + return; + } + //2021.1.19 end int succecssCount = 0; // 获取templateId CustomerTemplateListFormDTO customerTemplateListFormDTO = new CustomerTemplateListFormDTO(); @@ -337,6 +346,13 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { if (msgList.size() == 0){ return; } + //2021.1.19 根据客户类型判断是否允许推送微信消息【兼容泸州】 sun start + PaCustomerDTO pc = thirdCustomer(msgList.get(NumConstant.ZERO).getCustomerId()); + if (!pc.getType().equals(UserMessageConstans.MINI)) { + logger.warn(String.format("当前客户不允许推送微信消息,客户Id->%s", msgList.get(NumConstant.ZERO).getCustomerId())); + return; + } + //2021.1.19 end // 获取templateId TemplateListV2FormDTO templateListV2FormDTO = new TemplateListV2FormDTO(); templateListV2FormDTO.setCustomerId(msgList.get(0).getCustomerId()); @@ -873,8 +889,33 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { if(msgSubscribeStatusDao.updateUserSubscribe(formDTO) data = HttpClientManager.getInstance().sendGet(url, null); + logger.info("WxmpMessageServiceImpl.thirdCustomer:httpclient->url:" + url + ",结果->" + data); + if (!data.success()) { + logger.error(String.format("调用third服务查询客户基础数据失败,客户Id->%s", customerId)); + throw new RenException(data.getCode(), data.getInternalMsg()); + } + JSONObject toResult = JSON.parseObject(data.getData()); + Result result = ConvertUtils.mapToEntity(toResult, Result.class); + if (null != toResult.get("code")) { + result.setCode(((Integer) toResult.get("code")).intValue()); + } + if (!result.success()) { + throw new RenException(result.getCode()); + } + Object RegisterResult = result.getData(); + JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); + PaCustomerDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, PaCustomerDTO.class); + return resultDTO; } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.13__create_sys_msg_table.sql b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.13__create_sys_msg_table.sql new file mode 100644 index 0000000000..4796003268 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.13__create_sys_msg_table.sql @@ -0,0 +1,13 @@ +CREATE TABLE `system_message` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `MSG_TYPE` varchar(32) NOT NULL COMMENT '消息类型。init_customer:客户初始化', + `SEND_APPROACH` varchar(32) NOT NULL COMMENT '消息发送途径', + `CONTENT` varchar(1024) NOT NULL COMMENT '消息内容', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人(发布消息的人)', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='系统消息表' \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java index d5b9edd6c6..63ffc6a3c0 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.InitPointRuleResultDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback; @@ -26,4 +27,11 @@ public interface EpmetPointOpenFeignClient { **/ @PostMapping("/point/resi/point/mypoint") Result myPoint(CommonUserFormDTO param); + + /** + * @Description 新客户初始化积分规则 + * @author sun + **/ + @PostMapping("/point/opback/initpointrule") + Result initPointRule(); } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java index 7d5cda718f..ab0688e134 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.InitPointRuleResultDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.EpmetPointOpenFeignClient; @@ -20,4 +21,9 @@ public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignCli public Result myPoint(CommonUserFormDTO param) { return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint",param); } + + @Override + public Result initPointRule() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule"); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index ab2a23e1de..459d5b4d08 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -240,7 +240,7 @@ --> 8112 - test + prod diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java index 6bace14ee9..b4404dab1f 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java @@ -158,7 +158,7 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl rankList = @@ -199,7 +199,6 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl userIds = rankList.stream().map(ResiPointRankResultDTO::getUserId).collect(Collectors.toList()); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml index 983301e016..d49ca80396 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -25,6 +25,8 @@ diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml index e64d984a00..bcf4735cb8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml @@ -48,6 +48,9 @@ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/constant/ThirdConstant.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/constant/ThirdConstant.java new file mode 100644 index 0000000000..b72939808a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/constant/ThirdConstant.java @@ -0,0 +1,17 @@ +package com.epmet.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/1/19 9:43 + */ +public interface ThirdConstant { + /** + * 小程序 + */ + String MINI = "mini"; + /** + * 第三方app + */ + String APP = "app"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerDTO.java index 8beef22698..c06721dc55 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerDTO.java @@ -48,6 +48,11 @@ public class PaCustomerDTO implements Serializable { */ private Integer isInitialize; + /** + * 客户类型 mini 微信小程序客户 app 第三方app客户 + */ + private String type; + /** * 数据来源(dev:开发 test:体验 prod:生产) */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java index de5cc61d7a..d546f37046 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java @@ -6,6 +6,8 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerMpDTO; +import com.epmet.dto.PaCustomerDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.*; @@ -35,6 +37,12 @@ public class PaCustomerController { @Autowired private CustomerMpService customerMpService; + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PaCustomerDTO data = paCustomerService.get(id); + return new Result().ok(data); + } + /** * @param formDTO * @return diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerEntity.java index 71a5cf6fc4..d2731cf9bd 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerEntity.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerEntity.java @@ -48,6 +48,11 @@ public class PaCustomerEntity extends BaseEpmetEntity { */ private Integer isInitialize; + /** + * 客户类型 mini 微信小程序客户 app 第三方app客户 + */ + private String type; + /** * 数据来源(dev:开发 test:体验 prod:生产) */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index e230b87f3b..adabeb3a69 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -141,15 +141,19 @@ public class CodeServiceImpl implements CodeService { if(CodeConstant.RESI.equals(formDTO.getClientType())) { resiName = getNickName(authInfo.getAuthorizerAppid()); AuthorizationInfoDTO workAuthInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), CodeConstant.WORK); - workName = getNickName(workAuthInfo.getAuthorizerAppid()); + if (null != workAuthInfo) { + workName = getNickName(workAuthInfo.getAuthorizerAppid()); + miniInfoDao.updateNickName(formDTO.getCustomerId(), CodeConstant.WORK, workName); + } miniInfoDao.updateNickName(formDTO.getCustomerId(), formDTO.getClientType(), resiName); - miniInfoDao.updateNickName(formDTO.getCustomerId(), CodeConstant.WORK, workName); } else { workName = getNickName(authInfo.getAuthorizerAppid()); AuthorizationInfoDTO resiAuthInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), CodeConstant.RESI); - resiName = getNickName(resiAuthInfo.getAuthorizerAppid()); + if (null != resiAuthInfo) { + resiName = getNickName(resiAuthInfo.getAuthorizerAppid()); + miniInfoDao.updateNickName(formDTO.getCustomerId(), CodeConstant.RESI, resiName); + } miniInfoDao.updateNickName(formDTO.getCustomerId(), formDTO.getClientType(), workName); - miniInfoDao.updateNickName(formDTO.getCustomerId(), CodeConstant.RESI, resiName); } //获取小程序居民端与工作端名称 @@ -828,6 +832,7 @@ public class CodeServiceImpl implements CodeService { } private String getNickName(String appId) { + String nickName = ""; JSONObject jsonObject = new JSONObject(); jsonObject.put(ModuleConstant.COMPONENT_APP_ID,componentAppId); jsonObject.put(ModuleConstant.AUTHORIZER_APP_ID,appId); @@ -835,8 +840,10 @@ public class CodeServiceImpl implements CodeService { String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_GET_AUTHORIZER_INFO + componentAccessToken , JSON.toJSONString(jsonObject)).getData(); Map map = JSON.parseObject(data, Map.class); Map authInfo = (Map) map.get(ModuleConstant.AUTHORIZER_INFO); - ConvertUtils.mapToEntity(authInfo, MiniInfoFormDTO.class).getNick_name(); - return ConvertUtils.mapToEntity(authInfo, MiniInfoFormDTO.class).getNick_name(); + if (StringUtils.isNotEmpty(ConvertUtils.mapToEntity(authInfo, MiniInfoFormDTO.class).getNick_name())) { + nickName = ConvertUtils.mapToEntity(authInfo, MiniInfoFormDTO.class).getNick_name(); + } + return nickName; } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.12__alter_pa_customer.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.12__alter_pa_customer.sql new file mode 100644 index 0000000000..b7b4f4f770 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.12__alter_pa_customer.sql @@ -0,0 +1,3 @@ +ALTER TABLE `pa_customer` +ADD COLUMN `TYPE` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'mini' +COMMENT '客户类型 mini 微信小程序客户 app 第三方app客户' AFTER `IS_INITIALIZE`; \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml index 9926104565..ae01037bc0 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml @@ -102,7 +102,8 @@ AND ai.CLIENT_TYPE = #{clientType} ORDER BY - pc.CUSTOMER_NAME, + pc.created_time DESC, + ai.CLIENT_TYPE diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java index b278b9f585..c2dbdb85eb 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java @@ -44,5 +44,9 @@ public class IssueResultDTO implements Serializable { */ private String topicId; + /** + * 上级-网格名 20210224add + */ + private String gridName; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index c8e1118b77..38bc581f8c 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -269,4 +269,7 @@ public interface GovIssueOpenFeignClient { */ @PostMapping("/gov/issue/issuesharelink/sharelinkinfo") Result shareLinkInfo(@RequestParam String shareLinkId); + + @PostMapping("/gov/issue/issue/detail") + Result queryIssueDetail(@RequestBody IssueDetailFormDTO formDTO); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index 2a00463fa8..0046975f18 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -21,7 +21,6 @@ import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.RequestParam; import java.util.List; import java.util.Map; @@ -233,4 +232,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result shareLinkInfo(String shareLinkId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "shareLinkInfo", shareLinkId); } + + @Override + public Result queryIssueDetail(IssueDetailFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "detail", formDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java index 9d0ac9efd7..1db853f6db 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java @@ -112,4 +112,6 @@ public interface IssueConstant { * 审核状态:驳回 */ String REJECTED="rejected"; + + String PROJECT_PROCESS_LIST_FAILURE = "查询项目进展失败......"; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index 8ccb30aa15..c64573730a 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -34,7 +34,7 @@ public class IssueController { /** * @Description 议题详情 * @param issueDetail - * @author zxc + * @author zxc 这个接口内部feign也调用,不要加权限注解 * @date 2020/5/11 9:42 */ @PostMapping(value = "detail") diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java index db8fb0d7eb..5f674801ca 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java @@ -20,9 +20,11 @@ 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.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.constant.IssueConstant; import com.epmet.dao.IssueProcessDao; import com.epmet.dao.IssueProjectRelationDao; @@ -39,6 +41,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.util.ArrayList; import java.util.Arrays; @@ -137,17 +140,27 @@ public class IssueProcessServiceImpl extends BaseServiceImpl listResult = new ArrayList(); IssueDTO issueDTO = issueService.get(issueId.getIssueId()); String issueStatus = issueDTO.getIssueStatus(); - if (issueStatus.equals(IssueConstant.ISSUE_CLOSED)){//已关闭——处理进展 + if (issueStatus.equals(IssueConstant.ISSUE_CLOSED)){ + //已关闭——处理进展 listResult = baseDao.issueProcess(issueId); - }else if (issueStatus.equals(IssueConstant.ISSUE_SHIFT_PROJECT)){//已转项目——处理进展 + }else if (issueStatus.equals(IssueConstant.ISSUE_SHIFT_PROJECT)){ + //已转项目——处理进展 String projectId = issueProjectRelationDao.selectProjectIdByIssueId(issueId.getIssueId()); if (!StringUtils.isBlank(projectId)) { ProcessProjectIdFormDTO formDTO = new ProcessProjectIdFormDTO(); formDTO.setProjectId(projectId); - listResult = govProjectFeignClient.projectProcessList(formDTO).getData(); + Result> resultDTO = govProjectFeignClient.projectProcessList(formDTO); + if (!resultDTO.success()){ + throw new RenException(IssueConstant.PROJECT_PROCESS_LIST_FAILURE); + } + if (!CollectionUtils.isEmpty(resultDTO.getData())){ + listResult = resultDTO.getData(); + } //转议题信息 ProcessListResultDTO issueProcessResultDTO = issueProcessDao.issueBeginInfo(issueId); - listResult.add(issueProcessResultDTO); + if (null != issueProcessResultDTO) { + listResult.add(issueProcessResultDTO); + } } }else { return new ArrayList<>(); 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 d23fddf9b5..fb3c07e7e8 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 @@ -187,6 +187,15 @@ public class IssueServiceImpl extends BaseServiceImpl imp public IssueResultDTO detail(IssueDetailFormDTO issueDetail) { //议题信息 IssueResultDTO issueResult = issueDao.issueDetail(issueDetail); + if (null != issueResult && StringUtils.isNotBlank(issueResult.getGridId())) { + BelongGridNameFormDTO formDTO = new BelongGridNameFormDTO(); + formDTO.setGridId(issueResult.getGridId()); + Result result = govOrgOpenFeignClient.getGridNameByGridId(formDTO); + logger.info("根据网格id查询网格名称接口返参:" + JSON.toJSONString(result)); + if (result.success() && null != result.getData()) { + issueResult.setGridName(result.getData().getBelongsGridName()); + } + } return issueResult; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 4c2878e0e5..1b9dbdec01 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -54,6 +54,8 @@ AND GRID_ID = #{gridId} AND ISSUE_STATUS = 'shift_project' ORDER BY UPDATED_TIME DESC + LIMIT #{pageNo}, + #{pageSize} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/MineServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/MineServiceImpl.java index 4d9c0e30c8..77c8502971 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/MineServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/MineServiceImpl.java @@ -46,7 +46,7 @@ public class MineServiceImpl implements MineService { public Result resetPassword(StaffResetPassWordFormDTO formDTO) { //1、两次填写的密码需要保持一致 if(!formDTO.getNewPassword().equals(formDTO.getConfirmNewPassword())){ - logger.error(String.format("两次填写的新密码不一致,新密码%s,确认新密码%s",formDTO.getNewPassword(),formDTO.getConfirmNewPassword())); + logger.warn(String.format("两次填写的新密码不一致,新密码%s,确认新密码%s",formDTO.getNewPassword(),formDTO.getConfirmNewPassword())); throw new RenException(EpmetErrorCode.PASSWORD_NOT_FIT.getCode()); } //2、校验密码规则:密码必须8-20个字符,而且同时包含大小写字母和数字 @@ -63,7 +63,7 @@ public class MineServiceImpl implements MineService { if(updatePassWordResult.success()){ logger.info(String.format("调用%s服务,修改密码成功", ServiceConstant.EPMET_USER_SERVER)); }else{ - logger.error(String.format("调用%s服务,修改密码失败,返参:%s", ServiceConstant.EPMET_USER_SERVER, + logger.warn(String.format("调用%s服务,修改密码失败,返参:%s", ServiceConstant.EPMET_USER_SERVER, JSON.toJSONString(updatePassWordResult))); return new Result().error(EpmetErrorCode.PASSWORD_UPDATE_FAILED.getCode()); } @@ -73,7 +73,7 @@ public class MineServiceImpl implements MineService { private boolean checkPassWord(String password) { boolean flag=false; if(password.length()<8||password.length()>20){ - logger.error(String.format("密码长度应为8-20位,当前输入密码%s,长度为%s",password,password.length())); + logger.warn(String.format("密码长度应为8-20位,当前输入密码%s,长度为%s",password,password.length())); return flag; } boolean numFlag=false; @@ -101,7 +101,7 @@ public class MineServiceImpl implements MineService { if(numFlag&&bigLetter&&smallLetter){ flag=true; }else{ - logger.error(String.format("当前密码%s,是否包含数字%s,是否包含大写字母%s,是否包含小写字母%s",password,numFlag,bigLetter,smallLetter)); + logger.warn(String.format("当前密码%s,是否包含数字%s,是否包含大写字母%s,是否包含小写字母%s",password,numFlag,bigLetter,smallLetter)); } return flag; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java index f7380580b4..ea30dbd600 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -127,4 +128,8 @@ public class CustomerAgencyDTO implements Serializable { */ private String district; + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListCustomerGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListCustomerGridFormDTO.java index 21a790fe39..3724abbf02 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListCustomerGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListCustomerGridFormDTO.java @@ -35,4 +35,6 @@ public class ListCustomerGridFormDTO implements Serializable{ * 每页显示数量 * */ private Integer pageSize = 20; + + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java index 4b0d67ca35..d0e4558346 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java @@ -23,4 +23,9 @@ public class ExtDeptResultDTO implements Serializable { * 部门名称 * */ private String deptName; + + /** + * 当前deptId所属的customerId add02.03 + * */ + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java index 018c298c50..90641f29d4 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java @@ -23,4 +23,9 @@ public class ExtGridResultDTO implements Serializable { * 网格名称 * */ private String gridName; + + /** + * 当前gridId所属的客户id add02.03 + * */ + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java index 9aa4c9b982..fbaf784c25 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java @@ -45,4 +45,9 @@ public class ExtStaffPermissionResultDTO implements Serializable { * 子集机关列表 * */ private List subAgencyList = new ArrayList<>(); + + /** + * 当前agencyId所属的客户id add02.03 + * */ + private String customerId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index c1478df01d..c304943b30 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -168,6 +168,14 @@ public interface CustomerAgencyDao extends BaseDao { **/ List selectDeptList(@Param("agencyId") String agencyId); + /** + * @param agencyId + * @author yinzuomei + * @description 根据组织查询网格列表 + * @Date 2021/2/4 21:54 + **/ + List selectGridList(@Param("agencyId") String agencyId); + /** * @param staffId * @return diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java index 6a669609eb..5306281a03 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.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; - /** * 机关单位信息表 * @@ -97,4 +94,8 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private String district; + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 241f9d9a67..536cfdb330 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -38,6 +38,7 @@ import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerDepartmentService; import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerStaffAgencyService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,6 +55,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-04-20 */ +@Slf4j @Service public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl implements CustomerStaffAgencyService { @@ -146,7 +148,11 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl customerResult = operCrmFeignClient.getCustomerInfo(customerDTO); - resultDTO.setCustomerName(customerResult.getData().getCustomerName()); + if (customerResult.success() && null != customerResult.getData()) { + resultDTO.setCustomerName(customerResult.getData().getCustomerName()); + }else{ + log.warn(String.format("根据客户id:%s,查询客户信息失败",customerDTO.getId())); + } return new Result().ok(resultDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.3__customer_agency_addparentareacode.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.3__customer_agency_addparentareacode.sql new file mode 100644 index 0000000000..743c77ffba --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.3__customer_agency_addparentareacode.sql @@ -0,0 +1 @@ +alter table customer_agency add column `PARENT_AREA_CODE` varchar(30) DEFAULT NULL COMMENT '当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701'; \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 665fcba28f..e7f2621649 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -208,14 +208,17 @@ - + + + + SELECT ID AS deptId, - DEPARTMENT_NAME AS deptName + DEPARTMENT_NAME AS deptName, + CUSTOMER_ID as customerId FROM CUSTOMER_DEPARTMENT dept WHERE @@ -262,17 +263,26 @@ AND AGENCY_ID = #{agencyId} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerRelationDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerRelationDTO.java new file mode 100644 index 0000000000..463ac3abc5 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerRelationDTO.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-03 + */ +@Data +public class CustomerRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 父级客户id;如果是顶级客户,此列=0 + */ + private String parentCustomerId; + + /** + * 当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0 + */ + private String pids; + + /** + * 当前客户类型取值: external:外部客户,internal:内部客户 + */ + private String customerType; + + /** + * 父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0 + */ + private String parentCustomerType; + + /** + * open,closed是否启用 + */ + private String status; + + /** + * 当前客户级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 当前客户的地区编码,实际就是根组织的area_code + */ + private String areaCode; + + /** + * 删除标识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/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/ApiServiceFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/ApiServiceFormDTO.java new file mode 100644 index 0000000000..a111ca87c6 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/ApiServiceFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ApiServiceFormDTO { + + public interface GetByCustomerId extends PageFormDTO.AddUserShowGroup {} + + @NotBlank(message = "客户ID不能为空", groups = { GetByCustomerId.class }) + private String customerId; + +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerRelationInfoResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerRelationInfoResultDTO.java new file mode 100644 index 0000000000..99fb265f8a --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerRelationInfoResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * 009、根据客户id查询根客户信息 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 11:15 + */ +@Data +public class CustomerRelationInfoResultDTO { + /** + * 客户id + */ + private String customerId; + + /** + * 当前客户id的根级客户id,返回值0代表当前客户是根客户没有上级客户 + */ + private String rootCustomerId; + +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/ThirdplatApiserviceResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/ThirdplatApiserviceResultDTO.java new file mode 100644 index 0000000000..4737bf32d4 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/ThirdplatApiserviceResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class ThirdplatApiserviceResultDTO { + /** + * 客户id + */ + private String customerId; + + /** + * aipService名称 + */ + private String apiServiceName; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java index 496dcd636a..0f4313dfad 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java @@ -4,14 +4,15 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAppDTO; import com.epmet.dto.CustomerDTO; -import com.epmet.dto.form.CrmParameterFormDTO; -import com.epmet.dto.form.CustomerAppSecretFormDTO; -import com.epmet.dto.form.CustomerManagerFormDTO; -import com.epmet.dto.form.GridCountFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.dto.result.CustomerRelationInfoResultDTO; import com.epmet.dto.result.GridCountResultDTO; +import com.epmet.dto.result.ThirdplatApiserviceResultDTO; import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -24,7 +25,7 @@ import java.util.List; * @date 2020/6/4 13:25 */ @FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class) -//@FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class, url = "localhost:8090") +// @FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class, url = "localhost:8090") public interface OperCrmOpenFeignClient { /** * 获取客户信息 @@ -94,4 +95,31 @@ public interface OperCrmOpenFeignClient { */ @PostMapping("/oper/crm/parameter/parameterupdate") Result updateParamInfo(@RequestBody List formDTOS); + + /** + * @Description 根据客户id查询配置的apiService + * @return + * @author wxz + * @date 2021.01.20 15:55 + */ + @PostMapping("/oper/crm/customer/get-apiservice-by-customerid") + Result getApiServiceByCustomerId(@RequestBody ApiServiceFormDTO form); + + /** + * @param customerId + * @author yinzuomei + * @description 009、根据客户id查询根客户信息 + * @Date 2021/2/3 12:44 + **/ + @GetMapping("/oper/crm/customer/querycustomerinfobycustomerid/{customerId}") + Result queryCustomerInfoByCustomerId(@PathVariable("customerId") String customerId); + + /** + * @param customerId + * @author yinzuomei + * @description 根据customerId查询其所有下级子客户id + * @Date 2021/2/3 21:34 + **/ + @GetMapping("/oper/crm/customer/getallsubcustomerids/{customerId}") + Result> getAllSubCustomerIds(@PathVariable("customerId") String customerId); } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java index d18f98065a..5de09ce167 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java @@ -5,12 +5,11 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAppDTO; import com.epmet.dto.CustomerDTO; -import com.epmet.dto.form.CrmParameterFormDTO; -import com.epmet.dto.form.CustomerAppSecretFormDTO; -import com.epmet.dto.form.CustomerManagerFormDTO; -import com.epmet.dto.form.GridCountFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.dto.result.CustomerRelationInfoResultDTO; import com.epmet.dto.result.GridCountResultDTO; +import com.epmet.dto.result.ThirdplatApiserviceResultDTO; import com.epmet.feign.OperCrmOpenFeignClient; import org.springframework.stereotype.Component; @@ -69,4 +68,31 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { public Result updateParamInfo(List formDTOS) { return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "updateParamInfo", formDTOS); } + + @Override + public Result getApiServiceByCustomerId(ApiServiceFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getApiServiceByCustomerId", form); + } + + /** + * @param customerId + * @author yinzuomei + * @description 009、根据客户id查询根客户信息 + * @Date 2021/2/3 12:44 + **/ + @Override + public Result queryCustomerInfoByCustomerId(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "queryCustomerInfoByCustomerId", customerId); + } + + /** + * @param customerId + * @author yinzuomei + * @description 根据customerId查询其所有下级子客户id + * @Date 2021/2/3 21:34 + **/ + @Override + public Result> getAllSubCustomerIds(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllSubCustomerIds", customerId); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 610cdd9734..cc8a8b2112 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -99,6 +99,18 @@ epmet-commons-rocketmq 2.0.0 + + com.epmet + epmet-point-client + 2.0.0 + compile + + + com.epmet + data-statistical-client + 2.0.0 + compile + diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index e4ae80fc6e..c5330a9abd 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -31,13 +31,13 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.CustomerDetailResultDTO; -import com.epmet.dto.result.CustomerInfoResultDTO; -import com.epmet.dto.result.GridCountResultDTO; -import com.epmet.dto.result.ValidCustomerResultDTO; +import com.epmet.dto.result.*; import com.epmet.excel.CustomerExcel; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.service.CustomerRelationService; import com.epmet.service.CustomerService; +import com.epmet.service.CustomerThirdplatApiServiceService; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -63,10 +63,14 @@ public class CustomerController { @Autowired private CustomerService customerService; - + @Autowired + private CustomerRelationService customerRelationService; @Autowired private GovOrgFeignClient govOrgFeignClient; + @Autowired + private CustomerThirdplatApiServiceService customerThirdplatApiServiceService; + @GetMapping("page") public Result> page(@RequestParam Map params) { PageData page = customerService.page(params); @@ -330,4 +334,46 @@ public class CustomerController { return new Result(); } + /** + * @Description 根据客户id查询配置的apiService + * @return + * @author wxz + * @date 2021.01.20 15:55 + */ + @PostMapping("get-apiservice-by-customerid") + public Result getApiServiceByCustomerId(@RequestBody ApiServiceFormDTO form) { + ValidatorUtils.validateEntity(form, ApiServiceFormDTO.GetByCustomerId.class); + String customerId = form.getCustomerId(); + return new Result().ok(customerThirdplatApiServiceService.getByCustomerId(customerId)); + } + + /** + * @param customerId + * @author yinzuomei + * @description 009、根据客户id查询根客户信息 + * @Date 2021/2/3 12:52 + **/ + @GetMapping("querycustomerinfobycustomerid/{customerId}") + public Result queryCustomerInfoByCustomerId(@PathVariable("customerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + CustomerRelationInfoResultDTO resultDTO=customerService.queryCustomerInfoByCustomerId(customerId); + return new Result().ok(resultDTO); + } + return new Result<>(); + } + + /** + * @param customerId + * @author yinzuomei + * @description 根据customerId查询其所有下级子客户id + * @Date 2021/2/3 21:37 + **/ + @GetMapping("getallsubcustomerids/{customerId}") + public Result> getAllSubCustomerIds(@PathVariable("customerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + List subCustomerIds=customerRelationService.getAllSubCustomerIds(customerId); + return new Result>().ok(subCustomerIds); + } + return new Result<>(); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerRelationDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerRelationDao.java new file mode 100644 index 0000000000..948937062c --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerRelationDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerRelationDTO; +import com.epmet.entity.CustomerRelationEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-03 + */ +@Mapper +public interface CustomerRelationDao extends BaseDao { + + /** + * 根据客户id,查询客户关系表 + * + * @param customerId + * @return com.epmet.dto.CustomerRelationDTO + */ + CustomerRelationDTO selectByCustomerId(String customerId); + + /** + * 根据customerId查询其所有下级子客户id + * + * @param customerId + * @return java.util.List + */ + List selectAllSubCustomerIds(String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerThirdplatApiserviceDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerThirdplatApiserviceDao.java new file mode 100644 index 0000000000..52f05556b1 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerThirdplatApiserviceDao.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ThirdplatApiserviceResultDTO; +import com.epmet.entity.CustomerThirdplatApiserviceEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 客户所属的第三方平台的apiService列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-20 + */ +@Mapper +public interface CustomerThirdplatApiserviceDao extends BaseDao { + + ThirdplatApiserviceResultDTO getByCustomerId(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerRelationEntity.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerRelationEntity.java new file mode 100644 index 0000000000..9c33664b50 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerRelationEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_relation") +public class CustomerRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 父级客户id;如果是顶级客户,此列=0 + */ + private String parentCustomerId; + + /** + * 当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0 + */ + private String pids; + + /** + * 当前客户类型取值: external:外部客户,internal:内部客户 + */ + private String customerType; + + /** + * 父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0 + */ + private String parentCustomerType; + + /** + * open,closed是否启用 + */ + private String status; + + /** + * 当前客户级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 当前客户的地区编码,实际就是根组织的area_code + */ + private String areaCode; + +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerThirdplatApiserviceEntity.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerThirdplatApiserviceEntity.java new file mode 100644 index 0000000000..59be94ffb9 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerThirdplatApiserviceEntity.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; + +/** + * 客户所属的第三方平台的apiService列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_thirdplat_apiservice") +public class CustomerThirdplatApiserviceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * aipService名称 + */ + private String apiServiceName; + +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerRelationService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerRelationService.java new file mode 100644 index 0000000000..2776c8b0cf --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerRelationService.java @@ -0,0 +1,124 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerRelationDTO; +import com.epmet.entity.CustomerRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-03 + */ +public interface CustomerRelationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerRelationDTO + * @author generator + * @date 2021-02-03 + */ + CustomerRelationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-03 + */ + void save(CustomerRelationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-03 + */ + void update(CustomerRelationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-03 + */ + void delete(String[] ids); + + /** + * 根据客户id,查询客户关系表 + * + * @param customerId + * @return void + * @author generator + * @date 2021-02-03 + */ + CustomerRelationDTO getByCustomerId(String customerId); + + /** + * 获取某个客户的根客户id + * + * @param customerId + * @return void + * @author generator + * @date 2021-02-03 + */ + String getRootCustomerId(String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 根据customerId查询其所有下级子客户id + * @Date 2021/2/3 21:37 + **/ + List getAllSubCustomerIds(String customerId); +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index c9745552ed..82e872e511 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -22,10 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.CustomerDetailResultDTO; -import com.epmet.dto.result.CustomerInfoResultDTO; -import com.epmet.dto.result.GridCountResultDTO; -import com.epmet.dto.result.ValidCustomerResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerEntity; import java.text.ParseException; @@ -222,4 +219,11 @@ public interface CustomerService extends BaseService { */ void updateCustomerParameter(UpdateCustomerParameterFormDTO formDTO) throws ParseException; + /** + * @param customerId + * @author yinzuomei + * @description 009、根据客户id查询根客户信息 返参DTO + * @Date 2021/2/3 12:52 + **/ + CustomerRelationInfoResultDTO queryCustomerInfoByCustomerId(String customerId); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerThirdplatApiServiceService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerThirdplatApiServiceService.java new file mode 100644 index 0000000000..a1f9fa91e9 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerThirdplatApiServiceService.java @@ -0,0 +1,16 @@ +package com.epmet.service; + +import com.epmet.dto.result.ThirdplatApiserviceResultDTO; +import com.epmet.entity.CustomerThirdplatApiserviceEntity; + +public interface CustomerThirdplatApiServiceService { + + /** + * @Description 根据客户id查询客户第三方平台的ApiService + * @return + * @author wxz + * @date 2021.01.20 15:47 + */ + ThirdplatApiserviceResultDTO getByCustomerId(String customerId); + +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java new file mode 100644 index 0000000000..72727b7f22 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java @@ -0,0 +1,152 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.CustomerRelationDao; +import com.epmet.dto.CustomerRelationDTO; +import com.epmet.entity.CustomerRelationEntity; +import com.epmet.service.CustomerRelationService; +import lombok.extern.slf4j.Slf4j; +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; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-03 + */ +@Slf4j +@Service +public class CustomerRelationServiceImpl extends BaseServiceImpl implements CustomerRelationService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerRelationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerRelationDTO.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 CustomerRelationDTO get(String id) { + CustomerRelationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerRelationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerRelationDTO dto) { + CustomerRelationEntity entity = ConvertUtils.sourceToTarget(dto, CustomerRelationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerRelationDTO dto) { + CustomerRelationEntity entity = ConvertUtils.sourceToTarget(dto, CustomerRelationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 根据客户id,查询客户关系表 + * + * @param customerId + * @return void + * @author generator + * @date 2021-02-03 + */ + @Override + public CustomerRelationDTO getByCustomerId(String customerId) { + return baseDao.selectByCustomerId(customerId); + } + + /** + * 获取某个客户的根客户id + * + * @param customerId + * @return void + * @author generator + * @date 2021-02-03 + */ + @Override + public String getRootCustomerId(String customerId) { + CustomerRelationDTO customerRelationDTO=this.getByCustomerId(customerId); + if (null == customerRelationDTO) { + log.info(String.format("根据客户id:%s查找customer_relation为空",customerId)); + return StrConstant.EPMETY_STR; + } + log.info(JSON.toJSONString(customerRelationDTO,true)); + if (!NumConstant.ZERO_STR.equals(customerRelationDTO.getParentCustomerId())) { + log.info("parentCustomerId is not equals 0 so continue"); + return getRootCustomerId(customerRelationDTO.getParentCustomerId()); + } + return customerRelationDTO.getCustomerId(); + } + + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 根据customerId查询其所有下级子客户id + * @Date 2021/2/3 21:37 + **/ + @Override + public List getAllSubCustomerIds(String customerId) { + return baseDao.selectAllSubCustomerIds(customerId); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 9080d1573f..1fadbd8443 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -33,15 +33,18 @@ import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ModuleConstant; import com.epmet.constant.RoleKeyConstants; +import com.epmet.constant.ThirdConstant; import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserWorkType; import com.epmet.dao.CustomerDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.entity.CustomerEntity; import com.epmet.feign.*; import com.epmet.redis.CustomerRedis; +import com.epmet.service.CustomerRelationService; import com.epmet.service.CustomerService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -84,6 +87,12 @@ public class CustomerServiceImpl extends BaseServiceImpl page(Map params) { @@ -538,14 +547,32 @@ public class CustomerServiceImpl extends BaseServiceImpl resultPoint = epmetPointOpenFeignClient.initPointRule(); + if (!resultPoint.success()) { + throw new RenException(resultPoint.getCode(), resultPoint.getInternalMsg()); + } + + //9.新客户初始化评价指标 权重 + InitCustomerIndexForm indexForm = new InitCustomerIndexForm(); + indexForm.setCustomerId(formDTO.getCustomerId()); + Result resultData = dataStatisticalOpenFeignClient.initCustomerIndex(indexForm); + if (!resultData.success()) { + throw new RenException(resultData.getCode(), resultData.getInternalMsg()); } + //2021.1.25 end } @@ -738,4 +765,24 @@ public class CustomerServiceImpl extends BaseServiceImpl apiServiceMap = redisUtils.hGetAll(RedisKeys.getCustomerApiServiceKey(customerId)); + if (!CollectionUtils.isEmpty(apiServiceMap)) { + apiService = BeanUtil.mapToBean(apiServiceMap, ThirdplatApiserviceResultDTO.class, true); + } + + if (apiService == null) { + apiService = thirdplatApiserviceDao.getByCustomerId(customerId); + redisUtils.hMSet(RedisKeys.getCustomerApiServiceKey(customerId), BeanUtil.beanToMap(apiService)); + } + + return apiService; + } +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.6__create_thirdplat_apiservice.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.6__create_thirdplat_apiservice.sql new file mode 100644 index 0000000000..491d1d14c9 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.6__create_thirdplat_apiservice.sql @@ -0,0 +1,14 @@ +create table customer_thirdplat_apiservice +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) not null comment '客户id', + `API_SERVICE_NAME` varchar(64) not null comment 'aipService名称', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间' +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + collate utf8mb4_general_ci COMMENT ='客户所属的第三方平台的apiService列表'; diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.7__create_customer_relation.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.7__create_customer_relation.sql new file mode 100644 index 0000000000..5dc8c204c0 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.7__create_customer_relation.sql @@ -0,0 +1,18 @@ +CREATE TABLE `customer_relation` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `PARENT_CUSTOMER_ID` varchar(64) NOT NULL COMMENT '父级客户id;如果是顶级客户,此列=0', + `PIDS` varchar(255) NOT NULL COMMENT '当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0', + `CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '当前客户类型取值: external:外部客户,internal:内部客户', + `PARENT_CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0', + `STATUS` varchar(10) NOT NULL DEFAULT 'open' COMMENT 'open,closed是否启用', + `LEVEL` varchar(32) NOT NULL COMMENT '当前客户级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `AREA_CODE` varchar(32) NOT NULL COMMENT '当前客户的地区编码,实际就是根组织的area_code', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识0未删除1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户关系表(01.14 add)'; \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml index 0c531843f6..2b2af13d83 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerRelationDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerRelationDao.xml new file mode 100644 index 0000000000..f757a48b51 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerRelationDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerThirdplatApiserviceDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerThirdplatApiserviceDao.xml new file mode 100644 index 0000000000..8390e5647f --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerThirdplatApiserviceDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java index e577907d89..ff722a6122 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java @@ -172,7 +172,7 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl result=resiGuideFeignClient.enterGrid(userEnterGridFormDTO); if (!result.success() || null == result.getData()) { - logger.error(String.format("用户同意邀请进组,进入网格失败。入参:userId【%s】、invitationId【%s】、groupId【%s】、customerId【%s】、gridId【%s】", + logger.warn(String.format("用户同意邀请进组,进入网格失败。入参:userId【%s】、invitationId【%s】、groupId【%s】、customerId【%s】、gridId【%s】", formDTO.getUserId(), formDTO.getInvitationId(), groupInvitationDTO.getResiGroupId()), resiGroupDTO.getCustomerId(), resiGroupDTO.getGridId()); - logger.error(String.format("用户同意邀请进组,进入网格失败。当前接口返回8000,调用enterGrid接口返回", result.toString())); + logger.warn(String.format("用户同意邀请进组,进入网格失败。当前接口返回8000,调用enterGrid接口返回", result.toString())); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } //4、校验是否已经注册居民 @@ -463,7 +463,7 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl result=resiGuideFeignClient.enterGrid(userEnterGridFormDTO); if (!result.success() || null == result.getData()) { - logger.error(String.format("用户同意邀请进组,进入网格失败。入参:userId【%s】、invitationId【%s】、groupId【%s】、customerId【%s】、gridId【%s】", + logger.warn(String.format("用户同意邀请进组,进入网格失败。入参:userId【%s】、invitationId【%s】、groupId【%s】、customerId【%s】、gridId【%s】", formDTO.getUserId(), formDTO.getInvitationId(), groupInvitationDTO.getResiGroupId()), resiGroupDTO.getCustomerId(), resiGroupDTO.getGridId()); - logger.error(String.format("用户同意邀请进组,进入网格失败。当前接口返回8000,调用enterGrid接口返回", result.toString())); + logger.warn(String.format("用户同意邀请进组,进入网格失败。当前接口返回8000,调用enterGrid接口返回", result.toString())); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } //4、校验是否已经注册居民 @@ -629,7 +629,7 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl { * @Description 获取话题附件信息 **/ TopicAttachmentResultDTO topicAttachmentList(TopicAttachmentFormDTO formDTO); - - /** - * @Description 根据事件枚举发送积分事件 - * @param param - * @return void - * @author wangc - * @date 2021.01.04 16:41 - */ - void sendTopicPointEventByEventType(TopicEventFormDTO param); - /** /** * @Description 向关注话题的人发送微信订阅 * @param tokenDto @@ -351,4 +341,13 @@ public interface ResiTopicService extends BaseService { * @Date 2020/12/31 10:28 */ void sendWxmpUpdateSubscribe(TokenDto tokenDto, String id, String type); + + /** + * @Description 根据事件枚举发送积分事件 + * @param param + * @return void + * @author wangc + * @date 2021.01.04 16:41 + */ + void sendTopicPointEventByEventType(TopicEventFormDTO param); } diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java index f190314b1c..a19e255130 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/StrangerResiGuideController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -30,6 +31,7 @@ import com.epmet.dto.result.MarketContactInfoResultDTO; import com.epmet.dto.result.PublicCustomerGridForStrangerResultDTO; import com.epmet.service.StrangerAccessRecordService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -79,6 +81,20 @@ public class StrangerResiGuideController { } + /** + * @Description H5版 自动/选定定位获取地附近网格列表 + * @param customerGridListFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @author wangc + * @date 2021.01.18 16:39 + */ + @PostMapping("sso/publiclocationgridlist") + Result> locationGridList(@LoginUser TokenDto dto,@RequestBody CustomerGridListFormDTO customerGridListFormDTO){ + ValidatorUtils.validateEntity(customerGridListFormDTO); + if(null == dto || StringUtils.isEmpty(dto.getCustomerId())) throw new ValidateException("无法获取客户Id"); + return strangerAccessRecordService.listCustomerGridH5(customerGridListFormDTO,dto.getCustomerId()); + } + /** * @Description 陌生访客手动选定位置获取附近网格数据 * @Param CustomerGridListFormDTO diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java index 9dbd10519d..de23a80d7d 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/StrangerAccessRecordService.java @@ -120,4 +120,14 @@ public interface StrangerAccessRecordService extends BaseService> thirdCustomerGridList(PublicCustomerGridListFormDTO formDTO); + + /** + * @Description H5版 自动/选定定位获取地附近网格列表 + * @param customerGridListFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @author wangc + * @date 2021.01.18 16:39 + */ + Result> listCustomerGridH5(CustomerGridListFormDTO customerGridListFormDTO,String customerId); + } diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java index 72e16e1dfd..271e59d954 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java @@ -31,6 +31,7 @@ import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.OperCustomizeFeignClient; import com.epmet.service.StrangerAccessRecordService; import com.epmet.utils.ModuleConstant; +import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -303,6 +304,46 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl> + * @author wangc + * @date 2021.01.18 16:39 + */ + @Override + public Result> listCustomerGridH5(CustomerGridListFormDTO customerGridListFormDTO,String customerId) { + ThirdCustomerGridListFormDTO gridParam = new ThirdCustomerGridListFormDTO(); + gridParam.setAreaCode(StringUtils.isBlank(customerGridListFormDTO.getSelectedAreaCode()) ? + customerGridListFormDTO.getAreaCode() : customerGridListFormDTO.getSelectedAreaCode()); + + gridParam.setPageNo(null == customerGridListFormDTO.getPageNo() ? ModuleConstant.MIN_CURRENT_PAGE_NO : customerGridListFormDTO.getPageNo()); + gridParam.setPageSize(customerGridListFormDTO.getPageSize()); + gridParam.setCustomerId(customerId); + Result> queryResult = + govOrgFeignClient + .queryCustomerGridList(gridParam); + + //Feign调用成功 + if (queryResult.success()) { + List queryList = queryResult.getData(); + if (null != queryResult && queryList.size() > 0) { + StrangerAccessRecordEntity strangerTrance = new StrangerAccessRecordEntity(); + strangerTrance.setLocationAreaCode(gridParam.getAreaCode()); + strangerTrance.setIsAuthorized(customerGridListFormDTO.getIsAuthorized()); + strangerTrance.setGridNumber(queryList.size()); + strangerTrance.setVisitTime(new Date()); + strangerTrance.setProvince(customerGridListFormDTO.getProvince()); + strangerTrance.setCity(customerGridListFormDTO.getCity()); + strangerTrance.setArea(customerGridListFormDTO.getArea()); + insert(strangerTrance); + } + } + + return queryResult; + + } + /** * @Description 获取客户信息 * @param appId diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java index 62449677da..7ea7b24f3d 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java @@ -63,4 +63,16 @@ public class ResiMineGridController { return new Result().ok(resiMineGridService.latestGridInfo(formDTO)); } + /** + * @return com.epmet.resi.mine.dto.result.LatestGridInfoResultDTO + * @param tokenDto + * @Author yinzuomei + * @Description 获取用户最近访问网格 + * @Date 2020/3/24 11:10 + **/ + @PostMapping("sso/latestgridinfo") + public Result latestGridInfo(@LoginUser TokenDto tokenDto){ + LatestGridInfoResultDTO latestGridInfoResultDTO=resiMineGridService.getLatestGridInfoH5(tokenDto); + return new Result().ok(latestGridInfoResultDTO); + } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/ResiMineGridService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/ResiMineGridService.java index 0d1c3f3f8f..e6d8a70398 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/ResiMineGridService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/ResiMineGridService.java @@ -39,4 +39,13 @@ public interface ResiMineGridService { * @Date 2020/8/3 **/ LatestGridInfoResultDTO latestGridInfo(LatestGridInfoFormDTO formDTO); + + /** + * H5版本 - 获取用户最近访问网格 + * + * @Author + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + */ + LatestGridInfoResultDTO getLatestGridInfoH5(TokenDto tokenDto); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java index a60d242550..455b7c0cbf 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java @@ -138,4 +138,30 @@ public class ResiMineGridServiceImpl implements ResiMineGridService { return userResult.getData(); } + /** + * @Description H5版本 - 获取用户最近访问网格 + * @param tokenDto + * @return com.epmet.dto.result.LatestGridInfoResultDTO + * @author wangc + * @date 2021.01.18 17:22 + */ + @Override + public LatestGridInfoResultDTO getLatestGridInfoH5(TokenDto tokenDto) { + if (null == tokenDto || StringUtils.isBlank(tokenDto.getUserId())) { + logger.error(String.format("居民端获取用户最近访问的网格失败:tokenDto is null or userId is null")); + throw new RenException(ModuleConstant.USER_NOT_NULL); + } + if(!AppClientConstant.APP_RESI.equals(tokenDto.getApp())){ + logger.error(String.format("居民端获取用户最近访问的网格失败,userId:%s,错误提示:%s",tokenDto.getUserId(),ModuleConstant.FOR_RESI_CALL)); + throw new RenException(ModuleConstant.FOR_RESI_CALL); + } + logger.info(String.format("居民端获取用户最近访问网格入参%s", JSON.toJSONString(tokenDto))); + Result userResult=epmetUserFeignClient.getLatestGridInfoByUserId(tokenDto.getUserId()); + if(userResult.success()&&null!=userResult.getData()){ + return userResult.getData(); + } + logger.warn(String.format("居民端获取用户最近访问网格失败,调用epmet-user-server服务返回%s",JSON.toJSONString(userResult))); + return null ; + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index c30e9aca9f..eae2c74317 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -185,6 +185,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberConfirmAutoDTO confirmAutoDTO = partymemberBaseInfoService.getPartyMemberBaseInfo(partyMemberInfoDTO); + //判断是否已注册居民,如果没有则注册居民 + isResiRegister(partyMemberInfoDTO); + //党员信息存入党员认证信息表 PartymemberInfoEntity partyMemberInfoEntity = ConvertUtils.sourceToTarget(partyMemberInfoDTO, PartymemberInfoEntity.class); @@ -264,9 +267,6 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberConfirmAutoEntity.class)); } } - // - //判断是否已注册居民,如果没有则注册居民 - isResiRegister(partyMemberInfoDTO); //将身份证号更新到用户基础信息表中 UserBaseInfoDTO baseInfo = new UserBaseInfoDTO(); diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/CommonErrorCodeEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/CommonErrorCodeEnum.java new file mode 100644 index 0000000000..8ebed5781f --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/CommonErrorCodeEnum.java @@ -0,0 +1,68 @@ +package com.epmet.openapi.scan.common.enu; + +import com.epmet.commons.tools.constant.StrConstant; + +/** + * 公共错误码 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/10 19:43 + */ +public enum CommonErrorCodeEnum { + OK(200, "请求成功。"), + PROCESSING(280, "任务正在执行中,建议您等待一段时间(例如5s)后再查询结果。"), + BAD_REQUEST(400, "请求有误,通常由于请求参数不正确导致,请仔细检查请求参数。"), + NOT_ALLOWED(401, "请求失败,通常是由于使用了不安全的图片、视频、语音链接地址。"), + FORBIDDEN(403, "请求访问失败,通常由于您的图片、视频、语音链接无法访问导致,请确认公网是否可访问,并且无防盗链策略。"), + NOT_FOUND(404, "待检测内容未找到,通常是由于您的图片、视频、语音内容无法下载导致,请确认内容可通过公网访问到。"), + DOWNLOAD_FAILED(480, "下载失败,请确认待检测内容的大小、分辨率(如果有)在API的限制范围内。"), + GENERAL_ERROR(500, "一般是服务端临时出错。建议重试,若持续返回该错误码,请通过工单联系我们。"), + DB_FAILED(580, "数据库操作失败。建议重试,若持续返回该错误码,请通过工单联系我们。"), + TIMEOUT(581, "超时。建议重试,若持续返回该错误码,请通过工单联系我们。"), + CACHE_FAILED(585, "缓存出错。建议重试,若持续返回该错误码,请通过工单联系我们。"), + ALGO_FAILED(586, "算法出错。请通过工单联系我们。"), + MQ_FAILED(587, "中间件出错。请通过工单联系我们。"), + EXCEED_QUOTA(588, "请求频率超出配额。默认配额:图片检测50张/秒,视频检测20路/秒,语音检测20路/秒,文本检测100条/秒。如果需要调整配额,请通过工单联系我们。"), + TOO_LARGE(589, "待检测内容过大,请确保检测的内容在API的限制范围内。建议重试,若持续返回该错误码,请通过工单联系我们。"), + BAD_FORMAT(590, "待检测内容格式错误,请确保检测的内容在API的限制范围内。"), + CONNECTION_POOL_FULL(591, "连接池满。请通过工单联系我们。"), + DOWNLOAD_TIMEOUT(592, "下载超时,下载时间限制为3s,请确保检测的内容大小在API的限制范围内。"), + EXPIRED(594, "任务过期,如taskId过期。"), + CATCH_FRAME_FAILED(595, "截帧失败,请通过工单联系我们。"), + PERMISSION_DENY(596, "账号未授权、账号欠费、账号未开通、账号被禁等原因,具体可以参考返回的msg。"); + + + private Integer code; + private String desc; + + CommonErrorCodeEnum(Integer code, String desc) { + this.code = code; + this.desc = desc; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public static String getErrorMsg(Integer value) { + CommonErrorCodeEnum[] codeEnums = values(); + for (CommonErrorCodeEnum commonErrorCodeEnum : codeEnums) { + if (commonErrorCodeEnum.getCode().equals(value)) { + return commonErrorCodeEnum.getDesc(); + } + } + return StrConstant.EPMETY_STR; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VideoSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VideoSceneEnum.java new file mode 100644 index 0000000000..864d137dd2 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VideoSceneEnum.java @@ -0,0 +1,50 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * desc:视频检测场景 + * @author yinzuomei@elink-cn.com + * @date 2020/12/29 13:47 + **/ +public enum VideoSceneEnum { + PORN("porn", "视频智能鉴黄"), + TERRORISM("terrorism", "视频暴恐涉政"), + LIVE("live","视频不良场景"), + LOGO("logo","视频logo"), + AD("ad","视频图文违规"); + + private String code; + private String desc; + + VideoSceneEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static List getVideoSceneList() { + List result = new ArrayList<>(); + VideoSceneEnum[] values = VideoSceneEnum.values(); + for (VideoSceneEnum v : values) { + result.add(v.getCode()); + } + return result; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java index 27965201ac..cee27d28b8 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java @@ -2,14 +2,20 @@ package com.epmet.openapi.scan.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.openapi.scan.common.constant.SysConstant; +import com.epmet.openapi.scan.common.enu.SysResponseEnum; import com.epmet.openapi.scan.service.impl.ScanService; import com.epmet.openapi.scan.support.param.ImgScanParam; import com.epmet.openapi.scan.support.param.TextScanParam; import com.epmet.openapi.scan.support.param.VoiceAsyncScanParam; +import com.epmet.openapi.scan.support.param.video.VideoAsyncScanParam; import com.epmet.openapi.scan.support.result.ImgAsyncScanResult; import com.epmet.openapi.scan.support.result.SyncScanResult; import com.epmet.openapi.scan.support.result.VoiceAsyncScanResult; import com.epmet.openapi.scan.support.result.VoiceAsyncScanTaskResult; +import com.epmet.openapi.scan.support.result.video.VideoAsyncScanTaskResultDTO; +import com.epmet.openapi.scan.support.result.video.VideoResultDTO; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -81,4 +87,30 @@ public class ScanController { return scanService.voiceResults(taskIds); } + /** + * @author yinzuomei + * @description 视频检测-异步检测 + **/ + @PostMapping("videoAsyncScan") + public Result videoAsyncScan(@RequestBody VideoAsyncScanParam param) { + ValidatorUtils.validateEntity(param); + return scanService.videoAsyncScan(param); + } + + /** + * @author yinzuomei + * @description 视频异步检测结果查询接口 + **/ + @PostMapping("videoResults") + public Result videoResults(@RequestBody List taskIds) { + if (CollectionUtils.isEmpty(taskIds)) { + return new Result<>(); + } + //检测对象不能为空,且最多支持100个元素 + if (org.springframework.util.CollectionUtils.isEmpty(taskIds) || taskIds.size() > SysConstant.MAX_TASK_SIZE) { + return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), + SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg().concat(SysConstant.MAX_TASK_SIZE.toString())); + } + return scanService.videoResults(taskIds); + } } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java index d238ef95e5..4a3e734893 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java @@ -4,9 +4,12 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.openapi.scan.support.param.ImgScanParam; import com.epmet.openapi.scan.support.param.TextScanParam; import com.epmet.openapi.scan.support.param.VoiceAsyncScanParam; +import com.epmet.openapi.scan.support.param.video.VideoAsyncScanParam; import com.epmet.openapi.scan.support.result.SyncScanResult; import com.epmet.openapi.scan.support.result.VoiceAsyncScanResult; import com.epmet.openapi.scan.support.result.VoiceAsyncScanTaskResult; +import com.epmet.openapi.scan.support.result.video.VideoAsyncScanTaskResultDTO; +import com.epmet.openapi.scan.support.result.video.VideoResultDTO; import java.util.List; @@ -48,4 +51,19 @@ public interface ScanService { * @return com.epmet.openapi.scan.support.result.VoiceAsyncScanResult */ Result> voiceResults(List taskIds); + + /** + * desc:视频检测-异步检测 + * @param videoAsyncScanParam + * @return 异步检测)返回数据:taskId<=>dataId + */ + Result videoAsyncScan(VideoAsyncScanParam videoAsyncScanParam); + + /** + * @param taskIds + * @author yinzuomei + * @description 视频异步检测结果查询接口 + * @Date 2020/12/29 16:10 + **/ + Result videoResults(List taskIds); } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java index b95091abcc..44dd0da3de 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java @@ -4,10 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.aliyuncs.AcsRequest; -import com.aliyuncs.green.model.v20180509.ImageSyncScanRequest; -import com.aliyuncs.green.model.v20180509.TextScanRequest; -import com.aliyuncs.green.model.v20180509.VoiceAsyncScanRequest; -import com.aliyuncs.green.model.v20180509.VoiceAsyncScanResultsRequest; +import com.aliyuncs.green.model.v20180509.*; import com.aliyuncs.http.FormatType; import com.aliyuncs.http.HttpResponse; import com.epmet.commons.tools.constant.NumConstant; @@ -20,7 +17,10 @@ import com.epmet.openapi.scan.common.exception.ExecuteHttpException; import com.epmet.openapi.scan.common.redis.RedisKeys; import com.epmet.openapi.scan.common.util.IAcsClientUtil; import com.epmet.openapi.scan.support.param.*; +import com.epmet.openapi.scan.support.param.video.VideoAsyncScanParam; +import com.epmet.openapi.scan.support.param.video.VideoAsyncScanTask; import com.epmet.openapi.scan.support.result.*; +import com.epmet.openapi.scan.support.result.video.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; @@ -504,4 +504,231 @@ public class ScanServiceImpl implements ScanService { return getResultsRequest; } + /** + * desc:视频检测-异步检测 + * + * @param videoAsyncScanParam + * @return + */ + @Override + public Result videoAsyncScan(VideoAsyncScanParam videoAsyncScanParam) { + //一次至多提交100个检测对象 + List videoTasks = videoAsyncScanParam.getTasks(); + if (CollectionUtils.isEmpty(videoTasks) || videoTasks.size() > SysConstant.MAX_TASK_SIZE) { + return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg().concat(SysConstant.MAX_TASK_SIZE.toString())); + } + //默认参数赋值 + videoAsyncScanParam.setScenes(VideoSceneEnum.getVideoSceneList()); + videoAsyncScanParam.setBizType(bizType); + videoAsyncScanParam.setAudioScenes(VoiceSceneEnum.getVoiceSceneList()); + videoAsyncScanParam.setSeed(UUID.randomUUID().toString().replace("-", "")); + //API文档没写限制多少最大多少,应该与图片一致 + if (videoTasks.size() <= SysConstant.MAX_SCAN_IMG_TASK_SIZE) { + return doScanVideo(videoAsyncScanParam); + } + log.info("videoAsyncScan tasks size:{} over 10", videoTasks.size()); + //分组调用,一次提交10个 + List> partition = ListUtils.partition(videoTasks, SysConstant.MAX_SCAN_IMG_TASK_SIZE); + VideoAsyncScanTaskResultDTO finalResult = new VideoAsyncScanTaskResultDTO(); + for (List tasks : partition) { + VideoAsyncScanParam videParam = new VideoAsyncScanParam(); + videParam.setBizType(videoAsyncScanParam.getBizType()); + videParam.setScenes(videoAsyncScanParam.getScenes()); + videParam.setTasks(tasks); + videParam.setCallback(videoAsyncScanParam.getCallback()); + videParam.setSeed(videoAsyncScanParam.getSeed()); + videParam.setAudioScenes(videoAsyncScanParam.getAudioScenes()); + Result partResult = doScanVideo(videParam); + try { + Thread.sleep(5L); + } catch (InterruptedException e) { + log.error("videoAsyncScan InterruptedException"); + } + if (partResult.success()) { + VideoAsyncScanTaskResultDTO data = partResult.getData(); + finalResult.setSeed(data.getSeed()); + finalResult.getSuccessTasks().addAll(data.getSuccessTasks()); + finalResult.getFailTasks().addAll(data.getFailTasks()); + } else { + return partResult; + } + } + return new Result().ok(finalResult); + } + + private Result doScanVideo(VideoAsyncScanParam videoAsyncScanParam) { + VideoAsyncScanRequest videoAsyncScanRequest = getVideoAsyncScanRequest(); + try { + videoAsyncScanRequest.setHttpContent(JSON.toJSONString(videoAsyncScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); + } catch (UnsupportedEncodingException e) { + log.error("doScanVideo parse param exception", e); + return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); + } + + try { + VideoAsyncScanTaskResultDTO scanResult = executeAsyncVideo(videoAsyncScanRequest); + scanResult.setSeed(videoAsyncScanParam.getSeed()); + return new Result().ok(scanResult); + } catch (ExecuteHttpException e) { + log.error("doScanVideo execute exception,param:{},fail msg:{}", JSON.toJSONString(videoAsyncScanParam), e.getMsg()); + return new Result().error(e.getCode(), e.getMsg()); + } + } + + private VideoAsyncScanRequest getVideoAsyncScanRequest() { + VideoAsyncScanRequest videoAsyncScanRequest = new VideoAsyncScanRequest(); + videoAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定API返回格式。 + videoAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法。 + /** + * 请务必设置超时时间。 + */ + videoAsyncScanRequest.setConnectTimeout(3000); + videoAsyncScanRequest.setReadTimeout(6000); + return videoAsyncScanRequest; + } + + private VideoAsyncScanTaskResultDTO executeAsyncVideo(VideoAsyncScanRequest videoAsyncScanRequest) { + try { + HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(videoAsyncScanRequest); + if (httpResponse.isSuccess()) { + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) { + //获取data列表 + JSONArray dataResults = scrResponse.getJSONArray(SysConstant.DATA); + List dataList = dataResults.toJavaList(VideoAsyncScanTaskDataDTO.class); + VideoAsyncScanTaskResultDTO result=new VideoAsyncScanTaskResultDTO(); + dataList.forEach(data->{ + if (HttpStatus.SC_OK == data.getCode()) { + result.getSuccessTasks().add(data); + } else { + result.getFailTasks().add(data); + } + }); + return result; + } else { + log.warn("executeAsyncVideo detect not success. code:{}", scrResponse.getInteger(SysConstant.CODE)); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getCode(), + SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); + } + } else { + log.warn("executeAsyncVideo response status is not success. httpResponse:{}", JSON.toJSONString(httpResponse)); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(), + SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); + } + } catch (Exception e) { + log.error("executeAsyncVideo exception IAcsClientUtil do action exception", e); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg()); + } + } + + /** + * @param taskIds + * @author yinzuomei + * @description 视频异步检测结果查询接口 + * @Date 2020/12/29 16:10 + **/ + @Override + public Result videoResults(List taskIds) { + VideoAsyncScanResultsRequest videoAsyncScanResultsRequest = new VideoAsyncScanResultsRequest(); + videoAsyncScanResultsRequest.setAcceptFormat(FormatType.JSON); + videoAsyncScanResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST); + videoAsyncScanResultsRequest.setConnectTimeout(3000); + videoAsyncScanResultsRequest.setReadTimeout(6000); + try { + videoAsyncScanResultsRequest.setHttpContent(JSON.toJSONString(taskIds).getBytes("UTF-8"), "UTF-8", FormatType.JSON); + } catch (UnsupportedEncodingException e) { + log.error("videoResults parse param exception", e); + return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); + } + try { + HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(videoAsyncScanResultsRequest); + if (httpResponse.isSuccess()) { + JSONObject responseObject = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + log.info("查询视频检测结果返参"+JSON.toJSONString(responseObject)); + if (HttpStatus.SC_OK == responseObject.getInteger(SysConstant.CODE)) { + //获取data列表 + JSONArray dataResults = responseObject.getJSONArray(SysConstant.DATA); + List resultList = dataResults.toJavaList(VideoScanOriginalResultDTO.class); + //解析数据 + VideoResultDTO resultDTO = processVideoResults(resultList); + //成功返回 + return new Result().ok(resultDTO); + } else { + log.warn("查询视频检测结果,接口返回code=" + responseObject.getInteger(SysConstant.CODE)); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getCode(), + SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); + } + } else { + log.warn("查询视频检测结果,API返回失败"); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(), + SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); + } + } catch (Exception e) { + log.error("videoResults exception ", e); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg()); + } + } + + /** + * @author yinzuomei + * @description + **/ + private VideoResultDTO processVideoResults(List resultList) { + VideoResultDTO videoResultDTO = new VideoResultDTO(); + resultList.forEach(result -> { + result.setCodeDesc(CommonErrorCodeEnum.getErrorMsg(result.getCode())); + if (result.getCode().equals(CommonErrorCodeEnum.PROCESSING.getCode())) { + //任务正在检测中,继续轮询 + } else if (result.getCode().equals(CommonErrorCodeEnum.OK.getCode())) { + //成功=>分析结果 + boolean videoPassFlag = getVideoFlag(result.getResults()); + boolean voicePassFlag = getVoiceFlag(result.getAudioScanResults()); + if (videoPassFlag && voicePassFlag) { + videoResultDTO.getPassDataIds().add(result.getDataId()); + videoResultDTO.getPassTaskIds().add(result.getTaskId()); + } else { + videoResultDTO.getNoPassDataIds().add(result.getDataId()); + videoResultDTO.getNoPassTaskIds().add(result.getTaskId()); + } + } else { + //检测结果走丢了.... (*^▽^*) 默认失败 + videoResultDTO.getNoPassDataIds().add(result.getDataId()); + videoResultDTO.getNoPassTaskIds().add(result.getTaskId()); + } + }); + videoResultDTO.setDetails(resultList); + return videoResultDTO; + } + + /** + * @return boolean + * @author yinzuomei + * @description 视频检测结果判断 + **/ + private boolean getVideoFlag(List results) { + for(VideoScanOriginDetail videoRes:results){ + if (!SuggestionEnum.PASS.getCode().equals(videoRes.getSuggestion())) { + return false; + } + } + return true; + } + + /** + * @return boolean true:内容通过; 建议为内容违规或者需要人工审核的统一视为不通过,返回false + * @author yinzuomei + * @description 返回视频语音检测结果 + **/ + private boolean getVoiceFlag(List audioScanResults) { + if (CollectionUtils.isEmpty(audioScanResults)) { + return true; + } + for(VoiceAsyncScanResultDTO m:audioScanResults){ + //人工审核或者内容违规,统一视为不通过 + if (!SuggestionEnum.PASS.getCode().equals(m.getSuggestion())) { + return false; + } + } + return true; + } } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanParam.java new file mode 100644 index 0000000000..c0315f8c17 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanParam.java @@ -0,0 +1,76 @@ +package com.epmet.openapi.scan.support.param.video; + +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * 视频审核-异步检测入参DTO + * + * @author yinzuomei@elink-cn.com + */ +@Data +public class VideoAsyncScanParam implements Serializable { + private static final long serialVersionUID = -7635290200099445362L; + + /** + * 是否开启回调 + */ + private Boolean openCallBack; + + /** + * 不必填 + * 该字段用于标识您的业务场景。您可以通过内容安全控制台创建业务场景(具体操作,请参见自定义机审标准),或者提交工单联系我们帮助您创建业务场景。 + */ + private String bizType; + + /** + * 不必填 + * 是否为语音流(例如直播流)检测。取值: + * true:表示语音流检测。 + * false(默认):表示音频文件检测。 + */ + private Boolean live; + + /** + * 不必填 + * 是否为近线检测模式。 取值: + * true:表示近线检测模式。近线检测模式下,您提交的任务不保证能够实时处理,但是可以排队并在24小时内开始检测。 + * false(默认):表示实时检测模式。对于超过了并发路数限制的检测请求会直接拒绝。 + * 说明 该参数仅适用于音频文件检测,不适用于语音流检测。 + */ + private Boolean offline; + + /** + * 必填 + * 指定视频检测场景。取值: + * porn:视频智能鉴黄 + * terrorism:视频暴恐涉政 + * live:视频不良场景 + * logo:视频logo + * ad:视频图文违规 + */ + private List scenes; + + /** + * 不必填 + * 指定视频语音检测场景,唯一取值:antispam,表示语音反垃圾。不传入该参数时仅检测视频图像内容;如果传入该参数,则在检测视频中图像的同时,对视频中语音进行检测。 + * 说明 如果需要检测视频语音,则不支持通过上传视频截帧序列的方式(即在task中传入frames)进行检测,您必须传入视频或视频流的URL地址(即在task中传入url)进行检测。 + */ + private List audioScenes; + + /** + * 异步检测结果回调地址,执行异步审查内容时 必填 + */ + private String callback; + + /** + * 随机字符串,该值用于回调通知请求中的签名,使用callback时 必填 + */ + private String seed; + + @NotEmpty(message = "检测对象不能为空") + private List tasks; +} \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanTask.java new file mode 100644 index 0000000000..38a4584d94 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/video/VideoAsyncScanTask.java @@ -0,0 +1,30 @@ +package com.epmet.openapi.scan.support.param.video; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 视频审核-异步检测入参-检测对象 + * + * @author yinzuomei@elink-cn.com + */ +@Data +public class VideoAsyncScanTask implements Serializable { + /** + * 建议必填 + * 要检测的数据id 非必填 + * 检测对象对应的数据ID。 + * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。 + * */ + @NotBlank(message = "dataId不能为空") + private String dataId; + + /** + * 必填 + * 待检测视频的URL。该字段不能和frames同时为空,也不能和frames同时有值。 + */ + @NotBlank(message = "音频URL不能为空") + private String url; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskDataDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskDataDTO.java new file mode 100644 index 0000000000..1d559a31cd --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskDataDTO.java @@ -0,0 +1,41 @@ +package com.epmet.openapi.scan.support.result.video; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 视频审核-异步检测任务提交返参详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/29 13:42 + */ +@Data +public class VideoAsyncScanTaskDataDTO implements Serializable { + private static final long serialVersionUID = 8430710131685814181L; + /** + * 错误码,和HTTP状态码一致。 + * 更多信息,请参见公共错误码。 + */ + private Integer code; + /** + * 错误描述信息。 + */ + private String msg; + /** + * 检测对象对应的数据ID。 + */ + private String dataId; + + /** + * 检测任务的ID + */ + private String taskId; + + /** + * 暂时没用,所以返回忽略 + */ + @JsonIgnore + private String url; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskResultDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskResultDTO.java new file mode 100644 index 0000000000..75ecd6e84f --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoAsyncScanTaskResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.openapi.scan.support.result.video; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 视频审核-异步检测任务提交返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/29 13:38 + */ +@Data +public class VideoAsyncScanTaskResultDTO implements Serializable { + private static final long serialVersionUID = -467990806428860191L; + + /** + * 随机字符串,该值用于回调通知请求中的签名。 + */ + private String seed; + + /** + * 提交成功的失败对象 + */ + private List successTasks=new ArrayList<>(); + + /** + * 提交失败的检测对象 + */ + private List failTasks=new ArrayList<>(); + + /** + * 是否全部提交成功 + */ + private Boolean isAllSuccess; + + public boolean isAllSuccess() { + if (failTasks.isEmpty() && !successTasks.isEmpty()) { + return true; + } + return isAllSuccess; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoResultDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoResultDTO.java new file mode 100644 index 0000000000..0e781bf463 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.openapi.scan.support.result.video; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 视频异步检测结果查询接口返参 + * 正在检测中的不返回,调用方继续轮询查询结果 + * @author yinzuomei@elink-cn.com + * @date 2020/12/29 15:37 + */ +@Data +public class VideoResultDTO implements Serializable { + private static final long serialVersionUID = -3451342817149956488L; + + /** + * 执行成功的任务Id集合 + * code=200,且所有语音+视频所有场景返回结果都为pass时则为成功 + */ + private List passDataIds = new ArrayList<>(); + /** + * 执行失败的任务Id集合 + */ + private List noPassDataIds = new ArrayList<>(); + + private List passTaskIds = new ArrayList<>(); + private List noPassTaskIds = new ArrayList<>(); + + /** + * desc:阿里内容审核API返回结果详情 + */ + private List details = new ArrayList<>(); + + /** + * 本地是否全部通过 + */ + private Boolean isAllPass; + + public boolean isAllPass() { + if (noPassTaskIds.isEmpty() && !passTaskIds.isEmpty()) { + return true; + } + return isAllPass; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginDetail.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginDetail.java new file mode 100644 index 0000000000..78916c1fe6 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginDetail.java @@ -0,0 +1,53 @@ +package com.epmet.openapi.scan.support.result.video; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 视频异步检测结果查询接口原生返参-视频检测结果 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/29 16:39 + */ +@Data +public class VideoScanOriginDetail implements Serializable { + private static final long serialVersionUID = 5547706236158849091L; + /** + * 视频检测场景,和调用请求中的场景对应。取值: + * porn:视频智能鉴黄 + * terrorism:视频暴恐涉政 + * live:视频不良场景 + * logo:视频logo + * ad:视频图文违规 + */ + private String scene; + + /** + * 视频检测结果的分类。不同检测场景的结果分类不同,具体如下: + * 视频智能鉴黄(porn)结果分类: + * normal:正常 + * porn:色情 + * 视频暴恐涉政(terrorism)结果分类: + * normal:正常 + * terrorism:暴恐涉政 + * 视频不良场景(live)结果分类: + * normal:正常 + * live:包含不良场景 + * 视频logo(logo)结果分类: + * normal:正常 + * logo:包含logo + * 视频图文违规(ad)结果分类: + * normal:正常 + * ad:包含广告或文字违规信息 + */ + private String label; + + /** + * 建议您执行的后续操作。取值: + * pass:结果正常,无需进行其余操作。 + * review:结果不确定,需要进行人工审核。 + * block:结果违规,建议直接删除或者限制公开。 + */ + private String suggestion; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginalResultDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginalResultDTO.java new file mode 100644 index 0000000000..8964d5fe00 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/video/VideoScanOriginalResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.openapi.scan.support.result.video; + +import com.epmet.openapi.scan.support.result.VoiceAsyncScanResultDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 视频异步检测结果查询接口原生返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/29 15:48 + */ +@Data +public class VideoScanOriginalResultDTO implements Serializable { + private static final long serialVersionUID = -1565008507757551616L; + + /** + * 错误码,和HTTP状态码一致。 + * 更多信息,请参见公共错误码。 + */ + private Integer code; + + private String codeDesc; + + /** + * 错误描述信息。 + */ + private String msg; + /** + * 检测对象对应的数据ID。 + */ + private String dataId; + + /** + * 检测任务的ID + */ + private String taskId; + + /** + * 返回结果,调用成功时(code=200),返回结果中包含一个或多个元素。每个元素是个结构体,具体结构描述,请参见result。 + * 说明 视频流检测场景中,code返回280表示在检测中,返回200表示检测完成。在检测中状态时,检测结果中包含从开始检测到当前时间的检测到结果。 + */ + private List results; + + /** + * 视频语音检测结果。具体结构描述,请参见audioScanResult。 + */ + private List audioScanResults; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserInfoFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserInfoFormDTO.java new file mode 100644 index 0000000000..6c349d424e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserInfoFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/19 上午10:31 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UserInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 3394557656494741201L; + + public interface UserInfoForm{} + + /** + * 工作端:WORK、居民端:resi、运营端:oper + */ + @NotBlank(message = "app类型不能为空",groups = {UserInfoForm.class}) + private String app; + + /** + * UID 用户唯一标识 即wx_open_id + */ + @NotBlank(message = "UID不能为空",groups = {UserInfoForm.class}) + private String uid; + + private String name; + private String mobile; + private String account; + + private String userId; +} 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 494fce4e3f..d48703ffb4 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 @@ -477,4 +477,13 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/staffrole/initrolesforcustomer/{customerId}") Result initGovStaffRolesForCustomer(@PathVariable String customerId); + + /** + * @Description 新增或更新用户信息 + * @Param formDTO + * @author zxc + * @date 2021/1/19 上午10:35 + */ + @PostMapping(value = "/epmetuser/user/saveuserinfo") + Result saveUserInfo(@RequestBody UserInfoFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 7137d3ad1d..195f1a0c38 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 @@ -332,6 +332,11 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "specificRolesStaffs", rolesUsersListFormDTO); } + @Override + public Result saveUserInfo(UserInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveUserInfo", formDTO); + } + @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/constant/UserConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java index a82038d368..2214369866 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 @@ -28,6 +28,11 @@ public interface UserConstant { */ String CLIENT_WEB = "web"; + /** + * app + */ + String APP = "app"; + /** * 微信端 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index a5959e0825..a88a812828 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -154,4 +154,16 @@ public class UserController { return new Result().ok(userService.getUserBasicInfo(formDTO)); } + /** + * @Description 新增或更新用户信息 + * @Param formDTO + * @author zxc + * @date 2021/1/19 上午10:35 + */ + @PostMapping("saveuserinfo") + public Result saveUserInfo(@RequestBody UserInfoFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, UserInfoFormDTO.UserInfoForm.class); + return new Result().ok(userService.saveUserInfo(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java index d0f6b2def7..bd6839ac59 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.UserDTO; import com.epmet.dto.UserHeadPhotoDTO; import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.form.UserInfoFormDTO; import com.epmet.dto.form.WxLoginUserInfoFormDTO; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.dto.result.CustomerUser4PointResultDTO; @@ -77,4 +78,21 @@ public interface UserWechatDao extends BaseDao{ //临时用下in List selectNotInUserBaseInfoTemp(); + + /** + * @Description 根据app、uid查询用户是否存在 + * @Param uid + * @Param app + * @author zxc + * @date 2021/1/19 上午10:42 + */ + UserDTO selectUserDTOByUid(@Param("uid")String uid,@Param("app")String app); + + /** + * @Description 修改user_weChat信息 + * @Param formDTO + * @author zxc + * @date 2021/1/19 上午11:04 + */ + int editByUserId(UserInfoFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java index b83d85af51..cc2fb1aecf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java @@ -86,4 +86,12 @@ public interface UserService extends BaseService { * @Description 居民端-查询用户基础信息 **/ UserBasicInfo getUserBasicInfo(UserBasicInfoFormDTO formDTO); + + /** + * @Description 新增或更新用户信息 + * @Param formDTO + * @author zxc + * @date 2021/1/19 上午10:35 + */ + UserDTO saveUserInfo(UserInfoFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index e592642c97..fd31557530 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -162,7 +162,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerStaffDTOList = baseDao.selectListCustomerStaffDTO(mobile); if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) { - logger.error(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", mobile, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", mobile, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); } return new Result>().ok(customerStaffDTOList); @@ -173,12 +173,12 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getCustomerStaffInfo(CustomerStaffFormDTO formDTO) { CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(formDTO); if (null == customerStaffDTO) { - logger.error(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); } //判断用户是否已被禁用 if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) { - logger.error(String.format("根据手机号查询用户异常,手机号:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); return new Result().error(EpmetErrorCode.GOV_STAFF_DISABLED.getCode()); } return new Result().ok(customerStaffDTO); @@ -254,7 +254,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerStaffDTOList = baseDao.selectStaff(formDTO); if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) { - logger.error(String.format("根据客户Id和手机号查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", + logger.warn(String.format("根据客户Id和手机号查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", formDTO.getCustomerId(), formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); throw new RenException(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); @@ -655,7 +655,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); if (!customerInfo.success()) { - logger.error(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); + logger.warn(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); } else { if (null != customerInfo.getData()){ CustomerListResultDTO resultDTO = new CustomerListResultDTO(); 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 5b8638ab15..02e3c8c875 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 @@ -175,6 +175,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { return; } List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(reUserIds); + log.info("user基本信息:"+userBaseInfoResultDTOS.toString()); if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)) { log.error("未查询到党员基本信息......"); throw new RenException("未查询到党员基本信息......"); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 103a7a16c0..f821ff27da 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -279,4 +279,47 @@ public class UserServiceImpl extends BaseServiceImpl implem return baseDao.selectUserBasicInfo(formDTO); } + /** + * @Description 新增或更新用户信息 + * @Param formDTO + * @author zxc + * @date 2021/1/19 上午10:35 + */ + @Override + public UserDTO saveUserInfo(UserInfoFormDTO formDTO) { + UserDTO result = new UserDTO(); + UserDTO userDTO = userWechatDao.selectUserDTOByUid(formDTO.getUid(), formDTO.getApp()); + if (null == userDTO){ + // 用户不存在 + //user表新增 + UserEntity userEntity = new UserEntity(); + userEntity.setFromApp(UserConstant.APP_RESI); + userEntity.setFromClient(UserConstant.APP); + if (baseDao.insert(userEntity) < NumConstant.ONE) { + log.error("小程序登陆,居民端user表新增数据失败"); + throw new RenException(UserConstant.SAVE_USER); + } + UserWechatEntity entity = new UserWechatEntity(); + entity.setMobile(formDTO.getMobile()); + entity.setUserId(userEntity.getId()); + entity.setNickname(formDTO.getName()); + entity.setWxOpenId(formDTO.getUid()); + entity.setSex(NumConstant.ZERO); + if (userWechatDao.insert(entity) < NumConstant.ONE) { + log.error("小程序登陆,居民端user_wechat表新增数据失败"); + throw new RenException(UserConstant.SAVE_USER_WECHAT); + } + result.setId(userEntity.getId()); + }else { + // 用户已存在 + formDTO.setUserId(userDTO.getId()); + if (userWechatDao.editByUserId(formDTO) < NumConstant.ONE) { + log.error("小程序登陆,居民端user_weChat表更新数据失败"); + throw new RenException(UserConstant.UPDATE_USER_WECHAT); + } + result.setId(userDTO.getId()); + } + return result; + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index 3e6adef055..1dca8f531b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml @@ -70,7 +70,7 @@ ubi.NICKNAME as nickName FROM user_base_info ubi - LEFT JOIN user_resi_info uri ON ( ubi.USER_ID = uri.USER_ID AND uri.DEL_FLAG = '0' ) + INNER JOIN user_resi_info uri ON ( ubi.USER_ID = uri.USER_ID AND uri.DEL_FLAG = '0' ) WHERE ubi.USER_ID =#{userId} AND ubi.DEL_FLAG = '0' 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 d51c98cf19..f59dc05973 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 @@ -38,6 +38,24 @@ USER_ID = #{userId} + + + UPDATE user_wechat + + + NICKNAME = #{name}, + + + MOBILE = #{mobile}, + + UPDATED_BY = #{userId}, + UPDATED_TIME = NOW() + + WHERE + DEL_FLAG = 0 + AND USER_ID = #{userId} + + + + +